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

Merge pull request #50 from yunohost-bot/auto-helpers-2.1

[autopatch] Automatic patch attempt for helpers 2.1
This commit is contained in:
eric_G 2024-08-31 08:30:30 +02:00 committed by GitHub
commit e38ebd4b71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 83 additions and 260 deletions

BIN
.github/.DS_Store vendored

Binary file not shown.

View file

@ -19,7 +19,7 @@ It shall NOT be edited by hand.
FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
**Shipped version:** 2.31.0~ynh1
**Shipped version:** 2.31.1~ynh1
## Screenshots

View file

@ -19,7 +19,7 @@ No se debe editar a mano.
FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
**Versión actual:** 2.31.0~ynh1
**Versión actual:** 2.31.1~ynh1
## Capturas

View file

@ -19,7 +19,7 @@ EZ editatu eskuz.
FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
**Paketatutako bertsioa:** 2.31.0~ynh1
**Paketatutako bertsioa:** 2.31.1~ynh1
## Pantaila-argazkiak

View file

@ -18,7 +18,7 @@ Il NE doit PAS être modifié à la main.
FileBrowser fournit une interface de gestion de fichiers dans un répertoire spécifié et peut être utilisé pour télécharger, supprimer, prévisualiser, renommer et modifier vos fichiers. Il permet la création de plusieurs utilisateurs et chaque utilisateur peut avoir son propre répertoire. Il peut être utilisé comme application autonome ou comme middleware.
**Version incluse:** 2.31.0~ynh1
**Version incluse:** 2.31.1~ynh1
## Captures décran

View file

@ -19,7 +19,7 @@ NON debe editarse manualmente.
FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
**Versión proporcionada:** 2.31.0~ynh1
**Versión proporcionada:** 2.31.1~ynh1
## Capturas de pantalla

View file

@ -19,7 +19,7 @@ Ini TIDAK boleh diedit dengan tangan.
FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
**Versi terkirim:** 2.31.0~ynh1
**Versi terkirim:** 2.31.1~ynh1
## Tangkapan Layar

View file

@ -19,7 +19,7 @@
FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
**Поставляемая версия:** 2.31.0~ynh1
**Поставляемая версия:** 2.31.1~ynh1
## Снимки экрана

View file

@ -19,7 +19,7 @@
FileBrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.
**分发版本:** 2.31.0~ynh1
**分发版本:** 2.31.1~ynh1
## 截图

View file

@ -1,5 +1,5 @@
[Unit]
Description=File browser
Description=Filebrowser: Web File Browser
After=network.target
[Service]

View file

@ -1,15 +0,0 @@
version = "1.0"
[main]
name = "Filebrowser configuration"
services = ["__APP__"]
[main.config]
name = "Configuration Options"
[main.config.datadir]
ask = "Choose path"
type = "path"
default = "/home/yunohost.app/filebrowser"
help = "Choose path"
bind = "root:/var/www/__APP__/settings.json"

1
doc/ADMIN_fr.md Normal file
View file

@ -0,0 +1 @@
Par défaut, le chemin racine est défini sur __DATA_DIR__`. Vous pouvez choisir un chemin racine différent dans le fichier de configuration du navigateur de fichiers : `__INSTALL_DIR__/settings.json` et modifier l'entrée **root** comme vous le souhaitez. (Vous devrez peut-être définir les autorisations correctes pour le nouveau chemin).

8
doc/POST_INSTALL_fr.md Normal file
View file

@ -0,0 +1,8 @@
#### Identifiants par défaut
```
nom d'utilisateur : admin
mot de passe : admin
```
Vous devez modifier le mot de passe et, si vous le pouvez, le nom d'utilisateur pour la meilleure sécurité possible.

View file

@ -5,9 +5,9 @@ name = "Filebrowser"
description.en = "Web File Browser"
description.fr = "Gestionnaire de fichiers"
version = "2.31.0~ynh1"
version = "2.31.1~ynh1"
maintainers = ["eric_G"]
maintainers = [ ]
[upstream]
license = "Apache-2.0"
@ -16,7 +16,8 @@ admindoc = "https://filebrowser.org/"
code = "https://github.com/filebrowser/filebrowser"
[integration]
yunohost = ">= 11.2"
yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = "all"
multi_instance = true
@ -46,14 +47,14 @@ ram.runtime = "50M"
[resources.sources.main]
in_subdir = false
amd64.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.0/linux-amd64-filebrowser.tar.gz"
amd64.sha256 = "296f870816a5553de2d9f2cfe4046f77a86e33130d0af0c92b60f96f2aedf364"
arm64.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.0/linux-arm64-filebrowser.tar.gz"
arm64.sha256 = "e1087add9437dd3720d02280bf2dc13b31ee365143a0581cfbe305f7106c1148"
i386.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.0/linux-386-filebrowser.tar.gz"
i386.sha256 = "a1c999f4a4d912909503ac9a26762c25cb58fb9590fe11c104eab3cecca8b691"
armhf.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.0/linux-armv7-filebrowser.tar.gz"
armhf.sha256 = "71a4bd3498de92f4c3c4d1c9e4716b755bd54e1f41ab04875b3a905ae2b149c6"
amd64.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.1/linux-amd64-filebrowser.tar.gz"
amd64.sha256 = "dee16329431450ae33138a5c28e841a235833992560611e16b9f583b2da1a6c6"
arm64.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.1/linux-arm64-filebrowser.tar.gz"
arm64.sha256 = "5917529f03f88ab3128c89c330bd9eabfadc05cf4179887ff3ba04a111888e49"
i386.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.1/linux-386-filebrowser.tar.gz"
i386.sha256 = "db9f32dfc8650496848549d43b1f84ea020d30346f56177f4b9cdae7a95408d7"
armhf.url = "https://github.com/filebrowser/filebrowser/releases/download/v2.31.1/linux-armv7-filebrowser.tar.gz"
armhf.sha256 = "2daa0b516ae4cae0be3e24a0829117d13a0c96b8f09e643baa6708704820df95"
autoupdate.strategy = "latest_github_release"
autoupdate.asset.amd64 = "^linux-amd64-filebrowser.tar.gz$"

View file

@ -1,17 +1,5 @@
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
# COMMON VARIABLES AND CUSTOM HELPERS
#=================================================

View file

@ -1,46 +1,37 @@
#!/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 /usr/share/yunohost/helpers
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
ynh_print_info "Declaring files to be backed up..."
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_backup --src_path="$install_dir"
ynh_backup "$install_dir"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$data_dir" --is_big
ynh_backup "$data_dir"
#=================================================
# 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 SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service"
ynh_backup "/etc/systemd/system/$app.service"
#=================================================
# 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,52 +1,39 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_script_progression "Stopping $app's systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_script_progression "Updating NGINX web server configuration..."
ynh_change_url_nginx_config
ynh_config_change_url_nginx
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_script_progression "Adding $app's configuration..."
path="$new_path"
ynh_add_config --template="settings.json" --destination="$install_dir/settings.json"
ynh_config_add --template="settings.json" --destination="$install_dir/settings.json"
chmod 600 "$install_dir/settings.json"
chown $app:$app "$install_dir/settings.json"
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_script_progression "Starting $app's systemd service..."
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemctl --service=$app --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last
ynh_script_progression "Change of URL completed for $app"

View file

@ -1,102 +0,0 @@
#!/bin/bash
# In simple cases, you don't need a config script.
# With a simple config_panel.toml, you can write in the app settings, in the
# upstream config file or replace complete files (logo ...) and restart services.
# The config scripts allows you to go further, to handle specific cases
# (validation of several interdependent fields, specific getter/setter for a value,
# display dynamic informations or choices, pre-loading of config type .cube... ).
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# SPECIFIC GETTERS FOR TOML SHORT KEY
#=================================================
get__amount() {
# Here we can imagine to have an API call to stripe to know the amount of donation during a month
local amount = 200
# It's possible to change some properties of the question by overriding it:
if [ $amount -gt 100 ]
then
cat << EOF
style: success
value: $amount
ask:
en: A lot of donation this month: **$amount €**
EOF
else
cat << EOF
style: danger
value: $amount
ask:
en: Not so much donation this month: $amount €
EOF
fi
}
get__prices() {
local prices = "$(grep "DONATION\['" "$final_path/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')"
if [ "$prices" == "," ];
then
# Return YNH_NULL if you prefer to not return a value at all.
echo YNH_NULL
else
echo $prices
fi
}
#=================================================
# SPECIFIC VALIDATORS FOR TOML SHORT KEYS
#=================================================
validate__publishable_key() {
# We can imagine here we test if the key is really a publisheable key
(is_secret_key $publishable_key) &&
echo 'This key seems to be a secret key'
}
#=================================================
# SPECIFIC SETTERS FOR TOML SHORT KEYS
#=================================================
set__prices() {
#---------------------------------------------
# IMPORTANT: setter are trigger only if a change is detected
#---------------------------------------------
for price in $(echo $prices | sed "s/,/ /"); do
frequency=$(echo $price | cut -d/ -f1)
currency=$(echo $price | cut -d/ -f2)
price_id=$(echo $price | cut -d/ -f3)
sed "d/DONATION\['$frequency'\]\['$currency'\]" "$final_path/settings.py"
echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$final_path/settings.py"
done
#---------------------------------------------
# IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too
#---------------------------------------------
ynh_app_setting_set $app prices $prices
}
#=================================================
# GENERIC FINALIZATION
#=================================================
ynh_app_config_run $1

View file

@ -1,61 +1,50 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=3
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"
touch $install_dir/database.db
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod -R +x "$install_dir/filebrowser"
#=================================================
# 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_add_nginx_config
ynh_config_add_nginx
# Create a dedicated systemd config
ynh_add_systemd_config
ynh_config_add_systemd
yunohost service add $app --description="Web File Browser" --log="/var/log/$app/$app.log"
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_script_progression "Adding $app's configuration..."
ynh_add_config --template="settings.json" --destination="$install_dir/settings.json"
chmod 600 "$install_dir/settings.json"
chown $app:$app "$install_dir/settings.json"
ynh_config_add --template="settings.json" --destination="$install_dir/settings.json"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_script_progression "Starting $app's systemd service..."
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemctl --service=$app --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last
ynh_script_progression "Installation of $app completed"

View file

@ -1,34 +1,29 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
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
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_exec_warn_less yunohost service status $app >/dev/null
if ynh_hide_warnings yunohost service status $app >/dev/null
then
ynh_script_progression --message="Removing $app service integration..." --weight=1
ynh_script_progression "Removing $app service integration..."
yunohost service remove $app
fi
ynh_remove_systemd_config
ynh_config_remove_systemd
ynh_remove_nginx_config
ynh_config_remove_nginx
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last
ynh_script_progression "Removal of $app completed"

View file

@ -1,31 +1,23 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=3
ynh_script_progression "Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir"
ynh_restore "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod -R +x "$install_dir/filebrowser"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_script_progression "Restoring the data directory..."
ynh_restore_file --origin_path="$data_dir" --not_mandatory
ynh_restore "$data_dir"
chown -R $app:www-data "$data_dir"
@ -34,28 +26,26 @@ chown -R $app:www-data "$data_dir"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
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/nginx/conf.d/$domain.d/$app.conf"
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
ynh_restore "/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
yunohost service add $app --description="Web File Browser" --log="/var/log/$app/$app.log"
#=================================================
# 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
ynh_script_progression "Reloading NGINX web server and $app's service..."
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemctl --service=$app --action="start" --log_path="systemd"
ynh_systemd_action --service_name=nginx --action=reload
ynh_systemctl --service=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Restoration completed for $app" --last
ynh_script_progression "Restoration completed for $app"

View file

@ -1,55 +1,45 @@
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_script_progression "Stopping $app's systemd service..."
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
ynh_systemctl --service=$app --action="stop" --log_path="systemd"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=4
ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --keep="settings.json"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chmod -R +x "$install_dir/filebrowser"
#=================================================
# REAPPLY SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
ynh_script_progression "Upgrading system configurations related to $app..."
ynh_add_nginx_config
ynh_config_add_nginx
ynh_add_systemd_config
ynh_config_add_systemd
yunohost service add $app --description="Web File Browser" --log="/var/log/$app/$app.log"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_script_progression "Starting $app's systemd service..."
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd"
ynh_systemctl --service=$app --action="start" --log_path="systemd"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Upgrade of $app completed" --last
ynh_script_progression "Upgrade of $app completed"