Populate /var/lib/mobilizon and update config.exs accordingly

This commit is contained in:
pitchum 2024-03-10 13:15:43 +00:00
parent 8578fd0a73
commit 0bd8396b23
3 changed files with 39 additions and 0 deletions

24
debian/config.exs.tpl vendored
View File

@ -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")

8
debian/dirs vendored
View File

@ -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

7
debian/postinst vendored
View File

@ -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
;;