diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..3d5b94426e --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,20 @@ +# Debian version +ARG VARIANT="buster" +FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT} + +# Install PHP +RUN apt-get -y update +RUN apt-get -y install php php-xml php-mbstring php-curl php-zip php-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 + +# Xdebug +ADD resources/xdebug.ini /etc/php/8.1/apache2/conf.d/xdebug.ini + +# Configure Apache +RUN echo "Listen 8080" >> /etc/apache2/ports.conf && \ + a2enmod rewrite \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..33f13337fb --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +// 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", + "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" } + }, + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + "settings": { + // Allow Xdebug to listen to requests from remote (or container) + "remote.localPortHost": "allInterfaces" + }, + //"devPort": {}, + // Specify which VS Code extensions to install (List of IDs) + "extensions": ["xdebug.php-debug"] + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [80, 9003], + + // Use 'postCreateCommand' to run commands after the container is created. + "postStartCommand": "bash .devcontainer/resources/setup.sh", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "github-cli": "latest" + } +} \ No newline at end of file diff --git a/.devcontainer/resources/phpbb-config.yml b/.devcontainer/resources/phpbb-config.yml new file mode 100644 index 0000000000..414aef02a2 --- /dev/null +++ b/.devcontainer/resources/phpbb-config.yml @@ -0,0 +1,38 @@ +installer: + admin: + name: admin + password: mypassword + email: admin@example.org + + board: + lang: en + name: My Board + description: My amazing new phpBB board + + 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_auth: ~ + smtp_user: ~ + smtp_pass: ~ + + server: + cookie_secure: false + server_protocol: http:// + force_server_vars: false + server_name: localhost + server_port: 80 + script_path: / + + extensions: [] \ No newline at end of file diff --git a/.devcontainer/resources/setup.sh b/.devcontainer/resources/setup.sh new file mode 100644 index 0000000000..a2df6777f5 --- /dev/null +++ b/.devcontainer/resources/setup.sh @@ -0,0 +1,44 @@ +# setup.sh +# Commands to install and configure phpBB + +# Start MySQL +echo "[Codespaces] Start MySQL" +sudo service mysql start + +# Start Apache +echo "[Codespaces] Start Apache" +sudo service apache2 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<