mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-18 16:32:17 +00:00
Refactor (#10552)
This commit is contained in:
@@ -27,10 +27,15 @@ function update_script() {
|
|||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
setup_mariadb
|
|
||||||
|
|
||||||
|
setup_mariadb
|
||||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
|
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
|
if check_for_gh_release "monica" "monicahq/monica"; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop apache2
|
systemctl stop apache2
|
||||||
|
|||||||
@@ -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
|
PHP_VERSION="8.2" PHP_APACHE="YES" PHP_MODULE="dom,gmp,iconv,mysqli,pdo-mysql,redis,tokenizer" setup_php
|
||||||
setup_composer
|
setup_composer
|
||||||
setup_mariadb
|
setup_mariadb
|
||||||
|
MARIADB_DB_NAME="monica" MARIADB_DB_USER="monica" setup_mariadb_db
|
||||||
NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs
|
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"
|
fetch_and_deploy_gh_release "monica" "monicahq/monica" "prebuild" "latest" "/opt/monica" "monica-v*.tar.bz2"
|
||||||
|
|
||||||
msg_info "Configuring monica"
|
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
|
$STD php artisan setup:production --email=admin@helper-scripts.com --password=helper-scripts.com --force
|
||||||
chown -R www-data:www-data /opt/monica
|
chown -R www-data:www-data /opt/monica
|
||||||
chmod -R 775 /opt/monica/storage
|
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_ok "Configured monica"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
|
|||||||
Reference in New Issue
Block a user