Skip to content

Commit f28d520

Browse files
committed
fix: uses port decoupled installation script which loads ports and configs from a sepecific config.json file from the helpers/config.json
1 parent 426f06c commit f28d520

File tree

6 files changed

+523
-97
lines changed

6 files changed

+523
-97
lines changed

.github/workflows/qemu.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: QEMU Setup and Installation
22

33
on:
44
push:
5-
branches: [feat/develop]
5+
branches: [feat/port_decouple]
66
pull_request:
7-
branches: [feat/develop]
7+
branches: [feat/port_decouple]
88
workflow_dispatch:
99

1010
jobs:

helpers/config.json

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
{
2+
"production": {
3+
"config_dir": "/etc/nixopus",
4+
"api_port": 8443,
5+
"next_public_port": 7443,
6+
"db_port": 5432,
7+
"host_name": "nixopus-db",
8+
"redis_url": "redis://nixopus-redis:6379",
9+
"mount_path": "/etc/nixopus/configs",
10+
"docker_host": "tcp://{ip}:2376",
11+
"docker_port": 2376,
12+
"docker": {
13+
"required_version": "20.10.0",
14+
"required_compose_version": "2.0.0"
15+
},
16+
"ssh": {
17+
"port": 22,
18+
"user": "root",
19+
"key_bits": 4096,
20+
"key_type": "rsa"
21+
},
22+
"caddy": {
23+
"endpoint": "http://nixopus-caddy:2019",
24+
"data_volume": "/etc/nixopus/caddy/data",
25+
"config_volume": "/etc/nixopus/caddy/config"
26+
},
27+
"database": {
28+
"name_prefix": "nixopus_",
29+
"user_prefix": "nixopus_",
30+
"name_length": 8,
31+
"user_length": 8,
32+
"password_length": 16,
33+
"ssl_mode": "disable"
34+
},
35+
"version": {
36+
"file_path": "version.txt"
37+
},
38+
"urls": {
39+
"api": {
40+
"pattern": "{protocol}://{host}/api",
41+
"protocols": {
42+
"secure": "https",
43+
"insecure": "http"
44+
}
45+
},
46+
"websocket": {
47+
"pattern": "{protocol}://{host}/ws",
48+
"protocols": {
49+
"secure": "wss",
50+
"insecure": "ws"
51+
}
52+
},
53+
"webhook": {
54+
"pattern": "{protocol}://{host}/api/v1/webhook",
55+
"protocols": {
56+
"secure": "https",
57+
"insecure": "http"
58+
}
59+
},
60+
"app": {
61+
"pattern": "{protocol}://{host}",
62+
"protocols": {
63+
"secure": "https",
64+
"insecure": "http"
65+
}
66+
}
67+
},
68+
"directories": {
69+
"ssh": "ssh",
70+
"source": "source",
71+
"api": "source/api",
72+
"view": "source/view",
73+
"db": "db",
74+
"caddy": {
75+
"data": "caddy/data",
76+
"config": "caddy/config"
77+
}
78+
},
79+
"files": {
80+
"env": ".env",
81+
"env_sample": ".env.sample",
82+
"permissions": {
83+
"env": "600",
84+
"private_key": "600",
85+
"public_key": "644",
86+
"authorized_keys": "600"
87+
}
88+
},
89+
"errors": {
90+
"invalid_environment": "Invalid environment: {env}. Must be either 'production' or 'staging'",
91+
"config_not_found": "Configuration file not found at {path}",
92+
"invalid_json": "Invalid JSON in configuration file at {path}",
93+
"env_not_found": "Configuration for environment '{env}' not found in config file",
94+
"missing_keys": "Missing required configuration keys for environment '{env}': {keys}",
95+
"invalid_type": "Invalid configuration value type in environment '{env}': {error}",
96+
"invalid_url_type": "Invalid URL type: {type}",
97+
"invalid_dir_type": "Invalid directory type: {type}",
98+
"invalid_subdir_type": "Invalid sub-directory type: {type}",
99+
"ssh_keygen_failed": "Failed to generate SSH key",
100+
"ssh_keygen_not_found": "ssh-keygen not found: {error}",
101+
"ssh_key_error": "Error generating SSH key: {error}",
102+
"auth_keys_error": "Error setting up authorized_keys: {error}",
103+
"file_read_error": "File read error: {error}",
104+
"file_write_error": "File write error: {error}",
105+
"invalid_domain": "Invalid domain format. Domains must be valid hostnames",
106+
"setup_error": "Error setting up environment: {error}"
107+
}
108+
},
109+
"staging": {
110+
"config_dir": "/etc/nixopus-staging",
111+
"api_port": 8444,
112+
"next_public_port": 7444,
113+
"db_port": 5433,
114+
"host_name": "nixopus-staging-db",
115+
"redis_url": "redis://nixopus-staging-redis:6380",
116+
"mount_path": "/etc/nixopus-staging/configs",
117+
"docker_host": "tcp://{ip}:2377",
118+
"docker_port": 2377,
119+
"docker": {
120+
"required_version": "20.10.0",
121+
"required_compose_version": "2.0.0"
122+
},
123+
"ssh": {
124+
"port": 22,
125+
"user": "root",
126+
"key_bits": 4096,
127+
"key_type": "rsa"
128+
},
129+
"caddy": {
130+
"endpoint": "http://nixopus-caddy:2019",
131+
"data_volume": "/etc/nixopus-staging/caddy/data",
132+
"config_volume": "/etc/nixopus-staging/caddy/config"
133+
},
134+
"database": {
135+
"name_prefix": "nixopus_",
136+
"user_prefix": "nixopus_",
137+
"name_length": 8,
138+
"user_length": 8,
139+
"password_length": 16,
140+
"ssl_mode": "disable"
141+
},
142+
"version": {
143+
"file_path": "version.txt"
144+
},
145+
"urls": {
146+
"api": {
147+
"pattern": "{protocol}://{host}/api",
148+
"protocols": {
149+
"secure": "https",
150+
"insecure": "http"
151+
}
152+
},
153+
"websocket": {
154+
"pattern": "{protocol}://{host}/ws",
155+
"protocols": {
156+
"secure": "wss",
157+
"insecure": "ws"
158+
}
159+
},
160+
"webhook": {
161+
"pattern": "{protocol}://{host}/api/v1/webhook",
162+
"protocols": {
163+
"secure": "https",
164+
"insecure": "http"
165+
}
166+
},
167+
"app": {
168+
"pattern": "{protocol}://{host}",
169+
"protocols": {
170+
"secure": "https",
171+
"insecure": "http"
172+
}
173+
}
174+
},
175+
"directories": {
176+
"ssh": "ssh",
177+
"source": "source",
178+
"api": "source/api",
179+
"view": "source/view",
180+
"db": "db",
181+
"caddy": {
182+
"data": "caddy/data",
183+
"config": "caddy/config"
184+
}
185+
},
186+
"files": {
187+
"env": ".env",
188+
"env_sample": ".env.sample",
189+
"permissions": {
190+
"env": "600",
191+
"private_key": "600",
192+
"public_key": "644",
193+
"authorized_keys": "600"
194+
}
195+
},
196+
"errors": {
197+
"invalid_environment": "Invalid environment: {env}. Must be either 'production' or 'staging'",
198+
"config_not_found": "Configuration file not found at {path}",
199+
"invalid_json": "Invalid JSON in configuration file at {path}",
200+
"env_not_found": "Configuration for environment '{env}' not found in config file",
201+
"missing_keys": "Missing required configuration keys for environment '{env}': {keys}",
202+
"invalid_type": "Invalid configuration value type in environment '{env}': {error}",
203+
"invalid_url_type": "Invalid URL type: {type}",
204+
"invalid_dir_type": "Invalid directory type: {type}",
205+
"invalid_subdir_type": "Invalid sub-directory type: {type}",
206+
"ssh_keygen_failed": "Failed to generate SSH key",
207+
"ssh_keygen_not_found": "ssh-keygen not found: {error}",
208+
"ssh_key_error": "Error generating SSH key: {error}",
209+
"auth_keys_error": "Error setting up authorized_keys: {error}",
210+
"file_read_error": "File read error: {error}",
211+
"file_write_error": "File write error: {error}",
212+
"invalid_domain": "Invalid domain format. Domains must be valid hostnames",
213+
"setup_error": "Error setting up environment: {error}"
214+
}
215+
}
216+
}

0 commit comments

Comments
 (0)