1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tandoor_ynh.git synced 2024-09-03 20:35:56 +02:00

Merge pull request #82 from YunoHost-Apps/fix

Fix
This commit is contained in:
eric_G 2024-07-22 13:23:28 +02:00 committed by GitHub
commit 58ec2dcd76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 15 deletions

View file

@ -6,7 +6,7 @@ After=network.target
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=__INSTALL_DIR__/source/
WorkingDirectory=__INSTALL_DIR__/
EnvironmentFile=__INSTALL_DIR__/.env
ExecStart=__INSTALL_DIR__/venv/bin/gunicorn --bind 127.0.0.1:__PORT__ recipes.wsgi:application
Restart=on-failure

View file

@ -16,13 +16,13 @@ _tandoor_venv_install() {
ynh_exec_as "$app" python3 -m venv --upgrade "$install_dir/venv"
venvpy="$install_dir/venv/bin/python3"
pushd "$install_dir/source"
pushd "$install_dir"
ynh_exec_as "$app" "$venvpy" -m pip install -r requirements.txt
popd
}
_tandoor_build_frontend() {
pushd "$install_dir/source/vue"
pushd "$install_dir/vue"
ynh_use_nodejs
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" yarn install
ynh_exec_warn_less ynh_exec_as "$app" env "$ynh_node_load_PATH" yarn build

View file

@ -38,7 +38,7 @@ ynh_psql_execute_as_root --sql="ALTER USER $db_name WITH SUPERUSER;"
ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/source"
ynh_setup_source --dest_dir="$install_dir"
chown -R "$app:www-data" "$install_dir"
@ -54,10 +54,10 @@ chown "$app:$app" "$install_dir/.env"
version=$(ynh_app_upstream_version)
ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py"
ynh_add_config --template="version.py" --destination="$install_dir/recipes/version.py"
chmod 400 "$install_dir/source/recipes/version.py"
chown "$app:$app" "$install_dir/source/recipes/version.py"
chmod 400 "$install_dir/recipes/version.py"
chown "$app:$app" "$install_dir/recipes/version.py"
#=================================================
# SPECIFIC SETUP
@ -69,10 +69,9 @@ ynh_script_progression --message="Installing Tandoor and its python dependencies
_tandoor_venv_install
ynh_script_progression --message="Running migrations and generating static files..." --weight=2
pushd "$install_dir/source"
pushd "$install_dir"
(
source "$install_dir/.env"
ynh_exec_as "$app" "$venvpy" manage.py migrate
ynh_psql_execute_as_root --sql="ALTER USER $app WITH NOSUPERUSER;"
ynh_exec_as "$app" "$venvpy" manage.py collectstatic --no-input

View file

@ -31,7 +31,7 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version="$nodejs_version"
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir/source" --full_replace=1 --keep="$install_dir/.env"
ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="$install_dir/.env"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
@ -49,10 +49,10 @@ chown "$app:$app" "$install_dir/.env"
version=$(ynh_app_upstream_version)
ynh_add_config --template="version.py" --destination="$install_dir/source/recipes/version.py"
ynh_add_config --template="version.py" --destination="$install_dir/recipes/version.py"
chmod 400 "$install_dir/source/recipes/version.py"
chown "$app:$app" "$install_dir/source/recipes/version.py"
chmod 400 "$install_dir/recipes/version.py"
chown "$app:$app" "$install_dir/recipes/version.py"
#=================================================
# SPECIFIC SETUP
@ -66,10 +66,9 @@ ynh_script_progression --message="Installing Tandoor and its python dependencies
_tandoor_venv_install
ynh_script_progression --message="Running migrations and generating static files..." --weight=2
pushd "$install_dir/source"
pushd "$install_dir"
(
source "$install_dir/.env"
ynh_exec_as "$app" "$venvpy" manage.py migrate
ynh_psql_execute_as_root --sql="ALTER USER $app WITH NOSUPERUSER;"
ynh_exec_as "$app" "$venvpy" manage.py collectstatic --no-input