1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/digiscreen_ynh.git synced 2024-09-03 18:26:15 +02:00
This commit is contained in:
YunoHost Bot 2024-09-01 15:11:18 +00:00 committed by GitHub
commit 45f2ff1d7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 58 additions and 150 deletions

View file

@ -1,4 +0,0 @@
; Additional php.ini defines, specific to this pool of workers.
php_admin_value[upload_max_filesize] = 50M
php_admin_value[post_max_size] = 50M

View file

@ -12,7 +12,7 @@ location __PATH__/ {
try_files $uri $uri/ index.php; try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) { location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;

View file

@ -20,7 +20,8 @@ userdoc = "https://ladigitale.dev/blog/digiscreen-un-fond-d-ecran-interactif-pou
code = "https://codeberg.org/ladigitale/digiscreen" code = "https://codeberg.org/ladigitale/digiscreen"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
ldap = false ldap = false
@ -70,6 +71,7 @@ ram.runtime = "50M"
[resources.system_user] [resources.system_user]
[resources.install_dir] [resources.install_dir]
group = "www-data:r-x"
[resources.data_dir] [resources.data_dir]

View file

@ -1,19 +1,7 @@
#!/bin/bash #!/bin/bash
#================================================= #=================================================
# COMMON VARIABLES # COMMON VARIABLES AND CUSTOM HELPERS
#================================================= #=================================================
nodejs_version="16" nodejs_version="16"
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -1,19 +1,10 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts # 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
#================================================= ynh_print_info "Declaring files to be backed up..."
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs ### N.B. : the following 'ynh_backup' calls are only a *declaration* of what needs
### to be backuped and not an actual copy of any file. The actual backup that ### to be backuped and not an actual copy of any file. The actual backup that
@ -24,22 +15,22 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$install_dir" ynh_backup "$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
#================================================= #=================================================
# BACKUP THE PHP-FPM CONFIGURATION # BACKUP THE PHP-FPM CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -1,25 +1,17 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 ynh_script_progression "Updating NGINX web server configuration..."
ynh_change_url_nginx_config ynh_config_change_url_nginx
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" --time --last ynh_script_progression "Change of URL completed for $app"

View file

@ -1,70 +1,52 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# INSTALL NODEJS # INSTALL NODEJS
#================================================= #=================================================
ynh_script_progression --message="Installing NodeJS..." --weight=1 ynh_script_progression "Installing NodeJS..."
ynh_install_nodejs --nodejs_version="$nodejs_version" ynh_nodejs_install
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=1 ynh_script_progression "Setting up source files..."
# Download, check integrity, uncompress and patch the source
ynh_setup_source --dest_dir="$install_dir/source" ynh_setup_source --dest_dir="$install_dir/source"
# Patch broken dependency # Patch broken dependency
sed -i 's|"v-calendar": "^2.3.0"|"v-calendar": "2.3.0"|' "$install_dir/source/package.json" sed -i 's|"v-calendar": "^2.3.0"|"v-calendar": "2.3.0"|' "$install_dir/source/package.json"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# NODEJS BUILD # NODEJS BUILD
#================================================= #=================================================
ynh_script_progression --message="Building $app..." --weight=3 ynh_script_progression "Building $app..."
pushd "$install_dir/source" pushd "$install_dir/source"
echo VUE_APP_PIXABAY_API_KEY="$api_key_pixabay" >> .env echo VUE_APP_PIXABAY_API_KEY="$api_key_pixabay" >> .env
echo VUE_APP_GOOGLE_API_KEY="$api_key_google_youtube" >> .env echo VUE_APP_GOOGLE_API_KEY="$api_key_google_youtube" >> .env
ynh_use_nodejs ynh_exec_as_app npm install
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install ynh_exec_as_app npm run build
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build
popd popd
mv "$install_dir/source/dist" "$install_dir/www" mv "$install_dir/source/dist" "$install_dir/www"
ynh_secure_remove --file="$install_dir/source" ynh_safe_rm "$install_dir/source"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_script_progression "Adding system configurations related to $app..."
# Create a dedicated NGINX config ynh_config_add_nginx
ynh_add_nginx_config
# Create a dedicated PHP-FPM config ynh_config_add_phpfpm
ynh_add_fpm_config
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --last ynh_script_progression "Installation of $app completed"

View file

@ -1,10 +1,4 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -12,25 +6,21 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE SYSTEM CONFIGURATIONS # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 ynh_script_progression "Removing system configurations related to $app..."
# Remove the dedicated NGINX config ynh_config_remove_nginx
ynh_remove_nginx_config
# Remove the dedicated PHP-FPM config ynh_config_remove_phpfpm
ynh_remove_fpm_config
# Remove the log files
#================================================= #=================================================
# REMOVE NODEJS # REMOVE NODEJS
#================================================= #=================================================
ynh_script_progression --message="Removing NodeJS..." --weight=1 ynh_script_progression "Removing NodeJS..."
ynh_remove_nodejs ynh_nodejs_remove
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" --last ynh_script_progression "Removal of $app completed"

View file

@ -1,47 +1,34 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
# 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
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_script_progression "Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir" ynh_restore "$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_script_progression "Restoring system configurations related to $app..."
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# GENERIC FINALIZATION
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM # RELOAD NGINX AND PHP-FPM
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 ynh_script_progression "Reloading NGINX web server and PHP-FPM..."
ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload ynh_systemctl --service="php$php_version-fpm" --action=reload
ynh_systemd_action --service_name=nginx --action=reload ynh_systemctl --service=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --last ynh_script_progression "Restoration completed for $app"

View file

@ -1,90 +1,70 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# STANDARD UPGRADE STEPS
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression "Ensuring downward compatibility..."
# Renamed settings # Renamed settings
if [[ -z "${api_key_pixabay:-}" ]]; then if [[ -z "${api_key_pixabay:-}" ]]; then
api_key_pixabay="${pixabay:-}" api_key_pixabay="${pixabay:-}"
ynh_app_setting_delete --app="$app" --key=pixabay ynh_app_setting_delete --key=pixabay
ynh_app_setting_set --app="$app" --key="api_key_pixabay" --value="$api_key_pixabay" ynh_app_setting_set --key="api_key_pixabay" --value="$api_key_pixabay"
fi fi
if [[ -z "${api_key_google_youtube:-}" ]]; then if [[ -z "${api_key_google_youtube:-}" ]]; then
api_key_google_youtube="${googleYoutube:-}" api_key_google_youtube="${googleYoutube:-}"
ynh_app_setting_delete --app="$app" --key=googleYoutube ynh_app_setting_delete --key=googleYoutube
ynh_app_setting_set --app="$app" --key="api_key_google_youtube" --value="$api_key_google_youtube" ynh_app_setting_set --key="api_key_google_youtube" --value="$api_key_google_youtube"
fi fi
#================================================= #=================================================
# INSTALL NODEJS # INSTALL NODEJS
#================================================= #=================================================
ynh_script_progression --message="Installing NodeJS..." --weight=1 ynh_script_progression "Installing NodeJS..."
ynh_install_nodejs --nodejs_version="$nodejs_version" ynh_nodejs_install
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source ynh_setup_source --dest_dir="$install_dir/source" --full_replace
ynh_setup_source --dest_dir="$install_dir/source" --full_replace=1
# Patch broken dependency # Patch broken dependency
sed -i 's|"v-calendar": "^2.3.0"|"v-calendar": "2.3.0"|' "$install_dir/source/package.json" sed -i 's|"v-calendar": "^2.3.0"|"v-calendar": "2.3.0"|' "$install_dir/source/package.json"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# NODEJS BUILD # NODEJS BUILD
#================================================= #=================================================
ynh_script_progression --message="Building $app..." --weight=3 ynh_script_progression "Building $app..."
pushd "$install_dir/source" pushd "$install_dir/source"
echo VUE_APP_PIXABAY_API_KEY="$api_key_pixabay" >> .env echo VUE_APP_PIXABAY_API_KEY="$api_key_pixabay" >> .env
echo VUE_APP_GOOGLE_API_KEY="$api_key_google_youtube" >> .env echo VUE_APP_GOOGLE_API_KEY="$api_key_google_youtube" >> .env
ynh_use_nodejs ynh_exec_as_app npm install
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" install ynh_exec_as_app npm run build
ynh_exec_as "$app" "$ynh_node_load_PATH" "$ynh_npm" run build
popd popd
ynh_secure_remove --file="$install_dir/www" ynh_safe_rm "$install_dir/www"
mv "$install_dir/source/dist" "$install_dir/www" mv "$install_dir/source/dist" "$install_dir/www"
ynh_secure_remove --file="$install_dir/source" ynh_safe_rm "$install_dir/source"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 ynh_script_progression "Upgrading system configurations related to $app..."
# Create a dedicated NGINX config ynh_config_add_nginx
ynh_add_nginx_config
# Create a dedicated PHP-FPM config ynh_config_add_phpfpm
ynh_add_fpm_config
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --last ynh_script_progression "Upgrade of $app completed"