1
0
Fork 0
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:
Kayou 2024-08-30 22:07:34 +02:00 committed by GitHub
parent be46f0c7cb
commit 0e420dbab5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 22 deletions

View file

@ -17,7 +17,7 @@ install_borg_with_pip() {
BORG_VERSION=$(ynh_app_upstream_version) BORG_VERSION=$(ynh_app_upstream_version)
ynh_exec_as "$app" "$venvpy" -m pip install borgbackup[pyfuse3]=="$BORG_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" setfacl --recursive --modify g:$ssh_user:rwX,d:g:$ssh_user:rwX "$install_dir"
} }

View file

@ -20,13 +20,6 @@ fi
ynh_system_user_exists --username="$ssh_user" && ynh_die --message="This user already exists" 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 # 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" 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 # SETUP CRON
#================================================= #=================================================

View file

@ -9,13 +9,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # 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/.ssh"
ynh_restore_file --origin_path="/home/$ssh_user/.nobackup" 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 # RESTORE SYSTEM CONFIGURATIONS
#================================================= #=================================================

View file

@ -48,13 +48,6 @@ if [ -z "${alert_delay:-}" ]; then
ynh_app_setting_set --app="$app" --key=alert_mails --value="root" ynh_app_setting_set --app="$app" --key=alert_mails --value="root"
fi fi
#=================================================
# UPGRADE BORG
#=================================================
ynh_script_progression --message="Upgrading Borg..." --weight=1
install_borg_with_pip
#================================================= #=================================================
# AUTORIZE SSH FOR THIS USER # 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" 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 # SETUP CRON
#================================================= #=================================================