feat(devops): removed stuff and added jwt
This commit is contained in:
parent
d9a68771a6
commit
d0e787e2c7
5 changed files with 43 additions and 38 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -10,6 +10,7 @@ openapi.jar
|
||||||
.vscode
|
.vscode
|
||||||
nginx-dev/nginx
|
nginx-dev/nginx
|
||||||
nginx-dev/nginx.deb
|
nginx-dev/nginx.deb
|
||||||
|
.env
|
||||||
|
|
||||||
# sqlite stuff
|
# sqlite stuff
|
||||||
*.db
|
*.db
|
||||||
|
|
|
||||||
21
Docker.mk
21
Docker.mk
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
# TODO: REMOVE THIS BEFORE LAUNCH
|
# TODO: REMOVE THIS BEFORE LAUNCH
|
||||||
# this allows the us to only start the non-monitoring sercices
|
# this allows the us to only start the non-monitoring sercices
|
||||||
DOCKER_SERVICE= \
|
#DOCKER_SERVICE= \
|
||||||
auth \
|
# auth \
|
||||||
chat \
|
# chat \
|
||||||
tic-tac-toe \
|
# tic-tac-toe \
|
||||||
nginx \
|
# nginx \
|
||||||
user \
|
# user \
|
||||||
pong \
|
# pong \
|
||||||
|
|
||||||
all: build
|
all: build
|
||||||
docker compose up -d $(DOCKER_SERVICE)
|
docker compose up -d $(DOCKER_SERVICE)
|
||||||
|
|
@ -19,7 +19,7 @@ logs:
|
||||||
down:
|
down:
|
||||||
docker compose down
|
docker compose down
|
||||||
|
|
||||||
build:
|
build: .env
|
||||||
docker compose build $(DOCKER_SERVICE)
|
docker compose build $(DOCKER_SERVICE)
|
||||||
|
|
||||||
re:
|
re:
|
||||||
|
|
@ -38,3 +38,8 @@ prune: clean
|
||||||
-docker volume prune
|
-docker volume prune
|
||||||
-docker network prune
|
-docker network prune
|
||||||
-docker system prune -a
|
-docker system prune -a
|
||||||
|
|
||||||
|
.env:
|
||||||
|
@echo "edit the env.example file and use the \`make jwt_secret\` to create a valid jwt secret"
|
||||||
|
@echo "write the stuff to .env"
|
||||||
|
exit 1
|
||||||
|
|
|
||||||
5
Makefile
5
Makefile
|
|
@ -148,5 +148,8 @@ fnginx: nginx-dev/nginx nginx-dev/nginx-selfsigned.crt nginx-dev/nginx-selfsigne
|
||||||
-(cd ./frontend && npx pnpm exec vite --clearScreen false)
|
-(cd ./frontend && npx pnpm exec vite --clearScreen false)
|
||||||
wait
|
wait
|
||||||
|
|
||||||
|
jwt_secret:
|
||||||
|
sh -c "dd if=/dev/urandom bs=32 count=1 2>/dev/null | base64 | tr -d -- '\n' | tr -- '+/' '-_'; echo"
|
||||||
|
|
||||||
# phony
|
# phony
|
||||||
.PHONY: all clean fclean re header footer npm@install npm@clean npm@fclean npm@build sql tmux logs
|
.PHONY: all clean fclean re header footer npm@install npm@clean npm@fclean npm@build sql tmux logs jwt_secret
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
# if you need to share files with nginx, you do it here.
|
# if you need to share files with nginx, you do it here.
|
||||||
- static-volume:/volumes/static
|
- static-volume:/volumes/static
|
||||||
environment:
|
env_file: .env
|
||||||
# this can stay the same for developpement. This is an alias to `localhost`
|
|
||||||
- NGINX_DOMAIN=local.maix.me
|
|
||||||
logging:
|
logging:
|
||||||
driver: gelf
|
driver: gelf
|
||||||
options:
|
options:
|
||||||
|
|
@ -76,8 +74,7 @@ services:
|
||||||
- sqlite-volume:/volumes/database
|
- sqlite-volume:/volumes/database
|
||||||
- static-volume:/volumes/static
|
- static-volume:/volumes/static
|
||||||
- ./src/auth/config:/config
|
- ./src/auth/config:/config
|
||||||
environment:
|
env_file: .env
|
||||||
- JWT_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JA
|
|
||||||
logging:
|
logging:
|
||||||
driver: gelf
|
driver: gelf
|
||||||
options:
|
options:
|
||||||
|
|
@ -102,8 +99,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- sqlite-volume:/volumes/database
|
- sqlite-volume:/volumes/database
|
||||||
- static-volume:/volumes/static
|
- static-volume:/volumes/static
|
||||||
environment:
|
env_file: .env
|
||||||
- JWT_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JA
|
|
||||||
logging:
|
logging:
|
||||||
driver: gelf
|
driver: gelf
|
||||||
options:
|
options:
|
||||||
|
|
@ -125,18 +121,15 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- app
|
- app
|
||||||
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
- sqlite-volume:/volumes/database
|
- sqlite-volume:/volumes/database
|
||||||
- static-volume:/volumes/static
|
- static-volume:/volumes/static
|
||||||
environment:
|
logging:
|
||||||
- JWT_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JA
|
driver: gelf
|
||||||
- PROVIDER_FILE=/extra/providers.toml
|
options:
|
||||||
- SESSION_MANAGER=${SESSION_MANAGER}
|
gelf-address: "udp://127.0.0.1:12201"
|
||||||
# logging:
|
tag: "{{.Name}}"
|
||||||
# driver: gelf
|
|
||||||
# options:
|
|
||||||
# gelf-address: "udp://127.0.0.1:12201"
|
|
||||||
# tag: "{{.Name}}"
|
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# PONG #
|
# PONG #
|
||||||
|
|
@ -156,8 +149,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- sqlite-volume:/volumes/database
|
- sqlite-volume:/volumes/database
|
||||||
- static-volume:/volumes/static
|
- static-volume:/volumes/static
|
||||||
environment:
|
env_file: .env
|
||||||
- JWT_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JA
|
|
||||||
|
|
||||||
###############
|
###############
|
||||||
# USER #
|
# USER #
|
||||||
|
|
@ -177,8 +169,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- sqlite-volume:/volumes/database
|
- sqlite-volume:/volumes/database
|
||||||
- static-volume:/volumes/static
|
- static-volume:/volumes/static
|
||||||
environment:
|
env_file: .env
|
||||||
- JWT_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JA
|
|
||||||
logging:
|
logging:
|
||||||
driver: gelf
|
driver: gelf
|
||||||
options:
|
options:
|
||||||
|
|
@ -205,11 +196,10 @@ services:
|
||||||
- ./monitoring/grafana/dashboards-config:/etc/grafana/provisioning/dashboards
|
- ./monitoring/grafana/dashboards-config:/etc/grafana/provisioning/dashboards
|
||||||
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
|
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
|
||||||
- grafana-data:/var/lib/grafana
|
- grafana-data:/var/lib/grafana
|
||||||
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
# this can stay the same for developpement. This is an alias to `localhost`
|
|
||||||
- NGINX_DOMAIN=local.maix.me
|
|
||||||
- GF_LOG_LEVEL=warn
|
- GF_LOG_LEVEL=warn
|
||||||
- GF_SERVER_ROOT_URL=https://local.maix.me:9090/grafana/
|
- GF_SERVER_ROOT_URL=https:/${NGINX_DOMAIN}/:9090/grafana/
|
||||||
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
|
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
|
||||||
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASS}
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASS}
|
||||||
logging:
|
logging:
|
||||||
|
|
@ -238,6 +228,7 @@ services:
|
||||||
options:
|
options:
|
||||||
gelf-address: "udp://127.0.0.1:12201"
|
gelf-address: "udp://127.0.0.1:12201"
|
||||||
tag: "{{.Name}}"
|
tag: "{{.Name}}"
|
||||||
|
env_file: .env
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "--quiet", "--spider", "http://localhost:9090/-/healthy"]
|
test: ["CMD", "wget", "--quiet", "--spider", "http://localhost:9090/-/healthy"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|
@ -252,6 +243,7 @@ services:
|
||||||
container_name: mon-cadvisor
|
container_name: mon-cadvisor
|
||||||
command:
|
command:
|
||||||
- '-url_base_prefix=/cadvisor'
|
- '-url_base_prefix=/cadvisor'
|
||||||
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- CADVISOR_HEALTHCHECK_URL=http://localhost:8080/cadvisor/healthz
|
- CADVISOR_HEALTHCHECK_URL=http://localhost:8080/cadvisor/healthz
|
||||||
volumes:
|
volumes:
|
||||||
|
|
@ -277,6 +269,7 @@ services:
|
||||||
options:
|
options:
|
||||||
gelf-address: "udp://127.0.0.1:12201"
|
gelf-address: "udp://127.0.0.1:12201"
|
||||||
tag: "{{.Name}}"
|
tag: "{{.Name}}"
|
||||||
|
env_file: .env
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "--quiet", "--spider", "http://localhost:9115/-/healthy"]
|
test: ["CMD", "wget", "--quiet", "--spider", "http://localhost:9115/-/healthy"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|
@ -295,10 +288,10 @@ services:
|
||||||
container_name: log-elasticsearch
|
container_name: log-elasticsearch
|
||||||
networks:
|
networks:
|
||||||
- monitoring
|
- monitoring
|
||||||
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- discovery.type=single-node
|
- discovery.type=single-node
|
||||||
- ES_JAVA_OPTS=-Xms512m -Xmx512m
|
- ES_JAVA_OPTS=-Xms512m -Xmx512m
|
||||||
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
|
|
||||||
volumes:
|
volumes:
|
||||||
- elastic-data:/usr/share/elasticsearch/data
|
- elastic-data:/usr/share/elasticsearch/data
|
||||||
- ./logs/elasticsearch:/setup
|
- ./logs/elasticsearch:/setup
|
||||||
|
|
@ -323,6 +316,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "12201:12201/udp"
|
- "12201:12201/udp"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
env_file: .env
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "-s", "localhost:9600"]
|
test: ["CMD", "curl", "-f", "-s", "localhost:9600"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|
@ -338,9 +332,10 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- monitoring
|
- monitoring
|
||||||
- app
|
- app
|
||||||
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
|
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
|
||||||
- SERVER_PUBLICBASEURL=https://local.maix.me:9090/kibana
|
- SERVER_PUBLICBASEURL=https://${NGINX_DOMAIN}:9090/kibana
|
||||||
- SERVER_BASEPATH=/kibana
|
- SERVER_BASEPATH=/kibana
|
||||||
- SERVER_REWRITEBASEPATH=true
|
- SERVER_REWRITEBASEPATH=true
|
||||||
- ELASTICSEARCH_USERNAME=elastic
|
- ELASTICSEARCH_USERNAME=elastic
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
GRAFANA_ADMIN_USER=
|
GRAFANA_ADMIN_USER=admintochange
|
||||||
GRAFANA_ADMIN_PASS=
|
GRAFANA_ADMIN_PASS=passwordtochange
|
||||||
GRAFANA_WEBHOOK_URL=
|
GRAFANA_WEBHOOK_URL=
|
||||||
|
ELASTIC_PASSWORD=passwordtochange
|
||||||
ELASTIC_PASSWORD=
|
JWT_SECRET=
|
||||||
|
NGINX_DOMAIN=local.maix.me
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue