mirror of
https://github.com/YunoHost-Apps/armadietto_ynh.git
synced 2024-09-03 18:06:18 +02:00
commit
294eab73d9
6 changed files with 7 additions and 57 deletions
|
@ -1,9 +1,5 @@
|
|||
location __PATH__ {
|
||||
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
proxy_pass http://127.0.0.1:__PORT__;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
"id": "armadietto",
|
||||
"packaging_format": 1,
|
||||
"description": {
|
||||
"en": "A remoteStorage server written for Node.js.",
|
||||
"fr": "Un serveur remoteStorage écrit pour node.js."
|
||||
"en": "A remoteStorage server running as a nodejs web service with systemd",
|
||||
"fr": "Un serveur remoteStorage excécuté en tant que service web nodejs par systemd"
|
||||
},
|
||||
"version": "0.0.2~ynh6",
|
||||
"url": "https://github.com/remotestorage/armadietto",
|
||||
|
@ -32,12 +32,6 @@
|
|||
"name": "domain",
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"example": "/",
|
||||
"default": "/"
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
|
|
|
@ -25,7 +25,7 @@ ynh_abort_if_errors
|
|||
#=================================================
|
||||
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url=$YNH_APP_ARG_PATH
|
||||
path_url="/"
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
is_signup=$YNH_APP_ARG_IS_SIGNUP
|
||||
|
||||
|
@ -43,11 +43,6 @@ final_path=/opt/yunohost/$app
|
|||
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
||||
# Only on / directory
|
||||
if [ "$path_url" != "/" ]; then
|
||||
ynh_die "Only / is allowed"
|
||||
fi
|
||||
|
||||
# Register (book) web path
|
||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||
|
||||
|
@ -58,7 +53,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
|
|||
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=final_path
|
||||
ynh_app_setting_set --app=$app --key=is_signup --value=$is_signup
|
||||
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
|
||||
|
||||
|
@ -86,7 +80,7 @@ ynh_use_nodejs
|
|||
#=================================================
|
||||
ynh_script_progression --message="Setting up and create final app path..." --weight=1
|
||||
|
||||
ynh_app_setting_set $app final_path $final_path
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
|
||||
# Create final_path
|
||||
mkdir -p "$final_path"
|
||||
|
|
|
@ -77,7 +77,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
|||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
|
@ -85,34 +84,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=2
|
|||
|
||||
ynh_remove_nodejs --nodejs_version=$NODEJS_VERSION
|
||||
|
||||
#=================================================
|
||||
# CLOSE A PORT
|
||||
#=================================================
|
||||
|
||||
if yunohost firewall list | grep -q "\- $port$"
|
||||
then
|
||||
ynh_script_progression --message="Closing port $port..." --weight=1
|
||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE FAIL2BAN CONFIGURATION
|
||||
#=================================================
|
||||
# ynh_script_progression --message="Removing Fail2ban configuration..." --weight=1
|
||||
|
||||
# Remove the dedicated Fail2Ban config
|
||||
# ynh_remove_fail2ban_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
# REMOVE VARIOUS FILES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing various files..." --weight=1
|
||||
|
||||
# Remove a cron file
|
||||
# ynh_secure_remove --file=""
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
|
@ -114,7 +114,8 @@ ynh_script_progression --message="Secure files and directories" --weight=1
|
|||
|
||||
# Set permissions to app files
|
||||
chown -R $app:$app "$final_path"
|
||||
chmod 0700 $datadir && chown $app:$app $datadir
|
||||
chmod 0700 $datadir
|
||||
chown $app:$app $datadir
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
|
@ -29,13 +29,6 @@ ynh_script_progression --message="Checking version..." --weight=1
|
|||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
### This helper will compare the version of the currently installed app and the version of the upstream package.
|
||||
### $upgrade_type can have 2 different values
|
||||
### - UPGRADE_APP if the upstream app version has changed
|
||||
### - UPGRADE_PACKAGE if only the YunoHost package has changed
|
||||
### ynh_check_app_version_changed will stop the upgrade if the app is up to date.
|
||||
### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do.
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
@ -129,6 +122,7 @@ chown $app:$app "$final_path/config.yml"
|
|||
#=================================================
|
||||
# CREATE DATA DIRECTORY
|
||||
#=================================================
|
||||
|
||||
if [ -z "$datadir" ]; then
|
||||
ynh_script_progression --message="Creating a data directory..." --weight=1
|
||||
|
||||
|
|
Loading…
Reference in a new issue