Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ PMA_PORT=8080
MAIL_PORT=1025
MAILPIT_UI_PORT=8025

# Docker User Mapping
DOCKER_UID=1000
DOCKER_GID=1000

# Auto-Judge Configuration
AUTOJUDGE_ENABLED=true
AUTOJUDGE_TIME_LIMIT=10
Expand Down
119 changes: 105 additions & 14 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,43 +1,100 @@
APP_NAME=Laravel
APP_NAME=MicroHelium
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_LOG_LEVEL=debug
APP_URL=http://localhost
APP_URL=http://localhost:8000

# Issue #397: idioma padrao da interface (pt_BR ou es). Cada pessoa pode
# trocar o seu no seletor do cabecalho.
APP_LOCALE=pt_BR
# AGPL-3.0 secao 13: se esta instalacao roda uma versao modificada, aponte
# para o fonte DELA, e nao para o repositorio de origem.
APP_SOURCE_URL=https://github.com/UnitedOpen-Source/microHelium

# Logging
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

# Database (Docker MySQL)
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_HOST=db
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
DB_DATABASE=microhelium
DB_USERNAME=microhelium
DB_PASSWORD=
DB_ROOT_PASSWORD=

BROADCAST_DRIVER=log
CACHE_STORE=file
SESSION_DRIVER=file
QUEUE_CONNECTION=sync

REDIS_HOST=127.0.0.1
# Redis (Docker)
REDIS_CLIENT=phpredis
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

# Cache & Session
CACHE_STORE=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=120
SESSION_ENCRYPT=false

# Queue
QUEUE_CONNECTION=redis

# Broadcasting
BROADCAST_DRIVER=log
BROADCAST_CONNECTION=log

# Filesystem
FILESYSTEM_DISK=local

# Mail (Mailpit for development)
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="noreply@microhelium.local"
MAIL_FROM_NAME="${APP_NAME}"

# Pusher
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

# Docker Ports & User Mapping
APP_PORT=8000
APP_SSL_PORT=8443
VITE_PORT=5174
PMA_PORT=8080
MAILPIT_UI_PORT=8025
DOCKER_UID=1000
DOCKER_GID=1000

# Auto-Judge Configuration
AUTOJUDGE_ENABLED=true
AUTOJUDGE_TIME_LIMIT=10
AUTOJUDGE_MEMORY_LIMIT=512
AUTOJUDGE_MAX_FILE_SIZE=100
AUTOJUDGE_OUTPUT_LIMIT=1024
AUTOJUDGE_COMPILE_TIMEOUT=30

# Perfil de toolchain para compiladores: maratona (~2.1 GB), scripting (~2.3 GB), funcional (~4.5 GB), completo (~9.4 GB)
JUDGE_PROFILE=maratona

# Auto-Judge Sandbox & Cgroups (Avançado / Opcional)
# AUTOJUDGE_USE_BWRAP=true
# AUTOJUDGE_BWRAP_PATH=/usr/bin/bwrap
# AUTOJUDGE_TIME_PATH=/usr/bin/time
# AUTOJUDGE_CGROUP_ROOT=/sys/fs/cgroup/judge

# Vite
VITE_APP_NAME="${APP_NAME}"

# Issue #44 -- stays false until a real Animeitor consumer fixture confirms
# BOCA webcast ZIP byte-format compatibility. See docs/specs/44-webcast.md.
WEBCAST_EXPORT_ENABLED=false
Expand All @@ -58,6 +115,11 @@ SANCTUM_TOKEN_MINUTES=43200
# DE JULGAMENTO.
JUDGEHOST_CACHE_RETENTION_DAYS=7

# Configuração de Judgehost Remoto (caso esta instância atue como nó judgehost)
# JUDGEHOST_SERVER=
# JUDGEHOST_TOKEN=
# JUDGEHOST_WORKSPACE=judgehost

# Issue #199 -- quando o julgamento para, alguem precisa ser avisado. O
# watchdog do #45 recupera em silencio e a fila cresce sem alerta: a
# organizacao so descobre porque alguem, meia hora depois, foi olhar uma
Expand Down Expand Up @@ -91,3 +153,32 @@ JUDGING_ALERTS_QUEUE_DEPTH=20
# /backend/users, `teams:import` e a conta gerenciada do #47 continuam sendo
# os caminhos.
REGISTRATION_OPEN=true

# Credenciais do usuário administrador padrão criado durante a seed inicial do banco de dados.
# Caso modifique aqui, o comando 'make setup' ou 'php artisan db:seed' criará o admin com essas credenciais.
DEFAULT_ADMIN_USERNAME=admin
DEFAULT_ADMIN_EMAIL=admin@microhelium.local
DEFAULT_ADMIN_PASSWORD=

# Similaridade e Detecção de Plágio (JPlag)
# SIMILARITY_JPLAG_VERSION=6.2.0
# SIMILARITY_JPLAG_JAR_PATH=/opt/jplag/jplag-6.2.0-jar-with-dependencies.jar
# SIMILARITY_JAVA_BINARY=java
# SIMILARITY_MAX_TEAMS=60
# SIMILARITY_MAX_PAIRS=300
# SIMILARITY_MAX_CONCURRENT_PER_CONTEST=2
# SIMILARITY_TIMEOUT_SECONDS=240
# SIMILARITY_MEMORY_LIMIT_MB=1024

# Chamados SOS & Impressão
# SOS_NOTE_MAX_LENGTH=200
# SOS_HISTORY_LIMIT=10
# PRINT_MAX_FILE_SIZE_KB=512

# Backups
# BACKUP_DIRECTORY=backups
# BACKUP_MYSQLDUMP=mysqldump

# CLICS ICPC Event Feed
# CLICS_EVENT_FEED_POLL_MS=1000
# CLICS_EVENT_FEED_KEEP_ALIVE_SECONDS=30
35 changes: 23 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ WORKDIR /var/www/html
# imagem e construida tambem por parceiros.
#
# Esta lista tem de acompanhar a do Dockerfile.judge.
RUN apk add --no-cache \
ARG JUDGE_PROFILE=completo
ENV JUDGE_PROFILE=${JUDGE_PROFILE}
COPY --chmod=755 docker/judge/perfil/ /usr/local/share/juiz-perfil/
RUN /usr/local/share/juiz-perfil/perfil apk-add --no-cache \
git \
curl \
wget \
Expand Down Expand Up @@ -333,7 +336,8 @@ COPY --chmod=755 docker/judge/bin/ /usr/local/bin/

# TypeScript (npx tsc, used by the "TypeScript (Node 24)" language)
ARG TYPESCRIPT_VERSION=7.0.2
RUN npm install -g "typescript@${TYPESCRIPT_VERSION}"
RUN /usr/local/share/juiz-perfil/perfil inclui npm:typescript || exit 0; \
npm install -g "typescript@${TYPESCRIPT_VERSION}"

# Kotlin has no Alpine package; JetBrains only ships it as a GitHub release
# zip. This is the same install method used by every other Kotlin judge
Expand All @@ -355,7 +359,8 @@ RUN npm install -g "typescript@${TYPESCRIPT_VERSION}"
# existia neste arquivo (o JPlag, mais abaixo); faltava aplicar aos vizinhos.
ARG KOTLIN_VERSION=2.4.20
ARG KOTLIN_SHA256=59e9ca74c7904ef2c122b12114937673ccce68de820a663f0ed66ccf8799e0b7
RUN wget -q "https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip" -O /tmp/kotlin.zip \
RUN /usr/local/share/juiz-perfil/perfil inclui download:KOTLIN || exit 0; \
wget -q "https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip" -O /tmp/kotlin.zip \
&& echo "${KOTLIN_SHA256} /tmp/kotlin.zip" | sha256sum -c - \
&& unzip -q /tmp/kotlin.zip -d /opt \
&& rm /tmp/kotlin.zip \
Expand Down Expand Up @@ -384,16 +389,17 @@ RUN wget -q "https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VER
ARG FPC_VERSION=3.2.2
ARG FPC_SHA256_AARCH64=b39470f9b6b5b82f50fc8680a5da37d2834f2129c65c24c5628a80894d565451
ARG FPC_SHA256_X86_64=5adac308a5534b6a76446d8311fc340747cbb7edeaacfe6b651493ff3fe31e83
RUN set -eu; \
RUN /usr/local/share/juiz-perfil/perfil inclui download:FPC || exit 0; \
set -eu; \
arch="$(apk --print-arch)"; \
case "$arch" in \
x86_64) fpc_arch=x86_64-linux; fpc_bin=ppcx64; fpc_sha256="${FPC_SHA256_X86_64}" ;; \
aarch64) fpc_arch=aarch64-linux; fpc_bin=ppca64; fpc_sha256="${FPC_SHA256_AARCH64}" ;; \
x86_64) fpc_arch=x86_64-linux; fpc_bin=ppcx64; fpc_sha256="${FPC_SHA256_X86_64}"; fpc_mirror="https://distfiles.gentoo.org/distfiles/61/fpc-${FPC_VERSION}.x86_64-linux.tar" ;; \
aarch64) fpc_arch=aarch64-linux; fpc_bin=ppca64; fpc_sha256="${FPC_SHA256_AARCH64}"; fpc_mirror="https://distfiles.gentoo.org/distfiles/cd/fpc-${FPC_VERSION}.aarch64-linux.tar" ;; \
*) echo "Unsupported arch for FPC: $arch" >&2; exit 1 ;; \
esac; \
url="https://sourceforge.net/projects/freepascal/files/Linux/${FPC_VERSION}/fpc-${FPC_VERSION}.${fpc_arch}.tar/download"; \
sf_url="https://sourceforge.net/projects/freepascal/files/Linux/${FPC_VERSION}/fpc-${FPC_VERSION}.${fpc_arch}.tar/download"; \
tries=0; \
until wget -q "$url" -O /tmp/fpc.tar \
until { wget -q "$fpc_mirror" -O /tmp/fpc.tar || wget -q "$sf_url" -O /tmp/fpc.tar; } \
&& echo "${fpc_sha256} /tmp/fpc.tar" | sha256sum -c -; do \
tries=$((tries + 1)); \
[ "$tries" -ge 6 ] && { echo "FPC ${FPC_VERSION} (${fpc_arch}): $tries tentativas sem bater o SHA-256 fixado" >&2; exit 1; }; \
Expand All @@ -419,6 +425,7 @@ RUN set -eu; \
ARG SCALA_VERSION=3.3.8
ARG SCALA_SHA256=777423024bb2b4c2b33e18f9c28da7cea117b39478b9bb6811baf7b1a1cf22a7
RUN set -eux; \
/usr/local/share/juiz-perfil/perfil inclui download:SCALA || exit 0; \
wget -q "https://github.com/scala/scala3/releases/download/${SCALA_VERSION}/scala3-${SCALA_VERSION}.zip" -O /tmp/scala.zip; \
echo "${SCALA_SHA256} /tmp/scala.zip" | sha256sum -c -; \
unzip -q /tmp/scala.zip -d /opt; \
Expand All @@ -438,6 +445,7 @@ RUN set -eux; \
ARG GROOVY_VERSION=4.0.33
ARG GROOVY_SHA256=395a69a81d5e9915d360d630663c1d98534c9dec134cb267798e49370855d93d
RUN set -eux; \
/usr/local/share/juiz-perfil/perfil inclui download:GROOVY || exit 0; \
wget -q "https://archive.apache.org/dist/groovy/${GROOVY_VERSION}/distribution/apache-groovy-binary-${GROOVY_VERSION}.zip" -O /tmp/groovy.zip; \
echo "${GROOVY_SHA256} /tmp/groovy.zip" | sha256sum -c -; \
unzip -q /tmp/groovy.zip -d /opt; \
Expand All @@ -458,6 +466,7 @@ ARG DART_VERSION=3.13.4
ARG DART_SHA256_AARCH64=1d545609bdf9da6fb5e68fbd96a599e2836e44ee64379991bd4493ee764d2fdb
ARG DART_SHA256_X86_64=6487a10df5eab890d746d14a55f4c70bec3c1c0633f51804eb504cbc0fc395bb
RUN set -eux; \
/usr/local/share/juiz-perfil/perfil inclui download:DART || exit 0; \
arch="$(apk --print-arch)"; \
case "$arch" in \
aarch64) dart_arch=arm64; dart_sha256="${DART_SHA256_AARCH64}" ;; \
Expand Down Expand Up @@ -583,7 +592,7 @@ RUN set -eux; \
COPY --from=scratch-run-builder /src/dist/index.js /opt/scratch-run/index.js
RUN printf '#!/bin/sh\nexec node /opt/scratch-run/index.js "$@"\n' > /usr/local/bin/scratch-run \
&& chmod 755 /usr/local/bin/scratch-run \
&& echo 'x' | scratch-run --version
&& if /usr/local/share/juiz-perfil/perfil inclui apk:nodejs; then echo 'x' | scratch-run --version; fi

# Portugol Studio (issue #269, parte A).
#
Expand Down Expand Up @@ -714,11 +723,13 @@ RUN pecl install redis && docker-php-ext-enable redis
RUN pecl install pcov && docker-php-ext-enable pcov

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer

# Create system user for running Composer and Artisan
RUN addgroup -g 1000 -S www && \
adduser -u 1000 -S www -G www
ARG WWW_UID=1000
ARG WWW_GID=1000
RUN addgroup -g ${WWW_GID} -S www && \
adduser -u ${WWW_UID} -S www -G www

# Copy PHP configuration
COPY docker/php/php.ini /usr/local/etc/php/conf.d/custom.ini
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,13 @@ RUN pecl install redis && docker-php-ext-enable redis
RUN pecl install pcov && docker-php-ext-enable pcov

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer

# Create system user
RUN addgroup -g 1000 -S www && \
adduser -u 1000 -S www -G www
ARG WWW_UID=1000
ARG WWW_GID=1000
RUN addgroup -g ${WWW_GID} -S www && \
adduser -u ${WWW_UID} -S www -G www

# Create log directory
RUN mkdir -p /var/log/php && chown www:www /var/log/php
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.judge
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ RUN apk add --no-cache --virtual .pgsql-build postgresql-dev \
RUN pecl install redis && docker-php-ext-enable redis

# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer

# Create judge user with limited privileges
RUN addgroup -g 1000 -S judge && \
Expand Down
Loading
Loading