mirror of
				https://github.com/community-scripts/ProxmoxVE.git
				synced 2025-11-04 02:12:49 +00:00 
			
		
		
		
	Refactor (#6416)
This commit is contained in:
		@@ -13,14 +13,8 @@ setting_up_container
 | 
			
		||||
network_check
 | 
			
		||||
update_os
 | 
			
		||||
 | 
			
		||||
msg_info "Installing Dependencies"
 | 
			
		||||
$STD apt-get install -y \
 | 
			
		||||
  apache2 \
 | 
			
		||||
  libapache2-mod-php \
 | 
			
		||||
  php-{bcmath,curl,dom,gd,gmp,iconv,intl,json,mbstring,mysqli,opcache,pdo-mysql,redis,tokenizer,xml,zip} \
 | 
			
		||||
  composer
 | 
			
		||||
msg_ok "Installed Dependencies"
 | 
			
		||||
 | 
			
		||||
PHP_VERSION="8.2" PHP_APACHE="YES" PHP_MODULE="dom,gmp,iconv,mysqli,pdo-mysql,redis,tokenizer" setup_php
 | 
			
		||||
setup_composer
 | 
			
		||||
setup_mariadb
 | 
			
		||||
NODE_VERSION="20" NODE_MODULE="yarn@latest" setup_nodejs
 | 
			
		||||
 | 
			
		||||
@@ -39,12 +33,9 @@ $STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUS
 | 
			
		||||
} >>~/monica.creds
 | 
			
		||||
msg_ok "Set up MariaDB"
 | 
			
		||||
 | 
			
		||||
msg_info "Installing monica"
 | 
			
		||||
RELEASE=$(curl -fsSL https://api.github.com/repos/monicahq/monica/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
 | 
			
		||||
cd /opt
 | 
			
		||||
curl -fsSL "https://github.com/monicahq/monica/releases/download/v${RELEASE}/monica-v${RELEASE}.tar.bz2" -o "monica-v${RELEASE}.tar.bz2"
 | 
			
		||||
tar -xjf "monica-v${RELEASE}.tar.bz2"
 | 
			
		||||
mv "/opt/monica-v${RELEASE}" /opt/monica
 | 
			
		||||
fetch_and_deploy_gh_release "monica" "monicahq/monica" "prebuild" "latest" "/opt/monica" "monica-v*.tar.bz2"
 | 
			
		||||
 | 
			
		||||
msg_info "Configuring monica"
 | 
			
		||||
cd /opt/monica
 | 
			
		||||
cp /opt/monica/.env.example /opt/monica/.env
 | 
			
		||||
HASH_SALT=$(openssl rand -base64 32)
 | 
			
		||||
@@ -59,8 +50,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 "${RELEASE}" >/opt/${APPLICATION}_version.txt
 | 
			
		||||
msg_ok "Installed monica"
 | 
			
		||||
msg_ok "Configured monica"
 | 
			
		||||
 | 
			
		||||
msg_info "Creating Service"
 | 
			
		||||
cat <<EOF >/etc/apache2/sites-available/monica.conf
 | 
			
		||||
@@ -87,7 +77,6 @@ motd_ssh
 | 
			
		||||
customize
 | 
			
		||||
 | 
			
		||||
msg_info "Cleaning up"
 | 
			
		||||
rm -rf "/opt/monica-v${RELEASE}.tar.bz2"
 | 
			
		||||
$STD apt-get -y autoremove
 | 
			
		||||
$STD apt-get -y autoclean
 | 
			
		||||
msg_ok "Cleaned"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user