[ticket/16553] Use env variables in Codespaces for server name

PHPBB3-16553
This commit is contained in:
battye 2024-05-27 06:59:59 +00:00
parent 558b8ae7ed
commit 874fb7bf8a
2 changed files with 9 additions and 1 deletions

View file

@ -30,7 +30,7 @@ installer:
server:
cookie_secure: false
server_protocol: http://
force_server_vars: false
force_server_vars: true
server_name: localhost
server_port: 80
script_path: /

View file

@ -34,6 +34,14 @@ sudo ln -s /workspaces/phpbb/phpBB /var/www/html
echo "[Codespaces] Copy phpBB configuration"
cp /workspaces/phpbb/.devcontainer/resources/phpbb-config.yml /workspaces/phpbb/phpBB/install/install-config.yml
# Force the server URL to reflect the Codespace
# https://docs.github.com/en/codespaces/developing-in-a-codespace/default-environment-variables-for-your-codespace
if [ "$CODESPACES" = true ] ; then
echo "[Codespaces] Set the phpBB server name using default environment variables"
codespaces_url="${CODESPACE_NAME}-80.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
sed -i "s/localhost/$codespaces_url/g" /workspaces/phpbb/phpBB/install/install-config.yml
fi
# Install phpBB
echo "[Codespaces] Run phpBB CLI installation"
cd /workspaces/phpbb/phpBB && composer install --no-interaction