Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 74c89c5

Browse files
committed
Fix Unit Tests
2 parents 868f294 + 7071591 commit 74c89c5

File tree

13 files changed

+528
-794
lines changed

13 files changed

+528
-794
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ weaviate_data/
4747
codegate.db
4848

4949
# certificate directory
50-
certs/
50+
*certs/

docs/cli.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ codegate serve [OPTIONS]
2929
- Overrides configuration file and environment variables
3030

3131
- `--log-level [ERROR|WARNING|INFO|DEBUG]`: Set the log level (default: INFO)
32+
- Optional
3233
- Case-insensitive
3334
- Overrides configuration file and environment variables
3435

3536
- `--log-format [JSON|TEXT]`: Set the log format (default: JSON)
37+
- Optional
3638
- Case-insensitive
3739
- Overrides configuration file and environment variables
3840

@@ -72,6 +74,10 @@ codegate serve [OPTIONS]
7274
- `--embedding-model TEXT`: Name of the model used for embeddings
7375
- Optional
7476

77+
- `--db-path TEXT`: Path to a SQLite DB. It will create one if it doesn't exist. (default: ./codegate_volume/db/codegate.db)
78+
- Optional
79+
- Overrides configuration file and environment variables
80+
7581
### show-prompts
7682

7783
Display the loaded system prompts:
@@ -87,6 +93,46 @@ codegate show-prompts [OPTIONS]
8793
- Must be a valid YAML file
8894
- If not provided, shows default prompts from prompts/default.yaml
8995

96+
### generate_certs
97+
98+
Generate certificates for the CodeGate server.
99+
100+
```bash
101+
codegate generate-certs [OPTIONS]
102+
```
103+
104+
#### Options
105+
106+
- `--certs-out-dir PATH`: Directory path where the certificates are going to be generated. (default: ./codegate_volume/certs)
107+
- Optional
108+
- Overrides configuration file and environment variables
109+
110+
- `--ca-cert-name TEXT`: Name that will be given to the created CA certificate. (default: ca.crt)
111+
- Optional
112+
- Overrides configuration file and environment variables
113+
114+
- `--ca-key-name TEXT`: Name that will be given to the created CA key. (default: ca.key)
115+
- Optional
116+
- Overrides configuration file and environment variables
117+
118+
- `--server-cert-name TEXT`: Name that will be given to the created server certificate. (default: server.crt)
119+
- Optional
120+
- Overrides configuration file and environment variables
121+
122+
- `--server-key-name TEXT`: Name that will be given to the created server key. (default: server.key)
123+
- Optional
124+
- Overrides configuration file and environment variables
125+
126+
- `--log-level [ERROR|WARNING|INFO|DEBUG]`: Set the log level (default: INFO)
127+
- Optional
128+
- Case-insensitive
129+
- Overrides configuration file and environment variables
130+
131+
- `--log-format [JSON|TEXT]`: Set the log format (default: JSON)
132+
- Optional
133+
- Case-insensitive
134+
- Overrides configuration file and environment variables
135+
90136
## Error Handling
91137

92138
The CLI provides user-friendly error messages for:
@@ -144,3 +190,9 @@ codegate show-prompts
144190
Show prompts from a custom file:
145191
```bash
146192
codegate show-prompts --prompts my-prompts.yaml
193+
```
194+
195+
Generate certificates with default settings:
196+
```bash
197+
codegate generate-certs
198+
```

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/entrypoint.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ BACKUP_PATH="/tmp/weaviate_backup"
77
BACKUP_NAME="backup"
88
MODEL_BASE_PATH="/app/codegate_volume/models"
99
CODEGATE_DB_FILE="/app/codegate_volume/db/codegate.db"
10+
CODEGATE_CERTS="/app/codegate_volume/certs"
1011

1112
# Function to restore backup if paths are provided
1213
restore_backup() {
@@ -22,6 +23,11 @@ restore_backup() {
2223
fi
2324
}
2425

26+
genrerate_certs() {
27+
echo "Generating certificates..."
28+
python -m src.codegate.cli generate-certs --certs-out-dir "$CODEGATE_CERTS"
29+
}
30+
2531
# Function to start Nginx server for the dashboard
2632
start_dashboard() {
2733
echo "Starting the dashboard..."
@@ -54,8 +60,11 @@ echo "Initializing entrypoint script..."
5460
# Step 1: Restore backup if applicable
5561
restore_backup
5662

57-
# Step 2: Start the dashboard
63+
# Step 2: Generate certificates
64+
genrerate_certs
65+
66+
# Step 3: Start the dashboard
5867
start_dashboard
5968

60-
# Step 3: Start the main application
69+
# Step 4: Start the main application
6170
start_application

0 commit comments

Comments
 (0)