mirror of
https://github.com/YunoHost-Apps/UMS_ynh.git
synced 2024-10-01 13:35:01 +02:00
fix home folder
This commit is contained in:
parent
1529f487bc
commit
743b942146
3 changed files with 20 additions and 19 deletions
|
@ -78,15 +78,16 @@ ram.runtime = "350M"
|
||||||
rend.exposed = "TCP"
|
rend.exposed = "TCP"
|
||||||
|
|
||||||
[resources.system_user]
|
[resources.system_user]
|
||||||
|
#UMS require a home path for the user as config files are stored in there
|
||||||
|
home = '/home/yunohost.app/__APP__'
|
||||||
|
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
|
|
||||||
[resources.data_dir]
|
[resources.data_dir]
|
||||||
dir = "/home/yunohost.app/__APP__"
|
|
||||||
subdirs = [ '.config', '.config/UMS' ]
|
|
||||||
|
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
main.auth_header=false
|
||||||
|
|
||||||
[resources.apt]
|
[resources.apt]
|
||||||
packages = "mediainfo dcraw"
|
packages = "mediainfo dcraw"
|
||||||
|
|
|
@ -57,13 +57,14 @@ ynh_add_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Setting up configuration file.." --weight=5
|
ynh_script_progression --message="Setting up configuration file.." --weight=5
|
||||||
|
|
||||||
mkdir -p "$data_dir/.config/UMS"
|
#UMS read config file from .config/UMS folder
|
||||||
ynh_add_config --template="UMS.conf.default" --destination="$data_dir/.config/UMS/UMS.conf"
|
mkdir -p "/home/yunohost.app/$app/.config/UMS"
|
||||||
ynh_add_config --template="WEB.conf.default" --destination="$data_dir/.config/UMS/WEB.conf"
|
ynh_add_config --template="UMS.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/UMS.conf"
|
||||||
ynh_add_config --template="VirtualFolders.conf.default" --destination="$data_dir/.config/UMS/VirtualFolders.conf"
|
ynh_add_config --template="WEB.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/WEB.conf"
|
||||||
|
ynh_add_config --template="VirtualFolders.conf.default" --destination="/home/yunohost.app/$app/.config/UMS/VirtualFolders.conf"
|
||||||
|
|
||||||
chown -R $app:$app "$data_dir/.config"
|
chown -R $app:$app "/home/yunohost.app/$app/.config"
|
||||||
chmod -R 700 "$data_dir/.config"
|
chmod -R 700 "/home/yunohost.app/$app/.config"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
|
@ -22,17 +22,6 @@ chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:$app "$install_dir"
|
chown -R $app:$app "$install_dir"
|
||||||
chown $app:$app "$install_dir/UMS.sh"
|
chown $app:$app "$install_dir/UMS.sh"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE DATA DIRECTORY
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
|
||||||
|
|
||||||
# (Same as for install dir)
|
|
||||||
chown -R $app:$app "$data_dir"
|
|
||||||
chown -R $app:$app "$data_dir/.config"
|
|
||||||
chmod -R 700 "$data_dir/.config"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
#SETTING MULTIMEDIA DIRECTORY
|
#SETTING MULTIMEDIA DIRECTORY
|
||||||
|
@ -53,10 +42,20 @@ systemctl enable $app.service --quiet
|
||||||
|
|
||||||
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
|
yunohost service add $app --description="A DLNA, UPnP and HTTP(S) Media Server." --log=/var/log/$app/$app.log --needs_exposed_ports $port_rend
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /var/log/$app
|
mkdir -p /var/log/$app
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE VARIOUS FILES
|
||||||
|
#=================================================
|
||||||
|
mkdir -p /var/log/$app
|
||||||
|
ynh_restore_file --origin_path="/home/yunohost.app/$app/"
|
||||||
|
chown -R $app:$app "/home/yunohost.app/$app/.config"
|
||||||
|
chmod -R 700 "/home/yunohost.app/$app/.config"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue