1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

Merge pull request #24 from YunoHost-Apps/testing

Testing
This commit is contained in:
Maniack Crudelis 2018-04-27 16:12:56 +02:00 committed by GitHub
commit 6335513d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 19 deletions

View file

@ -9,7 +9,7 @@ Piwigo for YunoHost
Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free and opensource. Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free and opensource.
**Shipped version:** 2.9.2 **Shipped version:** 2.9.3
![](http://piwigo.org/screenshots/homepage/piwigo-batch-manager.png) ![](http://piwigo.org/screenshots/homepage/piwigo-batch-manager.png)

View file

@ -13,6 +13,7 @@
setup_private=1 setup_private=1
setup_public=1 setup_public=1
upgrade=1 upgrade=1
upgrade=1 from_commit=f7a6d6ca2dbbd39f20d299478c28f92e83f6f53c
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=1 incorrect_path=1
@ -34,3 +35,7 @@
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options
; commit=f7a6d6ca2dbbd39f20d299478c28f92e83f6f53c
name=Take more official review comments into account
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&

View file

@ -1,4 +1,3 @@
SOURCE_URL=http://piwigo.org/download/dlcounter.php?code=2.9.2 SOURCE_URL=http://piwigo.org/download/dlcounter.php?code=2.9.3
SOURCE_SUM=344937dd1685efb41c1aa7301497aea0fb84707a6a9809eca9efb390d4eadb4a SOURCE_SUM=4022a743ddc0555f8d4f114ec3c3aa439eec44659cbf0d1564d0e3cc2ff30426
SOURCE_FORMAT=zip SOURCE_FORMAT=zip

View file

@ -6,7 +6,7 @@
"en": "photo gallery", "en": "photo gallery",
"fr": "Galerie photo" "fr": "Galerie photo"
}, },
"version": "2.9.2-2", "version": "2.9.3~ynh1",
"url": "http://piwigo.org", "url": "http://piwigo.org",
"license": "GPL-2.0", "license": "GPL-2.0",
"maintainer": { "maintainer": {

View file

@ -24,41 +24,47 @@ ynh_add_fail2ban_config () {
test -n "$logpath" || ynh_die "ynh_add_fail2ban_config expects a logfile path as first argument and received nothing." test -n "$logpath" || ynh_die "ynh_add_fail2ban_config expects a logfile path as first argument and received nothing."
test -n "$failregex" || ynh_die "ynh_add_fail2ban_config expects a failure regex as second argument and received nothing." test -n "$failregex" || ynh_die "ynh_add_fail2ban_config expects a failure regex as second argument and received nothing."
finalfail2banjailconf="/etc/fail2ban/jail.d/$app.conf" finalfail2banjailconf="/etc/fail2ban/jail.d/$app.conf"
finalfail2banfilterconf="/etc/fail2ban/filter.d/$app.conf" finalfail2banfilterconf="/etc/fail2ban/filter.d/$app.conf"
ynh_backup_if_checksum_is_different "$finalfail2banjailconf" 1 ynh_backup_if_checksum_is_different "$finalfail2banjailconf" 1
ynh_backup_if_checksum_is_different "$finalfail2banfilterconf" 1 ynh_backup_if_checksum_is_different "$finalfail2banfilterconf" 1
cat > $finalfail2banjailconf <<EOF sudo tee $finalfail2banjailconf <<EOF
[$app] [$app]
enabled = true enabled = true
port = $ports port = $ports
filter = $app filter = $app
logpath = $logpath logpath = $logpath
maxretry = $max_retry" maxretry = $max_retry
EOF EOF
cat > $finalfail2banfilterconf <<EOF sudo tee $finalfail2banfilterconf <<EOF
[INCLUDES] [INCLUDES]
before = common.conf before = common.conf
[Definition] [Definition]
failregex = $failregex failregex = $failregex
ignoreregrex =" ignoreregex =
EOF EOF
ynh_store_file_checksum "$finalfail2banjailconf" ynh_store_file_checksum "$finalfail2banjailconf"
ynh_store_file_checksum "$finalfail2banfilterconf" ynh_store_file_checksum "$finalfail2banfilterconf"
systemctl restart fail2ban systemctl restart fail2ban
local fail2ban_error="$(journalctl -u fail2ban | tail -n50 | grep "WARNING.*$app.*")"
if [ -n "$fail2ban_error" ]
then
echo "[ERR] Fail2ban failed to load the jail for $app" >&2
echo "WARNING${fail2ban_error#*WARNING}" >&2
fi
} }
# Remove the dedicated fail2ban config (jail and filter conf files) # Remove the dedicated fail2ban config (jail and filter conf files)
# #
# usage: ynh_remove_fail2ban_config # usage: ynh_remove_fail2ban_config
ynh_remove_fail2ban_config () { ynh_remove_fail2ban_config () {
ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf" ynh_secure_remove "/etc/fail2ban/jail.d/$app.conf"
ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf" ynh_secure_remove "/etc/fail2ban/filter.d/$app.conf"
systemctl restart fail2ban sudo systemctl restart fail2ban
} }
# Delete a file checksum from the app settings # Delete a file checksum from the app settings

View file

@ -91,6 +91,10 @@ chown -R $app: /home/yunohost.app/${app}
#================================================= #=================================================
ynh_restore_file "/etc/fail2ban/jail.d/$app.conf" ynh_restore_file "/etc/fail2ban/jail.d/$app.conf"
ynh_restore_file "/etc/fail2ban/filter.d/$app.conf" ynh_restore_file "/etc/fail2ban/filter.d/$app.conf"
touch "/var/log/${app}FailedLogins.log"
chown $app: "/var/log/${app}FailedLogins.log"
systemctl restart fail2ban systemctl restart fail2ban
#================================================= #=================================================