1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Merge branch 'master' into Add_fail2ban

This commit is contained in:
JimboJoe 2017-08-09 15:36:20 +02:00 committed by GitHub
commit 1c8a785d0e
10 changed files with 71 additions and 7 deletions

View file

@ -5,7 +5,9 @@ Nextcloud for YunoHost
own data. A personal cloud which run on your own server. With Nextcloud
you can synchronize your files over your devices.
**Shipped version:** 11.0.2
**Shipped version:** 12.0.0
[![Install Nextcloud with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=nextcloud)
![](https://github.com/nextcloud/screenshots/blob/master/files/filelist.png)

View file

@ -15,7 +15,6 @@ location ^~ #LOCATION# {
# Add headers to serve security related headers
add_header Strict-Transport-Security "max-age=15768000;";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
@ -77,7 +76,6 @@ location ^~ #LOCATION# {
# Add headers to serve security related headers
add_header Strict-Transport-Security "max-age=15768000;";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;

7
conf/php-fpm.ini Normal file
View file

@ -0,0 +1,7 @@
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

View file

@ -8,7 +8,7 @@
},
"url": "https://nextcloud.com",
"license": "AGPL-3",
"version": "11.0.2",
"version": "12.0.0",
"maintainer": {
"name": "-",
"email": "-"

View file

@ -191,6 +191,7 @@ ynh_remove_logrotate () {
sudo rm "/etc/logrotate.d/$app"
fi
}
# Calculate and store a file checksum into the app settings
#
# $app should be defined when calling this helper
@ -284,3 +285,36 @@ ynh_remove_fail2ban_config () {
sudo systemctl restart fail2ban
}
# Create a dedicated php-fpm config
final_path=$1
# usage: ynh_add_fpm_config
ynh_add_fpm_config () {
finalphpconf="/etc/php5/fpm/pool.d/$app.conf"
ynh_backup_if_checksum_is_different "$finalphpconf" 1
sudo cp ../conf/php-fpm.conf "$finalphpconf"
ynh_replace_string "__NAMETOCHANGE__" "$app" "$finalphpconf"
ynh_replace_string "__FINALPATH__" "$final_path" "$finalphpconf"
ynh_replace_string "__USER__" "$app" "$finalphpconf"
sudo chown root: "$finalphpconf"
ynh_store_file_checksum "$finalphpconf"
if [ -e "../conf/php-fpm.ini" ]
then
finalphpini="/etc/php5/fpm/conf.d/20-$app.ini"
ynh_backup_if_checksum_is_different "$finalphpini" 1
sudo cp ../conf/php-fpm.ini "$finalphpini"
sudo chown root: "$finalphpini"
ynh_store_file_checksum "$finalphpini"
fi
sudo systemctl reload php5-fpm
}
# Remove the dedicated php-fpm config
#
# usage: ynh_remove_fpm_config
ynh_remove_fpm_config () {
ynh_secure_remove "/etc/php5/fpm/pool.d/$app.conf"
ynh_secure_remove "/etc/php5/fpm/conf.d/20-$app.ini" 2>&1
sudo systemctl reload php5-fpm
}

View file

@ -94,6 +94,7 @@ sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf
sudo cp ../conf/php-fpm.conf "$phpfpm_conf"
sudo chown root: $phpfpm_conf
sudo chmod 644 $phpfpm_conf
ynh_add_fpm_config
# occ helper for the current installation
_exec_occ() {

View file

@ -127,6 +127,7 @@ sed -i "s@#DESTDIR#@${DESTDIR}/@g" ../conf/php-fpm.conf
sudo cp ../conf/php-fpm.conf "$phpfpm_conf"
sudo chown root: $phpfpm_conf
sudo chmod 644 $phpfpm_conf
ynh_add_fpm_config
# Set system group in hooks
sed -i "s@#GROUP#@${app}@g" ../hooks/post_user_create

18
scripts/upgrade.d/upgrade.11.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
# Version cible de la mise à jour de Nextcloud
VERSION="12.0.0"
# Nextcloud tarball checksum
NEXTCLOUD_SOURCE_SHA256="1b9d9cf05e657cd564a552b418fbf42d669ca51e0fd1f1f118fe44cbf93a243f"
# Load common variables and helpers
source ./_common.sh
# Source app helpers
source /usr/share/yunohost/helpers
# Load common upgrade function
source ./upgrade.d/upgrade.generic.sh
COMMON_UPGRADE # Met à jour Nextcloud vers la version suivante

View file

@ -17,7 +17,10 @@ COMMON_UPGRADE () {
# Retrieve new Nextcloud sources in a temporary directory
TMPDIR=$(mktemp -d)
extract_nextcloud "$TMPDIR" # Télécharge nextcloud, vérifie sa somme de contrôle et le décompresse.
# Set temp folder ownership
sudo chown -R $app: "$TMPDIR"
extract_nextcloud "$TMPDIR" "$app" # Télécharge nextcloud, vérifie sa somme de contrôle et le décompresse.
# Copy Nextcloud configuration file
sed -i "s@#DOMAIN#@${domain}@g" ../conf/config.json

View file

@ -1,10 +1,10 @@
#!/bin/bash
# Version cible de la mise à jour de Nextcloud
VERSION=11.0.2
VERSION=12.0.0
# Nextcloud tarball checksum sha256
NEXTCLOUD_SOURCE_SHA256=5d1ef19d8f1f340b46c05ba3741dcb043dfc84fc3b9e2cfce1409c71a89b8700
NEXTCLOUD_SOURCE_SHA256=5288f645348eddc1a7768825678bd19f110cec585a16f98b52c64389358c74bc
# Load common variables and helpers
source ./_common.sh