Add data-dir in .zen/nextcloud for nextcloud flavor

This commit is contained in:
poka 2020-05-19 17:22:46 +02:00
parent 24f2ddc0e7
commit e5d026cf53
2 changed files with 16 additions and 13 deletions

View File

@ -10,12 +10,14 @@
nc_domain="" # Votre nom de domaine pour votre nextcloud. Si vide il prendra le premier argument que vous passerez, sinon le hostname de votre machine
nc_port=10050 # Numéro de port d'écoute de nginx
admin_user="admin" # Le pseudo du compte admin
admin_pass="admin" # Le mot de passe que vous désirez pour le compte admin
db_pass="" # Le mot de passe que vous désirez pour MariaDB. Si vide, un mot de passe aléatoire sécurisé sera choisi
isSSL=false # true si nextcloud et nginx doivent être configuré en https
YOU=$(ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
admin_user="$YOU" # Le pseudo du compte admin
admin_pass="0penS0urce!" # Le mot de passe que vous désirez pour le compte admin
db_pass="" # Le mot de passe que vous désirez pour MariaDB. Si vide, un mot de passe aléatoire sécurisé sera choisi
data_dir="/home/$YOU/.zen/nextcloud" # Le répertoir data de nextcloud, toutes les données utilisateurs s'y trouvent
isSSL=false # true si nextcloud et nginx doivent être configuré en https
configMaria=auto # Mettez manual ou auto, attention auto est expérimental et vraiment pas recommendé
p2env=false # true si vous êtes dans un environnement p2p.legal
p2env=false # true si vous êtes dans un environnement p2p.legal
#################
@ -34,10 +36,10 @@ nc_domain=$(../../zen/tools/nodename)
db_pass_root="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_-' | fold -w 32 | head -n 1)"
if [[ p2env == "true" ]]; then
cd /nextcloud/.install_templates/
cd /nextcloud/templates/
else
[[ ! -e .install_templates ]] && echo "Erreur: Le dossier .install_templates n'existe pas, installation impossible." && exit 1
cd .install_templates
[[ ! -e templates ]] && echo "Erreur: Le dossier templates n'existe pas, installation impossible." && exit 1
cd templates
fi
## Set apt key and upgrade system
@ -108,10 +110,10 @@ if [[ ! -e /var/www/nextcloud ]]; then
tar -xjf latest.tar.bz2 -C /var/www && chown -R www-data:www-data /var/www/ && rm -f latest.tar.bz2
fi
if [[ ! -e /var/nextcloud ]]; then
mkdir -p /var/nextcloud
chown www-data:www-data /var/nextcloud
chmod 750 /var/nextcloud || (echo "Erreur quelque part ..." && exit 1)
if [[ ! -e $data_dir ]]; then
mkdir -p $data_dir
chown www-data:www-data $data_dir
chmod 750 $data_dir || (echo "Erreur quelque part ..." && exit 1)
fi
## Add local IP as secondary trust domain
@ -121,7 +123,7 @@ ip_local=$(/sbin/ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){
[[ $nc_port == 80 ]] && nc_port_loc="" || nc_port_loc=":$nc_port"
[[ -e /var/www/nextcloud/config/config.php ]] && isNCConfig=$(cat /var/www/nextcloud/config/config.php | grep "'installed' => true")
[[ -z "$isNCConfig" ]] && sudo -u www-data php /var/www/nextcloud/occ maintenance:install --database "mysql" --database-name "nextcloud" --database-user "nextcloud" --database-pass "$db_pass" --admin-user "$admin_user" --admin-pass "$admin_pass" --data-dir "/var/nextcloud/"
[[ -z "$isNCConfig" ]] && sudo -u www-data php /var/www/nextcloud/occ maintenance:install --database "mysql" --database-name "nextcloud" --database-user "nextcloud" --database-pass "$db_pass" --admin-user "$admin_user" --admin-pass "$admin_pass" --data-dir "$data_dir"
sleep 0.2
sudo -u www-data php /var/www/nextcloud/occ config:system:set mysql.utf8mb4 --type boolean --value="true"
sudo -u www-data php /var/www/nextcloud/occ config:system:set trusted_domains 0 --value=$nc_domain

View File

@ -14,6 +14,7 @@ ME="${0##*/}"
# Write what you thing about the situation
# AND how you would like to 'fix it'...
# Then friends can read and enhance solution.
# WARNING: This script must be precessing less than 1 minute, so do not charge too much this script
# _ _____ ____ _ _______ ________ ____
# | | / / | / __ \/ | / / _/ | / / ____/ / / /
# | | /| / / /| | / /_/ / |/ // // |/ / / __ / / /