Browse Source

Fixed config; documented

feature/embedded-resources-and-css
root 5 months ago
parent
commit
ad7f671e4a
  1. 10
      README.md
  2. 2
      config.go

10
README.md

@ -14,10 +14,14 @@ Every configuration option is passed through the environment.
- `MAX_DESCRIPTION_LENGTH` (default: 120): The maximum length (in characters) for the description display
- `LISTEN` (default: `/run/gitmgr.sock`): The listen address+port (e.g. `127.0.0.1:3000`), or the listen socket
- `TITLE` (default: `gitmgr`): The forge's title
- `GIT_ROOT` (default: `/srv/git`): The git repository root (its contents must be writable by the daemon)
- `EXPORTED_FILE` (default: `git-daemon-export-ok`): The file used by the Git http daemon and Gitweb for making a repository public
- `CLONE_URL_TEMPLATE` (default: empty value): The template value used for building the clone URL.
The placeholder value `{{.Name}}` contains the repository name.
- `EXPORTED_FILE` (default: `git-daemon-export-ok`): The file used by the Git http daemon and Gitweb for making a
repository public
- `CLONE_URL_TEMPLATE` (default: empty value): The template value used for building the clone URL. The placeholder
value `{{.Name}}` contains the repository name.
- `PUBLIC_GIT_LINK_TEMPLATE` (default: `edit?repository={{.}}`): The template value used for linking to the public
repository page from within the project list.
- `VERBOSE` (default: unset): If set, enables verbose logging of git repository operations (e.g. edition, deletion)
- `URL_PREFIX` (default: empty): An optional URL prefix to provide if it doesn't sit at the website root (e.g. `/admin`)
- `DEFAULT_HEAD` (default: `heads/main`): The default head to set on repository init (full path relative to `refs/`)

2
config.go

@ -100,7 +100,7 @@ func GetConfig() (*Config, error) {
VerboseLogging: isVerbose,
UrlPrefix: getEnv("URL_PREFIX", ""),
Title: getEnv("TITLE", "gitmgr"),
PublicGitLinkTemplate: getEnv("PUBLIC_GIT_LINK_TEMPLATE", "/edit?repository={{.}}"),
PublicGitLinkTemplate: getEnv("PUBLIC_GIT_LINK_TEMPLATE", "edit?repository={{.}}"),
DefaultHeadRef: getEnv("DEFAULT_HEAD", "heads/main"),
}, nil
}
Loading…
Cancel
Save