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

Merge pull request #1 from YunoHost-Apps/master

Update master from master repo
This commit is contained in:
rokaz 2017-03-05 10:24:25 +02:00 committed by GitHub
commit bed8a2b7ca
4 changed files with 57 additions and 2 deletions

View file

@ -14,13 +14,13 @@ Help for dev/testing hightly appreciated :)
## Current features ## Current features
* Install / remove scripts * Install / remove scripts
* Backup/restore scripts
* Adding / removing a link * Adding / removing a link
* Upgrade *not tested* * Upgrade *not tested*
## TODO ## TODO
* Configure Shaarli during installation * Configure Shaarli during installation
* Add backup/restore scripts
* Test more the package * Test more the package
## Changelog ## Changelog

View file

@ -38,7 +38,7 @@
"fr": "Est-ce un site Shaarli public ?" "fr": "Est-ce un site Shaarli public ?"
}, },
"choices": ["Yes", "No"], "choices": ["Yes", "No"],
"default": "Yes" "default": "No"
}, },
{ {
"name": "title", "name": "title",

20
scripts/backup Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Backup sources & data
# Note: the last argument is where to save this path, see the restore script.
ynh_backup "/var/www/${app}" "sources"
# Copy NGINX configuration
domain=$(ynh_app_setting_get "$app" domain)
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"

35
scripts/restore Normal file
View file

@ -0,0 +1,35 @@
#!/bin/bash
# Note: each files and directories you've saved using the ynh_backup helper
# will be located in the current directory, regarding the last argument.
# Exit on command errors and treat unset variables as an error
set -eu
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Retrieve old app settings
domain=$(ynh_app_setting_get "$app" domain)
path_url=$(ynh_app_setting_get "$app" path)
# Check domain/path availability
sudo yunohost app checkurl "${domain}${path_url}" -a "$app" \
|| ynh_die "Path not available: ${domain}${path_url}"
# Restore sources & data
src_path="/var/www/${app}"
sudo cp -a ./sources "$src_path"
# Restore permissions to app files
# you may need to make some file and/or directory writeable by www-data (nginx user)
sudo chown -R www-data:www-data "$src_path"
# Restore NGINX configuration
sudo cp -a ./nginx.conf "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Restart webserver
sudo service nginx reload