Compare commits

..

No commits in common. "f1d29c5ed132ea1948dcac22874b456e24636e1f" and "0c1cc86e3e5dcfa61febff11bb57828d1e6f83f6" have entirely different histories.

7 changed files with 0 additions and 122 deletions

8
.gitignore vendored
View File

@ -21,11 +21,3 @@
# Go workspace file # Go workspace file
go.work go.work
# Ignore cached files
src/*/cache/*
# Ignore pycache bullshit
config/__pycache__
# Template generated files:
src/docker-compose.yml

View File

@ -1,17 +0,0 @@
# Checkout the Variables bellow
# Special lines:
# # => Comented lines, they get ignored by python
# #- => Optional Configuration lines
# Variables
## Database Variables
db = {}
#- db['root_pw'] = 'RootPassWord'
db['enabled'] = True
db['user'] = 'DBUser'
db['user_pw'] = 'DBUserPassWord'
db['db'] = 'Database Name'
#- db['data_path_mysql'] = '/var/lib/mysql'
#- db['data_path_mysql_backup'] = '/var/lib/mysql'
#- db['port'] = 3306

View File

View File

@ -1,27 +0,0 @@
from jinja2 import Environment, FileSystemLoader
import config
import os
# Static Variables
templates_directory = 'src/templates'
# Load Templates Directory
file_loader = FileSystemLoader(templates_directory)
env = Environment(loader=file_loader)
# Template everyfile
def template(filename, target_path):
# Load Template
template = env.get_template(filename)
# Render Output
content = template.render(db=config.db)
# Write Template to file
filename_without_ext = os.path.splitext(filename)[0]
cooked_file = target_path+filename_without_ext
file = open(cooked_file, 'w')
file.write(content)
file.close()
# Render the templates:
## Create Docker-Compose
template("docker-compose.yml.j2", "./src/")

View File

@ -1,37 +0,0 @@
# Make all
all: db api ui
# Start everything
start: db-start api-start ui-start
# Stop everything
stop: ui-stop api-stop db-stop
# Setup Database
db: db-init db-start
db-init:
db-start:
db-stop:
# Setup API
api: api-start
api-start:
api-stop:
# Setup UI
ui: ui-start
ui-start:
ui-stop:
# Regenerate configs
config: config-regenerate
config-regenerate:
python config/template.py

View File

View File

@ -1,33 +0,0 @@
# Do not adjust this file
version: '3.1'
services:
{% if db.enabled == true %}
ngx_mgmt_db:
image: mariadb:latest
restart: always
environment:
{% if db.root_pw is defined %}
MARIADB_ROOT_PASSWORD: {{ db.root_pw }}
{% endif %}
MARIADB_USER: {{ TMPL_DB_USER }}
MARIADB_PASSWORD: {{ TMPL_DB_USER_PW }}
MARIADB_DATABASE: {{ TMPL_DB_DB }}
volumes:
{% if db.data_path_mysql is defined %}
- {{ data_path_mysql }}:/var/lib/mysql
{% else %}
- ./src/db/cache/mysql_data:/var/lib/mysql
{% endif %}
{% if db.data_path_mysql_backup is defined %}
- {{ data_path_mysql_backup }}:/var/lib/mysql
{% else %}
- ./src/db/cache/mysql_backup:/var/lib/mysql
{% endif %}
ports:
{% if db.port is defined %}
- {{ port }}:3306
{% else %}
- 3306:3306
{% endif %}
{% endif %}