Éric Gaspar 1 anno fa
parent
commit
f21c79eddd
6 ha cambiato i file con 11 aggiunte e 36 eliminazioni
  1. 0 3
      scripts/_common.sh
  2. 0 1
      scripts/backup
  3. 5 13
      scripts/install
  4. 0 4
      scripts/remove
  5. 3 6
      scripts/restore
  6. 3 9
      scripts/upgrade

+ 0 - 3
scripts/_common.sh

@@ -3,8 +3,5 @@
 #=================================================
 #=================================================
 # COMMON VARIABLES AND CUSTOM HELPERS
 # COMMON VARIABLES AND CUSTOM HELPERS
 #=================================================
 #=================================================
-# PHP APP SPECIFIC
-#=================================================
 
 
-# nodejs version
 nodejs_version=20
 nodejs_version=20

+ 0 - 1
scripts/backup

@@ -1,6 +1,5 @@
 #!/bin/bash
 #!/bin/bash
 
 
-# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
 source ../settings/scripts/_common.sh
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 source /usr/share/yunohost/helpers
 
 

+ 5 - 13
scripts/install

@@ -11,7 +11,6 @@ timezone=$(cat /etc/timezone)
 #=================================================
 #=================================================
 ynh_script_progression "Installing dependencies..."
 ynh_script_progression "Installing dependencies..."
 
 
-# Install Nodejs
 ynh_nodejs_install
 ynh_nodejs_install
 
 
 #=================================================
 #=================================================
@@ -19,20 +18,15 @@ ynh_nodejs_install
 #=================================================
 #=================================================
 ynh_script_progression "Setting up source files..."
 ynh_script_progression "Setting up source files..."
 
 
-# Download, check integrity, uncompress and patch the source from app.src
 ynh_setup_source --dest_dir="$install_dir"
 ynh_setup_source --dest_dir="$install_dir"
 
 
-#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
-#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
 #=================================================
 #=================================================
 # APP INITIAL CONFIGURATION
 # APP INITIAL CONFIGURATION
 #=================================================
 #=================================================
 ynh_script_progression "Adding $app's configuration files..."
 ynh_script_progression "Adding $app's configuration files..."
 
 
-# Create a dedicated NGINX config
 ynh_config_add_nginx
 ynh_config_add_nginx
 
 
-# Create a dedicated systemd config
 ynh_config_add_systemd
 ynh_config_add_systemd
 
 
 yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
 yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
@@ -44,8 +38,8 @@ ynh_script_progression "Adding $app's configuration..."
 
 
 ynh_config_add --template=".env" --destination="$install_dir/.env"
 ynh_config_add --template=".env" --destination="$install_dir/.env"
 
 
-#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/.env"
-#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/.env"
+#chmod 400 "$install_dir/.env"
+#chown $app:$app "$install_dir/.env"
 
 
 #=================================================
 #=================================================
 # INSTALL HOMARR
 # INSTALL HOMARR
@@ -53,10 +47,9 @@ ynh_config_add --template=".env" --destination="$install_dir/.env"
 ynh_script_progression "Building the app..."
 ynh_script_progression "Building the app..."
 
 
 pushd $install_dir
 pushd $install_dir
-
-	ynh_hide_warnings ynh_exec_as_app node_load_PATH yarn install
-	ynh_hide_warnings ynh_exec_as_app node_load_PATH NODE_ENV=production yarn build
-	ynh_hide_warnings ynh_exec_as_app node_load_PATH  yarn db:migrate
+	ynh_hide_warnings ynh_exec_as_app yarn install
+	ynh_hide_warnings ynh_exec_as_app NODE_ENV=production yarn build
+	ynh_hide_warnings ynh_exec_as_app yarn db:migrate
 popd
 popd
 
 
 #=================================================
 #=================================================
@@ -64,7 +57,6 @@ popd
 #=================================================
 #=================================================
 ynh_script_progression "Starting $app's systemd service..."
 ynh_script_progression "Starting $app's systemd service..."
 
 
-# Start a systemd service
 ynh_systemctl --service=$app --action="start"
 ynh_systemctl --service=$app --action="start"
 
 
 #=================================================
 #=================================================

+ 0 - 4
scripts/remove

@@ -8,20 +8,16 @@ source /usr/share/yunohost/helpers
 #=================================================
 #=================================================
 ynh_script_progression "Removing system configurations related to $app..."
 ynh_script_progression "Removing system configurations related to $app..."
 
 
-# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
 if ynh_hide_warnings yunohost service status $app >/dev/null
 if ynh_hide_warnings yunohost service status $app >/dev/null
 then
 then
 	ynh_script_progression "Removing $app service integration..."
 	ynh_script_progression "Removing $app service integration..."
 	yunohost service remove $app
 	yunohost service remove $app
 fi
 fi
 
 
-# Remove the dedicated systemd config
 ynh_config_remove_systemd
 ynh_config_remove_systemd
 
 
-# Remove the dedicated NGINX config
 ynh_config_remove_nginx
 ynh_config_remove_nginx
 
 
-# Remove NodeJS
 ynh_nodejs_remove
 ynh_nodejs_remove
 
 
 #=================================================
 #=================================================

+ 3 - 6
scripts/restore

@@ -1,6 +1,5 @@
 #!/bin/bash
 #!/bin/bash
 
 
-# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
 source ../settings/scripts/_common.sh
 source ../settings/scripts/_common.sh
 source /usr/share/yunohost/helpers
 source /usr/share/yunohost/helpers
 
 
@@ -11,16 +10,14 @@ ynh_script_progression "Restoring the app main directory..."
 
 
 ynh_restore "$install_dir"
 ynh_restore "$install_dir"
 
 
-#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
-#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
-#=================================================
-# SPECIFIC RESTORATION
+#chmod -R o-rwx "$install_dir"
+#chown -R $app:www-data "$install_dir"
+
 #=================================================
 #=================================================
 # REINSTALL DEPENDENCIES
 # REINSTALL DEPENDENCIES
 #=================================================
 #=================================================
 ynh_script_progression "Reinstalling dependencies..."
 ynh_script_progression "Reinstalling dependencies..."
 
 
-# Install Nodejs
 ynh_nodejs_install
 ynh_nodejs_install
 
 
 #=================================================
 #=================================================

+ 3 - 9
scripts/upgrade

@@ -18,17 +18,16 @@ ynh_systemctl --service=$app --action="stop" --log_path="systemd"
 #=================================================
 #=================================================
 ynh_script_progression "Upgrading source files..."
 ynh_script_progression "Upgrading source files..."
 
 
-# Download, check integrity, uncompress and patch the source from app.src
 ynh_setup_source --dest_dir="$install_dir" --full_replace
 ynh_setup_source --dest_dir="$install_dir" --full_replace
 
 
-#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir"
-#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir"
+#chmod -R o-rwx "$install_dir"
+#chown -R $app:www-data "$install_dir"
+
 #=================================================
 #=================================================
 # UPGRADE DEPENDENCIES
 # UPGRADE DEPENDENCIES
 #=================================================
 #=================================================
 ynh_script_progression "Upgrading dependencies..."
 ynh_script_progression "Upgrading dependencies..."
 
 
-# Install Nodejs
 ynh_nodejs_install
 ynh_nodejs_install
 
 
 #=================================================
 #=================================================
@@ -36,10 +35,8 @@ ynh_nodejs_install
 #=================================================
 #=================================================
 ynh_script_progression "Upgrading system configurations related to $app..."
 ynh_script_progression "Upgrading system configurations related to $app..."
 
 
-# Create a dedicated NGINX config
 ynh_config_add_nginx
 ynh_config_add_nginx
 
 
-# Create a dedicated systemd config
 ynh_config_add_systemd
 ynh_config_add_systemd
 
 
 yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
 yunohost service add $app --description="Customizable browser's home page" --log="/var/log/$app/$app.log"
@@ -51,9 +48,6 @@ ynh_script_progression "Adding $app's configuration..."
 
 
 ynh_config_add --template=".env" --destination="$install_dir/.env"
 ynh_config_add --template=".env" --destination="$install_dir/.env"
 
 
-#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/.env"
-#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/.env"
-
 #=================================================
 #=================================================
 # INSTALL HOMARR
 # INSTALL HOMARR
 #=================================================
 #=================================================