mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Previously CGIT_CLONE_PREFIX_(PHP|FASTAPI), we found that we could use the same env var in multiple places, including non-cgit-clone-prefix areas. So, they were renamed, and one additional prefix was added. - CGIT_CLONE_PREFIX_PHP -> AURWEB_PHP_PREFIX - Used for cgit's clone prefix and AUR_CONFIG's aur_location for PHP - CGIT_CLONE_PREFIX_FASTAPI -> AURWEB_FASTAPI_PREFIX - Used for cgit's clone prefix and AUR_CONFIG's aur_location for FastAPI - AURWEB_SSHD_PREFIX - Used for aurweb's sshd clone prefix shown on package pages Signed-off-by: Kevin Morris <kevr@0cost.org>
30 lines
1.1 KiB
Bash
Executable file
30 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
set -eou pipefail
|
|
|
|
# Setup a config for our mysql db.
|
|
cp -vf conf/config.dev conf/config
|
|
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
|
|
|
sed -ri "s;^(aur_location) = .+;\1 = ${AURWEB_PHP_PREFIX};" conf/config
|
|
|
|
# Enable memcached.
|
|
sed -ri 's/^(cache) = .+$/\1 = memcache/' conf/config
|
|
|
|
sed -ri "s|^(git_clone_uri_anon) = .+|\1 = ${AURWEB_PHP_PREFIX}/%s.git|" conf/config.defaults
|
|
sed -ri "s|^(git_clone_uri_priv) = .+|\1 = ${AURWEB_SSHD_PREFIX}/%s.git|" conf/config.defaults
|
|
|
|
sed -ri 's/^(listen).*/\1 = 0.0.0.0:9000/' /etc/php/php-fpm.d/www.conf
|
|
sed -ri 's/^;?(clear_env).*/\1 = no/' /etc/php/php-fpm.d/www.conf
|
|
|
|
# Log to stderr. View logs via `docker-compose logs php-fpm`.
|
|
sed -ri 's|^(error_log) = .*$|\1 = /proc/self/fd/2|g' /etc/php/php-fpm.conf
|
|
sed -ri 's|^;?(access\.log) = .*$|\1 = /proc/self/fd/2|g' \
|
|
/etc/php/php-fpm.d/www.conf
|
|
|
|
sed -ri 's/^;?(extension=pdo_mysql)/\1/' /etc/php/php.ini
|
|
sed -ri 's/^;?(open_basedir).*$/\1 = \//' /etc/php/php.ini
|
|
|
|
# Use the sqlite3 extension line for memcached.
|
|
sed -ri 's/^;(extension)=sqlite3$/\1=memcached/' /etc/php/php.ini
|
|
|
|
exec "$@"
|