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

Refactor to harmonize with other apps in catalog

This commit is contained in:
Thomas 2023-07-09 22:21:01 +02:00 committed by GitHub
parent 0fda158546
commit 15cfb34986
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 15 deletions

View file

@ -6,10 +6,15 @@ After=network.target
[Service]
User=__APP__
Group=__APP__
StandardOutput=append:/var/log/__APP__/__APP__.log
StandardError=inherit
SyslogIdentifier=__APP__
Restart=always
Type=simple
WorkingDirectory=__INSTALL_DIR__
ExecStart=/usr/local/bin/pipenv run python3 __INSTALL_DIR__/.venv/bin/libretranslate --host 127.0.0.1 --port __PORT__ --load-only en,fr --frontend-language-target en
ExecStart=__INSTALL_DIR__/venv/bin/libretranslate --host 127.0.0.1 --port __PORT__ --load-only en,fr --frontend-language-target en
# Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these

View file

@ -5,7 +5,7 @@ name = "LibreTranslate"
description.en = "Open Source Machine Translation API"
description.fr = "API de traduction automatique Open Source"
version = "1.3.11~ynh1"
version = "1.3.11~ynh2"
maintainers = [""]

View file

@ -21,17 +21,15 @@ chown -R $app:www-data "$install_dir"
#=================================================
# SPECIFIC SETUP
#=================================================
ynh_script_progression --message="Installing dependencies..." --weight=2
ynh_exec_warn_less python3 -m pip install pipenv
ynh_script_progression --message="Installing LibreTranslate..." --weight=2
pushd $install_dir
mkdir -p .venv
PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install libretranslate==$libretranslate_version 2>&1
python3 -m venv $install_dir/venv
source $install_dir/venv/bin/activate
ynh_exec_warn_less pip install libretranslate==$libretranslate_version
popd
#=================================================
# SYSTEM CONFIGURATION
#=================================================

View file

@ -28,8 +28,6 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=5
ynh_exec_warn_less python3 -m pip install pipenv
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"

View file

@ -38,11 +38,10 @@ chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Installing LibreTranslate..." --weight=2
ynh_exec_warn_less python3 -m pip install pipenv
pushd $install_dir
mkdir -p .venv
PIPENV_VENV_IN_PROJECT="enabled" PIPENV_SKIP_LOCK=true ynh_exec_warn_less python3 -m pipenv install libretranslate==$libretranslate_version 2>&1
python3 -m venv $install_dir/venv
source $install_dir/venv/bin/activate
ynh_exec_warn_less pip install libretranslate==$libretranslate_version
popd
#=================================================

View file

@ -1,3 +1,5 @@
test_format = 1.0
[default]
[default]
test_upgrade_from.0fda158.name = "1.3.11~ynh1"