Skip to content

Commit 55496b7

Browse files
Nils Barsnbars
authored andcommitted
Use prepare.py in CI instead of manual settings.env creation
ctrl.sh now requires both settings.yaml and settings.env, but CI only created settings.env. Replace the manual file creation with a ./prepare.py call that generates all required configuration files. Also change the default TLS mode from "internal" to "off" so that prepare.py produces valid config without requiring a domain.
1 parent 60d7f00 commit 55496b7

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,11 @@ jobs:
9494
- name: Set up Python
9595
run: uv python install ${{ env.PYTHON_VERSION }}
9696

97-
- name: Install Python dependencies for ctrl.sh
98-
run: pip install jinja2
97+
- name: Install Python dependencies for prepare.py
98+
run: pip install jinja2 pyyaml
9999

100-
- name: Create settings.env
101-
run: |
102-
DOCKER_GID=$(getent group docker | cut -d: -f3)
103-
cat > settings.env << EOF
104-
DEBUG=1
105-
MAINTENANCE_ENABLED=0
106-
ADMIN_PASSWORD=TestAdmin123!
107-
DOCKER_GROUP_ID=${DOCKER_GID}
108-
SSH_HOST_PORT=2222
109-
HTTP_HOST_PORT=8000
110-
SECRET_KEY=TestSecretKeyForCI12345
111-
SSH_TO_WEB_KEY=TestSSHToWebKeyForCI
112-
POSTGRES_PASSWORD=TestPostgresPassword123!
113-
EOF
114-
# Remove leading whitespace from each line
115-
sed -i 's/^[[:space:]]*//' settings.env
100+
- name: Generate configuration
101+
run: ./prepare.py
116102

117103
- name: Set up Docker Buildx
118104
uses: docker/setup-buildx-action@v3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To inspect or edit `settings.yaml` before the first build, run `./prepare.py` ma
2020
| `ports` | `ssh_host_port` | 2222 | SSH reverse-proxy listen port |
2121
| | `http_host_port` | 8080 | HTTP port (plain or redirect) |
2222
| | `https_host_port` | 8443 | HTTPS port |
23-
| `tls` | `mode` | `internal` | `off` (plain HTTP), `internal` (self-signed), or `acme` (Let's Encrypt) |
23+
| `tls` | `mode` | `off` | `off` (plain HTTP), `internal` (self-signed), or `acme` (Let's Encrypt) |
2424
| | `domain` || Required for `internal` and `acme` modes |
2525
| | `redirect_http_to_https` | `false` | Redirect HTTP port to HTTPS (`internal` and `acme` modes only) |
2626
| `paths` | `data` | `./data` | Persistent data directory on the host |

prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def build_default_settings() -> Dict[str, Any]:
5656
},
5757
"tls": {
5858
# off = plain HTTP, internal = self-signed, acme = Let's Encrypt
59-
"mode": "internal",
59+
"mode": "off",
6060
"domain": None,
6161
# Redirect HTTP to HTTPS (only applies to internal and acme modes).
6262
"redirect_http_to_https": False,

0 commit comments

Comments
 (0)