Compare commits
15 Commits
edad4df6e4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d854c2813e | |||
| 5ac4ef2029 | |||
| d0309fdfc1 | |||
| f4f9ee4d22 | |||
| 24d44e0b4a | |||
| af0b47e2d1 | |||
| b32114f883 | |||
| ad8334d11c | |||
| 259af7dc81 | |||
| e6dfabe90d | |||
| 85ae6164e0 | |||
| ce367e8ce0 | |||
| f2c176d0fd | |||
| e788de8acb | |||
| 20b1f77e9e |
@@ -11,7 +11,7 @@ if [ -z "${DEVELOP}" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${DEVELOP} = "True" ]; then
|
if [ ${DEVELOP} = "True" ]; then
|
||||||
pip3 install --break-system-packages proteus==${TRYTOND_VERSION}
|
pip3 install --break-system-packages proteus==${TRYTOND_VERSION} trytond==${TRYTOND_VERSION}
|
||||||
pip3 install --break-system-packages -r .dev/requirements_dev.txt
|
pip3 install --break-system-packages -r .dev/requirements_dev.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -19,6 +19,7 @@ fi
|
|||||||
pip3 install --break-system-packages -r requirements.txt
|
pip3 install --break-system-packages -r requirements.txt
|
||||||
|
|
||||||
pip3 install --break-system-packages trytond==${TRYTOND_VERSION}
|
pip3 install --break-system-packages trytond==${TRYTOND_VERSION}
|
||||||
|
pip install "python-sql<1.8" --break-system-packages
|
||||||
official_modules=".dev/official_modules.txt"
|
official_modules=".dev/official_modules.txt"
|
||||||
|
|
||||||
while IFS= read -r module; do
|
while IFS= read -r module; do
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
google-api-python-client==2.195.0
|
||||||
|
google-auth-httplib2==0.3.1
|
||||||
|
google-auth-oauthlib==1.3.1
|
||||||
inotify==0.2.10
|
inotify==0.2.10
|
||||||
honcho==2.0.0
|
honcho==2.0.0
|
||||||
pudb==2025.1
|
pudb==2025.1
|
||||||
urwid==3.0.2
|
urwid==3.0.2
|
||||||
freezegun==1.5.1
|
freezegun==1.5.1
|
||||||
psycopg2==2.9.10
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ source ${SCRIPT_DIR}/install_module.sh
|
|||||||
|
|
||||||
# inicializar base de datos
|
# inicializar base de datos
|
||||||
# https://docs.tryton.org/projects/server/en/latest/tutorial/module/setup_database.html
|
# https://docs.tryton.org/projects/server/en/latest/tutorial/module/setup_database.html
|
||||||
|
|
||||||
yes admin | trytond-admin -d ${DB_NAME} --all --act
|
yes admin | trytond-admin -d ${DB_NAME} --all --act
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
[web]
|
[web]
|
||||||
listen = 0.0.0.0:8000
|
listen = 0.0.0.0:8000
|
||||||
root=/var/lib/trytond/www
|
root=/var/lib/trytond/www
|
||||||
|
cors=http://localhost:5173/
|
||||||
cors =
|
|
||||||
http://localhost:5173
|
|
||||||
|
|||||||
35
.env.development.example
Normal file
35
.env.development.example
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# version Trytond server example 6.0
|
||||||
|
|
||||||
|
TRYTOND_VERSION=7.6
|
||||||
|
TRYTON_ADMIN_PASS=admin
|
||||||
|
TRYTON_ADMIN_EMAIL=admin@gmail.co
|
||||||
|
TRYTONADMINPASS=admin
|
||||||
|
TRYTONPASSFILE=/etc/trytond_admin_pass.conf
|
||||||
|
SLEEP_TRYTOND_ADMIN=5
|
||||||
|
|
||||||
|
# TRYTOND operation mode
|
||||||
|
|
||||||
|
TRYTON_PORT_LIVE=18021
|
||||||
|
PUDB_PORT_LIVE=8085
|
||||||
|
PUDB_PORT=8095
|
||||||
|
WORKER=True
|
||||||
|
|
||||||
|
# Facho
|
||||||
|
|
||||||
|
FACHO=True
|
||||||
|
FACHO_BRANCH=MigrationPython312Test
|
||||||
|
|
||||||
|
# If the module repository is private
|
||||||
|
|
||||||
|
GITEA_USER=USER
|
||||||
|
GITEA_PASSWORD=PASSWORD
|
||||||
|
GITEA_ACCESS_TOKEN=TOKEN
|
||||||
|
GITEA_DOMAIN=gitea.domain.org
|
||||||
|
|
||||||
|
# Database configuration
|
||||||
|
|
||||||
|
DB_HOSTNAME=db
|
||||||
|
DB_PASSWORD=SUp3r-pass*DB
|
||||||
|
POSTGRES_DB=tryton
|
||||||
|
POSTGRES_USER=postgres
|
||||||
|
POSTGRES_PASSWORD=SUp3r-pass*DB
|
||||||
51
.env.production.example
Normal file
51
.env.production.example
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# version Trytond server example 6.0
|
||||||
|
|
||||||
|
TRYTOND_VERSION=7.6
|
||||||
|
TRYTON_ADMIN_PASS=admin
|
||||||
|
TRYTON_ADMIN_EMAIL=admin@gmail.co
|
||||||
|
TRYTONADMINPASS=admin
|
||||||
|
TRYTONPASSFILE=/etc/trytond_admin_pass.conf
|
||||||
|
SLEEP_TRYTOND_ADMIN=5
|
||||||
|
|
||||||
|
# TRYTOND operation mode
|
||||||
|
|
||||||
|
TRYTON_PORT=8000
|
||||||
|
DEVELOP=False
|
||||||
|
WORKER=True
|
||||||
|
|
||||||
|
# Facho
|
||||||
|
|
||||||
|
FACHO=True
|
||||||
|
FACHO_BRANCH=MigrationPython312Test
|
||||||
|
|
||||||
|
# if the module repository is private
|
||||||
|
|
||||||
|
GITEA_USER=user
|
||||||
|
GITEA_PASSWORD=password
|
||||||
|
GITEA_ACCESS_TOKEN=TOKEN
|
||||||
|
GITEA_DOMAIN=gitea.domain.org
|
||||||
|
|
||||||
|
# Database configuration
|
||||||
|
|
||||||
|
DB_HOSTNAME=db
|
||||||
|
DB_PASSWORD=SUp3r-pass*DB
|
||||||
|
|
||||||
|
POSTGRES_DB=tryton
|
||||||
|
POSTGRES_USER=postgres
|
||||||
|
POSTGRES_PASSWORD=SUp3r-pass*DB
|
||||||
|
|
||||||
|
# SMTP This value is True or False
|
||||||
|
|
||||||
|
SMTP=False
|
||||||
|
SMTP_TYPE=smtps+ssl
|
||||||
|
SMTP_USER=email@example.com
|
||||||
|
SMTP_PASSWORD=PASSWORD
|
||||||
|
SMTP_DOMAIN=mail.example.org
|
||||||
|
SMTP_PORT=465
|
||||||
|
SMTP_FROM="NAME_FROM <email@example.com>"
|
||||||
|
SMTP_EMAIL=email@example.org
|
||||||
|
|
||||||
|
# NGINX
|
||||||
|
SERVER_NAME=localhost.example
|
||||||
|
NGINX_PORT=10000
|
||||||
|
VARIABLE=$
|
||||||
38
.env_example
38
.env_example
@@ -1,38 +0,0 @@
|
|||||||
# TRYTOND operation mode
|
|
||||||
DEVELOP=False
|
|
||||||
WORKER=True
|
|
||||||
|
|
||||||
# Develop mode
|
|
||||||
PUDB_PORT=8025
|
|
||||||
|
|
||||||
# TRYTOND information
|
|
||||||
TRYTOND_VERSION=7.6
|
|
||||||
TRYTOND_PORT_LIVE=8090
|
|
||||||
TRYTON_ADMIN_EMAIL=admin@admin.co
|
|
||||||
TRYTON_ADMIN_PASSWORD=s0p0rt3f1n4l*
|
|
||||||
TRYTONPASSFILE=/etc/trytond_admin_pass.conf
|
|
||||||
|
|
||||||
DB_HOSTNAME=db
|
|
||||||
POSTGRES_DB=tryton
|
|
||||||
POSTGRES_USER=tryton
|
|
||||||
POSTGRES_PASSWORD=SUp3r-pass*DB
|
|
||||||
|
|
||||||
# Email user admin
|
|
||||||
EMAIL=domain@domain.com
|
|
||||||
|
|
||||||
SLEEP_TRYTOND_ADMIN=15
|
|
||||||
|
|
||||||
# SMTP
|
|
||||||
SMTP="True"
|
|
||||||
SMTP_TYPE="smtps+ssl"
|
|
||||||
SMTP_USER="user"
|
|
||||||
SMTP_PASSWORD="passsword"
|
|
||||||
SMTP_DOMAIN="domain.com"
|
|
||||||
SMTP_PORT="465"
|
|
||||||
SMTP_FROM="Company CO"
|
|
||||||
SMTP_EMAIL="domain@domain.com"
|
|
||||||
|
|
||||||
# NGINX
|
|
||||||
SERVER_NAME=tryton.domain.com
|
|
||||||
NGINX_PORT=10000
|
|
||||||
VARIABLE=$
|
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -111,6 +111,8 @@ celerybeat.pid
|
|||||||
|
|
||||||
# Environments
|
# Environments
|
||||||
.env
|
.env
|
||||||
|
.env.development
|
||||||
|
.env.production
|
||||||
.venv
|
.venv
|
||||||
env/
|
env/
|
||||||
venv/
|
venv/
|
||||||
@@ -225,4 +227,4 @@ pyvenv.cfg
|
|||||||
pip-selfcheck.json
|
pip-selfcheck.json
|
||||||
|
|
||||||
.tdd_cache
|
.tdd_cache
|
||||||
app
|
app
|
||||||
|
|||||||
8
.gitmodules
vendored
8
.gitmodules
vendored
@@ -2,10 +2,6 @@
|
|||||||
path = modules/party_co
|
path = modules/party_co
|
||||||
url = https://aserrador:3sh0r4d3s3gu1r@gitea.onecluster.org/OneTeam/trytondo-party_co.git
|
url = https://aserrador:3sh0r4d3s3gu1r@gitea.onecluster.org/OneTeam/trytondo-party_co.git
|
||||||
branch = main
|
branch = main
|
||||||
[submodule "web_app"]
|
|
||||||
path = web_app
|
|
||||||
url = https://aserrador:3sh0r4d3s3gu1r@gitea.onecluster.org/OneTeam/Naliia_webapp.git
|
|
||||||
branch = main
|
|
||||||
[submodule "modules/naliia"]
|
[submodule "modules/naliia"]
|
||||||
path = modules/naliia
|
path = modules/naliia
|
||||||
url = https://aserrador:3sh0r4d3s3gu1r@gitea.onecluster.org/OneTeam/trytond-au-naliia.git
|
url = https://aserrador:3sh0r4d3s3gu1r@gitea.onecluster.org/OneTeam/trytond-au-naliia.git
|
||||||
@@ -48,3 +44,7 @@
|
|||||||
path = modules/account_co_pyme
|
path = modules/account_co_pyme
|
||||||
url = ssh://git@gitea.onecluster.org:6666/OneTeam/trytondo-account_co_pyme.git
|
url = ssh://git@gitea.onecluster.org:6666/OneTeam/trytondo-account_co_pyme.git
|
||||||
branch = 7.6
|
branch = 7.6
|
||||||
|
[submodule "modules/google_integration"]
|
||||||
|
path = modules/google_integration
|
||||||
|
url = ssh://git@gitea.onecluster.org:6666/OneTeam/trytondo-google_integration.git
|
||||||
|
branch = main
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
|
||||||
FROM python:3.11-bullseye
|
|
||||||
|
|
||||||
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
|
|
||||||
RUN apt-get update && apt-get install -y postgresql-client
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
||||||
FROM node as builder-node
|
FROM node AS builder-node
|
||||||
|
|
||||||
ARG TRYTOND_VERSION
|
ARG TRYTOND_VERSION
|
||||||
|
|
||||||
@@ -9,11 +9,26 @@ RUN curl https://downloads.tryton.org/${SERIES}/tryton-sao-last.tgz | tar zxf -
|
|||||||
COPY naliia_sao_custom/sao.less /package/src/sao.less
|
COPY naliia_sao_custom/sao.less /package/src/sao.less
|
||||||
RUN cd /package && bower install --allow-root
|
RUN cd /package && bower install --allow-root
|
||||||
|
|
||||||
FROM python:3.11-bullseye
|
|
||||||
|
FROM debian:12-slim
|
||||||
|
|
||||||
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
|
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
|
||||||
RUN apt-get update && apt-get install -y postgresql-client
|
RUN apt-get update && \
|
||||||
|
apt-get install -y postgresql-client python3-pip curl && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
||||||
COPY --from=builder-node /package /var/lib/trytond/www
|
COPY --from=builder-node /package /var/lib/trytond/www
|
||||||
COPY naliia_sao_custom/ /var/lib/trytond/www/
|
COPY naliia_sao_custom/ /var/lib/trytond/www/
|
||||||
|
|
||||||
|
ARG TRYTONPASSFILE
|
||||||
|
ARG TRYTON_ADMIN_PASSWORD
|
||||||
|
|
||||||
|
ENV TRYTONPASSFILE=/etc/trytond_admin_pass.conf
|
||||||
|
|
||||||
|
|
||||||
|
RUN touch /etc/trytond_populate.conf \
|
||||||
|
&& touch $TRYTONPASSFILE \
|
||||||
|
&& echo $TRYTON_ADMIN_PASSWORD >> $TRYTONPASSFILE \
|
||||||
|
|
||||||
@@ -20,7 +20,6 @@ FROM tryton/tryton:$TRYTOND_VERSION
|
|||||||
LABEL org.label-schema.version="$TRYTOND_VERSION"
|
LABEL org.label-schema.version="$TRYTOND_VERSION"
|
||||||
|
|
||||||
ARG TRYTOND_VERSION
|
ARG TRYTOND_VERSION
|
||||||
ARG DEVELOP
|
|
||||||
ARG WORKER
|
ARG WORKER
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
@@ -38,20 +37,19 @@ RUN echo "Install modules non official"
|
|||||||
COPY trytond.conf /etc/trytond.conf
|
COPY trytond.conf /etc/trytond.conf
|
||||||
COPY trytond_worker.conf /etc/trytond_worker.conf
|
COPY trytond_worker.conf /etc/trytond_worker.conf
|
||||||
COPY gunicorn.conf.py /etc/gunicorn.conf.py
|
COPY gunicorn.conf.py /etc/gunicorn.conf.py
|
||||||
|
|
||||||
COPY requirements.txt /opt
|
|
||||||
RUN pip install --break-system-packages -r /opt/requirements.txt
|
|
||||||
COPY start.sh /opt
|
|
||||||
|
|
||||||
COPY trytond_logging.conf /etc/trytond_logging.conf
|
COPY trytond_logging.conf /etc/trytond_logging.conf
|
||||||
COPY trytond_cron_logging.conf /etc/trytond_cron_logging.conf
|
COPY trytond_cron_logging.conf /etc/trytond_cron_logging.conf
|
||||||
COPY trytond_worker_logging.conf /etc/trytond_worker_logging.conf
|
COPY trytond_worker_logging.conf /etc/trytond_worker_logging.conf
|
||||||
|
|
||||||
COPY common_password.txt /etc/common_password.txt
|
COPY common_password.txt /etc/common_password.txt
|
||||||
|
COPY start.sh /opt
|
||||||
|
|
||||||
|
COPY requirements.txt /opt
|
||||||
|
|
||||||
|
RUN pip install --break-system-packages -r /opt/requirements.txt
|
||||||
|
|
||||||
COPY modules /app/modules
|
COPY modules /app/modules
|
||||||
|
|
||||||
COPY install_modules.sh /app/install_modules.sh
|
COPY ./prod/install_modules.sh /app/install_modules.sh
|
||||||
RUN chmod +x /app/install_modules.sh && /bin/bash /app/install_modules.sh
|
RUN chmod +x /app/install_modules.sh && /bin/bash /app/install_modules.sh
|
||||||
|
|
||||||
RUN rm -rf /var/lib/trytond/www
|
RUN rm -rf /var/lib/trytond/www
|
||||||
7
Dockerfile_test
Executable file
7
Dockerfile_test
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
# TOMADO DE: https://hg.tryton.org/tryton-docker/file/tip/6.6/Dockerfile
|
||||||
|
FROM debian:12-slim
|
||||||
|
|
||||||
|
# trytond DB_CACHE requiere commandos `pg_dump` y `pg_restore`
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y postgresql-client python3-pip curl && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
99
Rakefile
99
Rakefile
@@ -1,7 +1,14 @@
|
|||||||
require 'yaml'
|
require 'yaml'
|
||||||
require 'digest'
|
require 'digest'
|
||||||
|
|
||||||
DOCKER_COMPOSE='compose.test.yml'
|
DOCKER_COMPOSE_TEST='docker-compose.test.yaml'
|
||||||
|
ENV_FILE_DEV='.env.development'
|
||||||
|
|
||||||
|
DOCKER_COMPOSE_LIVE='docker-compose.live.yaml'
|
||||||
|
ENV_FILE_LIVE='.env.development'
|
||||||
|
|
||||||
|
DOCKER_COMPOSE_DEPLOY='docker-compose.prod.yaml'
|
||||||
|
ENV_FILE_DEPLOY='.env.production'
|
||||||
|
|
||||||
desc 'iniciar entorno'
|
desc 'iniciar entorno'
|
||||||
task :up do
|
task :up do
|
||||||
@@ -10,7 +17,7 @@ end
|
|||||||
|
|
||||||
desc 'poblar entorno'
|
desc 'poblar entorno'
|
||||||
task :init => [:up] do
|
task :init => [:up] do
|
||||||
compose('exec', 'test.dev', 'pip3 install psycopg2 flake8')
|
compose('exec', 'test.dev', 'pip3 install psycopg2-binary flake8 --break-system-packages')
|
||||||
compose('exec', 'test.dev', "bash .dev/install_module.sh")
|
compose('exec', 'test.dev', "bash .dev/install_module.sh")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -21,7 +28,6 @@ end
|
|||||||
|
|
||||||
desc 'iterar'
|
desc 'iterar'
|
||||||
task :tdd, [:name] do |_, args|
|
task :tdd, [:name] do |_, args|
|
||||||
|
|
||||||
refresh_cache
|
refresh_cache
|
||||||
test_dir = ''
|
test_dir = ''
|
||||||
if args.name
|
if args.name
|
||||||
@@ -30,9 +36,8 @@ task :tdd, [:name] do |_, args|
|
|||||||
compose('exec', 'test.dev', "bash -c 'cd #{test_dir}/tests && python3 -m unittest'")
|
compose('exec', 'test.dev', "bash -c 'cd #{test_dir}/tests && python3 -m unittest'")
|
||||||
else
|
else
|
||||||
compose('exec', 'test.dev', "bash -c 'cd modules && flake8 *'")
|
compose('exec', 'test.dev', "bash -c 'cd modules && flake8 *'")
|
||||||
compose('exec', 'test.dev', "bash -c 'python -m unittest discover -s modules'")
|
compose('exec', 'test.dev', "bash -c 'python3 -m unittest discover -s modules'")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'detener entorno'
|
desc 'detener entorno'
|
||||||
@@ -45,32 +50,32 @@ namespace :live do
|
|||||||
|
|
||||||
desc 'iniciar entorno'
|
desc 'iniciar entorno'
|
||||||
task :up do
|
task :up do
|
||||||
compose('up', '--build', '-d', compose: 'compose.live.yml')
|
compose('up', '--build', '-d', env_file: ENV_FILE_LIVE, compose: DOCKER_COMPOSE_LIVE)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'monitorear salida'
|
desc 'monitorear salida'
|
||||||
task :tail do
|
task :tail do
|
||||||
compose('logs', '-f', 'live', compose: 'compose.live.yml')
|
compose('logs', '-f', 'live', '-n', '50', env_file: ENV_FILE_LIVE, compose: DOCKER_COMPOSE_LIVE)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'detener entorno'
|
desc 'detener entorno'
|
||||||
task :down do
|
task :down do
|
||||||
compose('down', compose: 'compose.live.yml')
|
compose('down', env_file: ENV_FILE_LIVE, compose: DOCKER_COMPOSE_LIVE)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'eliminar entorno'
|
desc 'eliminar entorno'
|
||||||
task :del do
|
task :del do
|
||||||
compose('down', '-v', '--rmi', 'all', compose: 'compose.live.yml')
|
compose('down', '-v', '--rmi', 'all', env_file: ENV_FILE_LIVE, compose: DOCKER_COMPOSE_LIVE)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'detener entorno'
|
desc 'detener entorno'
|
||||||
task :stop do
|
task :stop do
|
||||||
compose('stop', compose: 'compose.live.yml')
|
compose('stop', env_file: ENV_FILE_LIVE, compose: DOCKER_COMPOSE_LIVE)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'reiniciar entorno'
|
desc 'reiniciar entorno'
|
||||||
task :restart do
|
task :restart do
|
||||||
compose('restart', compose: 'compose.live.yml')
|
compose('restart', env_file: ENV_FILE_LIVE, compose: DOCKER_COMPOSE_LIVE)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'terminal'
|
desc 'terminal'
|
||||||
@@ -80,25 +85,85 @@ namespace :live do
|
|||||||
|
|
||||||
desc 'monitorear salida'
|
desc 'monitorear salida'
|
||||||
task :tail_end do
|
task :tail_end do
|
||||||
compose('logs', '-f', '-n 50', 'live', compose: 'compose.live.yml')
|
compose('logs', '-f', '-n 50', 'live', env_file: ENV_FILE_LIVE, compose: DOCKER_COMPOSE_LIVE)
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'populate data'
|
desc 'populate data'
|
||||||
task :populate, [:database] do |_, args|
|
task :populate, [:database] do |_, args|
|
||||||
if args.database
|
if args.database
|
||||||
compose('stop', "live", compose: "compose.live.yml")
|
compose('stop', "live", env_file: ENV_FILE_DEV, compose: DOCKER_COMPOSE_LIVE)
|
||||||
compose('exec', '-it', '--user', 'postgres', 'db', "bash -c 'dropdb -U tryton #{args.database}'")
|
compose('exec', '-it', '--user', 'postgres', 'db', "bash -c 'dropdb -U tryton #{args.database}'")
|
||||||
compose('exec', '-it', '--user', 'postgres', 'db', "bash -c 'createdb -U tryton #{args.database}'")
|
compose('exec', '-it', '--user', 'postgres', 'db', "bash -c 'createdb -U tryton #{args.database}'")
|
||||||
compose('restart', "live", compose: "compose.live.yml")
|
compose('restart', "live", env_file: ENV_FILE_DEV, compose: DOCKER_COMPOSE_LIVE)
|
||||||
sleep(40)
|
sleep(40)
|
||||||
compose('exec', 'live', "bash -c 'python3 demo/populate_scripts/__main__.py -c .dev/trytond.cfg -d #{args.database}'")
|
compose('exec', 'live', "bash -c 'python3 demo/populate_scripts/__main__.py -c .dev/trytond.cfg -d #{args.database}'")
|
||||||
compose('restart', 'live', compose: "compose.live.yml")
|
compose('restart', 'live', env_file: ENV_FILE_DEV, compose: DOCKER_COMPOSE_LIVE)
|
||||||
else
|
else
|
||||||
puts "Falta el nombre de la base de datos"
|
puts "Falta el nombre de la base de datos"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc 'produccion'
|
||||||
|
namespace :deploy do
|
||||||
|
|
||||||
|
desc 'iniciar entorno'
|
||||||
|
task :up do
|
||||||
|
compose('up', '--build', '-d', env_file: ENV_FILE_DEPLOY, compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'monitorear salida'
|
||||||
|
task :tail do
|
||||||
|
compose('logs', env_file: ENV_FILE_DEPLOY, compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'detener entorno'
|
||||||
|
task :down do
|
||||||
|
compose('down', env_file: ENV_FILE_DEPLOY, compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'eliminar entorno'
|
||||||
|
task :del do
|
||||||
|
compose('down', '-v', '--rmi', 'all', env_file: ENV_FILE_DEPLOY ,compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'reiniciar entorno'
|
||||||
|
task :restart do
|
||||||
|
compose('restart', env_file: ENV_FILE_DEPLOY, compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'terminal-tryton'
|
||||||
|
task :sh_tryton do
|
||||||
|
compose('exec', '--user', 'root', 'tryton', '/entrypoint.sh', 'bash', compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'terminal-worker'
|
||||||
|
task :sh_worker do
|
||||||
|
compose('exec', '--user', 'root', 'tryton_worker', '/entrypoint.sh', 'bash', compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'terminal-cron'
|
||||||
|
task :sh_cron do
|
||||||
|
compose('exec', '--user', 'root', 'tryton_cron', '/entrypoint.sh', 'bash', compose: DOCKER_COMPOSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'terminal-db'
|
||||||
|
task :sh_db do
|
||||||
|
compose('exec', '--user', 'postgres', 'db', 'bash', compose: DOCKER_COMOPSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'terminal-nginx'
|
||||||
|
task :sh_nginx do
|
||||||
|
compose('exec', 'nginx', 'bash', compose: DOCKER_COMOPSE_DEPLOY)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc 'top'
|
||||||
|
task :top do
|
||||||
|
compose('top', compose: DOCKER_COMOPSE_DEPLOY)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
desc 'Git - Submodules'
|
desc 'Git - Submodules'
|
||||||
namespace :git do
|
namespace :git do
|
||||||
|
|
||||||
@@ -124,8 +189,8 @@ namespace :git do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def compose(*arg, compose: DOCKER_COMPOSE)
|
def compose(*arg, env_file: ENV_FILE_DEV, compose: DOCKER_COMPOSE_TEST)
|
||||||
sh "docker-compose -f #{compose} #{arg.join(' ')}"
|
sh "docker compose --env-file #{env_file} -f #{compose} #{arg.join(' ')}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def refresh_cache
|
def refresh_cache
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
services:
|
|
||||||
db:
|
|
||||||
image: postgres
|
|
||||||
hostname:
|
|
||||||
${DB_HOSTNAME}
|
|
||||||
volumes:
|
|
||||||
- postgres:/var/lib/postgresql
|
|
||||||
environment:
|
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
||||||
POSTGRES_DB: ${POSTGRES_DB}
|
|
||||||
tryton:
|
|
||||||
build:
|
|
||||||
context: ./
|
|
||||||
dockerfile: Dockerfile_Deploy
|
|
||||||
args:
|
|
||||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
|
||||||
EMAIL: admin@admin.org
|
|
||||||
WORKER: True
|
|
||||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
|
||||||
healthcheck:
|
|
||||||
test: curl --fail localhost:8000 || exit 1
|
|
||||||
interval: 30s
|
|
||||||
retries: 5
|
|
||||||
start_period: 30s
|
|
||||||
timeout: 20s
|
|
||||||
ports:
|
|
||||||
- "${TRYTON_PORT:-8000}:8000"
|
|
||||||
volumes:
|
|
||||||
- .:/app
|
|
||||||
- var:/var
|
|
||||||
- attachment:/mnt/attachment
|
|
||||||
environment:
|
|
||||||
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
working_dir: /app
|
|
||||||
nginx:
|
|
||||||
image: nginx:1.23.3
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template
|
|
||||||
ports:
|
|
||||||
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
depends_on:
|
|
||||||
- tryton
|
|
||||||
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
|
||||||
tryton_worker:
|
|
||||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
|
||||||
depends_on:
|
|
||||||
tryton:
|
|
||||||
condition: service_healthy
|
|
||||||
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-worker -c /etc/trytond_worker.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf"]
|
|
||||||
volumes:
|
|
||||||
- .:/app
|
|
||||||
environment:
|
|
||||||
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
working_dir: /app
|
|
||||||
tryton_cron:
|
|
||||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
|
||||||
depends_on:
|
|
||||||
tryton:
|
|
||||||
condition: service_healthy
|
|
||||||
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf"]
|
|
||||||
volumes:
|
|
||||||
- .:/app
|
|
||||||
environment:
|
|
||||||
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
working_dir: /app
|
|
||||||
volumes:
|
|
||||||
var:
|
|
||||||
postgres:
|
|
||||||
attachment:
|
|
||||||
@@ -8,9 +8,10 @@ services:
|
|||||||
live:
|
live:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile_Live
|
dockerfile: Dockerfile_live
|
||||||
args:
|
args:
|
||||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
||||||
|
TRYTON_ADMIN_PASSWORD: ${TRYTON_ADMIN_PASSWORD:-admin}
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
command: bash .dev/run.sh
|
command: bash .dev/run.sh
|
||||||
@@ -27,7 +28,7 @@ services:
|
|||||||
- "${PUDB_PORT_LIVE:-8020}:8020"
|
- "${PUDB_PORT_LIVE:-8020}:8020"
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env.development
|
||||||
volumes:
|
volumes:
|
||||||
app:
|
app:
|
||||||
attachments:
|
attachments:
|
||||||
102
docker-compose.prod.yaml
Normal file
102
docker-compose.prod.yaml
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres
|
||||||
|
hostname: ${DB_HOSTNAME}
|
||||||
|
volumes:
|
||||||
|
- postgres:/var/lib/postgresql
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
|
tryton:
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: Dockerfile_prod
|
||||||
|
args:
|
||||||
|
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
||||||
|
GITEA_USER: ${GITEA_USER}
|
||||||
|
GITEA_PASSWORD: ${GITEA_PASSWORD}
|
||||||
|
GITEA_DOMAIN: ${GITEA_DOMAIN}
|
||||||
|
WORKER: ${WORKER}
|
||||||
|
TRYTONPASSFILE: ${TRYTONPASSFILE}
|
||||||
|
TRYTON_ADMIN_EMAIL: ${TRYTON_ADMIN_EMAIL}
|
||||||
|
SMTP: ${SMTP}
|
||||||
|
SMTP_TYPE: ${SMTP_TYPE}
|
||||||
|
SMTP_USER: ${SMTP_USER}
|
||||||
|
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
||||||
|
SMTP_DOMAIN: ${SMTP_DOMAIN}
|
||||||
|
SMTP_PORT: ${SMTP_PORT}
|
||||||
|
SMTP_FROM: ${SMTP_FROM}
|
||||||
|
SMTP_EMAIL: ${SMTP_EMAIL}
|
||||||
|
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
||||||
|
healthcheck:
|
||||||
|
test: curl --fail localhost:8000 || exit 1
|
||||||
|
interval: 30s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
timeout: 20s
|
||||||
|
ports:
|
||||||
|
- "${TRYTON_PORT:-8000}:8000"
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
- var:/var
|
||||||
|
- attachment:/mnt/attachment
|
||||||
|
environment:
|
||||||
|
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
env_file:
|
||||||
|
- .env.production
|
||||||
|
working_dir: /app
|
||||||
|
nginx:
|
||||||
|
image: nginx:1.23.3
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ./prod/nginx.conf:/etc/nginx/conf.d/nginx.conf.template
|
||||||
|
ports:
|
||||||
|
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
|
||||||
|
env_file:
|
||||||
|
- .env.production
|
||||||
|
depends_on:
|
||||||
|
- tryton
|
||||||
|
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
||||||
|
tryton_worker:
|
||||||
|
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
||||||
|
depends_on:
|
||||||
|
tryton:
|
||||||
|
condition: service_healthy
|
||||||
|
entrypoint:
|
||||||
|
[
|
||||||
|
"bash",
|
||||||
|
"-c",
|
||||||
|
"/entrypoint.sh trytond-worker -c /etc/trytond_worker.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf",
|
||||||
|
]
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
environment:
|
||||||
|
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
|
||||||
|
env_file:
|
||||||
|
- .env.production
|
||||||
|
working_dir: /app
|
||||||
|
tryton_cron:
|
||||||
|
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
||||||
|
depends_on:
|
||||||
|
tryton:
|
||||||
|
condition: service_healthy
|
||||||
|
entrypoint:
|
||||||
|
[
|
||||||
|
"bash",
|
||||||
|
"-c",
|
||||||
|
"/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf",
|
||||||
|
]
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
environment:
|
||||||
|
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
|
||||||
|
env_file:
|
||||||
|
- .env.production
|
||||||
|
working_dir: /app
|
||||||
|
volumes:
|
||||||
|
app:
|
||||||
|
var:
|
||||||
|
postgres:
|
||||||
|
attachment:
|
||||||
@@ -2,7 +2,7 @@ services:
|
|||||||
test.dev:
|
test.dev:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile_Test
|
dockerfile: Dockerfile_test
|
||||||
args:
|
args:
|
||||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
||||||
environment:
|
environment:
|
||||||
@@ -10,6 +10,7 @@ services:
|
|||||||
DB_CACHE: /tmp
|
DB_CACHE: /tmp
|
||||||
DB_NAME: ":memory:"
|
DB_NAME: ":memory:"
|
||||||
TRYTOND_DATABASE_URI: sqlite://
|
TRYTOND_DATABASE_URI: sqlite://
|
||||||
|
DEVELOP: "True"
|
||||||
command: sleep 10h
|
command: sleep 10h
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
@@ -17,4 +18,4 @@ services:
|
|||||||
- "${PUDB_PORT:-8025}:8025"
|
- "${PUDB_PORT:-8025}:8025"
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env.development
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
services:
|
|
||||||
db:
|
|
||||||
image: postgres:12
|
|
||||||
environment:
|
|
||||||
- POSTGRES_USER=${POSTGRES_USER}
|
|
||||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
||||||
- POSTGRES_DB=${POSTGRES_DB}
|
|
||||||
live:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile_Live
|
|
||||||
args:
|
|
||||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
command: bash /app/.dev/run.sh
|
|
||||||
environment:
|
|
||||||
- DB_NAME=${POSTGRES_DB}
|
|
||||||
- SRC=/app
|
|
||||||
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
|
|
||||||
volumes:
|
|
||||||
- ./:/app
|
|
||||||
- ./attachments:/attachments
|
|
||||||
- ./.dev/pudb.cfg:/root/.config/pudb/pudb.cfg
|
|
||||||
ports:
|
|
||||||
- "${TRYTOND_PORT_LIVE:-18020}:8000"
|
|
||||||
- "${PUDB_PORT_LIVE:-8020}:8020"
|
|
||||||
working_dir: /app
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
volumes:
|
|
||||||
app:
|
|
||||||
attachments:
|
|
||||||
Submodule modules/account_co_pyme updated: e49d942e46...753ece0d8d
1
modules/google_integration
Submodule
1
modules/google_integration
Submodule
Submodule modules/google_integration added at 1fd0347230
Submodule modules/naliia updated: c86e7b0088...528cca7ccf
Submodule modules/naliia_payment updated: d9db31eb18...aeb410dac6
Submodule modules/purchase_one_click updated: 823ec91563...7e6369061b
Submodule modules/sale_one_click updated: dddb2b955b...b2672e926e
19
nginx.conf
19
nginx.conf
@@ -1,19 +0,0 @@
|
|||||||
server {
|
|
||||||
server_name ${SERVER_NAME};
|
|
||||||
listen ${NGINX_PORT};
|
|
||||||
client_max_body_size 8M;
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
send_timeout 500s;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://tryton:8000/; # "trytond" is the service name of another Docker container on port 8000
|
|
||||||
proxy_read_timeout 500;
|
|
||||||
proxy_connect_timeout 500;
|
|
||||||
proxy_send_timeout 500;
|
|
||||||
proxy_set_header Host ${VARIABLE}host;
|
|
||||||
proxy_set_header X-Real-IP ${VARIABLE}remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For ${VARIABLE}proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Host ${VARIABLE}server_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
21
prod/nginx.conf
Normal file
21
prod/nginx.conf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
server {
|
||||||
|
server_name ${SERVER_NAME};
|
||||||
|
listen ${NGINX_PORT};
|
||||||
|
client_max_body_size 50M;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
send_timeout 500s;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://tryton:8000/; # "trytond" is the service name of another Docker container on port 8000
|
||||||
|
proxy_read_timeout 500;
|
||||||
|
proxy_connect_timeout 500;
|
||||||
|
proxy_send_timeout 500;
|
||||||
|
|
||||||
|
proxy_set_header Host ${VARIABLE}host;
|
||||||
|
proxy_set_header X-Real-IP ${VARIABLE}remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For ${VARIABLE}proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host ${VARIABLE}server_name;
|
||||||
|
proxy_set_header X-Forwarded-Proto ${VARIABLE}scheme;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,8 @@ root=/var/lib/trytond/www
|
|||||||
cors=
|
cors=
|
||||||
https://appdemo.naliia.co
|
https://appdemo.naliia.co
|
||||||
https://app.naliia.co
|
https://app.naliia.co
|
||||||
|
http://localhost:5173
|
||||||
|
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
list=True
|
list=True
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
google-api-python-client==2.195.0
|
||||||
|
google-auth-httplib2==0.3.1
|
||||||
|
google-auth-oauthlib==1.3.1
|
||||||
qrcode==6.1
|
qrcode==6.1
|
||||||
pydot==3.0.0
|
pydot==3.0.0
|
||||||
tqdm==4.67.1
|
tqdm==4.67.1
|
||||||
@@ -8,4 +11,4 @@ urwid==3.0.2
|
|||||||
freezegun==1.5.1
|
freezegun==1.5.1
|
||||||
psycopg2-binary==2.9.11
|
psycopg2-binary==2.9.11
|
||||||
pycountry==24.6.1
|
pycountry==24.6.1
|
||||||
|
pytz==2026.2
|
||||||
|
|||||||
1
web_app
1
web_app
Submodule web_app deleted from c364dee2e7
Reference in New Issue
Block a user