mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-06-07 21:15:29 +02:00
Fix access to var directory
Fix cron file EOL Fix access rights when restoring
This commit is contained in:
parent
57708e3169
commit
a7c054b535
@ -10,7 +10,6 @@ app=$YNH_APP_INSTANCE_NAME
|
|||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Backup sources & data
|
# Backup sources & data
|
||||||
# Note: the last argument is where to save this path, see the restore script.
|
|
||||||
ynh_backup "/var/www/${app}" "sources"
|
ynh_backup "/var/www/${app}" "sources"
|
||||||
|
|
||||||
# Dump the database
|
# Dump the database
|
||||||
|
@ -3,16 +3,6 @@
|
|||||||
# Exit on command errors and treat unset variables as an error
|
# Exit on command errors and treat unset variables as an error
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# This is a multi-instance app, meaning it can be installed several times independently
|
|
||||||
# The id of the app as stated in the manifest is available as $YNH_APP_ID
|
|
||||||
# The instance number is available as $YNH_APP_INSTANCE_NUMBER (equals "1", "2", ...)
|
|
||||||
# The app instance name is available as $YNH_APP_INSTANCE_NAME
|
|
||||||
# - the first time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample
|
|
||||||
# - the second time the app is installed, YNH_APP_INSTANCE_NAME = ynhexample__2
|
|
||||||
# - ynhexample__{N} for the subsequent installations, with N=3,4, ...
|
|
||||||
# The app instance name is probably what you are interested the most, since this is
|
|
||||||
# guaranteed to be unique. This is a good unique identifier to define installation path,
|
|
||||||
# db names, ...
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
@ -37,8 +27,8 @@ sudo mkdir -p $src_path/var
|
|||||||
sudo cp -a ../sources/. $src_path
|
sudo cp -a ../sources/. $src_path
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
|
||||||
sudo chown -R root: $src_path
|
sudo chown -R root: $src_path
|
||||||
|
sudo chown -R www-data: $src_path/var
|
||||||
|
|
||||||
# Generate MySQL password and create database
|
# Generate MySQL password and create database
|
||||||
dbuser=$app
|
dbuser=$app
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# See comments in install script
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# Source YunoHost helpers
|
# Source YunoHost helpers
|
||||||
@ -15,12 +14,6 @@ sudo rm -rf /var/www/$app
|
|||||||
# Remove nginx configuration file
|
# Remove nginx configuration file
|
||||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
|
|
||||||
### PHP (remove if not used) ###
|
|
||||||
# If a dedicated php-fpm process is used:
|
|
||||||
# sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
|
||||||
# sudo service php5-fpm reload
|
|
||||||
### PHP end ###
|
|
||||||
|
|
||||||
# Drop MySQL database and user
|
# Drop MySQL database and user
|
||||||
dbname=$app
|
dbname=$app
|
||||||
dbuser=$app
|
dbuser=$app
|
||||||
|
@ -22,8 +22,8 @@ src_path="/var/www/${app}"
|
|||||||
sudo cp -a ./sources "$src_path"
|
sudo cp -a ./sources "$src_path"
|
||||||
|
|
||||||
# Restore permissions to app files
|
# Restore permissions to app files
|
||||||
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
|
||||||
sudo chown -R root: "$src_path"
|
sudo chown -R root: "$src_path"
|
||||||
|
sudo chown -R www-data: "$src_path/var"
|
||||||
|
|
||||||
# Create and restore the database
|
# Create and restore the database
|
||||||
dbname=$app
|
dbname=$app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user