Skip to content

Commit

Permalink
feat: Add custom instance names (#399)
Browse files Browse the repository at this point in the history
* Add custom name variable

* Add custom name variable usage to docs

* Remove leftover testing config options (oops)
  • Loading branch information
SangeloDev authored Dec 15, 2024
1 parent 00951bf commit 20aef5e
Show file tree
Hide file tree
Showing 6 changed files with 1,401 additions and 1,387 deletions.
5 changes: 3 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ git.default-branch:
# For SQLite databases only.
sqlite.journal-mode: WAL


# HTTP server configuration
# Host to bind to. Default: 0.0.0.0
http.host: 0.0.0.0
Expand Down Expand Up @@ -72,7 +71,6 @@ ssh.external-domain:
# Path or alias to ssh-keygen executable. Default: ssh-keygen
ssh.keygen-executable: ssh-keygen


# OAuth2 configuration
# The callback/redirect URL must be http://opengist.url/oauth/<github|gitlab|gitea|openid-connect>/callback

Expand Down Expand Up @@ -102,6 +100,9 @@ oidc.secret:
# Discovery endpoint of the OpenID provider. Generally something like http://auth.example.com/.well-known/openid-configuration
oidc.discovery-url:

# Instance name
# Set your own custom name to be displayed instead of 'Opengist'
custom.name:

# Custom assets
# Add your own custom assets, that are files relatives to $opengist-home/custom/
Expand Down
1 change: 1 addition & 0 deletions docs/configuration/cheat-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ aside: false
| oidc.client-key | OG_OIDC_CLIENT_KEY | none | The client key for the OpenID application. |
| oidc.secret | OG_OIDC_SECRET | none | The secret for the OpenID application. |
| oidc.discovery-url | OG_OIDC_DISCOVERY_URL | none | Discovery endpoint of the OpenID provider. |
| custom.name | OG_CUSTOM_NAME | none | The name of your instance, to be displayed in the tab title |
| custom.logo | OG_CUSTOM_LOGO | none | Path to an image, relative to $opengist-home/custom. |
| custom.favicon | OG_CUSTOM_FAVICON | none | Path to an image, relative to $opengist-home/custom. |
| custom.static-links | OG_CUSTOM_STATIC_LINK_#_(PATH,NAME) | none | Path and name to custom links, more info [here](custom-links.md). |
16 changes: 15 additions & 1 deletion docs/configuration/custom-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,18 @@ custom.favicon: favicon.png
#### Environment variable
```sh
export OG_CUSTOM_FAVICON=favicon.png
```
```

### Instance Name

It is also possible to set a name for your instance, that would be displayed in the title bar instead of 'Opengist'.

#### YAML
```yaml
custom.name: My Gists
```
#### Environment variable
```sh
export OG_CUSTOM_NAME="My Gists"
```
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type config struct {
OIDCSecret string `yaml:"oidc.secret" env:"OG_OIDC_SECRET"`
OIDCDiscoveryUrl string `yaml:"oidc.discovery-url" env:"OG_OIDC_DISCOVERY_URL"`

CustomName string `yaml:"custom.name" env:"OG_CUSTOM_NAME"`
CustomLogo string `yaml:"custom.logo" env:"OG_CUSTOM_LOGO"`
CustomFavicon string `yaml:"custom.favicon" env:"OG_CUSTOM_FAVICON"`
StaticLinks []StaticLink `yaml:"custom.static-links" env:"OG_CUSTOM_STATIC_LINK"`
Expand Down
Loading

0 comments on commit 20aef5e

Please sign in to comment.