This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/main by this push:
new 10795fc Allow the state directory to be configured during setup
10795fc is described below
commit 10795fcc06b10c73176849582363d8e52e8ac269
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Jan 15 19:16:20 2026 +0000
Allow the state directory to be configured during setup
---
Makefile | 14 ++++++++------
scripts/generate-certificates | 2 +-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index beb28fc..b251086 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@
BIND ?= 127.0.0.1:8080
IMAGE ?= tooling-trusted-release
+STATE_DIR ?= state
build: build-alpine
@@ -40,12 +41,13 @@ bump-bootstrap:
atr-bootstrap /opt/bootstrap/bump.sh $(BOOTSTRAP_VERSION)
certs:
- if test ! -f state/cert.pem || test ! -f state/key.pem; \
- then uv run --frozen scripts/generate-certificates; \
+ if test ! -f $(STATE_DIR)/cert.pem || test ! -f $(STATE_DIR)/key.pem; \
+ then STATE_DIR=$(STATE_DIR) uv run --frozen
scripts/generate-certificates; \
fi
certs-local:
- cd state && mkcert localhost.apache.org 127.0.0.1 ::1
+ mkdir -p $(STATE_DIR)
+ cd $(STATE_DIR) && mkcert localhost.apache.org 127.0.0.1 ::1
check:
git add -A
@@ -91,9 +93,9 @@ ipython:
run-alpine:
docker run --rm --init --user "$$(id -u):$$(id -g)" \
-p 8080:8080 -p 2222:2222 \
- -v "$$PWD/state:/opt/atr/state" \
- -v
"$$PWD/state/localhost.apache.org+2-key.pem:/opt/atr/state/key.pem" \
- -v "$$PWD/state/localhost.apache.org+2.pem:/opt/atr/state/cert.pem" \
+ -v "$$PWD/$(STATE_DIR):/opt/atr/state" \
+ -v
"$$PWD/$(STATE_DIR)/localhost.apache.org+2-key.pem:/opt/atr/state/key.pem" \
+ -v
"$$PWD/$(STATE_DIR)/localhost.apache.org+2.pem:/opt/atr/state/cert.pem" \
-e APP_HOST=localhost.apache.org:8080 -e
SECRET_KEY=insecure-local-key \
-e ALLOW_TESTS=1 -e SSH_HOST=0.0.0.0 -e BIND=0.0.0.0:8080 \
tooling-trusted-release
diff --git a/scripts/generate-certificates b/scripts/generate-certificates
index 7a5fa72..4bc8356 100755
--- a/scripts/generate-certificates
+++ b/scripts/generate-certificates
@@ -9,7 +9,7 @@ from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.x509.oid import NameOID
# All state is placed in this directory
-STATE_DIR = "./state"
+STATE_DIR = os.environ.get("STATE_DIR", "./state")
CERT_PATH = os.path.join(STATE_DIR, "cert.pem")
KEY_PATH = os.path.join(STATE_DIR, "key.pem")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]