diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..36d9aac6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +services: + web: + build: docker/web + ports: + - "80:80" + volumes: + - ./www:/var/www/html + - ./docker/config/roslogin-connect.php:/var/www/html/www.reactos.org_config/roslogin-connect.php + - ./docker/config/testman-connect.php:/var/www/html/www.reactos.org_config/testman-connect.php + - ./docker/config/gitinfo-connect.php:/var/www/html/www.reactos.org_config/gitinfo-connect.php + - ./docker/parts:/srv/www/www.reactos.org_content/parts:ro + depends_on: + db: + condition: service_healthy + ldap: + condition: service_started + + db: + image: mysql:8.0 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" + volumes: + - ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql + - db_data:/var/lib/mysql + healthcheck: + test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] + interval: 5s + timeout: 5s + retries: 10 + + ldap: + build: + context: . + dockerfile: docker/ldap/Dockerfile + ports: + - "389:389" + +volumes: + db_data: diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..53af49e5 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,60 @@ +# Docker Development Environment + +Runs the ReactOS web services locally using three containers: + +| Container | Description | +|-----------|-------------| +| `web` | Apache + PHP 8.2 serving all four services | +| `db` | MySQL 8.0 with roslogin, testman, and gitinfo databases | +| `ldap` | In-memory LDAP stub (replaces real LDAP for local testing) | + +## Starting + +```bash +docker compose up --build +``` + +The `--build` flag is only needed the first time or after changing files in `docker/web/` or `docker/ldap/`. On subsequent runs, `docker compose up` is sufficient. + +## Services + +Once running, the following URLs are available: + +| URL | Service | +|-----|---------| +| http://localhost/roslogin/ | Authentication / user management | +| http://localhost/testman/ | Build and test results | +| http://localhost/getbuilds/ | Pre-built revision downloads | +| http://localhost/rosweb/ | Shared interface component | + +## Test Credentials + +The LDAP stub is pre-populated with these test accounts: + +| Username | Password | Groups | +|----------|----------|--------| +| test | test12 | — | +| test2 | test12 | — | +| test3 | test12 | — | +| testmod | test12 | Moderators | +| testadmin | test12 | Moderators, Administrators | + +## Database Access + +Connect directly to the database for debugging: + +```bash +docker compose exec db mysql -u roslogin roslogin +docker compose exec db mysql -u testman testman +``` + +## Configuration + +The files in `docker/config/` are Docker-specific overrides for the connection settings in `www/www.reactos.org_config/`. They redirect database connections to the `db` container and LDAP to the `ldap` container. The original config files are not modified. + +## Stopping + +```bash +docker compose down # stop containers, keep database volume +docker compose down -v # stop containers and delete database volume +``` diff --git a/docker/config/gitinfo-connect.php b/docker/config/gitinfo-connect.php new file mode 100644 index 00000000..459f338c --- /dev/null +++ b/docker/config/gitinfo-connect.php @@ -0,0 +1,6 @@ +"); + define("ROSLOGIN_MAIL_LINK", "http://localhost/roslogin/?p=confirm&"); + define("ROSLOGIN_MAIL_VALIDITY", "1 DAY"); + + // Captcha Settings + define("ROSLOGIN_RECAPTCHA_SITEKEY", "YOUR_GOOGLE_RECAPTCHA_SITEKEY_HERE"); + define("ROSLOGIN_RECAPTCHA_SECRET", "YOUR_GOOGLE_RECAPTCHA_SECRET_HERE"); + + // Miscellaneous Website Settings + define("ROSLOGIN_TITLE_SUFFIX", " | ReactOS Project"); + + // Admin panel settings + define("ROSLOGIN_ADMIN_GROUP", "LDAP Administrators"); + define("ROSLOGIN_MODERATOR_GROUP", "Moderators"); + define("ROSLOGIN_MATTERMOST_URL", "https://chat.reactos.org"); + define("ROSLOGIN_MATTERMOST_TOKEN", "YOUR_MATTERMOST_TOKEN_HERE"); diff --git a/docker/config/testman-connect.php b/docker/config/testman-connect.php new file mode 100644 index 00000000..5b4c6329 --- /dev/null +++ b/docker/config/testman-connect.php @@ -0,0 +1,6 @@ + +
ReactOS development environment
+ diff --git a/docker/parts/head.html b/docker/parts/head.html new file mode 100644 index 00000000..3f9c87b9 --- /dev/null +++ b/docker/parts/head.html @@ -0,0 +1,4 @@ + + + + diff --git a/docker/parts/header.html b/docker/parts/header.html new file mode 100644 index 00000000..d98351ad --- /dev/null +++ b/docker/parts/header.html @@ -0,0 +1,12 @@ + diff --git a/docker/web/Dockerfile b/docker/web/Dockerfile new file mode 100644 index 00000000..eec1f538 --- /dev/null +++ b/docker/web/Dockerfile @@ -0,0 +1,12 @@ +FROM php:8.2-apache + +RUN apt-get update && apt-get install -y \ + libldap2-dev \ + libonig-dev \ + && docker-php-ext-configure ldap \ + && docker-php-ext-install mysqli pdo_mysql ldap mbstring \ + && a2enmod rewrite \ + && rm -rf /var/lib/apt/lists/* + +COPY apache.conf /etc/apache2/sites-available/000-default.conf +COPY php.ini /usr/local/etc/php/conf.d/docker-custom.ini diff --git a/docker/web/apache.conf b/docker/web/apache.conf new file mode 100644 index 00000000..9917b8fb --- /dev/null +++ b/docker/web/apache.conf @@ -0,0 +1,26 @@ +