Skip to content

Commit a45e716

Browse files
authored
Merge pull request #6 from tristcoil/develop
[ZEN] v0.3.6 build
2 parents b68675f + 24617ef commit a45e716

File tree

221 files changed

+72147
-30651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+72147
-30651
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
- name: Install Nginx on Ubuntu 24.04
3+
become: yes
4+
hosts: all
5+
tasks:
6+
- name: Install snapd
7+
apt:
8+
name: snapd
9+
state: present
10+
11+
- name: Ensure snapd is enabled
12+
systemd:
13+
name: snapd
14+
enabled: yes
15+
16+
- name: Ensure snapd is running
17+
service:
18+
name: snapd
19+
state: started
20+
enabled: yes
21+
22+
- name: Install Certbot
23+
command: snap install --classic certbot
24+
25+
- name: Create symbolic link for Certbot
26+
file:
27+
src: /snap/bin/certbot
28+
dest: /usr/bin/certbot
29+
state: link
30+
31+
- name: Create a simple default Nginx configuration
32+
copy:
33+
content: |
34+
server {
35+
listen 80 default_server;
36+
listen [::]:80 default_server;
37+
38+
server_name _;
39+
40+
location / {
41+
return 200 "Welcome to Nginx default server!";
42+
add_header Content-Type text/plain;
43+
}
44+
}
45+
dest: /etc/nginx/sites-enabled/default
46+
owner: root
47+
group: root
48+
mode: '0644'
49+
50+
51+
- name: Obtain SSL certificates for hanabira.org
52+
command: certbot --nginx -d hanabira.org --non-interactive --agree-tos -m [email protected]
53+
54+
- name: Remove default Nginx configuration file
55+
file:
56+
path: /etc/nginx/sites-enabled/default
57+
state: absent
58+
59+
- name: Copy the Nginx configuration file for hanabira.org
60+
copy:
61+
src: nginx/hanabira.org
62+
dest: /etc/nginx/sites-enabled/hanabira.org
63+
owner: root
64+
group: root
65+
mode: '0644'
66+
67+
- name: Restart Nginx after copying configuration
68+
service:
69+
name: nginx
70+
state: restarted
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
- name: Install Nginx on Ubuntu 24.04
3+
become: yes
4+
hosts: all
5+
tasks:
6+
- name: Install snapd
7+
apt:
8+
name: snapd
9+
state: present
10+
11+
- name: Ensure snapd is enabled
12+
systemd:
13+
name: snapd
14+
enabled: yes
15+
16+
- name: Ensure snapd is running
17+
service:
18+
name: snapd
19+
state: started
20+
enabled: yes
21+
22+
- name: Install Certbot
23+
command: snap install --classic certbot
24+
25+
- name: Create symbolic link for Certbot
26+
file:
27+
src: /snap/bin/certbot
28+
dest: /usr/bin/certbot
29+
state: link
30+
31+
- name: Create a simple default Nginx configuration
32+
copy:
33+
content: |
34+
server {
35+
listen 80 default_server;
36+
listen [::]:80 default_server;
37+
38+
server_name _;
39+
40+
location / {
41+
return 200 "Welcome to Nginx default server!";
42+
add_header Content-Type text/plain;
43+
}
44+
}
45+
dest: /etc/nginx/sites-enabled/default
46+
owner: root
47+
group: root
48+
mode: '0644'
49+
50+
51+
- name: Obtain SSL certificates for hanabira-dev.org
52+
command: certbot --nginx -d hanabira-dev.org --non-interactive --agree-tos -m [email protected]
53+
54+
- name: Remove default Nginx configuration file
55+
file:
56+
path: /etc/nginx/sites-enabled/default
57+
state: absent
58+
59+
- name: Copy the Nginx configuration file for hanabira-dev.org
60+
copy:
61+
src: nginx/hanabira-dev.org
62+
dest: /etc/nginx/sites-enabled/hanabira-dev.org
63+
owner: root
64+
group: root
65+
mode: '0644'
66+
67+
- name: Restart Nginx after copying configuration
68+
service:
69+
name: nginx
70+
state: restarted
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
version: '3.8'
2+
3+
services:
4+
frontend-next:
5+
image: coil/hanabira.org:frontend-next_blue
6+
network_mode: "bridge"
7+
extra_hosts:
8+
- "localhost:host-gateway"
9+
- "host.docker.internal:host-gateway"
10+
ports:
11+
- "127.0.0.1:3000:3000" # Bind to localhost only
12+
environment:
13+
GA_MEASUREMENT_ID: 'G-P4SLLVSNCX' # Google Analytics measurement ID
14+
#REACT_APP_HOST_IP: host.docker.internal # ${HOST_IP}
15+
REACT_APP_HOST_IP: 'express-db'
16+
# depends_on:
17+
# - express-db
18+
#- flask-dynamic-db
19+
#- dictionary-db
20+
restart: unless-stopped
21+
networks:
22+
- hanabira-network
23+
24+
express-db:
25+
image: coil/hanabira.org:express-db_blue
26+
network_mode: "bridge"
27+
extra_hosts:
28+
- "localhost:host-gateway"
29+
- "host.docker.internal:host-gateway"
30+
ports:
31+
- "127.0.0.1:8000:8000" # Bind to localhost only
32+
environment:
33+
# REACT_APP_HOST_IP: host.docker.internal # ${HOST_IP}
34+
REACT_APP_HOST_IP: 'express-db'
35+
restart: unless-stopped
36+
networks:
37+
- hanabira-network
38+
39+
flask-dynamic-db:
40+
image: coil/hanabira.org:flask-dynamic-db_blue
41+
network_mode: "bridge"
42+
extra_hosts:
43+
- "localhost:host-gateway"
44+
- "host.docker.internal:host-gateway"
45+
volumes:
46+
- /opt/data/user_db:/data/db
47+
ports:
48+
- "127.0.0.1:5100:5100" # Bind to localhost only
49+
restart: unless-stopped
50+
networks:
51+
- hanabira-network
52+
53+
dictionary-db:
54+
image: coil/hanabira.org:dictionary-db_blue
55+
network_mode: "bridge"
56+
extra_hosts:
57+
- "localhost:host-gateway"
58+
- "host.docker.internal:host-gateway"
59+
volumes:
60+
- './config_dummy.json:/app/config.json'
61+
ports:
62+
- "127.0.0.1:5200:5200" # Bind to localhost only
63+
restart: unless-stopped
64+
networks:
65+
- hanabira-network
66+
67+
volumes:
68+
user_db:
69+
70+
networks:
71+
hanabira-network:
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Redirect HTTP traffic to HTTPS
2+
server {
3+
if ($host = hanabira-dev.org) {
4+
return 301 https://$host$request_uri;
5+
} # managed by Certbot
6+
7+
8+
listen 80;
9+
server_name hanabira-dev.org www.hanabira-dev.org;
10+
11+
return 301 https://$server_name$request_uri;
12+
13+
14+
}
15+
16+
server {
17+
listen [::]:443 ssl ipv6only=on; # managed by Certbot
18+
listen 443 ssl; # managed by Certbot
19+
server_name hanabira-dev.org www.hanabira-dev.org;
20+
21+
ssl_certificate /etc/letsencrypt/live/hanabira-dev.org/fullchain.pem; # managed by Certbot
22+
ssl_certificate_key /etc/letsencrypt/live/hanabira-dev.org/privkey.pem; # managed by Certbot
23+
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
24+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
25+
26+
27+
28+
29+
location / {
30+
proxy_pass http://localhost:3000;
31+
proxy_set_header Host $host;
32+
proxy_set_header X-Real-IP $remote_addr;
33+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34+
proxy_set_header X-Forwarded-Proto $scheme;
35+
proxy_pass_request_headers on;
36+
proxy_http_version 1.1;
37+
proxy_cache_bypass $http_upgrade;
38+
proxy_set_header Upgrade $http_upgrade;
39+
}
40+
41+
42+
43+
location /e-api/v1 {
44+
proxy_pass http://localhost:8000/e-api/v1;
45+
proxy_set_header Host $host;
46+
proxy_set_header X-Real-IP $remote_addr;
47+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
48+
proxy_pass_request_headers on;
49+
proxy_http_version 1.1;
50+
proxy_set_header Upgrade $http_upgrade;
51+
proxy_set_header Connection 'upgrade';
52+
}
53+
54+
55+
# ---
56+
57+
location /f-api/v1 {
58+
proxy_pass http://localhost:5100/f-api/v1;
59+
proxy_set_header Host $host;
60+
proxy_set_header X-Real-IP $remote_addr;
61+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
62+
proxy_http_version 1.1;
63+
}
64+
65+
location /d-api/v1 {
66+
proxy_pass http://localhost:5200/d-api/v1;
67+
proxy_set_header Host $host;
68+
proxy_set_header X-Real-IP $remote_addr;
69+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
70+
proxy_http_version 1.1;
71+
}
72+
73+
74+
# --------------------------------------- #
75+
76+
}

CICD/ansible/files/nginx/hanabira.org

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Redirect HTTP traffic to HTTPS
2+
server {
3+
if ($host = hanabira.org) {
4+
return 301 https://$host$request_uri;
5+
} # managed by Certbot
6+
7+
8+
listen 80;
9+
server_name hanabira.org www.hanabira.org;
10+
11+
return 301 https://$server_name$request_uri;
12+
13+
14+
}
15+
16+
server {
17+
listen [::]:443 ssl ipv6only=on; # managed by Certbot
18+
listen 443 ssl; # managed by Certbot
19+
server_name hanabira.org www.hanabira.org;
20+
21+
ssl_certificate /etc/letsencrypt/live/hanabira.org/fullchain.pem; # managed by Certbot
22+
ssl_certificate_key /etc/letsencrypt/live/hanabira.org/privkey.pem; # managed by Certbot
23+
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
24+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
25+
26+
27+
28+
29+
location / {
30+
proxy_pass http://localhost:3000;
31+
proxy_set_header Host $host;
32+
proxy_set_header X-Real-IP $remote_addr;
33+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34+
proxy_set_header X-Forwarded-Proto $scheme;
35+
proxy_pass_request_headers on;
36+
proxy_http_version 1.1;
37+
proxy_cache_bypass $http_upgrade;
38+
proxy_set_header Upgrade $http_upgrade;
39+
}
40+
41+
42+
43+
location /e-api/v1 {
44+
proxy_pass http://localhost:8000/e-api/v1;
45+
proxy_set_header Host $host;
46+
proxy_set_header X-Real-IP $remote_addr;
47+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
48+
proxy_pass_request_headers on;
49+
proxy_http_version 1.1;
50+
proxy_set_header Upgrade $http_upgrade;
51+
proxy_set_header Connection 'upgrade';
52+
}
53+
54+
55+
# ---
56+
57+
location /f-api/v1 {
58+
proxy_pass http://localhost:5100/f-api/v1;
59+
proxy_set_header Host $host;
60+
proxy_set_header X-Real-IP $remote_addr;
61+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
62+
proxy_http_version 1.1;
63+
}
64+
65+
location /d-api/v1 {
66+
proxy_pass http://localhost:5200/d-api/v1;
67+
proxy_set_header Host $host;
68+
proxy_set_header X-Real-IP $remote_addr;
69+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
70+
proxy_http_version 1.1;
71+
}
72+
73+
74+
# --------------------------------------- #
75+
76+
}

0 commit comments

Comments
 (0)