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:
parent
ccebfa85fd
commit
1b5bb83821
4 changed files with 27 additions and 17 deletions
|
@ -23,7 +23,7 @@ multi_instance = true
|
||||||
ldap = false
|
ldap = false
|
||||||
sso = true
|
sso = true
|
||||||
disk = "500M"
|
disk = "500M"
|
||||||
ram.build = "512M"
|
ram.build = "256M"
|
||||||
ram.runtime = "1024M"
|
ram.runtime = "1024M"
|
||||||
|
|
||||||
[install]
|
[install]
|
||||||
|
@ -60,6 +60,7 @@ ram.runtime = "1024M"
|
||||||
[resources.install_dir]
|
[resources.install_dir]
|
||||||
|
|
||||||
[resources.data_dir]
|
[resources.data_dir]
|
||||||
|
subdirs = ["logs", "media"]
|
||||||
|
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
|
|
@ -44,7 +44,7 @@ ynh_use_logrotate
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
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
|
# SETUP APPLICATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -57,17 +57,9 @@ pushd $install_dir
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# pid dir
|
# pid dir
|
||||||
mkdir -p /var/www/$app/run
|
mkdir -p $install_dir/run
|
||||||
chown $app:$app /var/www/$app/run
|
chown $app:$app $install_dir/run
|
||||||
chmod 664 /var/www/$app/run
|
chmod 664 $install_dir/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
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# APP INITIAL CONFIGURATION
|
# 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_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"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -19,6 +19,17 @@ ynh_restore_file --origin_path="$install_dir"
|
||||||
|
|
||||||
chown -R $app:www-data "$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
|
# RESTORE THE DATA DIRECTORY
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -30,6 +30,12 @@ then
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir="$install_dir"
|
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
|
fi
|
||||||
|
|
||||||
chown -R $app:www-data "$install_dir"
|
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_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"
|
chmod 600 "$install_dir/motioneye.conf"
|
||||||
chown $app:$app "$install_dir/some_config_file"
|
chown $app:$app "$install_dir/motioneye.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
|
Loading…
Add table
Reference in a new issue