github-backup reads several environment variables so that secrets stay out
of the command line, shell history and the process list. A variable that is
set but empty is treated as unset (container launchers often pass every
optional variable as an empty string); surrounding whitespace, such as a
newline pasted with a token, is trimmed.
64 hexadecimal characters: AES-256-GCM key for the S3 upload (and for --decrypt)
The three AWS_* variables are ignored unless --s3-bucket is given, so
credentials exported for other tools never affect a run that does not use S3.
AWS_PROFILE, ~/.aws/credentials and instance metadata are not read.
Fallback for both when the specific variable is unset
NO_PROXY / no_proxy
Comma-separated exceptions: *, host names (also match subdomains), IP addresses, CIDR blocks such as 10.0.0.0/8, each with an optional :port
The lower-case spelling wins when both are set. The proxy must be an
HTTP proxy (http://[user:pass@]host[:port], port 3128 if omitted;
credentials are sent as Proxy-Authorization: Basic). https:// targets are
reached through an HTTP CONNECT tunnel. A value that is not a usable HTTP
proxy URL (socks5://... for example) is ignored with a warning. SOCKS
proxies are not supported.
What the variables apply to:
Traffic
Uses the proxy settings?
GitHub API calls, including release-asset downloads
yes
--notify-webhook
yes
--doctor / --check
yes (the same client as the backup)
git clone, git fetch, git push (the git binary)
by git's own rules: git reads the same variables (https_proxy, no_proxy, ...) or its http.proxy setting
S3 requests
no, they connect to the endpoint directly
Gitea / GitLab API calls of --mirror-to
no, they connect directly (the git push itself follows git's rules)
Extra or alternative trust store for the tool's own TLS clients (GitHub API, S3, webhook, mirror API). Without them the operating system's certificate store is used.
GIT_SSL_CAINFO
The same for the git subprocesses (git has its own setting)
The image's entrypoint additionally reads GITHUB_OWNER, BACKUP_MODE,
BACKUP_FLAGS and UMASK when it is started without arguments; see
Docker. They are not read by the github-backup binary.
For interactive use, read keeps the token out of the shell history:
read -rs GITHUB_TOKEN && export GITHUB_TOKEN
For systemd services use EnvironmentFile= with a 0600 file; for Docker use
--env-file or -e GITHUB_TOKEN (no value, so the secret is not in the
docker command line); for Kubernetes use a Secret.