diff --git a/debian/config.exs.tpl b/debian/config.exs.tpl index 2b1ed8aa..4af9cb30 100644 --- a/debian/config.exs.tpl +++ b/debian/config.exs.tpl @@ -33,3 +33,27 @@ config :mobilizon, Mobilizon.Storage.Repo, hostname: "__DB_HOST__", port: "5432", pool_size: 10 + +config :geolix, + databases: [ + %{ + id: :city, + adapter: Geolix.Adapter.MMDB2, + source: "/var/lib/mobilizon/geo_db/GeoLite2-City.mmdb" + } + ] + +config :mobilizon, Mobilizon.Web.Upload.Uploader.Local, + uploads: System.get_env("MOBILIZON_UPLOADS", "/var/lib/mobilizon/uploads") + +config :mobilizon, :exports, + path: System.get_env("MOBILIZON_UPLOADS_EXPORTS", "/var/lib/mobilizon/uploads/exports"), + formats: [ + Mobilizon.Service.Export.Participants.CSV, + Mobilizon.Service.Export.Participants.PDF, + Mobilizon.Service.Export.Participants.ODS + ] + +config :tz_world, + data_dir: System.get_env("MOBILIZON_TIMEZONES_DIR", "/var/lib/mobilizon/timezones") +config :tzdata, :data_dir, System.get_env("MOBILIZON_TZDATA_DIR", "/var/lib/mobilizon/tzdata") diff --git a/debian/dirs b/debian/dirs index 081ac7fa..26cf6f33 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,3 +1,11 @@ etc/mobilizon usr/share/mobilizon var/lib/mobilizon +var/lib/mobilizon/geo_db +var/lib/mobilizon/sitemap +var/lib/mobilizon/timezones +var/lib/mobilizon/tzdata +var/lib/mobilizon/uploads +var/lib/mobilizon/uploads/csv +var/lib/mobilizon/uploads/pdf +var/lib/mobilizon/uploads/ods diff --git a/debian/postinst b/debian/postinst index 3de0d463..014d136c 100644 --- a/debian/postinst +++ b/debian/postinst @@ -48,6 +48,13 @@ case "$1" in mv /etc/mobilizon/config.exs.tmp /etc/mobilizon/config.exs fi + # Set permissions + chown -R mobilizon: /var/lib/mobilizon/geo_db + chown -R mobilizon: /var/lib/mobilizon/sitemap + chown -R mobilizon: /var/lib/mobilizon/timezones + chown -R mobilizon: /var/lib/mobilizon/tzdata + chown -R mobilizon: /var/lib/mobilizon/uploads + # Initialize/update database schema /usr/bin/mobilizon_ctl migrate ;;