diff --git a/.gitignore b/.gitignore index 5d85b55..af44591 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ go.work vendor/ ./bot-telegram tg-bot-token.txt +*.pem +*.key diff --git a/config/config.go b/config/config.go index a45a21a..2f3df2d 100644 --- a/config/config.go +++ b/config/config.go @@ -7,7 +7,7 @@ import ( type Config struct { Api struct { Host string `envconfig:"API_HOST" default:"demo.awakari.cloud" required:"true"` - Path string `envconfig:"API_PATH" default:"/webhook" required:"true"` + Path string `envconfig:"API_PATH" default:"/" required:"true"` Port uint16 `envconfig:"API_PORT" default:"8080" required:"true"` Token string `envconfig:"API_TOKEN" required:"true"` } diff --git a/helm/bot-telegram/templates/deployment.yaml b/helm/bot-telegram/templates/deployment.yaml index e971ee6..7b1c3f0 100644 --- a/helm/bot-telegram/templates/deployment.yaml +++ b/helm/bot-telegram/templates/deployment.yaml @@ -69,7 +69,7 @@ spec: volumes: - name: server-cert secret: - secretName: secret-api-tls-server + secretName: secret-bot-telegram-tls-server items: - key: tls.crt path: tls.crt diff --git a/helm/bot-telegram/values-demo-0.yaml b/helm/bot-telegram/values-demo-0.yaml index 3297fc2..7f42984 100644 --- a/helm/bot-telegram/values-demo-0.yaml +++ b/helm/bot-telegram/values-demo-0.yaml @@ -5,6 +5,6 @@ ingress: - path: / pathType: ImplementationSpecific tls: - - secretName: secret-api-tls-server + - secretName: secret-bot-telegram-tls-server hosts: - demo.tgbot.awakari.cloud diff --git a/helm/bot-telegram/values.yaml b/helm/bot-telegram/values.yaml index 8e4e2a2..9e3c68c 100644 --- a/helm/bot-telegram/values.yaml +++ b/helm/bot-telegram/values.yaml @@ -56,10 +56,8 @@ ingress: paths: - path: / pathType: ImplementationSpecific - tlsCa: - secretName: secret-api-tls-ca tls: - - secretName: secret-api-tls-server + - secretName: secret-bot-telegram-tls-server hosts: - bot-telegram.local diff --git a/main.go b/main.go index 79a82a9..a70a014 100644 --- a/main.go +++ b/main.go @@ -52,6 +52,7 @@ func main() { if info.LastErrorDate != 0 { panic(err) } + log.Info(fmt.Sprintf("Webhook listen path: %s", cfg.Api.Path)) chUpdates := bot.ListenForWebhook(cfg.Api.Path) // http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { @@ -61,6 +62,7 @@ func main() { // go http.ListenAndServe(fmt.Sprintf("0.0.0.0:%d", cfg.Api.Port), nil) // + log.Info("Start processing updates...") for update := range chUpdates { log.Info(fmt.Sprintf("%+v\n", update)) }