From 4d020ece1a5812330e1835e7edf934576a63b6fc Mon Sep 17 00:00:00 2001 From: battye Date: Thu, 25 Sep 2025 07:45:37 +0000 Subject: [PATCH] [ticket/17544] Support Codespaces on master PHPBB-17544 --- .devcontainer/Dockerfile | 12 +-- .../devcontainer.json | 12 +-- .../customisations-team/phpbb-config.yml | 37 ++++++++ .devcontainer/customisations-team/setup.sh | 85 +++++++++++++++++++ .../development-team/devcontainer.json | 37 ++++++++ .../phpbb-config.yml | 1 - .../{resources => development-team}/setup.sh | 32 +++---- 7 files changed, 189 insertions(+), 27 deletions(-) rename .devcontainer/{ => customisations-team}/devcontainer.json (74%) create mode 100644 .devcontainer/customisations-team/phpbb-config.yml create mode 100644 .devcontainer/customisations-team/setup.sh create mode 100644 .devcontainer/development-team/devcontainer.json rename .devcontainer/{resources => development-team}/phpbb-config.yml (97%) rename .devcontainer/{resources => development-team}/setup.sh (56%) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ceb94dc09d..7f80583bd2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,20 +1,22 @@ # Debian version -ARG VARIANT="buster" +ARG VARIANT="bookworm" FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} # Install PHP +RUN apt-get -y update && apt-get -y install software-properties-common +RUN add-apt-repository ppa:ondrej/php RUN apt-get -y update -RUN apt-get -y install php php-xml php-mbstring php-curl php-zip php-xdebug +RUN apt-get -y install php8.4 php8.4-xml php8.4-mbstring php8.4-curl php8.4-zip php8.4-xdebug # Install Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Install MySQL -RUN apt-get -y install mysql-server php-mysql +RUN apt-get -y install mysql-server php8.4-mysql # Xdebug -ADD resources/xdebug.ini /etc/php/8.1/apache2/conf.d/xdebug.ini +ADD resources/xdebug.ini /etc/php/8.4/apache2/conf.d/xdebug.ini # Configure Apache RUN echo "Listen 8080" >> /etc/apache2/ports.conf && \ - a2enmod rewrite + a2enmod rewrite \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/customisations-team/devcontainer.json similarity index 74% rename from .devcontainer/devcontainer.json rename to .devcontainer/customisations-team/devcontainer.json index 7bb0e9cc3a..5a0803656e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/customisations-team/devcontainer.json @@ -1,12 +1,12 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu { - "name": "Ubuntu", + "name": "phpBB (Customisations Team)", "build": { - "dockerfile": "Dockerfile", - // Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04 - // Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon. - "args": { "VARIANT": "ubuntu-22.04" } + "dockerfile": "../Dockerfile", + "args": { + "VARIANT": "ubuntu-22.04" + } }, // Configure tool-specific properties. @@ -27,7 +27,7 @@ "forwardPorts": [80, 9003], // Use 'postCreateCommand' to run commands after the container is created. - "postStartCommand": "bash .devcontainer/resources/setup.sh", + "postStartCommand": "bash .devcontainer/customisations-team/setup.sh", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", diff --git a/.devcontainer/customisations-team/phpbb-config.yml b/.devcontainer/customisations-team/phpbb-config.yml new file mode 100644 index 0000000000..1ddc1f4247 --- /dev/null +++ b/.devcontainer/customisations-team/phpbb-config.yml @@ -0,0 +1,37 @@ +installer: + admin: + name: admin + password: adminadmin + email: admin@example.org + + board: + lang: en + name: My Board (with Titania) + description: My amazing new phpBB board (with Titania) + + database: + dbms: mysqli + dbhost: 127.0.0.1 + dbport: 3306 + dbuser: phpbb + dbpasswd: phpbb + dbname: phpbb + table_prefix: phpbb_ + + email: + enabled: false + smtp_delivery : ~ + smtp_host: ~ + smtp_port: ~ + smtp_user: ~ + smtp_pass: ~ + + server: + cookie_secure: false + server_protocol: http:// + force_server_vars: true + server_name: localhost + server_port: 80 + script_path: / + + extensions: ["phpbb/titania"] diff --git a/.devcontainer/customisations-team/setup.sh b/.devcontainer/customisations-team/setup.sh new file mode 100644 index 0000000000..5511a2eb54 --- /dev/null +++ b/.devcontainer/customisations-team/setup.sh @@ -0,0 +1,85 @@ +# setup.sh - Customisations Team +# Commands to install and configure phpBB +echo "[Codespaces] Customisations Team configuration..." + +# Start MySQL +echo "[Codespaces] Start MySQL" +sudo service mysql start + +# Start Apache +echo "[Codespaces] Start Apache" +sudo apache2ctl start + +# Add SSH key +# echo "[Codespaces] Add SSH key" +# echo "$SSH_KEY" > /home/vscode/.ssh/id_rsa && chmod 600 /home/vscode/.ssh/id_rsa + +# Create a MySQL user to use +echo "[Codespaces] Create MySQL user" +sudo mysql -u root< /home/vscode/.ssh/id_rsa && chmod 600 /home/vscode/.ssh/id_rsa +# echo "[Codespaces] Add SSH key" +# echo "$SSH_KEY" > /home/vscode/.ssh/id_rsa && chmod 600 /home/vscode/.ssh/id_rsa # Create a MySQL user to use echo "[Codespaces] Create MySQL user" @@ -22,31 +23,32 @@ sudo mysql -u root<