Chore: Updated python dependencies
Chore: Updated angular to v19 Chore: Refactored ops with docker and ansible
This commit is contained in:
18
ansible/files/.env
Normal file
18
ansible/files/.env
Normal file
@ -0,0 +1,18 @@
|
||||
HOST=0.0.0.0
|
||||
PORT=80
|
||||
LOG_LEVEL=WARN
|
||||
DEBUG=false
|
||||
SQLALCHEMY_DATABASE_URI=postgresql://postgres:123456@db:5432/petty{{ name }}
|
||||
MODULE_NAME=barker.main
|
||||
PROJECT_NAME=barker
|
||||
MAX_WORKERS=4
|
||||
REDIS_HOST=redis
|
||||
REDIS_PORT=6379
|
||||
SECRET_KEY={{ secret_key }}
|
||||
MIDDLEWARE_SECRET_KEY={{ middleware_key }}
|
||||
ALGORITHM=HS256
|
||||
JWT_TOKEN_EXPIRE_MINUTES=30
|
||||
NEW_DAY_OFFSET_MINUTES=420
|
||||
TIMEZONE_OFFSET_MINUTES=330
|
||||
ALEMBIC_LOG_LEVEL=INFO
|
||||
ALEMBIC_SQLALCHEMY_LOG_LEVEL=WARN
|
||||
1
ansible/files/build-frank.sh
Executable file
1
ansible/files/build-frank.sh
Executable file
@ -0,0 +1 @@
|
||||
docker build --file /home/{{ user }}/dockerfile/app/frank.Dockerfile --tag frank:latest /home/{{ user }}/dockerfile/app
|
||||
4
ansible/files/config
Normal file
4
ansible/files/config
Normal file
@ -0,0 +1,4 @@
|
||||
Host rohan rohan.tanshu.com
|
||||
HostName rohan.tanshu.com
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
User tanshu
|
||||
3
ansible/files/frank.env
Normal file
3
ansible/files/frank.env
Normal file
@ -0,0 +1,3 @@
|
||||
REDIS_HOST=localhost
|
||||
REDIS_PORT=6379
|
||||
QUEUE_NAME={{ queue_name }}
|
||||
15
ansible/files/frank.service
Normal file
15
ansible/files/frank.service
Normal file
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Frank container service
|
||||
After=docker.service rohan-redis-tunnel.service
|
||||
Wants=network-online.target docker.socket rohan-redis-tunnel.service
|
||||
Requires=docker.socket rohan-redis-tunnel.service
|
||||
PartOf=rohan-redis-tunnel.service
|
||||
|
||||
[Service]
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
ExecStart=/usr/bin/docker start -a frank
|
||||
ExecStop=/usr/bin/docker stop -t 10 frank
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
1
ansible/files/frank.sh
Normal file
1
ansible/files/frank.sh
Normal file
@ -0,0 +1 @@
|
||||
docker run --detach --name frank --env-file=/home/{{ user }}/frank.env --network=host --restart=no --device /dev/usb/lp0:/printer frank:latest
|
||||
16
ansible/files/leardal.service
Normal file
16
ansible/files/leardal.service
Normal file
@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Reverse SSH connection
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ user }}
|
||||
|
||||
ExecStart=/usr/bin/ssh -NTg -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -o ServerAliveCountMax=3 -o StrictHostKeyChecking=no -i /home/{{ user }}/.ssh/id_ed25519 -R {{ ssh_port }}:localhost:22 tanshu@rohan.tanshu.com
|
||||
|
||||
# Restart every >2 seconds to avoid StartLimitInterval failure
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
39
ansible/files/nginx.conf.j2
Normal file
39
ansible/files/nginx.conf.j2
Normal file
@ -0,0 +1,39 @@
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
server_name {{ http_host }};
|
||||
|
||||
# Allow large attachments
|
||||
client_max_body_size 128M;
|
||||
|
||||
location /api {
|
||||
proxy_set_header Host $host:$server_port;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_pass http://localhost:{{ host_port }};
|
||||
}
|
||||
location /token {
|
||||
|
||||
proxy_set_header Host $host:$server_port;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_pass http://localhost:{{ host_port }};
|
||||
}
|
||||
location /refresh {
|
||||
proxy_set_header Host $host:$server_port;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_pass http://localhost:{{ host_port }};
|
||||
}
|
||||
location /db-image {
|
||||
proxy_set_header Host $host:$server_port;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_pass http://localhost:{{ host_port }};
|
||||
}
|
||||
location / {
|
||||
root /var/lib/{{ host_directory }}/frontend;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
15
ansible/files/rohan-redis-tunnel.service
Normal file
15
ansible/files/rohan-redis-tunnel.service
Normal file
@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Keep ssh tunnel to specified remote host open
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User={{ user }}
|
||||
|
||||
ExecStart=/usr/bin/ssh -NT -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes -o ServerAliveCountMax=2 -o StrictHostKeyChecking=no -i /home/{{ user }}/.ssh/id_ed25519 -L 6379:localhost:6379 tanshu@rohan.tanshu.com
|
||||
|
||||
# Restart every >2 seconds to avoid StartLimitInterval failure
|
||||
RestartSec=5
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user