|
10 | 10 | from core.config import write_file, write_env_file, add_db_to_json |
11 | 11 | from core.docker import ensure_network, run_compose |
12 | 12 | from core.network import fetch_template |
13 | | -from templates.compose import AGENT_POSTGRES_SNIPPET, AGENT_MARIADB_SNIPPET |
| 13 | +from templates.compose import AGENT_POSTGRES_SNIPPET, AGENT_MARIADB_SNIPPET, AGENT_MONGODB_AUTH_SNIPPET, \ |
| 14 | + AGENT_MONGODB_SNIPPET |
14 | 15 |
|
15 | 16 |
|
16 | 17 | def agent( |
@@ -57,7 +58,7 @@ def agent( |
57 | 58 | console.print(Panel("[bold]Database Setup[/bold]", style="cyan")) |
58 | 59 |
|
59 | 60 | while Confirm.ask("Do you want to configure a database?", default=True): |
60 | | - mode = Prompt.ask("Configuration Mode", choices=["new", "existing"], default="news") |
| 61 | + mode = Prompt.ask("Configuration Mode", choices=["new", "existing"], default="new") |
61 | 62 |
|
62 | 63 | if mode == "existing": |
63 | 64 | console.print("[info]External/Existing Database Configuration[/info]") |
@@ -170,7 +171,7 @@ def agent( |
170 | 171 | env_vars[f"{var_prefix}_USER"] = db_user |
171 | 172 | env_vars[f"{var_prefix}_PASS"] = db_pass |
172 | 173 |
|
173 | | - snippet = AGENT_MARIADB_SNIPPET \ |
| 174 | + snippet = AGENT_MONGODB_AUTH_SNIPPET \ |
174 | 175 | .replace("${SERVICE_NAME}", service_name) \ |
175 | 176 | .replace("${PORT}", f"${{{var_prefix}_PORT}}") \ |
176 | 177 | .replace("${VOL_NAME}", f"{service_name}-data") \ |
@@ -203,7 +204,7 @@ def agent( |
203 | 204 | env_vars[f"{var_prefix}_PORT"] = str(mongo_port) |
204 | 205 | env_vars[f"{var_prefix}_DB"] = db_name |
205 | 206 |
|
206 | | - snippet = AGENT_MARIADB_SNIPPET \ |
| 207 | + snippet = AGENT_MONGODB_SNIPPET \ |
207 | 208 | .replace("${SERVICE_NAME}", service_name) \ |
208 | 209 | .replace("${PORT}", f"${{{var_prefix}_PORT}}") \ |
209 | 210 | .replace("${VOL_NAME}", f"{service_name}-data") \ |
|
0 commit comments