1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/motioneye_ynh.git synced 2024-09-03 19:46:09 +02:00

updated folders, upgrade, restore and install usage

This commit is contained in:
SolAZDev 2024-01-16 11:17:09 -04:00
parent ccebfa85fd
commit 1b5bb83821
4 changed files with 27 additions and 17 deletions

View file

@ -23,7 +23,7 @@ multi_instance = true
ldap = false
sso = true
disk = "500M"
ram.build = "512M"
ram.build = "256M"
ram.runtime = "1024M"
[install]
@ -60,6 +60,7 @@ ram.runtime = "1024M"
[resources.install_dir]
[resources.data_dir]
subdirs = ["logs", "media"]
[resources.permissions]
main.url = "/"

View file

@ -44,7 +44,7 @@ ynh_use_logrotate
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/motioneye.conf" --destination="/var/www/$app/motioneye.conf"
ynh_add_config --template="../conf/motioneye.conf" --destination="$install_dir/motioneye.conf"
#=================================================
# SETUP APPLICATION
#=================================================
@ -57,17 +57,9 @@ pushd $install_dir
popd
# pid dir
mkdir -p /var/www/$app/run
chown $app:$app /var/www/$app/run
chmod 664 /var/www/$app/run
# data dirs
mkdir -p /home/yunohost.app/$app/logs
chown $app:$app /home/yunohost.app/$app/logs
chmod 664 /home/yunohost.app/$app/logs
mkdir -p /home/yunohost.app/$app/media
chown $app:$app /home/yunohost.app/$app/media
chmod 664 /home/yunohost.app/$app/media
mkdir -p $install_dir/run
chown $app:$app $install_dir/run
chmod 664 $install_dir/run
#=================================================
# APP INITIAL CONFIGURATION
@ -76,7 +68,7 @@ chmod 664 /home/yunohost.app/$app/media
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config --template="../conf/motioneye.conf" --destination="/var/www/$app/motioneye.conf"
ynh_add_config --template="../conf/motioneye.conf" --destination="$install_dir/motioneye.conf"
#=================================================

View file

@ -19,6 +19,17 @@ ynh_restore_file --origin_path="$install_dir"
chown -R $app:www-data "$install_dir"
pushd $install_dir
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install source.tar.gz
popd
# pid dir
mkdir -p $install_dir/run
chown $app:$app $install_dir/run
chmod 664 $install_dir/run
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================

View file

@ -30,6 +30,12 @@ then
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
pushd $install_dir
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install source.tar.gz
popd
fi
chown -R $app:www-data "$install_dir"
@ -54,10 +60,10 @@ ynh_use_logrotate --non-append
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=1
ynh_add_config --template="some_config_file" --destination="$install_dir/some_config_file"
ynh_add_config --template="../conf/motioneye.conf" --destination="$install_dir/motioneye.conf"
chmod 400 "$install_dir/some_config_file"
chown $app:$app "$install_dir/some_config_file"
chmod 600 "$install_dir/motioneye.conf"
chown $app:$app "$install_dir/motioneye.conf"
#=================================================
# START SYSTEMD SERVICE