1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/forgejo_ynh.git synced 2024-09-03 18:36:26 +02:00

fix: move .ssh dir to home dir

This commit is contained in:
Emmanuel Averty 2023-06-07 15:22:12 +02:00 committed by grosmanal
parent 78128a2f05
commit b1883d875a
4 changed files with 8 additions and 5 deletions

View file

@ -6,10 +6,10 @@ After=syslog.target network.target mysql.service slapd.service
Type=simple Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__DATA_DIR__/ WorkingDirectory=__INSTALL_DIR__/
ExecStart=__INSTALL_DIR__/forgejo web -p __PORT__ ExecStart=__INSTALL_DIR__/forgejo web -p __PORT__
Restart=always Restart=always
Environment=USER=__APP__ HOME=__DATA_DIR__/ Environment=USER=__APP__
# Sandboxing options to harden security # Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these # Depending on specificities of your service/app, you may need to tweak these

View file

@ -64,7 +64,6 @@ ram.runtime = "2G"
[resources.install_dir] [resources.install_dir]
[resources.data_dir] [resources.data_dir]
subdirs = ['.ssh']
[resources.permissions] [resources.permissions]
main.url = "/" main.url = "/"

View file

@ -22,8 +22,6 @@ mkdir -p "$install_dir/custom/conf"
chmod -R o-rwx "$install_dir/custom" chmod -R o-rwx "$install_dir/custom"
chown -R $app:$app "$install_dir/custom" chown -R $app:$app "$install_dir/custom"
chmod 700 $data_dir/.ssh
#================================================= #=================================================
# KEYS GENERATION # KEYS GENERATION
#================================================= #=================================================

View file

@ -28,6 +28,12 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# forgejo home directory has changed (yunohost packaging v2)
# .ssh directory should move from old home dir (data_dir) to new one
# (/var/www/$app is the default value for home in resources.system_user)
if [ -d "$data_dir/.ssh" ]; then
mv "$data_dir/.ssh" /var/www/$app
fi
# If secret_key doesn't exist, create it # If secret_key doesn't exist, create it
if [ -z "$secret_key" ]; then if [ -z "$secret_key" ]; then