Diffstat (limited to 'config')
| -rw-r--r-- | config/config.go | 18 | ||||
| -rw-r--r-- | config/config.local.yaml | 27 | ||||
| -rw-r--r-- | config/config.prod.yaml | 35 | ||||
| -rw-r--r-- | config/config.stage.yaml | 27 |
4 files changed, 42 insertions, 65 deletions
diff --git a/config/config.go b/config/config.go index 9185e6a..0b1570a 100644 --- a/config/config.go +++ b/config/config.go @@ -20,9 +20,9 @@ type Config struct { Auth AuthConfig `json:"Auth" yaml:"auth" validate:"required"` Mail MailConfig `json:"Mail" yaml:"mail" validate:"required"` CanonicalEndpoint string `json:"CanonicalEndpoint" yaml:"canonicalEndpoint" validate:"required"` - Meta []MetaConfig `json:"Meta" yaml:"meta"` + Meta MetaConfig `json:"Meta" yaml:"meta"` PhotoStorage PhotoStorageConfig `json:"PhotoStorage" yaml:"photoStorage"` - StaticStorage StaticStorageConfig `json:"StaticStorage" yaml:"staticStorage" validate:"required"` + StaticStorage PhotoTypeConfig `json:"StaticStorage" yaml:"staticStorage"` AllowOrigins []string `json:"AllowOrigins" yaml:"allowOrigins"` } @@ -237,8 +237,8 @@ type TriggerConfig struct { } type MetaConfig struct { - Name string `json:"Name" yaml:"name"` - Value string `json:"Value" yaml:"value"` + GoogleSiteVerification string `json:"GoogleSiteVerification" yaml:"googleSiteVerification"` + YandexVerification string `json:"YandexVerification" yaml:"yandexVerification"` } type PhotoStorageConfig struct { @@ -261,16 +261,6 @@ type HomePageGifsConfig struct { Indexes []string `json:"Indexes" yaml:"indexes"` } -type StaticStorageConfig struct { - BaseUrl string `json:"BaseUrl" yaml:"baseUrl" validate:"url,required"` - Map MapStorageConfig `json:"Map" yaml:"map" validate:"required"` -} - -type MapStorageConfig struct { - BaseUrl string `json:"BaseUrl" yaml:"baseUrl" validate:"url,required"` - PMTiles string `json:"PMTiles" yaml:"pmTiles" validate:"required"` -} - func LoadConfig(path string, config *Config) error { fileBytes, err := os.ReadFile(path) if err != nil { diff --git a/config/config.local.yaml b/config/config.local.yaml index fefe2e7..d3e2e33 100644 --- a/config/config.local.yaml +++ b/config/config.local.yaml @@ -30,11 +30,11 @@ localePath: ./locale/ availableLanguages: - name: ru alt: Русский - flag: https://cdn.saya.uz/stats/flags/ru.svg + flag: https://storage.yandexcloud.kz/sayauz-static/flags/ru.svg locFile: localization.ru.yaml - name: en alt: English - flag: https://cdn.saya.uz/stats/flags/gb.svg + flag: https://storage.yandexcloud.kz/sayauz-static/flags/gb.svg locFile: localization.en.yaml auth: db: @@ -56,26 +56,23 @@ mail: canonicalEndpoint: "http://127.0.0.1:3000" photoStorage: full: - baseUrl: https://cdn.saya.uz/photos/jpeg-full/%s + baseUrl: https://storage.yandexcloud.kz/sayauz-photos/%s webp: - baseUrl: https://cdn.saya.uz/photos/webp-full/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp/%s.webp thumbnail1600p: - baseUrl: https://cdn.saya.uz/photos/webp-1600p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1600/%s.webp thumbnail1200p: - baseUrl: https://cdn.saya.uz/photos/webp-1200p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1200/%s.webp thumbnail800p: - baseUrl: https://cdn.saya.uz/photos/webp-800p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp800/%s.webp thumbnail560p: - baseUrl: https://cdn.saya.uz/photos/webp-560p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp560/%s.webp thumbnail320p: - baseUrl: https://cdn.saya.uz/photos/webp-320p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp320/%s.webp homePageGifs: - baseUrl: https://cdn.saya.uz/stats/home-page-gifs/otter-%s.gif + baseUrl: https://storage.yandexcloud.kz/sayauz-static/home-page-gifs/otter-%s.gif indexes: ["1", "2", "3"] staticStorage: - baseUrl: https://cdn.saya.uz/stats - map: - baseUrl: https://cdn.saya.uz/map - pmTiles: global.pmtiles + baseUrl: https://storage.yandexcloud.kz/sayauz-static allowOrigins: - - https://cdn.saya.uz + - https://storage.yandexcloud.kz diff --git a/config/config.prod.yaml b/config/config.prod.yaml index 6ec00d8..e5785f8 100644 --- a/config/config.prod.yaml +++ b/config/config.prod.yaml @@ -31,11 +31,11 @@ localePath: ./locale/ availableLanguages: - name: ru alt: Русский - flag: https://cdn.saya.uz/stats/flags/ru.svg + flag: https://storage.yandexcloud.kz/sayauz-static/flags/ru.svg locFile: localization.ru.yaml - name: en alt: English - flag: https://cdn.saya.uz/stats/flags/gb.svg + flag: https://storage.yandexcloud.kz/sayauz-static/flags/gb.svg locFile: localization.en.yaml auth: db: @@ -55,34 +55,27 @@ mail: onNewPost: "0/5 * * * *" canonicalEndpoint: "https://${FQDN}" meta: - - name: google-site-verification - value: "${GOOGLE_SITE_VERIFICATION}" - - name: yandex-verification - value: "${YANDEX_VERIFICATION}" - - name: msvalidate.01 - value: "${BING_VERIFICATION}" + googleSiteVerification: "${GOOGLE_SITE_VERIFICATION}" + yandexVerification: "${YANDEX_VERIFICATION}" photoStorage: full: - baseUrl: https://cdn.saya.uz/photos/jpeg-full/%s + baseUrl: https://storage.yandexcloud.kz/sayauz-photos/%s webp: - baseUrl: https://cdn.saya.uz/photos/webp-full/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp/%s.webp thumbnail1600p: - baseUrl: https://cdn.saya.uz/photos/webp-1600p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1600/%s.webp thumbnail1200p: - baseUrl: https://cdn.saya.uz/photos/webp-1200p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1200/%s.webp thumbnail800p: - baseUrl: https://cdn.saya.uz/photos/webp-800p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp800/%s.webp thumbnail560p: - baseUrl: https://cdn.saya.uz/photos/webp-560p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp560/%s.webp thumbnail320p: - baseUrl: https://cdn.saya.uz/photos/webp-320p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp320/%s.webp homePageGifs: - baseUrl: https://cdn.saya.uz/stats/home-page-gifs/otter-%s.gif + baseUrl: https://storage.yandexcloud.kz/sayauz-static/home-page-gifs/otter-%s.gif indexes: ["1", "2", "3"] staticStorage: - baseUrl: https://cdn.saya.uz/stats - map: - baseUrl: https://cdn.saya.uz/map - pmTiles: global.pmtiles + baseUrl: https://storage.yandexcloud.kz/sayauz-static allowOrigins: - - https://cdn.saya.uz + - https://storage.yandexcloud.kz diff --git a/config/config.stage.yaml b/config/config.stage.yaml index d8819ca..c2e337b 100644 --- a/config/config.stage.yaml +++ b/config/config.stage.yaml @@ -31,11 +31,11 @@ localePath: ./locale/ availableLanguages: - name: ru alt: Русский - flag: https://cdn.saya.uz/stats/flags/ru.svg + flag: https://storage.yandexcloud.kz/sayauz-static/flags/ru.svg locFile: localization.ru.yaml - name: en alt: English - flag: https://cdn.saya.uz/stats/flags/gb.svg + flag: https://storage.yandexcloud.kz/sayauz-static/flags/gb.svg locFile: localization.en.yaml auth: db: @@ -56,26 +56,23 @@ mail: canonicalEndpoint: "https://${FQDN}" photoStorage: full: - baseUrl: https://cdn.saya.uz/photos/jpeg-full/%s + baseUrl: https://storage.yandexcloud.kz/sayauz-photos/%s webp: - baseUrl: https://cdn.saya.uz/photos/webp-full/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp/%s.webp thumbnail1600p: - baseUrl: https://cdn.saya.uz/photos/webp-1600p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1600/%s.webp thumbnail1200p: - baseUrl: https://cdn.saya.uz/photos/webp-1200p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1200/%s.webp thumbnail800p: - baseUrl: https://cdn.saya.uz/photos/webp-800p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp800/%s.webp thumbnail560p: - baseUrl: https://cdn.saya.uz/photos/webp-560p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp560/%s.webp thumbnail320p: - baseUrl: https://cdn.saya.uz/photos/webp-320p/%s.webp + baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp320/%s.webp homePageGifs: - baseUrl: https://cdn.saya.uz/stats/home-page-gifs/otter-%s.gif + baseUrl: https://storage.yandexcloud.kz/sayauz-static/home-page-gifs/otter-%s.gif indexes: ["1", "2", "3"] staticStorage: - baseUrl: https://cdn.saya.uz/stats - map: - baseUrl: https://cdn.saya.uz/map - pmTiles: global.pmtiles + baseUrl: https://storage.yandexcloud.kz/sayauz-static allowOrigins: - - https://cdn.saya.uz + - https://storage.yandexcloud.kz |