This commit is contained in:
Slaviša Arežina
2026-01-05 21:54:52 +01:00
committed by GitHub
parent 337fa761fe
commit 91ce09982c
2 changed files with 8 additions and 17 deletions

View File

@@ -27,10 +27,15 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
setup_mariadb
setup_mariadb
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
# Fix for previous versions not having cronjob
if ! grep -Fq 'php /opt/monica/artisan schedule:run' /etc/crontab; then
echo '* * * * * root php /opt/monica/artisan schedule:run >> /dev/null 2>&1' >>/etc/crontab
fi
if check_for_gh_release "monica" "monicahq/monica"; then
msg_info "Stopping Service"
systemctl stop apache2

View File

@@ -16,23 +16,8 @@ update_os
PHP_VERSION="8.2" PHP_APACHE="YES" PHP_MODULE="dom,gmp,iconv,mysqli,pdo-mysql,redis,tokenizer" setup_php
setup_composer
setup_mariadb
MARIADB_DB_NAME="monica" MARIADB_DB_USER="monica" setup_mariadb_db
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
msg_info "Setting up MariaDB"
DB_NAME=monica
DB_USER=monica
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
$STD mariadb -u root -e "CREATE DATABASE $DB_NAME;"
$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';"
$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
{
echo "monica-Credentials"
echo "monica Database User: $DB_USER"
echo "monica Database Password: $DB_PASS"
echo "monica Database Name: $DB_NAME"
} >>~/monica.creds
msg_ok "Set up MariaDB"
fetch_and_deploy_gh_release "monica" "monicahq/monica" "prebuild" "latest" "/opt/monica" "monica-v*.tar.bz2"
msg_info "Configuring monica"
@@ -51,6 +36,7 @@ $STD php artisan key:generate
$STD php artisan setup:production --email=admin@helper-scripts.com --password=helper-scripts.com --force
chown -R www-data:www-data /opt/monica
chmod -R 775 /opt/monica/storage
echo "* * * * * root php /opt/monica/artisan schedule:run >> /dev/null 2>&1" >>/etc/crontab
msg_ok "Configured monica"
msg_info "Creating Service"