Add prefix for environment variables

This commit is contained in:
2025-04-26 11:36:21 +03:00
parent 6acd0e7f09
commit a62ef3a243
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ import (
func parseEnv() (*config, error) { func parseEnv() (*config, error) {
c := new(config) c := new(config)
if err := envconfig.Process("", c); err != nil { if err := envconfig.Process(appID, c); err != nil {
return nil, errors.Wrap(err, "failed to parse env") return nil, errors.Wrap(err, "failed to parse env")
} }
return c, nil return c, nil
+2
View File
@@ -11,6 +11,8 @@ import (
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
const appID = "anon3anon"
func main() { func main() {
logger := initLogger() logger := initLogger()
+2 -2
View File
@@ -1,5 +1,5 @@
services: services:
anon3anon: anon3anon:
environment: environment:
TELEGRAM_BOT_TOKEN: 123:ABC ANON3ANON_TELEGRAM_BOT_TOKEN: 123:ABC
OWNER_CHAT_ID: 123 ANON3ANON_OWNER_CHAT_ID: 123