From 29a2626bcdfb9da06c84e9a9765adce63e5869a4 Mon Sep 17 00:00:00 2001 From: Alnus Tmp Date: Mon, 15 May 2023 16:41:52 +0000 Subject: [PATCH] compatible with Debian --- .env_oneteam | 54 ++++++++++++++++----------------- Dockerfile | 3 +- docker-compose.yml | 3 +- trytond-modules_non_official.sh | 13 +++++--- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.env_oneteam b/.env_oneteam index 60f1b9c..a6cb3be 100644 --- a/.env_oneteam +++ b/.env_oneteam @@ -1,38 +1,38 @@ #version Trytond server example 6.0 -TRYTOND_VERSION="6.2" +TRYTOND_VERSION=6.6 #python version that will run the docker example 3.7 or 3.9 is mandatory in case you use tryton6.2 -PYTHON_VERSION="3.9" +PYTHON_VERSION=3.9 #if the module repository is private -GITEA_USER="" -GITEA_PASSWORD="" -GITEA_ACCESS_TOKEN="123" +GITEA_USER= +GITEA_PASSWORD= +GITEA_ACCESS_TOKEN= #domain server gitea -GITEA_DOMAIN="git.disroot.org" -URL_MULTI_MIGRATE="https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/OneTeam/oc-multi_migrate_to_gitea.git" +GITEA_DOMAIN=git.disroot.org +URL_MULTI_MIGRATE=https://${GITEA_USER}:${GITEA_PASSWORD}@git.disroot.org/OneTeam/oc-multi_migrate_to_gitea.git #By default all organizations are set to false, activate only one. #GnuHealth, Etrivial, tryton-ar, OneTeam, OneTeam_Pos, Presik, Datalife, NaNtic, Kalenis -Provider="OneTeam" -DIR_MODULES="/usr/local/lib/python${PYTHON_VERSION}/dist-packages/trytond/modules" -DB_PASSWORD="SUp3r-pass*DB" -POSTGRES_DB="tryton" -DB_HOSTNAME="db" -POSTGRES_PASSWORD="SUp3r-pass*DB" -TRYTON_PORT="8000" -DEVELOP="True" -WORKER="True" -TRYTONPASSFILE="/etc/trytond_admin_pass.conf" +Provider=OneTeam +DIR_MODULES=/usr/local/lib/python${PYTHON_VERSION}/dist-packages/trytond/modules +DB_PASSWORD=SUp3r-pass*DB +POSTGRES_DB=tryton +DB_HOSTNAME=db +POSTGRES_PASSWORD=SUp3r-pass*DB +TRYTON_PORT=8000 +DEVELOP=True +WORKER=True +TRYTONPASSFILE=/etc/trytond_admin_pass.conf #Password user admin -TRYTONADMINPASS="admin" +TRYTONADMINPASS=admin #Email user admin -EMAIL="admin@admin.com" +EMAIL=admin@admin.com SLEEP_TRYTOND_ADMIN=15 #SMTP #This value is True or False -SMTP="" -SMTP_TYPE="smtps+ssl" -SMTP_USER="" -SMTP_PASSWORD="" -SMTP_DOMAIN="" -SMTP_PORT="" -SMTP_FROM="" -SMTP_EMAIL="" +SMTP=False +SMTP_TYPE=smtps+ssl +SMTP_USER= +SMTP_PASSWORD= +SMTP_DOMAIN= +SMTP_PORT=465 +SMTP_FROM=NAME_FROM +SMTP_EMAIL= diff --git a/Dockerfile b/Dockerfile index 5f97151..c574530 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ ARG TRYTOND_VERSION ARG PYTHON_VERSION ARG Provider ARG URL_MULTI_MIGRATE +ARG REPO_MULTI_MIGRATE ARG GITEA_DOMAIN ARG GITEA_USER ARG GITEA_PASSWORD @@ -60,4 +61,4 @@ RUN touch /etc/trytond_populate.conf \ USER trytond -CMD ["/bin/bash", "/opt/start.sh"] \ No newline at end of file +CMD ["/bin/bash", "/opt/start.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 84c35ed..d8a8f0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,7 @@ services: PYTHON_VERSION: ${PYTHON_VERSION} Provider: ${Provider} URL_MULTI_MIGRATE: ${URL_MULTI_MIGRATE} + REPO_MULTI_MIGRATE: ${REPO_MULTI_MIGRATE} GITEA_DOMAIN: ${GITEA_DOMAIN} GITEA_USER: ${GITEA_USER} GITEA_PASSWORD: ${GITEA_PASSWORD} @@ -47,4 +48,4 @@ volumes: modules: var: postgres: - attachment: \ No newline at end of file + attachment: diff --git a/trytond-modules_non_official.sh b/trytond-modules_non_official.sh index 74094d7..011d565 100644 --- a/trytond-modules_non_official.sh +++ b/trytond-modules_non_official.sh @@ -1,17 +1,18 @@ #!/usr/bin/bash -gitea_url="https://${GITEA_USER}:${GITEA_PASSWORD}@${GITEA_DOMAIN}/" +gitea_url="https://$GITEA_USER:$GITEA_PASSWORD@${GITEA_DOMAIN}/" cd /tmp -git clone ${URL_MULTI_MIGRATE} +git clone "${gitea_url}${REPO_MULTI_MIGRATE}" multi_migrate="/tmp/oc-multi_migrate_to_gitea/migrate_to_gitea.py" +DIR_USR=/usr/local/lib/python +DIR_PACKAGES=/dist-packages/trytond/modules +DIR_MODULES="${DIR_USR}${PYTHON_VERSION}${DIR_PACKAGES}" cd ${DIR_MODULES} -PYTHON_VERSION="python"${PYTHON_VERSION} - +PYTHON_VERSION="python${PYTHON_VERSION}" if [ "$WORKER" == "True" ]; then cat <>/etc/trytond.conf - [queue] worker = True EOF @@ -110,6 +111,7 @@ if [ "$Provider" == "OneTeam" ]; then purchase_coffee sale_payment_form sale_pos_extras + optical_equipment ) inactive_module "trytond-" $pip "${inactive_modules_trytondo[@]}" @@ -143,6 +145,7 @@ if [ "$Provider" == "OneTeam_Pos" ]; then inactive_modules_trytondo=( purchase_coffee sale_payment + optical_equipment ) inactive_module "trytond-" $pip "${inactive_modules_trytondo[@]}"