mirror of
https://github.com/YunoHost-Apps/borgserver_ynh.git
synced 2024-09-03 20:36:20 +02:00
[enh] Quota documentation
This commit is contained in:
parent
b585de64f4
commit
d91707c232
3 changed files with 23 additions and 5 deletions
|
@ -35,6 +35,15 @@
|
|||
"en": "Indicate the public key given by borg_ynh app",
|
||||
"fr": "Indiquez la clé publique donnée par l'app borg_ynh"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "quota",
|
||||
"ask": {
|
||||
"en": "Indicate the storage quota",
|
||||
"fr": "Indiquez le quota de stockage"
|
||||
},
|
||||
"optionnal": true,
|
||||
"example": "30G"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -22,12 +22,12 @@ ynh_abort_if_errors
|
|||
export app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
# Retrieve arguments
|
||||
ynh_export ssh_user public_key
|
||||
ynh_export ssh_user public_key quota
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_save_args ssh_user public_key
|
||||
ynh_save_args ssh_user public_key quota
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
|
@ -47,7 +47,11 @@ adduser $ssh_user --quiet --gecos ",,," --shell /bin/bash --disabled-password
|
|||
home=/home/$ssh_user
|
||||
mkdir -p /home/$ssh_user/.ssh
|
||||
touch /home/$ssh_user/.ssh/authorized_keys
|
||||
echo "command=\"borg serve --restrict-to-path /home/$ssh_user/backup\",no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc $public_key" >> /home/$ssh_user/.ssh/authorized_keys
|
||||
extra="--storage-quota $quota"
|
||||
if [ "$quota" = "" ]; then
|
||||
extra=""
|
||||
fi
|
||||
echo "command=\"borg serve $extra --restrict-to-repository /home/$ssh_user/backup\",no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc $public_key" >> /home/$ssh_user/.ssh/authorized_keys
|
||||
|
||||
#=================================================
|
||||
# AVOID BACKUP OF BACKUP
|
||||
|
|
|
@ -29,6 +29,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
export ssh_user=$(ynh_app_setting_get $app ssh_user)
|
||||
export public_key=$(ynh_app_setting_get $app public_key)
|
||||
export quota=$(ynh_app_setting_get $app quota)
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
|
@ -40,7 +41,7 @@ pip3 install borgbackup
|
|||
#=================================================
|
||||
# CREATE SSH USER USED BY BORG
|
||||
#=================================================
|
||||
adduser $ssh_user -s /bin/bash --disabled-password
|
||||
adduser $ssh_user --quiet --gecos ",,," --shell /bin/bash --disabled-password
|
||||
|
||||
#=================================================
|
||||
# AUTORIZE SSH FOR THIS USER
|
||||
|
@ -48,7 +49,11 @@ adduser $ssh_user -s /bin/bash --disabled-password
|
|||
home=/home/$ssh_user
|
||||
mkdir -p /home/$ssh_user/.ssh
|
||||
touch /home/$ssh_user/.ssh/authorized_keys
|
||||
echo "command=\"borg serve --restrict-to-path /home/$ssh_user/backup\",no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc $public_key" >> /home/$ssh_user/.ssh/authorized_keys
|
||||
extra="--storage-quota $quota"
|
||||
if [ "$quota" = "" ]; then
|
||||
extra=""
|
||||
fi
|
||||
echo "command=\"borg serve $extra --restrict-to-repository /home/$ssh_user/backup\",no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc $public_key" >> /home/$ssh_user/.ssh/authorized_keys
|
||||
|
||||
#=================================================
|
||||
# AVOID BACKUP OF BACKUP
|
||||
|
|
Loading…
Add table
Reference in a new issue