mirror of
https://github.com/YunoHost-Apps/borgserver_ynh.git
synced 2024-09-03 20:36:20 +02:00
create user before installing borg
This commit is contained in:
parent
be46f0c7cb
commit
0e420dbab5
4 changed files with 22 additions and 22 deletions
|
@ -17,7 +17,7 @@ install_borg_with_pip() {
|
|||
BORG_VERSION=$(ynh_app_upstream_version)
|
||||
ynh_exec_as "$app" "$venvpy" -m pip install borgbackup[pyfuse3]=="$BORG_VERSION"
|
||||
|
||||
# Make venv accessible for every user
|
||||
# Make venv accessible for ssh_user
|
||||
setfacl --recursive --modify g:$ssh_user:rwX,d:g:$ssh_user:rwX "$install_dir"
|
||||
}
|
||||
|
||||
|
|
|
@ -20,13 +20,6 @@ fi
|
|||
|
||||
ynh_system_user_exists --username="$ssh_user" && ynh_die --message="This user already exists"
|
||||
|
||||
#=================================================
|
||||
# INSTALL BORG
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing Borg..."
|
||||
|
||||
install_borg_with_pip
|
||||
|
||||
#=================================================
|
||||
# AUTORIZE SSH FOR THIS USER
|
||||
#=================================================
|
||||
|
@ -42,6 +35,13 @@ touch "/home/$ssh_user/.nobackup"
|
|||
|
||||
create_ssh_config "/home/$ssh_user/.ssh" "/home/$ssh_user/backup"
|
||||
|
||||
#=================================================
|
||||
# INSTALL BORG
|
||||
#=================================================
|
||||
ynh_script_progression --message="Installing Borg..."
|
||||
|
||||
install_borg_with_pip
|
||||
|
||||
#=================================================
|
||||
# SETUP CRON
|
||||
#=================================================
|
||||
|
|
|
@ -9,13 +9,6 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE DATA DIRECTORY
|
||||
#=================================================
|
||||
|
@ -29,6 +22,13 @@ chown "$ssh_user" "/home/$ssh_user"
|
|||
ynh_restore_file --origin_path="/home/$ssh_user/.ssh"
|
||||
ynh_restore_file --origin_path="/home/$ssh_user/.nobackup"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEM CONFIGURATIONS
|
||||
#=================================================
|
||||
|
|
|
@ -48,13 +48,6 @@ if [ -z "${alert_delay:-}" ]; then
|
|||
ynh_app_setting_set --app="$app" --key=alert_mails --value="root"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# UPGRADE BORG
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading Borg..." --weight=1
|
||||
|
||||
install_borg_with_pip
|
||||
|
||||
#=================================================
|
||||
# AUTORIZE SSH FOR THIS USER
|
||||
#=================================================
|
||||
|
@ -70,6 +63,13 @@ touch "/home/$ssh_user/.nobackup"
|
|||
|
||||
create_ssh_config "/home/$ssh_user/.ssh" "/home/$ssh_user/backup"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE BORG
|
||||
#=================================================
|
||||
ynh_script_progression --message="Upgrading Borg..." --weight=1
|
||||
|
||||
install_borg_with_pip
|
||||
|
||||
#=================================================
|
||||
# SETUP CRON
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue