refactor!: prefix instance configuration settings with VERSIA_

This commit is contained in:
DevMiner 2024-08-24 22:50:43 +02:00
parent 106a20a922
commit 3acb3caad1
3 changed files with 9 additions and 9 deletions

6
.env
View file

@ -3,9 +3,9 @@ VERSIA_PORT=8443
#VERSIA_TLS_KEY=
#VERSIA_TLS_CERT=
PUBLIC_ADDRESS=https://localhost
INSTANCE_NAME=lysand-test
INSTANCE_DESCRIPTION=Versia-Go Instance
VERSIA_INSTANCE_ADDRESS=https://localhost
VERSIA_INSTANCE_NAME=lysand-test
VERSIA_INSTANCE_DESCRIPTION=Versia-Go Instance
NATS_URI=nats://localhost:4222
NATS_STREAM_NAME=versia-go

View file

@ -30,8 +30,8 @@ services:
target: /app/test.db
environment:
VERSIA_PORT: 8080
VERSIA_INSTANCE_ADDRESS: https://lysand-test.i.devminer.xyz:8080
NATS_URI: nats://nats:4222
PUBLIC_ADDRESS: https://lysand-test.i.devminer.xyz:8080
NATS_STREAM_NAME: versia-go-1
ports:
- "8080:8080"
@ -45,8 +45,8 @@ services:
target: /app/test.db
environment:
VERSIA_PORT: 8081
VERSIA_INSTANCE_ADDRESS: https://lysand-test-2.i.devminer.xyz:8081
NATS_URI: nats://nats:4222
PUBLIC_ADDRESS: https://lysand-test-2.i.devminer.xyz:8081
NATS_STREAM_NAME: versia-go-2
ports:
- "8081:8081"

View file

@ -38,9 +38,9 @@ func Load() {
log.Warn().Err(err).Msg("Failed to load .env file")
}
publicAddress, err := url.Parse(os.Getenv("PUBLIC_ADDRESS"))
publicAddress, err := url.Parse(os.Getenv("VERSIA_INSTANCE_ADDRESS"))
if err != nil {
log.Fatal().Err(err).Msg("Failed to parse PUBLIC_ADDRESS")
log.Fatal().Err(err).Msg("Failed to parse VERSIA_INSTANCE_ADDRESS")
}
var forwardTracesTo *regexp.Regexp
@ -66,8 +66,8 @@ func Load() {
Host: publicAddress.Host,
SharedInboxURL: publicAddress.ResolveReference(&url.URL{Path: "/api/inbox"}),
InstanceName: os.Getenv("INSTANCE_NAME"),
InstanceDescription: optionalEnvStr("INSTANCE_DESCRIPTION"),
InstanceName: os.Getenv("VERSIA_INSTANCE_NAME"),
InstanceDescription: optionalEnvStr("VERSIA_INSTANCE_DESCRIPTION"),
NATSURI: os.Getenv("NATS_URI"),
NATSStreamName: getEnvStr("NATS_STREAM_NAME", "versia-go"),