summaryrefslogtreecommitdiff
path: root/testrig/config.go
diff options
context:
space:
mode:
authorLibravatar tobi <tobi.smethurst@protonmail.com>2025-06-13 16:05:00 +0200
committerLibravatar tobi <kipvandenbos@noreply.codeberg.org>2025-06-13 16:05:00 +0200
commit726584287a721d22a0287e62a37e14c81e01b454 (patch)
treec4e054a06b82bf00ca3b4b4d5980b043ea62fe30 /testrig/config.go
parent[chore] upgrade golangci-lint to v2.1.6 and migrate config (#4265) (diff)
downloadgotosocial-726584287a721d22a0287e62a37e14c81e01b454.tar.xz
[bugfix] Remove hardcoded "public" db schema assumption (#4269)
This pull request closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4257 by removing the hardcoded "public" schema assumption in the database migrations. Tested on a local postgres with both the default public schema, and with the connection string (gotosocial schema) mentioned in the issue. Both seem to work OK! Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4269 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>
Diffstat (limited to 'testrig/config.go')
-rw-r--r--testrig/config.go51
1 files changed, 26 insertions, 25 deletions
diff --git a/testrig/config.go b/testrig/config.go
index af2b8d287..8d1c6581d 100644
--- a/testrig/config.go
+++ b/testrig/config.go
@@ -56,31 +56,32 @@ func InitTestConfig() {
func testDefaults() config.Configuration {
return config.Configuration{
- LogLevel: envStr("GTS_LOG_LEVEL", "error"),
- LogTimestampFormat: "02/01/2006 15:04:05.000",
- LogDbQueries: true,
- ApplicationName: "gotosocial",
- LandingPageUser: "",
- ConfigPath: "",
- Host: "localhost:8080",
- AccountDomain: "localhost:8080",
- Protocol: "http",
- BindAddress: "127.0.0.1",
- Port: 8080,
- TrustedProxies: []string{"127.0.0.1/32", "::1"},
- DbType: envStr("GTS_DB_TYPE", "sqlite"),
- DbAddress: envStr("GTS_DB_ADDRESS", ":memory:"),
- DbPort: envInt("GTS_DB_PORT", 0),
- DbUser: envStr("GTS_DB_USER", ""),
- DbPassword: envStr("GTS_DB_PASSWORD", ""),
- DbDatabase: envStr("GTS_DB_DATABASE", ""),
- DbTLSMode: envStr("GTS_DB_TLS_MODE", ""),
- DbTLSCACert: envStr("GTS_DB_TLS_CA_CERT", ""),
- DbMaxOpenConnsMultiplier: 8,
- DbSqliteJournalMode: "WAL",
- DbSqliteSynchronous: "NORMAL",
- DbSqliteCacheSize: 8 * bytesize.MiB,
- DbSqliteBusyTimeout: time.Minute * 5,
+ LogLevel: envStr("GTS_LOG_LEVEL", "error"),
+ LogTimestampFormat: "02/01/2006 15:04:05.000",
+ LogDbQueries: true,
+ ApplicationName: "gotosocial",
+ LandingPageUser: "",
+ ConfigPath: "",
+ Host: "localhost:8080",
+ AccountDomain: "localhost:8080",
+ Protocol: "http",
+ BindAddress: "127.0.0.1",
+ Port: 8080,
+ TrustedProxies: []string{"127.0.0.1/32", "::1"},
+ DbType: envStr("GTS_DB_TYPE", "sqlite"),
+ DbAddress: envStr("GTS_DB_ADDRESS", ":memory:"),
+ DbPort: envInt("GTS_DB_PORT", 0),
+ DbUser: envStr("GTS_DB_USER", ""),
+ DbPassword: envStr("GTS_DB_PASSWORD", ""),
+ DbDatabase: envStr("GTS_DB_DATABASE", ""),
+ DbTLSMode: envStr("GTS_DB_TLS_MODE", ""),
+ DbTLSCACert: envStr("GTS_DB_TLS_CA_CERT", ""),
+ DbPostgresConnectionString: envStr("GTS_DB_POSTGRES_CONNECTION_STRING", ""),
+ DbMaxOpenConnsMultiplier: 8,
+ DbSqliteJournalMode: "WAL",
+ DbSqliteSynchronous: "NORMAL",
+ DbSqliteCacheSize: 8 * bytesize.MiB,
+ DbSqliteBusyTimeout: time.Minute * 5,
WebTemplateBaseDir: "./web/template/",
WebAssetBaseDir: "./web/assets/",