From 7dec62ab52c61d78a1a2e92e2e005c32725c4b03 Mon Sep 17 00:00:00 2001 From: aserrador Date: Thu, 12 Mar 2026 21:16:26 -0500 Subject: [PATCH] feat: Add .env --- .env.example | 23 +++++ .gitignore | 228 ++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yaml | 18 +++- 3 files changed, 265 insertions(+), 4 deletions(-) create mode 100644 .env.example create mode 100644 .gitignore diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a93e688 --- /dev/null +++ b/.env.example @@ -0,0 +1,23 @@ +# Naliia +NALIIA_IMAGE="gitea.onecluster.org/aserrador/naliia:latest" + +# Tryton +EMAIL="admin@admin.org" +TRYTON_PORT=8000 + +# Database +DB_HOSTNAME="db" +POSTGRES_DB="database" +POSTGRES_USER="postgres" +POSTGRES_PASSWORD="SUp3r-pass*DB" +TRYTOND_DATABASE_URI="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/" + +# 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" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9db73e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,228 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +*.bk + +/.vscode + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +bin/ +include/ +wheels/ +__pycache__ +trytond_miac.egg-info/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script fkrom a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# ---> Emacs +# -*- mode: gitignore; -*- +*~ +.~* +*# +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +# ---> Vim +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# ---> VirtualEnv +# Virtualenv +# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ +.Python +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ll]ocal +[Ss]cripts +pyvenv.cfg +.venv +pip-selfcheck.json + +.tdd_cache +app \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 8b0fdf6..110adde 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,12 +8,13 @@ services: POSTGRES_DB: ${POSTGRES_DB:-naliia} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-SUp3r-pass*DB} healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres"] + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-naliia}"] interval: 10s timeout: 5s retries: 5 env_file: - .env + tryton: image: ${NALIIA_IMAGE} working_dir: /app @@ -22,9 +23,11 @@ services: - var:/var - attachment:/mnt/attachment environment: - TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://postgres:SUp3r-pass*DB@db:5432/} + TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://${POSTGRES_USER:-naliia}:${POSTGRES_PASSWORD:-SUp3r-pass*DB}@${DB_HOSTNAME:-db}:5432/} NALIIA_IMAGE: ${NALIIA_IMAGE:-gitea.onecluster.org/aserrador/naliia:latest} EMAIL: ${EMAIL:-admin@admin.org} + ports: + - "${TRYTON_PORT:-8000}:8000" depends_on: db: condition: service_healthy @@ -36,32 +39,39 @@ services: timeout: 20s env_file: - .env + worker: image: ${NALIIA_IMAGE} working_dir: /app depends_on: tryton: condition: service_healthy + db: + 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: ${TRYTOND_DATABASE_URI:-postgresql://postgres:SUp3r-pass*DB@db:5432/} + TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://${POSTGRES_USER:-naliia}:${POSTGRES_PASSWORD:-SUp3r-pass*DB}@${DB_HOSTNAME:-db}:5432/} env_file: - .env + cron: image: ${NALIIA_IMAGE} working_dir: /app depends_on: tryton: condition: service_healthy + db: + 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: ${TRYTOND_DATABASE_URI:-postgresql://postgres:SUp3r-pass*DB@db:5432/} + TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://${POSTGRES_USER:-naliia}:${POSTGRES_PASSWORD:-SUp3r-pass*DB}@${DB_HOSTNAME:-db}:5432/} env_file: - .env + volumes: postgres: var: