mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
Merge pull request #122 from ericgaspar/fix-linter-warnings
Fix linter warnings
This commit is contained in:
commit
ffdb51d10c
6 changed files with 10 additions and 30 deletions
|
@ -37,7 +37,7 @@
|
|||
setup_public=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
multi_instance=1
|
||||
port_already_use=1 (9001)
|
||||
change_url=1
|
||||
actions=1
|
||||
|
@ -85,8 +85,6 @@
|
|||
useldap=0
|
||||
; Checks
|
||||
setup_root=1
|
||||
;;; Levels
|
||||
Level 5=auto
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=change
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Online editor providing collaborative editing in real-time.",
|
||||
"fr": "Éditeur en ligne fournissant l'édition collaborative en temps réel."
|
||||
},
|
||||
"version": "1.8.4~ynh1",
|
||||
"version": "1.8.4~ynh2",
|
||||
"url": "https://framapad.org",
|
||||
"license": "Apache-2.0",
|
||||
"maintainer": {
|
||||
|
@ -18,7 +18,7 @@
|
|||
"email": "maniackc_dev@crudelis.fr"
|
||||
}],
|
||||
"requirements": {
|
||||
"yunohost": ">= 3.6"
|
||||
"yunohost": ">= 3.8.1"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
|
|
@ -4,28 +4,6 @@
|
|||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# BACKUP
|
||||
#=================================================
|
||||
|
||||
HUMAN_SIZE () { # Transforme une taille en Ko en une taille lisible pour un humain
|
||||
human=$(numfmt --to=iec --from-unit=1K $1)
|
||||
echo $human
|
||||
}
|
||||
|
||||
CHECK_SIZE () { # Vérifie avant chaque backup que l'espace est suffisant
|
||||
file_to_analyse=$1
|
||||
backup_size=$(du --summarize "$file_to_analyse" | cut -f1)
|
||||
free_space=$(df --output=avail "/home/yunohost.backup" | sed 1d)
|
||||
|
||||
if [ $free_space -le $backup_size ]
|
||||
then
|
||||
ynh_print_err "Espace insuffisant pour sauvegarder $file_to_analyse."
|
||||
ynh_print_err "Espace disponible : $(HUMAN_SIZE $free_space)"
|
||||
ynh_die "Espace nécessaire : $(HUMAN_SIZE $backup_size)"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# FUTUR OFFICIAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -36,7 +36,6 @@ ynh_print_info --message="Declaring files to be backed up..."
|
|||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
||||
CHECK_SIZE "$final_path"
|
||||
ynh_backup --src_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
|
@ -51,7 +50,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
|||
ynh_print_info --message="Backing up the MySQL database..."
|
||||
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
CHECK_SIZE "db.sql"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC BACKUP
|
||||
|
|
|
@ -149,7 +149,7 @@ yunohost service add $app --log "/var/log/$app/etherpad.log"
|
|||
ynh_script_progression --message="Restoring the systemd configuration..."
|
||||
|
||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# RESTORE FAIL2BAN CONFIGURATION
|
||||
|
|
|
@ -358,6 +358,12 @@ chmod 600 "$final_path/credentials.json"
|
|||
# Restrict access to credentials.json
|
||||
chown $app -R /var/log/$app/etherpad.log
|
||||
|
||||
#=================================================
|
||||
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||
#=================================================
|
||||
|
||||
yunohost service add $app --log "/var/log/$app/etherpad.log"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE FAIL2BAN
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue