fix(sitemap): save generated sitemaps in configurable directory
Previously in priv/static, now by default in production in /var/lib/mobilizon/sitemap and configurable through the $MOBILIZON_SITEMAP_PATH ENV variable Closes #1321 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
13099e0f11
commit
f28109ad50
|
@ -392,6 +392,9 @@ config :mobilizon, Mobilizon.Service.GlobalSearch.SearchMobilizon,
|
|||
|
||||
config :mobilizon, Mobilizon.Service.AntiSpam, service: Mobilizon.Service.AntiSpam.Akismet
|
||||
|
||||
config :mobilizon, Mobilizon.Service.SiteMap,
|
||||
path: System.get_env("MOBILIZON_SITEMAP_PATH", "/var/lib/mobilizon/sitemap")
|
||||
|
||||
# Import environment specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
import_config "#{config_env()}.exs"
|
||||
|
|
|
@ -92,6 +92,9 @@ config :mobilizon, Mobilizon.Web.Upload.Uploader.Local, uploads: "uploads"
|
|||
|
||||
config :mobilizon, :exports, path: "uploads/exports"
|
||||
|
||||
config :mobilizon, Mobilizon.Service.SiteMap,
|
||||
path: System.get_env("MOBILIZON_SITEMAP_PATH", "priv/static")
|
||||
|
||||
config :tz_world, data_dir: "_build/dev/lib/tz_world/priv"
|
||||
|
||||
config :mobilizon, :anonymous,
|
||||
|
|
|
@ -62,6 +62,9 @@ config :mobilizon, Mobilizon.Web.Upload.Uploader.Local, uploads: "test/uploads"
|
|||
|
||||
config :mobilizon, :exports, path: "test/uploads/exports"
|
||||
|
||||
config :mobilizon, Mobilizon.Service.SiteMap,
|
||||
path: System.get_env("MOBILIZON_SITEMAP_PATH", "test/sitemap")
|
||||
|
||||
config :tz_world, data_dir: "_build/test/lib/tz_world/priv"
|
||||
|
||||
config :tesla, Mobilizon.Service.HTTP.ActivityPub,
|
||||
|
|
|
@ -24,7 +24,7 @@ defmodule Mobilizon.Service.SiteMap do
|
|||
|
||||
config = [
|
||||
store: Sitemapper.FileStore,
|
||||
store_config: [path: Application.app_dir(:mobilizon, "priv/static")],
|
||||
store_config: [path: Application.get_env(:mobilizon, __MODULE__) |> get_in([:path])],
|
||||
sitemap_url: Endpoint.url(),
|
||||
gzip: false
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue