mirror of
https://github.com/YunoHost-Apps/13ft_ynh.git
synced 2024-09-03 18:06:03 +02:00
v2
This commit is contained in:
parent
3997eaf74b
commit
08937000c7
4 changed files with 29 additions and 29 deletions
|
@ -55,4 +55,4 @@ ram.runtime = "50M"
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
|
|
||||||
[resources.apt]
|
[resources.apt]
|
||||||
packages = "python3-venv"
|
packages = "python3-venv, python3, python3-pip"
|
||||||
|
|
|
@ -20,21 +20,9 @@ chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL PYTHON DEPENDENCIES
|
# SYSTEM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing python dependencies..." --weight=1
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
pushd $install_dir
|
|
||||||
python3 -m venv venv
|
|
||||||
venv/bin/pip install --upgrade pip
|
|
||||||
venv/bin/pip install -r requirements.txt # should only be flask for now, but just in case
|
|
||||||
venv/bin/pip install requests
|
|
||||||
popd
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# NGINX CONFIGURATION
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=1
|
|
||||||
|
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
|
@ -42,6 +30,18 @@ ynh_add_systemd_config
|
||||||
|
|
||||||
yunohost service add $app --description="Bypass paywall" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Bypass paywall" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# INSTALL PYTHON DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Installing python dependencies..." --weight=1
|
||||||
|
|
||||||
|
pushd $install_dir
|
||||||
|
ynh_exec_as $app python3 -m venv $final_path/venv
|
||||||
|
ynh_exec_as $app "$install_dir/venv/bin/pip" install --upgrade pip
|
||||||
|
ynh_exec_as $app "$install_dir/venv/bin/pip" install -r requirements.txt
|
||||||
|
ynh_exec_as $app "$install_dir/venv/bin/pip" install requests
|
||||||
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,7 +22,7 @@ chown -R $app:www-data "$install_dir"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
# RESTORE THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
|
|
|
@ -38,22 +38,10 @@ fi
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app:www-data "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# INSTALL PYTHON DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing python dependencies..." --weight=1
|
|
||||||
|
|
||||||
pushd $install_dir
|
|
||||||
python3 -m venv venv
|
|
||||||
venv/bin/pip install --upgrade pip
|
|
||||||
venv/bin/pip install -r requirements.txt # should only be flask for now, but just in case
|
|
||||||
venv/bin/pip install requests
|
|
||||||
popd
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1
|
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated NGINX config
|
# Create a dedicated NGINX config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -66,6 +54,18 @@ ynh_use_logrotate --non-append
|
||||||
|
|
||||||
yunohost service add $app --description="Bypass paywall" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Bypass paywall" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# INSTALL PYTHON DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Installing python dependencies..." --weight=1
|
||||||
|
|
||||||
|
pushd $install_dir
|
||||||
|
ynh_exec_as $app python3 -m venv $final_path/venv
|
||||||
|
ynh_exec_as $app "$install_dir/venv/bin/pip" install --upgrade pip
|
||||||
|
ynh_exec_as $app "$install_dir/venv/bin/pip" install -r requirements.txt
|
||||||
|
ynh_exec_as $app "$install_dir/venv/bin/pip" install requests
|
||||||
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue