Skip to content

Commit

Permalink
Add Viper default configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcamou committed Nov 29, 2024
1 parent 46a177c commit 7c34cd9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
6 changes: 6 additions & 0 deletions pkg/config/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ func (c *AppConfig) setDefaultConfig() {
viper.SetDefault(PrivKeyFile, DefaultPrivKeyFile)

viper.SetDefault(APIEnabled, false)

viper.SetDefault(ProxyEnabled, true)
viper.SetDefault(ProxyListenAddr, "127.0.0.1")
viper.SetDefault(ProxyListenPort, "8888")
// TODO What is the default Cosmos port?
viper.SetDefault(ProxyTargetPort, "8080")

Check warning on line 140 in pkg/config/app.go

View check run for this annotation

Codecov / codecov/patch

pkg/config/app.go#L135-L140

Added lines #L135 - L140 were not covered by tests
}

// setFileConfig loads configuration from a YAML file.
Expand Down
26 changes: 15 additions & 11 deletions pkg/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ const (
BlockTopic = "blockTopic"
Rendezvous = "masa-mdns"
PageSize = 25
DefaultPrivKeyFile = "masa_oracle_key"

TwitterUsername = "TWITTER_USERNAME"
TwitterPassword = "TWITTER_PASSWORD"
Twitter2FaCode = "TWITTER_2FA_CODE"
DiscordBotToken = "DISCORD_BOT_TOKEN"
TwitterScraper = "TWITTER_SCRAPER"
DiscordScraper = "DISCORD_SCRAPER"
TelegramScraper = "TELEGRAM_SCRAPER"
WebScraper = "WEB_SCRAPER"
APIEnabled = "API_ENABLED"
ProxyEnabled = "PROXY_ENABLED"
DefaultPrivKeyFile = "masa_oracle_key"
TwitterUsername = "TWITTER_USERNAME"
TwitterPassword = "TWITTER_PASSWORD"
Twitter2FaCode = "TWITTER_2FA_CODE"
DiscordBotToken = "DISCORD_BOT_TOKEN"
TwitterScraper = "TWITTER_SCRAPER"
DiscordScraper = "DISCORD_SCRAPER"
TelegramScraper = "TELEGRAM_SCRAPER"
WebScraper = "WEB_SCRAPER"
APIEnabled = "API_ENABLED"

ProxyEnabled = "PROXY_ENABLED"
ProxyListenAddr = "PROXY_LISTEN_ADDR"
ProxyListenPort = "PROXY_LISTEN_PORT"
ProxyTargetPort = "PROXY_TARGET_PORT"
)

0 comments on commit 7c34cd9

Please sign in to comment.