Compare commits

...

9 Commits

11 changed files with 219 additions and 8 deletions

View File

@ -5,8 +5,20 @@
```
git remote add upstream https://framagit.org/framasoft/mobilizon.git
git fetch --all
sudo apt build-dep .
gbp buildpackage
```
## Build a release
export VERSION=4.1.0
git fetch --all
gbp import-ref --merge-mode=replace -u ${VERSION?}
dch --newversion "${VERSION?}-1" "New upstream release"
git commit -m "Start packaging ${VERSION?}" debian/changelog
# ... refresh patches, build, fix problems, build, ....
quilt push -a --refresh ; quilt pop -a ; rm .pc/ -rf
dch --release --distribution stable ""
git commit -m "Release ${VERSION?}-1" debian/changelog
gbp buildpackage

15
debian/changelog vendored
View File

@ -1,9 +1,16 @@
mobilizon (4.0.2-2) UNRELEASED; urgency=medium
mobilizon (4.0.2-2) bookworm; urgency=medium
* fix postinst script
* include wrapper script /bin/mobilizon_ctl
* Execute db migration script in d/postinst
* Include wrapper script /bin/mobilizon_ctl
* Add some docs:
* debian packaring howto
* nginx example config file
* Make Web static files available in /var/lib/mobilizon/priv/static
* Populate /var/lib/mobilizon and update config.exs accordingly
* Move files needed for reverse-proxy in /var/lib/mobilizon/www
* Remove languages having less than 50% of translated strings.
-- pitchum <pitchum@gramaton.org> Wed, 17 Jan 2024 11:45:42 +0000
-- pitchum <pitchum@gramaton.org> Sun, 10 Mar 2024 17:19:05 +0000
mobilizon (4.0.2-1) bookworm; urgency=medium

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

View File

@ -1,2 +1,3 @@
debian/README.Debian.md
debian/README.packaging.md
debian/examples/

78
debian/examples/nginx.conf vendored Normal file
View File

@ -0,0 +1,78 @@
# Example nginx site config for Mobilizon on Debian
#
# Simple installation instructions:
# 1. Install your TLS certificate, possibly using Let's Encrypt.
# 2. Replace 'example.tld' with your instance's domain wherever it appears.
# 3. Copy this file to /etc/nginx/sites-available/ and then add a symlink to it
# in /etc/nginx/sites-enabled/ and run 'nginx -s reload' or restart nginx.
server {
server_name example.tld;
listen 80 default_server;
listen [::]:80 default_server;
# Remove once HTTPS is setup
location ^~ '/.well-known/acme-challenge' {
root /var/www/certbot;
default_type "text/plain";
}
# Uncomment once HTTPS is setup
# return 301 https://$server_name$request_uri;
}
server {
server_name example.tld;
listen 443 ssl http2;
listen [::]:443 ssl http2;
include /etc/nginx/snippets/snakeoil.conf;
# Replace the above line with the following once you have your own certificates
# ssl_trusted_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
# ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
add_header Strict-Transport-Security "max-age=31536000";
# the nginx default is 1m, not enough for large media uploads
client_max_body_size 16m;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
include proxy_params;
location / {
expires off;
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
proxy_pass http://127.0.0.1:4000;
}
# Let's Encrypt keeps its files here
location ^~ '/.well-known/acme-challenge' {
root /var/www/certbot;
default_type "text/plain";
}
location ~ ^/(assets|img) {
root /var/lib/mobilizon/www/static;
access_log off;
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
}
location ~ ^/(media|proxy) {
access_log off;
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
proxy_pass http://127.0.0.1:4000;
}
error_page 500 501 502 503 504 @error;
location @error {
root /var/lib/mobilizon/www/errors;
try_files /error.html 502;
}
}

3
debian/install vendored
View File

@ -1,4 +1,5 @@
debian/config.exs.tpl etc/mobilizon
_build/prod/rel/mobilizon/lib/mobilizon*/* var/lib/mobilizon
_build/prod/rel/mobilizon/lib/mobilizon*/priv/static var/lib/mobilizon/www
_build/prod/rel/mobilizon/lib/mobilizon*/priv/errors var/lib/mobilizon/www
_build/prod/rel/mobilizon usr/share
debian/mobilizon_ctl bin

View File

@ -1,7 +1,7 @@
Index: mobilizon/mix.exs
Index: debianize-mobilizon/mix.exs
===================================================================
--- mobilizon.orig/mix.exs 2024-01-13 15:23:04.911709837 +0000
+++ mobilizon/mix.exs 2024-01-13 15:23:04.907709918 +0000
--- debianize-mobilizon.orig/mix.exs 2024-03-10 16:59:58.067660182 +0000
+++ debianize-mobilizon/mix.exs 2024-03-10 16:59:58.063660257 +0000
@@ -7,7 +7,7 @@
[
app: :mobilizon,

View File

@ -0,0 +1,72 @@
Description: Remove languages with less than 50% of translated strings.
Index: debianize-mobilizon/config/prod.exs
===================================================================
--- debianize-mobilizon.orig/config/prod.exs 2024-03-10 17:10:45.662725338 +0000
+++ debianize-mobilizon/config/prod.exs 2024-03-10 17:10:45.658725422 +0000
@@ -16,30 +16,21 @@
# Load all locales in production
config :mobilizon, :cldr,
locales: [
- "ar",
- "be",
- "bn",
"ca",
"cs",
- "cy",
"de",
"en",
"es",
- "fa",
"fi",
"fr",
"gd",
"gl",
"hr",
"hu",
- "id",
"it",
- "ja",
"nl",
"nn",
"pl",
- "pt",
"ru",
"sv",
- "zh_Hant"
]
Index: debianize-mobilizon/src/i18n/langs.json
===================================================================
--- debianize-mobilizon.orig/src/i18n/langs.json 2024-03-09 11:35:56.402348657 +0000
+++ debianize-mobilizon/src/i18n/langs.json 2024-03-10 17:12:48.164170596 +0000
@@ -1,30 +1,20 @@
{
- "ar": "العربية",
- "bn": "বাংলা",
"ca": "Català",
"cs": "čeština",
- "cy": "Cymraeg",
"de": "Deutsch",
"en": "English",
"es": "Español",
- "fa": "فارسی",
"fi": "suomi",
"fr": "Français",
"gd": "Gàidhlig",
"gl": "Galego",
"hr": "Hrvatski",
"hu": "Magyar",
- "id": "Bahasa Indonesia",
"it": "Italiano",
- "ja": "日本語",
"nl": "Nederlands",
"nn": "Nynorsk",
"oc": "Occitan",
"pl": "Polski",
- "pt_BR": "Português brasileiro",
"ru": "Русский",
- "sl": "Slovenščina",
- "sv": "Svenska",
- "zh_Hans": "简体字",
- "zh_Hant": "繁體字"
+ "sv": "Svenska"
}

View File

@ -1 +1,2 @@
override-elixir-version.path
restrict-supported-l10n.patch

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