This repository has been archived by the owner on Mar 16, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 83
Configuration
Max Schmitt edited this page Nov 13, 2017
·
5 revisions
The configuration is a YAML file, an example is located here.
Field | Value | Type |
---|---|---|
Store | Store Object | object |
Handlers | Handlers Object | object |
Field | Value | Type | Example |
---|---|---|---|
DBPath | Relative or absolute path of your bolt DB | string | main.db |
ShortedIDLength | Length of the random generated ID which is used for new shortened URLs | uint | 4 |
Field | Value | Type | Example |
---|---|---|---|
ListenAddr | Consists of 'IP:Port', normally the value ':8080' e.g. is enough | string | :8080 |
BaseURL | Origin URL, required for the authentication via OAuth | string | http://shortener.google.com |
EnableDebugMode | Activates more detailed logging | bool | true |
Secret | Used for encryption of the JWT and for the CookieJar | string | Will be randomly generated when it isn't set |
OAuth | OAuth Object | object |
Field | Value | Type |
---|---|---|
Google Object | object |
Field | Value | Type |
---|---|---|
ClientID | ClientID which you get from console.cloud.google.com | string |
ClientSecret | ClientSecret which get from console.cloud.google.com | string |
To use environment variables you can do it by simply use the prefix GUS
and the variable key name split by an underscore. The environment variables will override the normal configuration file. To use only environment variables (and change so the default values) create an empty config.yaml
file.
Examples:
Key | Value |
---|---|
GUS_GENERAL_ENABLEDEBUGMODE | 0 |
GUS_GENERAL_SHORTEDIDLENGTH | 8 |
GUS_GENERAL_DATADIR | /opt/shortener/data |