Update leantime-install.sh

This commit is contained in:
CanbiZ 2025-07-22 12:57:59 +02:00
parent 97c13e8b7c
commit 5c147d9841

View File

@ -35,17 +35,17 @@ fetch_and_deploy_gh_release "leantime" "Leantime/leantime" "prebuild" "latest" "
msg_info "Setup ${APPLICATION}"
APACHE_LOG_DIR=/var/log/apache2
chown -R www-data:www-data "/opt/${APPLICATION}"
chmod -R 750 "/opt/${APPLICATION}"
chown -R www-data:www-data "/opt/leantime"
chmod -R 750 "/opt/leantime"
cat <<EOF >/etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /opt/${APPLICATION}/public
DocumentRoot /opt/leantime/public
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml
Options +ExecCGI
<Directory /opt/${APPLICATION}/>
<Directory /opt/leantime/>
Options FollowSymLinks
Require all granted
AllowOverride All
@ -60,12 +60,12 @@ cat <<EOF >/etc/apache2/sites-enabled/000-default.conf
</VirtualHost>
EOF
mv "/opt/${APPLICATION}/config/sample.env" "/opt/${APPLICATION}/config/.env"
mv "/opt/leantime/config/sample.env" "/opt/leantime/config/.env"
sed -i -e "s|^LEAN_DB_DATABASE.*|LEAN_DB_DATABASE = '$DB_NAME'|" \
-e "s|^LEAN_DB_USER.*|LEAN_DB_USER = '$DB_USER'|" \
-e "s|^LEAN_DB_PASSWORD.*|LEAN_DB_PASSWORD = '$DB_PASS'|" \
-e "s|^LEAN_SESSION_PASSWORD.*|LEAN_SESSION_PASSWORD = '$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)'|" \
"/opt/${APPLICATION}/config/.env"
"/opt/leantime/config/.env"
a2enmod -q proxy_fcgi setenvif rewrite
a2enconf -q "php${PHP_VERSION}-fpm"