mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
commit
880d6459a0
10 changed files with 50 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
||||||
<!--
|
<!--
|
||||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
|
||||||
It shall NOT be edited by hand.
|
It shall NOT be edited by hand.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ In addition to Nextcloud core features, the following are made available with th
|
||||||
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal
|
* Serve `/.well-known` paths for CalDAV and CardDAV on the domain only if it's not already served - i.e. by Baïkal
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 28.0.2~ynh1
|
**Shipped version:** 28.0.3~ynh1
|
||||||
|
|
||||||
**Demo:** https://demo.nextcloud.com/
|
**Demo:** https://demo.nextcloud.com/
|
||||||
|
|
||||||
|
@ -58,4 +58,4 @@ or
|
||||||
sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
|
sudo yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
|
@ -1,5 +1,5 @@
|
||||||
<!--
|
<!--
|
||||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/readme_generator
|
||||||
It shall NOT be edited by hand.
|
It shall NOT be edited by hand.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ En plus des fonctionnalités principales de Nextcloud, les fonctionnalités suiv
|
||||||
* Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, Baïkal
|
* Utilise l'adresse `/.well-known` pour la synchronisation CalDAV et CardDAV du domaine si aucun autre service ne l'utilise déjà - par exemple, Baïkal
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 28.0.2~ynh1
|
**Version incluse :** 28.0.3~ynh1
|
||||||
|
|
||||||
**Démo :** https://demo.nextcloud.com/
|
**Démo :** https://demo.nextcloud.com/
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"hashing_default_password": true,
|
"hashing_default_password": true,
|
||||||
"localstorage.allowsymlinks": true,
|
"localstorage.allowsymlinks": true,
|
||||||
"simpleSignUpLink.shown": false,
|
"simpleSignUpLink.shown": false,
|
||||||
|
"maintenance_window_start": 1,
|
||||||
"mail_smtpmode": "smtp",
|
"mail_smtpmode": "smtp",
|
||||||
"mail_smtpport": "25",
|
"mail_smtpport": "25",
|
||||||
"mail_smtpauth": 1,
|
"mail_smtpauth": 1,
|
||||||
|
|
|
@ -55,7 +55,7 @@ location ^~ __PATH__/ {
|
||||||
client_body_buffer_size 512k;
|
client_body_buffer_size 512k;
|
||||||
|
|
||||||
# HTTP response headers borrowed from Nextcloud `.htaccess`
|
# HTTP response headers borrowed from Nextcloud `.htaccess`
|
||||||
more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;";
|
#more_set_headers "Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;";
|
||||||
more_set_headers "Referrer-Policy: no-referrer";
|
more_set_headers "Referrer-Policy: no-referrer";
|
||||||
more_set_headers "X-Content-Type-Options: nosniff";
|
more_set_headers "X-Content-Type-Options: nosniff";
|
||||||
more_set_headers "X-Download-Options: noopen";
|
more_set_headers "X-Download-Options: noopen";
|
||||||
|
|
|
@ -5,7 +5,7 @@ name = "Nextcloud"
|
||||||
description.en = "Online storage, file sharing platform and various other applications"
|
description.en = "Online storage, file sharing platform and various other applications"
|
||||||
description.fr = "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications"
|
description.fr = "Stockage en ligne, plateforme de partage de fichiers et diverses autres applications"
|
||||||
|
|
||||||
version = "28.0.2~ynh1"
|
version = "28.0.3~ynh1"
|
||||||
|
|
||||||
maintainers = ["kay0u"]
|
maintainers = ["kay0u"]
|
||||||
|
|
||||||
|
@ -59,8 +59,8 @@ ram.runtime = "512M"
|
||||||
[resources.sources]
|
[resources.sources]
|
||||||
|
|
||||||
[resources.sources.main]
|
[resources.sources.main]
|
||||||
url = 'https://download.nextcloud.com/server/releases/nextcloud-28.0.2.tar.bz2'
|
url = 'https://download.nextcloud.com/server/releases/nextcloud-28.0.3.tar.bz2'
|
||||||
sha256 = 'de34d6baf3ecceacfdd138e85520cd85e1d2ce6798d9ffa478ac17eb1efa1d08'
|
sha256 = '9ed413c0de16f5b033ceeffcca99c0d61fc698dbeb8db851ac9adf9eef951906'
|
||||||
|
|
||||||
[resources.sources.27]
|
[resources.sources.27]
|
||||||
url = 'https://download.nextcloud.com/server/releases/nextcloud-27.0.0.tar.bz2'
|
url = 'https://download.nextcloud.com/server/releases/nextcloud-27.0.0.tar.bz2'
|
||||||
|
|
|
@ -60,6 +60,12 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/cron.d/$app"
|
ynh_backup --src_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP LOGS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE MYSQL DATABASE
|
# BACKUP THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -87,6 +87,9 @@ ynh_script_progression --message="Configuring $app..." --weight=8
|
||||||
# Set the mysql.utf8mb4 config to true in config.php
|
# Set the mysql.utf8mb4 config to true in config.php
|
||||||
exec_occ config:system:set mysql.utf8mb4 --type boolean --value="true"
|
exec_occ config:system:set mysql.utf8mb4 --type boolean --value="true"
|
||||||
|
|
||||||
|
# move the logs from the data_dir to the standard /var/log
|
||||||
|
exec_occ config:system:set logfile --value="/var/log/$app/nextcloud.log"
|
||||||
|
|
||||||
# Ensure that UpdateNotification app is disabled
|
# Ensure that UpdateNotification app is disabled
|
||||||
exec_occ app:disable updatenotification
|
exec_occ app:disable updatenotification
|
||||||
|
|
||||||
|
@ -240,7 +243,7 @@ chmod 750 $install_dir
|
||||||
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
||||||
|
|
||||||
# Use logrotate to manage application logfile(s)
|
# Use logrotate to manage application logfile(s)
|
||||||
ynh_use_logrotate --logfile="$data_dir/data/nextcloud.log"
|
ynh_use_logrotate
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
|
@ -248,7 +251,7 @@ ynh_use_logrotate --logfile="$data_dir/data/nextcloud.log"
|
||||||
ynh_script_progression --message="Configuring Fail2Ban..." --weight=8
|
ynh_script_progression --message="Configuring Fail2Ban..." --weight=8
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
# Create a dedicated Fail2Ban config
|
||||||
ynh_add_fail2ban_config --logpath="$data_dir/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
|
ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
|
@ -16,6 +16,9 @@ ynh_remove_nginx_config
|
||||||
# Remove the dedicated PHP-FPM config
|
# Remove the dedicated PHP-FPM config
|
||||||
ynh_remove_fpm_config
|
ynh_remove_fpm_config
|
||||||
|
|
||||||
|
# remove logs
|
||||||
|
ynh_secure_remove --file="/var/log/$app"
|
||||||
|
|
||||||
# Remove the app-specific logrotate config
|
# Remove the app-specific logrotate config
|
||||||
ynh_remove_logrotate
|
ynh_remove_logrotate
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,12 @@ ynh_script_progression --message="Restoring cron job..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE LOGS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/var/log/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE LOGROTATE CONFIGURATION
|
# BACKUP THE LOGROTATE CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -109,10 +115,10 @@ ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
|
||||||
# Make sure a log file exists (mostly for CI tests)
|
# Make sure a log file exists (mostly for CI tests)
|
||||||
logfile="$data_dir/data/nextcloud.log"
|
logfile="/var/log/$app/nextcloud.log"
|
||||||
if [ ! -f "$logfile" ]; then
|
if [ ! -f "$logfile" ]; then
|
||||||
touch "$logfile"
|
touch "$logfile"
|
||||||
chown $app: "$logfile"
|
chown "$app:" "$logfile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ynh_systemd_action --action=restart --service_name=fail2ban
|
ynh_systemd_action --action=restart --service_name=fail2ban
|
||||||
|
|
|
@ -24,7 +24,6 @@ then
|
||||||
ynh_die --message="Upgrading from Nextcloud < 22.2 is not supported anymore. You should first upgrade to 22.2 using: yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/41f5f902e7c7cd3c30a6793020562ba98b9bf3e9"
|
ynh_die --message="Upgrading from Nextcloud < 22.2 is not supported anymore. You should first upgrade to 22.2 using: yunohost app upgrade nextcloud -u https://github.com/YunoHost-Apps/nextcloud_ynh/tree/41f5f902e7c7cd3c30a6793020562ba98b9bf3e9"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -239,6 +238,15 @@ then
|
||||||
# Update all installed apps
|
# Update all installed apps
|
||||||
exec_occ app:update --all
|
exec_occ app:update --all
|
||||||
|
|
||||||
|
# move the logs from the data_dir to the standard /var/log
|
||||||
|
# it would be better in the ENSURE DOWNWARD COMPATIBILITY section
|
||||||
|
# but it must be after the exec_occ() definition, so it's here
|
||||||
|
if [ -f "$data_dir/data/nextcloud.log" ]; then
|
||||||
|
mv "$data_dir"/data/nextcloud.log* "/var/log/$app"
|
||||||
|
# adapt the nextcloud config
|
||||||
|
exec_occ config:system:set logfile --value="/var/log/$app/nextcloud.log"
|
||||||
|
fi
|
||||||
|
|
||||||
# Load the config file in nextcloud
|
# Load the config file in nextcloud
|
||||||
exec_occ config:import "$nc_conf"
|
exec_occ config:import "$nc_conf"
|
||||||
|
|
||||||
|
@ -340,9 +348,10 @@ fi
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#-------------------------------------------------
|
#=================================================
|
||||||
# CRON JOB
|
# CRON JOB
|
||||||
#-------------------------------------------------
|
#=================================================
|
||||||
|
|
||||||
cron_path="/etc/cron.d/$app"
|
cron_path="/etc/cron.d/$app"
|
||||||
ynh_add_config --template="nextcloud.cron" --destination="$cron_path"
|
ynh_add_config --template="nextcloud.cron" --destination="$cron_path"
|
||||||
chown root: "$cron_path"
|
chown root: "$cron_path"
|
||||||
|
@ -350,17 +359,18 @@ chmod 644 "$cron_path"
|
||||||
|
|
||||||
exec_occ background:cron
|
exec_occ background:cron
|
||||||
|
|
||||||
#-------------------------------------------------
|
#=================================================
|
||||||
# LOGROTATE
|
# LOGROTATE
|
||||||
#-------------------------------------------------
|
#=================================================
|
||||||
|
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
|
||||||
#-------------------------------------------------
|
#=================================================
|
||||||
# FAIL2BAN
|
# FAIL2BAN
|
||||||
#-------------------------------------------------
|
#=================================================
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
# Create a dedicated Fail2Ban config
|
||||||
ynh_add_fail2ban_config --logpath="$data_dir/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
|
ynh_add_fail2ban_config --logpath="/var/log/$app/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# END OF SCRIPT
|
# END OF SCRIPT
|
||||||
|
|
Loading…
Add table
Reference in a new issue