Skip to content

Commit

Permalink
Merge pull request #147 from khakers/feature/config-rewrite
Browse files Browse the repository at this point in the history
Rewrite config for Gestalt
  • Loading branch information
khakers authored Jan 22, 2024
2 parents 3203cdf + 844329c commit a644593
Show file tree
Hide file tree
Showing 34 changed files with 744 additions and 441 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Changelog

Based on [common changelog spec](https://common-changelog.org/)

## [Unreleased]

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md)._


### Changed

- **Breaking:** Migrate configuration system to Gestalt.
- **Breaking:** Change default http port to 7080.
- **Breaking:** Change default https port to 7443.

### Added

### Removed

- **Breaking:** Remove support for automatic secret key generation. You must always provide a valid key when using authentication.
- **Breaking:** Deprecate support for `MODMAIL_VIEWER_ANALYTICS_BASE64` configuration key. Use `MODMAIL_VIEWER_ANALYTICS` with ${base64Decode:}.

### Fixed
31 changes: 31 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## [UNRELEASED] - 2023-8-18

All configuration keys have been changed with the migration of the configuration system.
See below for a list of keys and their new values.

| Previous Key | New Key |
|--------------------------------------------|---------------------------------------------|
| MODMAIL_VIEWER_URL | MODMAIL_VIEWER_APP_URL |
| MODMAIL_VIEWER_MONGODB_URI | MODMAIL_VIEWER_APP_MONGODB_URI |
| MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_ID | MODMAIL_VIEWER_APP_DISCORD_CLIENT_ID |
| MODMAIL_VIEWER_DISCORD_OAUTH_CLIENT_SECRET | MODMAIL_VIEWER_APP_DISCORD_CLIENT_SECRET |
| MODMAIL_VIEWER_DISCORD_GUILD_ID | MODMAIL_VIEWER_APP_DISCORD_GUILD_ID |
| MODMAIL_VIEWER_SECRETKEY | MODMAIL_VIEWER_APP_AUTH_SECRETKEY |
| MODMAIL_VIEWER_DEV | MODMAIL_VIEWER_APP_DEV |
| MODMAIL_VIEWER_AUTH_ENABLED | MODMAIL_VIEWER_APP_AUTH_ENABLED |
| MODMAIL_VIEWER_SSL | MODMAIL_VIEWER_APP_SSL_ENABLED |
| MODMAIL_VIEWER_HTTPS_ONLY | MODMAIL_VIEWER_APP_SSL_HTTPS_ONLY |
| MODMAIL_VIEWER_SSL_CERT | MODMAIL_VIEWER_APP_SSL_CERT |
| MODMAIL_VIEWER_SSL_KEY | MODMAIL_VIEWER_APP_SSL_KEY |
| MODMAIL_VIEWER_HTTP_PORT | MODMAIL_VIEWER_APP_PORT_HTTP |
| MODMAIL_VIEWER_HTTPS_PORT | MODMAIL_VIEWER_APP_PORT_HTTPS |
| MODMAIL_VIEWER_SNI | MODMAIL_VIEWER_APP_SSL_SNI |
| MODMAIL_VIEWER_STS | MODMAIL_VIEWER_APP_SSL_STS |
| MODMAIL_VIEWER_INSECURE | MODMAIL_VIEWER_APP_SECURE_COOKIES |
| MODMAIL_VIEWER_BRANDING | **AWAITING MIGRATION** |
| MODMAIL_VIEWER_LOG_LEVEL | **NO CHANGE** |
| MODMAIL_VIEWER_ANALYTICS | **AWAITING MIGRATION** |
| MODMAIL_VIEWER_ANALYTICS_BASE64 | **DEPRECATED** |
| MODMAIL_VIEWER_BOT_ID | MODMAIL_VIEWER_APP_BOT_ID |
| MODMAIL_VIEWER_CSP | MODMAIL_VIEWER_APP_CSP_OVERRIDE |
| MODMAIL_VIEWER_CSP_SCRIPT_SRC_ELEM_EXTRA | MODMAIL_VIEWER_APP_CSP_EXTRA_SCRIPT_SOURCES |
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ dependencies {
implementation platform(libs.okhttp.bom)
implementation libs.okhttp

implementation(libs.gestalt)

testImplementation libs.junit.jupiter.api
testRuntimeOnly libs.junit.jupiter.engine
testImplementation libs.junit.jupiter.params
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ okhttp = "4.10.0"
mongodriver = "4.8.2"
mongojack = "4.8.0"
owasp-encoder = "1.2.3"
gestalt = "0.24.3"

bootstrap = "5.3.0"
bootstrap-icons = "1.10.3"
Expand Down Expand Up @@ -67,6 +68,8 @@ okhttp = { module = "com.squareup.okhttp3:okhttp" }

owasp-encoder = { module = "org.owasp.encoder:encoder", version.ref = "owasp-encoder" }

gestalt = { module = "com.github.gestalt-config:gestalt-core", version.ref = "gestalt" }

webjar-bootstrap = { module = "org.webjars.npm:bootstrap", version.ref = "bootstrap" }
webjar-bootstrap-icons = { module = "org.webjars.npm:bootstrap-icons", version.ref = "bootstrap-icons" }
webjar-highlightjs = { module = "org.webjars.npm:highlightjs__cdn-assets", version.ref = "highlightjs" }
Expand Down
203 changes: 0 additions & 203 deletions src/main/java/com/github/khakers/modmailviewer/Config.java

This file was deleted.

Loading

0 comments on commit a644593

Please sign in to comment.