summaryrefslogtreecommitdiffci
path: root/config
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/config.go17
-rw-r--r--config/config.local.yaml51
-rw-r--r--config/config.prod.yaml58
-rw-r--r--config/config.stage.yaml51
4 files changed, 107 insertions, 70 deletions
diff --git a/config/config.go b/config/config.go
index 784ac38..9185e6a 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 PhotoTypeConfig `json:"StaticStorage" yaml:"staticStorage"`
+ StaticStorage StaticStorageConfig `json:"StaticStorage" yaml:"staticStorage" validate:"required"`
AllowOrigins []string `json:"AllowOrigins" yaml:"allowOrigins"`
}
@@ -237,7 +237,8 @@ type TriggerConfig struct {
}
type MetaConfig struct {
- GoogleSiteVerification string `json:"GoogleSiteVerification" yaml:"googleSiteVerification"`
+ Name string `json:"Name" yaml:"name"`
+ Value string `json:"Value" yaml:"value"`
}
type PhotoStorageConfig struct {
@@ -260,6 +261,16 @@ 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 1822fdc..fefe2e7 100644
--- a/config/config.local.yaml
+++ b/config/config.local.yaml
@@ -5,32 +5,36 @@ endpoint:
listenOn: ":3000"
blogPages:
storage:
- type: b2
+ type: s3
config:
- bucketName: sayana-pages
- region: eu-central-003
+ bucketName: sayauz-pages
+ region: kz1
prefix: "stage-"
- keyID: "${B2_KEY_ID}"
- applicationKey: "${B2_APPLICATION_KEY}"
+ endpoint: "https://storage.yandexcloud.kz"
+ usePathStyle: true
+ accessKeyID: "${S3_ACCESS_KEY_ID}"
+ secretAccessKey: "${S3_SECRET_ACCESS_KEY}"
factGiver:
storage:
- type: b2
+ type: s3
config:
- bucketName: sayana-pages
- region: eu-central-003
+ bucketName: sayauz-pages
+ region: kz1
prefix: ""
- keyID: "${B2_KEY_ID}"
- applicationKey: "${B2_APPLICATION_KEY}"
+ endpoint: "https://storage.yandexcloud.kz"
+ usePathStyle: true
+ accessKeyID: "${S3_ACCESS_KEY_ID}"
+ secretAccessKey: "${S3_SECRET_ACCESS_KEY}"
factsFileName: "facts-*.txt"
localePath: ./locale/
availableLanguages:
- name: ru
alt: Русский
- flag: https://storage.yandexcloud.kz/sayauz-static/flags/ru.svg
+ flag: https://cdn.saya.uz/stats/flags/ru.svg
locFile: localization.ru.yaml
- name: en
alt: English
- flag: https://storage.yandexcloud.kz/sayauz-static/flags/gb.svg
+ flag: https://cdn.saya.uz/stats/flags/gb.svg
locFile: localization.en.yaml
auth:
db:
@@ -52,23 +56,26 @@ mail:
canonicalEndpoint: "http://127.0.0.1:3000"
photoStorage:
full:
- baseUrl: https://storage.yandexcloud.kz/sayauz-photos/%s
+ baseUrl: https://cdn.saya.uz/photos/jpeg-full/%s
webp:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-full/%s.webp
thumbnail1600p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1600/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-1600p/%s.webp
thumbnail1200p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1200/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-1200p/%s.webp
thumbnail800p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp800/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-800p/%s.webp
thumbnail560p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp560/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-560p/%s.webp
thumbnail320p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp320/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-320p/%s.webp
homePageGifs:
- baseUrl: https://storage.yandexcloud.kz/sayauz-static/home-page-gifs/otter-%s.gif
+ baseUrl: https://cdn.saya.uz/stats/home-page-gifs/otter-%s.gif
indexes: ["1", "2", "3"]
staticStorage:
- baseUrl: https://storage.yandexcloud.kz/sayauz-static
+ baseUrl: https://cdn.saya.uz/stats
+ map:
+ baseUrl: https://cdn.saya.uz/map
+ pmTiles: global.pmtiles
allowOrigins:
- - https://storage.yandexcloud.kz
+ - https://cdn.saya.uz
diff --git a/config/config.prod.yaml b/config/config.prod.yaml
index 2daa3ff..6ec00d8 100644
--- a/config/config.prod.yaml
+++ b/config/config.prod.yaml
@@ -6,32 +6,36 @@ endpoint:
chmod: '0666'
blogPages:
storage:
- type: b2
+ type: s3
config:
- bucketName: sayana-pages
- region: eu-central-003
+ bucketName: sayauz-pages
+ region: kz1
prefix: "prod-"
- keyID: "${B2_KEY_ID}"
- applicationKey: "${B2_APPLICATION_KEY}"
+ endpoint: "https://storage.yandexcloud.kz"
+ usePathStyle: true
+ accessKeyID: "${S3_ACCESS_KEY_ID}"
+ secretAccessKey: "${S3_SECRET_ACCESS_KEY}"
factGiver:
storage:
- type: b2
+ type: s3
config:
- bucketName: sayana-pages
- region: eu-central-003
+ bucketName: sayauz-pages
+ region: kz1
prefix: ""
- keyID: "${B2_KEY_ID}"
- applicationKey: "${B2_APPLICATION_KEY}"
+ endpoint: "https://storage.yandexcloud.kz"
+ usePathStyle: true
+ accessKeyID: "${S3_ACCESS_KEY_ID}"
+ secretAccessKey: "${S3_SECRET_ACCESS_KEY}"
factsFileName: "facts-*.txt"
localePath: ./locale/
availableLanguages:
- name: ru
alt: Русский
- flag: https://storage.yandexcloud.kz/sayauz-static/flags/ru.svg
+ flag: https://cdn.saya.uz/stats/flags/ru.svg
locFile: localization.ru.yaml
- name: en
alt: English
- flag: https://storage.yandexcloud.kz/sayauz-static/flags/gb.svg
+ flag: https://cdn.saya.uz/stats/flags/gb.svg
locFile: localization.en.yaml
auth:
db:
@@ -51,26 +55,34 @@ mail:
onNewPost: "0/5 * * * *"
canonicalEndpoint: "https://${FQDN}"
meta:
- googleSiteVerification: "${GOOGLE_SITE_VERIFICATION}"
+ - name: google-site-verification
+ value: "${GOOGLE_SITE_VERIFICATION}"
+ - name: yandex-verification
+ value: "${YANDEX_VERIFICATION}"
+ - name: msvalidate.01
+ value: "${BING_VERIFICATION}"
photoStorage:
full:
- baseUrl: https://storage.yandexcloud.kz/sayauz-photos/%s
+ baseUrl: https://cdn.saya.uz/photos/jpeg-full/%s
webp:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-full/%s.webp
thumbnail1600p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1600/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-1600p/%s.webp
thumbnail1200p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1200/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-1200p/%s.webp
thumbnail800p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp800/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-800p/%s.webp
thumbnail560p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp560/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-560p/%s.webp
thumbnail320p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp320/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-320p/%s.webp
homePageGifs:
- baseUrl: https://storage.yandexcloud.kz/sayauz-static/home-page-gifs/otter-%s.gif
+ baseUrl: https://cdn.saya.uz/stats/home-page-gifs/otter-%s.gif
indexes: ["1", "2", "3"]
staticStorage:
- baseUrl: https://storage.yandexcloud.kz/sayauz-static
+ baseUrl: https://cdn.saya.uz/stats
+ map:
+ baseUrl: https://cdn.saya.uz/map
+ pmTiles: global.pmtiles
allowOrigins:
- - https://storage.yandexcloud.kz
+ - https://cdn.saya.uz
diff --git a/config/config.stage.yaml b/config/config.stage.yaml
index 151bb4a..d8819ca 100644
--- a/config/config.stage.yaml
+++ b/config/config.stage.yaml
@@ -6,32 +6,36 @@ endpoint:
chmod: '0666'
blogPages:
storage:
- type: b2
+ type: s3
config:
- bucketName: sayana-pages
- region: eu-central-003
+ bucketName: sayauz-pages
+ region: kz1
prefix: "stage-"
- keyID: "${B2_KEY_ID}"
- applicationKey: "${B2_APPLICATION_KEY}"
+ endpoint: "https://storage.yandexcloud.kz"
+ usePathStyle: true
+ accessKeyID: "${S3_ACCESS_KEY_ID}"
+ secretAccessKey: "${S3_SECRET_ACCESS_KEY}"
factGiver:
storage:
- type: b2
+ type: s3
config:
- bucketName: sayana-pages
- region: eu-central-003
+ bucketName: sayauz-pages
+ region: kz1
prefix: ""
- keyID: "${B2_KEY_ID}"
- applicationKey: "${B2_APPLICATION_KEY}"
+ endpoint: "https://storage.yandexcloud.kz"
+ usePathStyle: true
+ accessKeyID: "${S3_ACCESS_KEY_ID}"
+ secretAccessKey: "${S3_SECRET_ACCESS_KEY}"
factsFileName: "facts-*.txt"
localePath: ./locale/
availableLanguages:
- name: ru
alt: Русский
- flag: https://storage.yandexcloud.kz/sayauz-static/flags/ru.svg
+ flag: https://cdn.saya.uz/stats/flags/ru.svg
locFile: localization.ru.yaml
- name: en
alt: English
- flag: https://storage.yandexcloud.kz/sayauz-static/flags/gb.svg
+ flag: https://cdn.saya.uz/stats/flags/gb.svg
locFile: localization.en.yaml
auth:
db:
@@ -52,23 +56,26 @@ mail:
canonicalEndpoint: "https://${FQDN}"
photoStorage:
full:
- baseUrl: https://storage.yandexcloud.kz/sayauz-photos/%s
+ baseUrl: https://cdn.saya.uz/photos/jpeg-full/%s
webp:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-full/%s.webp
thumbnail1600p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1600/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-1600p/%s.webp
thumbnail1200p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp1200/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-1200p/%s.webp
thumbnail800p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp800/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-800p/%s.webp
thumbnail560p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp560/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-560p/%s.webp
thumbnail320p:
- baseUrl: https://storage.yandexcloud.kz/sayauz-thumbnails-webp320/%s.webp
+ baseUrl: https://cdn.saya.uz/photos/webp-320p/%s.webp
homePageGifs:
- baseUrl: https://storage.yandexcloud.kz/sayauz-static/home-page-gifs/otter-%s.gif
+ baseUrl: https://cdn.saya.uz/stats/home-page-gifs/otter-%s.gif
indexes: ["1", "2", "3"]
staticStorage:
- baseUrl: https://storage.yandexcloud.kz/sayauz-static
+ baseUrl: https://cdn.saya.uz/stats
+ map:
+ baseUrl: https://cdn.saya.uz/map
+ pmTiles: global.pmtiles
allowOrigins:
- - https://storage.yandexcloud.kz
+ - https://cdn.saya.uz