mirror of
https://github.com/mxpv/podsync.git
synced 2024-05-11 05:55:04 +00:00
Add webhooks secret configuration key
This commit is contained in:
@@ -14,6 +14,7 @@ services:
|
||||
- PATREON_CLIENT_ID={PATREON_CLIENT_ID}
|
||||
- PATREON_SECRET={PATREON_SECRET}
|
||||
- PATREON_REDIRECT_URL=https://podsync.net/patreon
|
||||
- PATREON_WEBHOOKS_SECRET={PATREON_WEBHOOKS_SECRET}
|
||||
- COOKIE_SECRET={COOKIE_SECRET}
|
||||
ytdl:
|
||||
image: gcr.io/pod-sync/ytdl:latest
|
||||
|
@@ -14,6 +14,7 @@ type AppConfig struct {
|
||||
PatreonClientId string `yaml:"patreonClientId"`
|
||||
PatreonSecret string `yaml:"patreonSecret"`
|
||||
PatreonRedirectURL string `yaml:"patreonRedirectUrl"`
|
||||
PatreonWebhooksSecret string `json:"patreonWebhooksSecret"`
|
||||
PostgresConnectionURL string `yaml:"postgresConnectionUrl"`
|
||||
RedisURL string `yaml:"redisUrl"`
|
||||
CookieSecret string `yaml:"cookieSecret"`
|
||||
@@ -38,6 +39,7 @@ func ReadConfiguration() (cfg *AppConfig, err error) {
|
||||
"patreonClientId": "PATREON_CLIENT_ID",
|
||||
"patreonSecret": "PATREON_SECRET",
|
||||
"patreonRedirectUrl": "PATREON_REDIRECT_URL",
|
||||
"patreonWebhooksSecret": "PATREON_WEBHOOKS_SECRET",
|
||||
"postgresConnectionUrl": "POSTGRES_CONNECTION_URL",
|
||||
"redisUrl": "REDIS_CONNECTION_URL",
|
||||
"cookieSecret": "COOKIE_SECRET",
|
||||
|
@@ -19,6 +19,7 @@ cookieSecret: "6"
|
||||
patreonRedirectUrl: "7"
|
||||
assetsPath: "8"
|
||||
templatesPath: "9"
|
||||
patreonWebhooksSecret: "10"
|
||||
`
|
||||
|
||||
func TestReadYaml(t *testing.T) {
|
||||
@@ -40,6 +41,7 @@ func TestReadYaml(t *testing.T) {
|
||||
require.Equal(t, "7", cfg.PatreonRedirectURL)
|
||||
require.Equal(t, "8", cfg.AssetsPath)
|
||||
require.Equal(t, "9", cfg.TemplatesPath)
|
||||
require.Equal(t, "10", cfg.PatreonWebhooksSecret)
|
||||
}
|
||||
|
||||
func TestReadEnv(t *testing.T) {
|
||||
@@ -55,6 +57,7 @@ func TestReadEnv(t *testing.T) {
|
||||
os.Setenv("PATREON_REDIRECT_URL", "77")
|
||||
os.Setenv("ASSETS_PATH", "88")
|
||||
os.Setenv("TEMPLATES_PATH", "99")
|
||||
os.Setenv("PATREON_WEBHOOKS_SECRET", "1010")
|
||||
|
||||
cfg, err := ReadConfiguration()
|
||||
require.NoError(t, err)
|
||||
@@ -68,4 +71,5 @@ func TestReadEnv(t *testing.T) {
|
||||
require.Equal(t, "77", cfg.PatreonRedirectURL)
|
||||
require.Equal(t, "88", cfg.AssetsPath)
|
||||
require.Equal(t, "99", cfg.TemplatesPath)
|
||||
require.Equal(t, "1010", cfg.PatreonWebhooksSecret)
|
||||
}
|
||||
|
Reference in New Issue
Block a user