1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/directorylister_ynh.git synced 2024-09-03 18:26:02 +02:00

Coding style

This commit is contained in:
Salamandar 2024-07-14 17:30:01 +02:00
parent ded72d7a94
commit d753c306e6
9 changed files with 41 additions and 68 deletions

View file

@ -1,3 +1,5 @@
#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
packaging_format = 2
id = "directorylister"
@ -44,7 +46,7 @@ ram.runtime = "50M"
[install.language]
ask.en = "Choose the application language"
ask.fr = "Choisissez la langue de l'application"
type = "string"
type = "select"
choices = ["fr", "en"]
default = "fr"
@ -52,11 +54,11 @@ ram.runtime = "50M"
[resources.sources]
[resources.sources.main]
in_subdir = false
url = "https://github.com/DirectoryLister/DirectoryLister/archive/refs/tags/4.1.0.tar.gz"
sha256 = "4b2d2eade47ad1f48775bf2b1b66f25131f53ffa1563978dd9b771aedde400ef"
autoupdate.strategy = "latest_github_tag"
[resources.sources.main]
in_subdir = false
url = "https://github.com/DirectoryLister/DirectoryLister/archive/refs/tags/4.1.0.tar.gz"
sha256 = "4b2d2eade47ad1f48775bf2b1b66f25131f53ffa1563978dd9b771aedde400ef"
autoupdate.strategy = "latest_github_tag"
[resources.system_user]
@ -66,4 +68,9 @@ ram.runtime = "50M"
main.url = "/"
[resources.apt]
packages = "php8.2-fpm, php8.2-fileinfo, php8.2-dom, php8.2-zip"
packages = [
"php8.2-fpm",
"php8.2-fileinfo",
"php8.2-dom",
"php8.2-zip",
]

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -22,15 +20,11 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$install_dir"
#=================================================
# BACKUP THE NGINX CONFIGURATION
# SYSTEM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -9,8 +7,6 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -19,7 +15,17 @@ ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
chown -R $app:www-data "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template=".env.example" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown "$app:$app" "$install_dir/.env"
#=================================================
# SYSTEM CONFIGURATION
@ -32,18 +38,6 @@ ynh_add_fpm_config
# Create a dedicated NGINX config using the conf/nginx.conf template
ynh_add_nginx_config
#=================================================
# APP INITIAL CONFIGURATION
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template=".env.example" --destination="$install_dir/.env"
chmod 400 "$install_dir/.env"
chown $app:$app "$install_dir/.env"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -10,9 +8,7 @@ source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
# REMOVE SYSTEMD SERVICE
# REMOVE SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -17,12 +15,10 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir"
chown -R $app:www-data "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# RESTORE SYSTEM CONFIGURATIONS
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
@ -30,15 +26,13 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
#=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
# Typically you only have either $app or php-fpm but not both at the same time...
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload
ynh_systemd_action --service_name=nginx --action=reload

View file

@ -1,7 +1,5 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
@ -9,8 +7,6 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -19,7 +15,17 @@ ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep=".env"
chown -R $app:www-data "$install_dir"
chown -R "$app:www-data" "$install_dir"
#=================================================
# UPDATE A CONFIG FILE
#=================================================
# ynh_script_progression --message="Updating a configuration file..." --weight=1
# ynh_add_config --template=".env.example" --destination="$install_dir/.env"
# chmod 400 "$install_dir/.env"
# chown $app:$app "$install_dir/.env"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
@ -30,18 +36,6 @@ ynh_add_fpm_config
ynh_add_nginx_config
#=================================================
# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...)
#=================================================
# UPDATE A CONFIG FILE
#=================================================
#ynh_script_progression --message="Updating a configuration file..." --weight=1
#ynh_add_config --template=".env.example" --destination="$install_dir/.env"
#chmod 400 "$install_dir/.env"
#chown $app:$app "$install_dir/.env"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -1,2 +0,0 @@
*~
*.sw[op]

View file

@ -1,2 +0,0 @@
*~
*.sw[op]