@@ -49,7 +49,7 @@ func initHTTPHandlers(e *echo.Echo, a *App) {
4949
5050 // On no-auth, redirect to login page
5151 if _ , ok := u .(* echo.HTTPError ); ok {
52- u , _ := url .Parse (a .constants .LoginURL )
52+ u , _ := url .Parse (a .urlCfg .LoginURL )
5353 q := url.Values {}
5454 q .Set ("next" , c .Request ().RequestURI )
5555 u .RawQuery = q .Encode ()
@@ -197,7 +197,7 @@ func initHTTPHandlers(e *echo.Echo, a *App) {
197197 g .PUT ("/api/roles/lists/:id" , pm (a .UpdateListRole , "roles:manage" ))
198198 g .DELETE ("/api/roles/:id" , pm (a .DeleteRole , "roles:manage" ))
199199
200- if a .constants .BounceWebhooksEnabled {
200+ if a .cfg .BounceWebhooksEnabled {
201201 // Private authenticated bounce endpoint.
202202 g .POST ("/webhooks/bounce" , pm (a .BounceWebhook , "webhooks:post_bounce" ))
203203 }
@@ -209,7 +209,7 @@ func initHTTPHandlers(e *echo.Echo, a *App) {
209209 // Public unauthenticated endpoints.
210210 g := e .Group ("" )
211211
212- if a .constants .BounceWebhooksEnabled {
212+ if a .cfg .BounceWebhooksEnabled {
213213 // Public bounce endpoints for webservices like SES.
214214 g .POST ("/webhooks/service/:service" , a .BounceWebhook )
215215 }
@@ -223,15 +223,15 @@ func initHTTPHandlers(e *echo.Echo, a *App) {
223223 g .GET (path .Join (uriAdmin , "/login" ), a .LoginPage )
224224 g .POST (path .Join (uriAdmin , "/login" ), a .LoginPage )
225225
226- if a .constants .Security .OIDC .Enabled {
226+ if a .cfg .Security .OIDC .Enabled {
227227 g .POST ("/auth/oidc" , a .OIDCLogin )
228228 g .GET ("/auth/oidc" , a .OIDCFinish )
229229 }
230230
231231 // Public APIs.
232232 g .GET ("/api/public/lists" , a .GetPublicLists )
233233 g .POST ("/api/public/subscription" , a .PublicSubscription )
234- if a .constants .EnablePublicArchive {
234+ if a .cfg .EnablePublicArchive {
235235 g .GET ("/api/public/archive" , a .GetCampaignArchives )
236236 }
237237
@@ -249,7 +249,7 @@ func initHTTPHandlers(e *echo.Echo, a *App) {
249249 g .GET ("/campaign/:campUUID/:subUUID" , noIndex (validateUUID (a .ViewCampaignMessage , "campUUID" , "subUUID" )))
250250 g .GET ("/campaign/:campUUID/:subUUID/px.png" , noIndex (validateUUID (a .RegisterCampaignView , "campUUID" , "subUUID" )))
251251
252- if a .constants .EnablePublicArchive {
252+ if a .cfg .EnablePublicArchive {
253253 g .GET ("/archive" , a .CampaignArchivesPage )
254254 g .GET ("/archive.xml" , a .GetCampaignArchivesFeed )
255255 g .GET ("/archive/:id" , a .CampaignArchivePage )
@@ -283,7 +283,7 @@ func (a *App) AdminPage(c echo.Context) error {
283283 return echo .NewHTTPError (http .StatusInternalServerError , err .Error ())
284284 }
285285
286- b = bytes .ReplaceAll (b , []byte ("asset_version" ), []byte (a .constants .AssetVersion ))
286+ b = bytes .ReplaceAll (b , []byte ("asset_version" ), []byte (a .cfg .AssetVersion ))
287287
288288 return c .HTMLBlob (http .StatusOK , b )
289289}
@@ -306,19 +306,19 @@ func serveCustomAppearance(name string) echo.HandlerFunc {
306306
307307 switch name {
308308 case "admin.custom_css" :
309- out = app .constants .Appearance .AdminCSS
309+ out = app .cfg .Appearance .AdminCSS
310310 hdr = "text/css; charset=utf-8"
311311
312312 case "admin.custom_js" :
313- out = app .constants .Appearance .AdminJS
313+ out = app .cfg .Appearance .AdminJS
314314 hdr = "application/javascript; charset=utf-8"
315315
316316 case "public.custom_css" :
317- out = app .constants .Appearance .PublicCSS
317+ out = app .cfg .Appearance .PublicCSS
318318 hdr = "text/css; charset=utf-8"
319319
320320 case "public.custom_js" :
321- out = app .constants .Appearance .PublicJS
321+ out = app .cfg .Appearance .PublicJS
322322 hdr = "application/javascript; charset=utf-8"
323323 }
324324
0 commit comments