Skip to content

Commit 0600d35

Browse files
committed
set allow origins as a environment variable
1 parent 0dd2315 commit 0600d35

11 files changed

Lines changed: 203 additions & 259 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
**/*.tfplan
1111
**/tfplan.binary
1212
**/plan.json
13-
**/.terraform.lock.hcl
13+
**/.terraform.lock.hcl
14+
15+
.secrets

client/src/stores/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ export const useAuthStore = defineStore("authentication", () => {
1212
const baseUrl = "http://localhost:8000/";
1313

1414
const authAxios = axios.create({
15-
baseURL: "http://localhost:8000/",
15+
baseURL: baseUrl,
1616
withCredentials: true,
1717
});
1818

1919
const publicAxios = axios.create({
20-
baseURL: "http://localhost:8000/",
20+
baseURL: baseUrl,
2121
});
2222

2323
// Axios interceptor to catch unauthentication error and retry after retriving the auth tokens
@@ -49,7 +49,7 @@ export const useAuthStore = defineStore("authentication", () => {
4949
}
5050
}
5151
return Promise.reject(error); // For all other errors, return the error as is.
52-
},
52+
}
5353
);
5454

5555
async function logOut() {

development/docker-compose.yaml

Lines changed: 193 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,210 @@
11
name: bridge-1
22

33
services:
4-
rabbitmq:
5-
hostname: rabbitmq
6-
image: rabbitmq:latest
7-
container_name: rabbitmq-dev
8-
expose:
9-
- "5672"
10-
ports:
11-
- "5672:5672"
12-
- "15672:15672"
13-
environment:
14-
RABBITMQ_DEFAULT_USER: bridge-bot
15-
RABBITMQ_DEFAULT_PASS: Mybridge1936
4+
rabbitmq:
5+
hostname: rabbitmq
6+
image: rabbitmq:latest
7+
container_name: rabbitmq-dev
8+
expose:
9+
- "5672"
10+
ports:
11+
- "5672:5672"
12+
- "15672:15672"
13+
environment:
14+
RABBITMQ_DEFAULT_USER: bridge-bot
15+
RABBITMQ_DEFAULT_PASS: Mybridge1936
1616

17-
volumes:
18-
- ./rabbitmq:/var/lib/rabbitmq/
19-
- ./rabbitmq/log:/var/log/rabbitmq
17+
volumes:
18+
- ./rabbitmq:/var/lib/rabbitmq/
19+
- ./rabbitmq/log:/var/log/rabbitmq
2020

21-
healthcheck:
22-
test: [ "CMD", "rabbitmq-diagnostics", "status" ]
23-
interval: 15s
24-
timeout: 5s
25-
retries: 5
26-
deploy:
27-
resources:
28-
limits:
29-
cpus: "1.0"
30-
memory: 1G
21+
healthcheck:
22+
test: ["CMD", "rabbitmq-diagnostics", "status"]
23+
interval: 15s
24+
timeout: 5s
25+
retries: 5
26+
deploy:
27+
resources:
28+
limits:
29+
cpus: "1.0"
30+
memory: 1G
3131

32-
mongo-setup:
33-
container_name: mongo-setup
34-
image: mongo
35-
restart: on-failure
32+
mongo-setup:
33+
container_name: mongo-setup
34+
image: mongo
35+
restart: on-failure
3636

37-
volumes:
38-
- ./scripts:/scripts
39-
entrypoint: [ "/scripts/setup.sh" ]
40-
depends_on:
41-
mongo1:
42-
condition: service_healthy
43-
mongo2:
44-
condition: service_healthy
45-
mongo3:
46-
condition: service_healthy
37+
volumes:
38+
- ./scripts:/scripts
39+
entrypoint: ["/scripts/setup.sh"]
40+
depends_on:
41+
mongo1:
42+
condition: service_healthy
43+
mongo2:
44+
condition: service_healthy
45+
mongo3:
46+
condition: service_healthy
4747

48-
mongo1:
49-
hostname: mongo1
50-
container_name: localmongo1
51-
image: mongo
52-
expose:
53-
- "27017"
54-
ports:
55-
- "27017:27017"
56-
restart: always
57-
entrypoint: [ "mongod", "--replSet", "rs0", "--bind_ip_all", "--dbpath", "/data/db", "--oplogSize", "128" ]
58-
healthcheck:
59-
test: [ "CMD", "mongosh", "--eval", "'db.runCommand({ ping: 1 })'" ]
60-
interval: 20s
61-
timeout: 15s
62-
retries: 5
63-
start_period: 10s
48+
mongo1:
49+
hostname: mongo1
50+
container_name: localmongo1
51+
image: mongo
52+
expose:
53+
- "27017"
54+
ports:
55+
- "27017:27017"
56+
restart: always
57+
entrypoint:
58+
[
59+
"mongod",
60+
"--replSet",
61+
"rs0",
62+
"--bind_ip_all",
63+
"--dbpath",
64+
"/data/db",
65+
"--oplogSize",
66+
"128",
67+
]
68+
healthcheck:
69+
test: ["CMD", "mongosh", "--eval", "'db.runCommand({ ping: 1 })'"]
70+
interval: 20s
71+
timeout: 15s
72+
retries: 5
73+
start_period: 10s
6474

65-
volumes:
66-
- ./mongodb/mongo/data1/db:/data/db
67-
# - ./mongodb/mongo/data1/configdb:/data/configdb
68-
mongo2:
69-
hostname: mongo2
70-
container_name: localmongo2
71-
image: mongo
72-
expose:
73-
- "27017"
74-
ports:
75-
- "27018:27017"
76-
restart: always
77-
entrypoint: [ "mongod", "--replSet", "rs0", "--bind_ip_all", "--dbpath", "/data/db", "--oplogSize", "128" ]
78-
healthcheck:
79-
test: [ "CMD", "mongosh", "--eval", "'db.runCommand({ ping: 1 })'" ]
80-
interval: 20s
81-
timeout: 15s
82-
retries: 5
83-
start_period: 10s
75+
volumes:
76+
- ./mongodb/mongo/data1/db:/data/db
77+
# - ./mongodb/mongo/data1/configdb:/data/configdb
78+
mongo2:
79+
hostname: mongo2
80+
container_name: localmongo2
81+
image: mongo
82+
expose:
83+
- "27017"
84+
ports:
85+
- "27018:27017"
86+
restart: always
87+
entrypoint:
88+
[
89+
"mongod",
90+
"--replSet",
91+
"rs0",
92+
"--bind_ip_all",
93+
"--dbpath",
94+
"/data/db",
95+
"--oplogSize",
96+
"128",
97+
]
98+
healthcheck:
99+
test: ["CMD", "mongosh", "--eval", "'db.runCommand({ ping: 1 })'"]
100+
interval: 20s
101+
timeout: 15s
102+
retries: 5
103+
start_period: 10s
84104

85-
volumes:
86-
- ./mongodb/mongo/data2/db:/data/db
87-
# - ./mongodb/mongo/data2/configdb:/data/configdb
88-
mongo3:
89-
hostname: mongo3
90-
container_name: localmongo3
91-
image: mongo
92-
expose:
93-
- "27017"
94-
ports:
95-
- "27019:27017"
96-
restart: always
97-
entrypoint: [ "mongod", "--replSet", "rs0", "--bind_ip_all", "--dbpath", "/data/db", "--oplogSize", "128" ]
98-
healthcheck:
99-
test: [ "CMD", "mongosh", "--eval", "'db.runCommand({ ping: 1 })'" ]
100-
interval: 20s
101-
timeout: 15s
102-
retries: 5
103-
start_period: 10s
105+
volumes:
106+
- ./mongodb/mongo/data2/db:/data/db
107+
# - ./mongodb/mongo/data2/configdb:/data/configdb
108+
mongo3:
109+
hostname: mongo3
110+
container_name: localmongo3
111+
image: mongo
112+
expose:
113+
- "27017"
114+
ports:
115+
- "27019:27017"
116+
restart: always
117+
entrypoint:
118+
[
119+
"mongod",
120+
"--replSet",
121+
"rs0",
122+
"--bind_ip_all",
123+
"--dbpath",
124+
"/data/db",
125+
"--oplogSize",
126+
"128",
127+
]
128+
healthcheck:
129+
test: ["CMD", "mongosh", "--eval", "'db.runCommand({ ping: 1 })'"]
130+
interval: 20s
131+
timeout: 15s
132+
retries: 5
133+
start_period: 10s
104134

105-
volumes:
106-
- ./mongodb/mongo/data3/db:/data/db
107-
# - ./mongodb/mongo/data3/configdb:/data/configdb
135+
volumes:
136+
- ./mongodb/mongo/data3/db:/data/db
137+
# - ./mongodb/mongo/data3/configdb:/data/configdb
108138

109-
celery:
110-
build:
111-
context: ../server
112-
dockerfile: ./Dockerfile.celery
139+
celery:
140+
build:
141+
context: ../server
142+
dockerfile: ./Dockerfile.celery
113143

114-
command: [ "uv", "run", "watchfiles", "--ignore-paths", "./app.log", "--sigint-timeout", "30", "/server/.venv/bin/python -m celery -A app.background_tasks.celery.tasks worker --pool solo --loglevel=INFO" ]
144+
command:
145+
[
146+
"uv",
147+
"run",
148+
"watchfiles",
149+
"--ignore-paths",
150+
"./app.log",
151+
"--sigint-timeout",
152+
"30",
153+
"/server/.venv/bin/python -m celery -A app.background_tasks.celery.tasks worker --pool solo --loglevel=INFO",
154+
]
115155

116-
volumes:
117-
- ../server/app:/server/app:consistent
118-
depends_on:
119-
rabbitmq:
120-
condition: service_healthy
156+
volumes:
157+
- ../server/app:/server/app:consistent
158+
depends_on:
159+
rabbitmq:
160+
condition: service_healthy
121161

122-
app:
123-
container_name: bridge-server
124-
build:
125-
context: ../server
126-
dockerfile: ./Dockerfile
127-
ports:
128-
- "8000:8000"
129-
volumes:
130-
- ../server/app:/server/app
162+
app:
163+
container_name: bridge-server
164+
build:
165+
context: ../server
166+
dockerfile: ./Dockerfile
167+
ports:
168+
- "8000:8000"
169+
volumes:
170+
- ../server/app:/server/app
131171

132-
command: [ "uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--reload-dir", "/server/app" ]
133-
depends_on:
134-
rabbitmq:
135-
condition: service_healthy
136-
mongo-setup:
137-
condition: service_completed_successfully
138-
celery:
139-
condition: service_started
140-
# coturn:
141-
# condition: service_started
172+
command:
173+
[
174+
"uv",
175+
"run",
176+
"uvicorn",
177+
"app.main:app",
178+
"--host",
179+
"0.0.0.0",
180+
"--port",
181+
"8000",
182+
"--reload",
183+
"--reload-dir",
184+
"/server/app",
185+
]
186+
depends_on:
187+
rabbitmq:
188+
condition: service_healthy
189+
mongo-setup:
190+
condition: service_completed_successfully
191+
celery:
192+
condition: service_started
193+
# coturn:
194+
# condition: service_started
142195

143-
coturn:
144-
image: coturn/coturn:4.6.3-alpine
145-
container_name: coturn
146-
restart: unless-stopped
147-
ports:
148-
- "3478:3478" # STUN/TURN over UDP & TCP
149-
- "3478:3478/udp"
150-
- "5349:5349" # TURN over TLS
151-
- "5349:5349/udp"
152-
- "49152-49200:49152-49200/udp" # UDP relay ports
153-
volumes:
154-
- ./turnserver.conf:/etc/coturn/turnserver.conf:ro
155-
# environment:
156-
# - PUBLIC_IP=YOUR.SERVER.IP # or DETECT_EXTERNAL_IP=yes
157-
# - STATIC_AUTH_SECRET=changeme
196+
coturn:
197+
image: coturn/coturn:4.6.3-alpine
198+
container_name: coturn
199+
restart: unless-stopped
200+
ports:
201+
- "3478:3478" # STUN/TURN over UDP & TCP
202+
- "3478:3478/udp"
203+
- "5349:5349" # TURN over TLS
204+
- "5349:5349/udp"
205+
- "49152-49200:49152-49200/udp" # UDP relay ports
206+
volumes:
207+
- ./turnserver.conf:/etc/coturn/turnserver.conf:ro
208+
# environment:
209+
# - PUBLIC_IP=YOUR.SERVER.IP # or DETECT_EXTERNAL_IP=yes
210+
# - STATIC_AUTH_SECRET=changeme

0 commit comments

Comments
 (0)