Credential Examples
Credential Examples
Set up GitHub or GitLab without copying secrets into the project.
custy configure credentialsCategory
Quick Command
custy configure credentials COMMAND [OPTIONS]File-backed GitHub tokenâ
custy configure credentials set --provider github --source fileThe hidden prompt stores the token under the external credential root. Mount that directory read-only into the container:
Create the file from Windows CMD through Docker
The credential mount must be writable while set creates or replaces the
external file:docker run --rm -it -v "%cd%:/workspace" -v "%LOCALAPPDATA%Custycredentials:/run/secrets/custy" -w /workspace custy-prod:latest --no-banner configure credentials set --provider github
The resulting host file is
%LOCALAPPDATA%\Custy\credentials\github.token. Inside the running container,
the same file is /run/secrets/custy/github.token.
After setup, mount the directory read-only for status, testing, and push:
docker run --rm -it -v "${PWD}:/workspace" -v "$env:LOCALAPPDATA/Custy/credentials:/run/secrets/custy:ro" -w /workspace custy-prod:latest pushdocker run --rm -it -v "%cd%:/workspace" -v "%LOCALAPPDATA%Custycredentials:/run/secrets/custy:ro" -w /workspace custy-prod:latest pushInspect the mounted source from Windows CMD
docker run --rm -it -v "%cd%:/workspace" -v "%LOCALAPPDATA%Custycredentials:/run/secrets/custy:ro" -w /workspace custy-prod:latest --no-banner configure credentials status
docker run --rm -it -v "%cd%:/workspace" -v "%LOCALAPPDATA%Custycredentials:/run/secrets/custy:ro" -w /workspace custy-prod:latest --no-banner configure credentials test --remote originToken file: valid is sufficient. Environment: missing is expected when the
file source is used and CUSTY_GITHUB_TOKEN was not supplied.
Environment-backed GitLab token
custy configure credentials set --provider gitlab --source environment --token-env CUSTY_GITLAB_TOKEN
docker run --rm -it -e CUSTY_GITLAB_TOKEN -v "${PWD}:/workspace" -w /workspace custy-prod:latest pushSet the variable in the calling shell or secret-aware CI/Docker runtime. Avoid literal token values in committed Compose files or reusable shell history.
Inspect and test
custy configure credentials status
custy configure credentials test --remote originUse the Make helpers
From the Custy source checkout, the d-, c-, and r-custy- target families
can create, inspect, test, and use the same external credential directory:# Setup uses a writable mount
make d-credentials-set-github
make d-credentials-set-gitlab
# Inspection and access testing use a read-only mount
make d-credentials-status
make d-credentials-test CUSTY_CREDENTIALS_REMOTE=origin
# Runtime mounting is explicit and read-only
make d-run-push CUSTY_CREDENTIALS_MOUNT=true
Equivalent Compose and published-image targets are available as
c-credentials-* / c-run-push and
r-custy-credentials-* / r-custy-run-push.
| Setting | Result |
|---|---|
CUSTY_CREDENTIALS_MOUNT=false | Default. Do not mount the external files; native Git, SSH, or an interactive username/PAT prompt remains responsible for authentication. |
CUSTY_CREDENTIALS_MOUNT=true | Mount the external directory read-only for a runtime command such as d-run-push. |
make d-credentials-set-github | Mount the directory writable only while Custy creates or replaces github.token. |
make d-credentials-status or make d-credentials-test | Mount the directory read-only without displaying a token value. |
On Windows, CUSTY_CREDENTIALS_HOST_DIR defaults to
%LOCALAPPDATA%/Custy/credentials. On Linux and macOS it uses
$XDG_DATA_HOME/custy/credentials, or
$HOME/.local/share/custy/credentials when XDG_DATA_HOME is unset. Override
the location explicitly when required:make d-run-push CUSTY_CREDENTIALS_MOUNT=true CUSTY_CREDENTIALS_HOST_DIR=/approved/secret/directory
The token itself is never passed as a Make variable or written into a Makefile.
Disable or delete
# Disable but preserve the external file
custy configure credentials remove --provider github
# Disable and explicitly delete the external file
custy configure credentials remove --provider github --delete-fileManual Docker fallback
docker run --rm -it -v "%cd%:/workspace" -w /workspace custy-prod:latest --no-banner pushThis intentionally omits the credential mount and token environment variable.
Git may ask for a username and PAT for each HTTPS provider. The values are not
persisted by a disposable --rm container.