mirror of
https://github.com/versia-pub/versia-go.git
synced 2025-12-06 06:28:18 +01:00
refactor!: prefix instance configuration settings with VERSIA_
This commit is contained in:
parent
106a20a922
commit
3acb3caad1
6
.env
6
.env
|
|
@ -3,9 +3,9 @@ VERSIA_PORT=8443
|
||||||
#VERSIA_TLS_KEY=
|
#VERSIA_TLS_KEY=
|
||||||
#VERSIA_TLS_CERT=
|
#VERSIA_TLS_CERT=
|
||||||
|
|
||||||
PUBLIC_ADDRESS=https://localhost
|
VERSIA_INSTANCE_ADDRESS=https://localhost
|
||||||
INSTANCE_NAME=lysand-test
|
VERSIA_INSTANCE_NAME=lysand-test
|
||||||
INSTANCE_DESCRIPTION=Versia-Go Instance
|
VERSIA_INSTANCE_DESCRIPTION=Versia-Go Instance
|
||||||
|
|
||||||
NATS_URI=nats://localhost:4222
|
NATS_URI=nats://localhost:4222
|
||||||
NATS_STREAM_NAME=versia-go
|
NATS_STREAM_NAME=versia-go
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ services:
|
||||||
target: /app/test.db
|
target: /app/test.db
|
||||||
environment:
|
environment:
|
||||||
VERSIA_PORT: 8080
|
VERSIA_PORT: 8080
|
||||||
|
VERSIA_INSTANCE_ADDRESS: https://lysand-test.i.devminer.xyz:8080
|
||||||
NATS_URI: nats://nats:4222
|
NATS_URI: nats://nats:4222
|
||||||
PUBLIC_ADDRESS: https://lysand-test.i.devminer.xyz:8080
|
|
||||||
NATS_STREAM_NAME: versia-go-1
|
NATS_STREAM_NAME: versia-go-1
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
|
|
@ -45,8 +45,8 @@ services:
|
||||||
target: /app/test.db
|
target: /app/test.db
|
||||||
environment:
|
environment:
|
||||||
VERSIA_PORT: 8081
|
VERSIA_PORT: 8081
|
||||||
|
VERSIA_INSTANCE_ADDRESS: https://lysand-test-2.i.devminer.xyz:8081
|
||||||
NATS_URI: nats://nats:4222
|
NATS_URI: nats://nats:4222
|
||||||
PUBLIC_ADDRESS: https://lysand-test-2.i.devminer.xyz:8081
|
|
||||||
NATS_STREAM_NAME: versia-go-2
|
NATS_STREAM_NAME: versia-go-2
|
||||||
ports:
|
ports:
|
||||||
- "8081:8081"
|
- "8081:8081"
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,9 @@ func Load() {
|
||||||
log.Warn().Err(err).Msg("Failed to load .env file")
|
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 {
|
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
|
var forwardTracesTo *regexp.Regexp
|
||||||
|
|
@ -66,8 +66,8 @@ func Load() {
|
||||||
Host: publicAddress.Host,
|
Host: publicAddress.Host,
|
||||||
SharedInboxURL: publicAddress.ResolveReference(&url.URL{Path: "/api/inbox"}),
|
SharedInboxURL: publicAddress.ResolveReference(&url.URL{Path: "/api/inbox"}),
|
||||||
|
|
||||||
InstanceName: os.Getenv("INSTANCE_NAME"),
|
InstanceName: os.Getenv("VERSIA_INSTANCE_NAME"),
|
||||||
InstanceDescription: optionalEnvStr("INSTANCE_DESCRIPTION"),
|
InstanceDescription: optionalEnvStr("VERSIA_INSTANCE_DESCRIPTION"),
|
||||||
|
|
||||||
NATSURI: os.Getenv("NATS_URI"),
|
NATSURI: os.Getenv("NATS_URI"),
|
||||||
NATSStreamName: getEnvStr("NATS_STREAM_NAME", "versia-go"),
|
NATSStreamName: getEnvStr("NATS_STREAM_NAME", "versia-go"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue