mirror of
https://github.com/YunoHost-Apps/borgwarehouse_ynh.git
synced 2024-09-03 18:16:17 +02:00
Test with env variable
This commit is contained in:
parent
eb2d957e03
commit
1ebc032316
6 changed files with 32 additions and 42 deletions
|
@ -19,18 +19,13 @@ ynh_print_info --message="Declaring files to be backed up..."
|
|||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$install_dir"
|
||||
|
||||
unlink "/home/$app/app"
|
||||
unlink "/home/$app/repos"
|
||||
|
||||
ynh_backup --src_path="/home/$app"
|
||||
ynh_backup --src_path="/home/yunohost.app/$app/app"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE REPOS DIRECTORY
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/home/yunohost.app/$app" --is_big
|
||||
ynh_backup --src_path="/home/yunohost.app/$app/repos" --is_big
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
|
|
|
@ -30,10 +30,10 @@ ynh_change_url_nginx_config
|
|||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template=".env" --destination="$install_dir/app/.env.local"
|
||||
ynh_add_config --template=".env" --destination="/home/yunohost.app/$app/app/.env.local"
|
||||
|
||||
chmod 400 "$install_dir/app/.env.local"
|
||||
chown $app:$app "$install_dir/app/.env.local"
|
||||
chmod 400 "/home/yunohost.app/$app/app/.env.local"
|
||||
chown $app:$app "/home/yunohost.app/$app/app/.env.local"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
|
|
|
@ -35,22 +35,19 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
|||
#=================================================
|
||||
ynh_script_progression --message="Setting up source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from manifest.toml
|
||||
ynh_setup_source --dest_dir="$install_dir/app"
|
||||
|
||||
mkdir "/home/$app" && chmod 700 "/home/$app"
|
||||
ln -s "$install_dir/app" "/home/$app/app"
|
||||
|
||||
mkdir "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh"
|
||||
touch "/home/$app/.ssh/authorized_keys" && chmod 600 "/home/$app/.ssh/authorized_keys"
|
||||
|
||||
mkdir "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app"
|
||||
ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos"
|
||||
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R $app:www-data "/home/$app"
|
||||
# Download, check integrity, uncompress and patch the source from manifest.toml
|
||||
ynh_setup_source --dest_dir="/home/yunohost.app/$app/app"
|
||||
|
||||
chmod 700 "/home/$app/app/helpers/shells/"*
|
||||
chmod 700 "/home/yunohost.app/$app"
|
||||
|
||||
mkdir "/home/yunohost.app/$app/.ssh" && chmod 700 "/home/yunohost.app/$app/.ssh"
|
||||
touch "/home/yunohost.app/$app/.ssh/authorized_keys" && chmod 600 "/home/yunohost.app/$app/.ssh/authorized_keys"
|
||||
|
||||
chown -R $app:www-data "/home/yunohost.app/$app"
|
||||
|
||||
chmod 700 "/home/yunohost.app/$app/app/helpers/shells/"*
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
|
@ -74,17 +71,17 @@ yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$
|
|||
#=================================================
|
||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template=".env" --destination="$install_dir/app/.env.local"
|
||||
ynh_add_config --template=".env" --destination="home/yunohost.app/$app/app/.env.local"
|
||||
|
||||
chmod 400 "$install_dir/app/.env.local"
|
||||
chown $app:$app "$install_dir/app/.env.local"
|
||||
chmod 400 "/home/yunohost.app/$app/app/.env.local"
|
||||
chown $app:$app "/home/yunohost.app/$app/app/.env.local"
|
||||
|
||||
#=================================================
|
||||
# INSTALL BORGWARHOUSE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing $app..." --weight=10
|
||||
|
||||
pushd $install_dir/app
|
||||
pushd /home/yunohost.app/$app/app
|
||||
ynh_use_nodejs
|
||||
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm ci
|
||||
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH NODE_ENV=production $ynh_npm run build
|
||||
|
|
|
@ -31,8 +31,6 @@ ynh_remove_nodejs
|
|||
|
||||
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||
|
||||
ynh_secure_remove --file="/home/$app"
|
||||
|
||||
ynh_secure_remove --file="/home/yunohost.app/$app"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -15,17 +15,17 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
mkdir -p "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app"
|
||||
|
||||
chown -R $app:www-data "$install_dir"
|
||||
ynh_restore_file --origin_path="/home/yunohost.app/$app/app"
|
||||
|
||||
ynh_restore_file --origin_path="/home/$app"
|
||||
ynh_restore_file --origin_path="/home/yunohost.app/$app" --not_mandatory
|
||||
chown -R $app:www-data "/home/yunohost.app/$app/app"
|
||||
|
||||
chown -R $app:www-data "/home/$app"
|
||||
chown -R $app:www-data "/home/yunohost.app/$app"
|
||||
ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos"
|
||||
ln -s "$install_dir/app" "/home/$app/app" && chmod 700 "/home/$app/app"
|
||||
ynh_restore_file --origin_path="/home/yunohost.app/$app/repos" --not_mandatory
|
||||
|
||||
chown -R $app:www-data "/home/yunohost.app/$app/repos"
|
||||
|
||||
chmod 700 "/home/yunohost.app/$app"
|
||||
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
|
|
|
@ -37,10 +37,10 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from manifest.toml
|
||||
ynh_setup_source --dest_dir="$install_dir" --keep="app/.env.local app/config/users.json app/config/repo.json"
|
||||
ynh_setup_source --dest_dir="/home/yunohost.app/$app/app" --keep="app/.env.local app/config/users.json app/config/repo.json"
|
||||
fi
|
||||
|
||||
chown -R $app:www-data "$install_dir"
|
||||
chown -R $app:www-data "/home/yunohost.app/$app/app"
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
|
@ -60,10 +60,10 @@ yunohost service add $app --description="WebUI for BorgBackup" --log="/var/log/$
|
|||
#=================================================
|
||||
ynh_script_progression --message="Updating a configuration file..." --weight=1
|
||||
|
||||
ynh_add_config --template=".env" --destination="$install_dir/app/.env.local"
|
||||
ynh_add_config --template=".env" --destination="/home/yunohost.app/$app/app/.env.local"
|
||||
|
||||
chmod 400 "$install_dir/app/.env.local"
|
||||
chown $app:$app "$install_dir/app/.env.local"
|
||||
chmod 400 "/home/yunohost.app/$app/app/.env.local"
|
||||
chown $app:$app "/home/yunohost.app/$app/app/.env.local"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
Loading…
Reference in a new issue