From 7355cdb888e9605ecf533956b529e7760e284061 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 22 Oct 2020 21:00:32 +0200 Subject: [PATCH] Add docs for Decidim middleware and DB migration --- doc/applications/decidim.rst | 26 ++++++++++++++++++++++++++ doc/applications/index.rst | 1 + 2 files changed, 27 insertions(+) create mode 100644 doc/applications/decidim.rst diff --git a/doc/applications/decidim.rst b/doc/applications/decidim.rst new file mode 100644 index 0000000..1975c09 --- /dev/null +++ b/doc/applications/decidim.rst @@ -0,0 +1,26 @@ +Decidim +======= + +Overview +-------- + +Decidim is a participatory democracy platform for cities and organizations. Decidim is written and runs on Ruby 2.6, where it is installed as Ruby Gem. Incoming HTTP requests are handled via passenger nginx plugin. + +Upstream URL: https://github.com/decidim/decidim + +Passenger nginx plugin +---------------------- + +The passenger plugin work as application proxy between HTTP server and Ruby on Rails applications. Nginix doesn't have modules API like Apache does, so all nginx module must be present at compile time and only then they can be loaded and unloaded at runtime. Passenger plugin is not present in the standard Alpine nginx packages, therefore for passenger to work, a custom version of nginx including the passenger plugin needs to be compiled. Passenger sources contain ``passenger-install-nginx-module`` script which eases and semi-automates the compilation. + +Database upgrades +----------------- + +Decidim creates a series of database migration scripts under ``db/migrate`` directory. Unfortunately, these script are not created deterministically as their file names are always created with current build's timestamp. The same script using the same Decidim version therefore always ends up with different database migration scripts. Newly added scripts in a new version of Decidim are not sorted at the end, so it's impossible to determine which scripts need to applied from the filenames alone. + +During manual upgrade, the workaround is to compare the directories between the old and the new image, stripping the timestamp and running only the scripts which don't exist in the old directory, however this is impossible to be done during automatic upgrade, as the old image is removed before the upgrade script is executed. + +Additional site creation +------------------------ + +Decidim allows to create managed sites using the superadmin interface on ``https:///system/``. The sites require their own (sub)domains, therefore some additional considerations must be taken when setting up HTTP reverse proxies and TLS certificates. diff --git a/doc/applications/index.rst b/doc/applications/index.rst index c65e880..94f2ab8 100644 --- a/doc/applications/index.rst +++ b/doc/applications/index.rst @@ -9,6 +9,7 @@ Applications and containers map-services ckan crisiscleanup + decidim frontlinesms kanboard opendatakit