OpenSlides¶
OpenSlides is a free, web-based presentation and assembly system for managing and projecting agenda, motions, and elections of assemblies.
Note
For this guide you should be familiar with the basic concepts of
Python and its package manager pip
License¶
OpenSlides is released under the MIT License.
Prerequisites¶
Your URL needs to be setup:
[isabell@stardust ~]$ uberspace web domain list
isabell.uber.space
[isabell@stardust ~]$
You’ll need your MySQL credentials. Get them with my_print_defaults
:
[isabell@stardust ~]$ my_print_defaults client
--default-character-set=utf8mb4
--user=isabell
--password=MySuperSecretPassword
[isabell@stardust ~]$
Installation¶
Install Python packages¶
Install the OpenSlides Python package:
[isabell@stardust ~]$ pip3.7 install openslides mysqlclient --user
[...]
Running setup.py install for pyrsistent ... done
Running setup.py install for PyPDF2 ... done
Running setup.py install for roman ... done
Running setup.py install for websockets ... done
Running setup.py install for openslides ... done
Running setup.py install for mysqlclient ... done
[...]
[isabell@stardust ~]$
Check if OpenSlides is installed by typing:
[isabell@stardust ~]$ openslides --version
3.3
[isabell@stardust ~]$
Create Database¶
For performance reasons, we will use a MySQL database for storing the OpenSlides data. It is recommended to use an additional database (e.g. isabell_openslides
) instead of the default database.
[isabell@stardust ~]$ mysql --verbose --execute="CREATE DATABASE ${USER}_openslides"
--------------
CREATE DATABASE isabell_openslides
--------------
[isabell@stardust ~]$
Create configuration¶
Run the following command to create the configuration:
[isabell@stardust ~]$ openslides createsettings
Settings created at /home/isabell/.config/openslides/settings.py
[isabell@stardust ~]$
Open the file ~/.config/openslides/settings.py
and replace the existing database configuration (DATABASES
) with the following one:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'isabell_openslides',
'USER': 'isabell',
'PASSWORD': 'MySuperSecretPassword',
'HOST': 'localhost',
'PORT': '',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'",
},
}
}
# This will suppress an error, which already was converted into a warning, see https://code.djangoproject.com/ticket/31144
SILENCED_SYSTEM_CHECKS = ['mysql.E001']
Check the beginning of the guide for your database credentials and replace name, user and password with your database name and database credentials.
Then, we will populate the database by running the following command:
[isabell@stardust ~]$ openslides migrate
Operations to perform:
Apply all migrations: agenda, assignments, auth, contenttypes, core, mediafiles, motions, sessions, topics, users
Running migrations:
Applying contenttypes.0001_initial... OK
[...]
[2021-04-11 20:59:34 +0200] [21317] [INFO] openslides.core.apps [zxnj] Updated config variables
[isabell@stardust ~]$
Create web backend¶
Note
OpenSlides is running on port 8000.
To make the application accessible from the outside, configure a web backend:
[isabell@stardust ~]$ uberspace web backend set / --http --port <port>
Set backend for / to port <port>; please make sure something is listening!
You can always check the status of your backend using "uberspace web backend list".
[isabell@stardust ~]$
Create service¶
You should set up a service that keeps OpenSlides alive while you are gone. We will use daphne
as an ASGI backend server for the OpenSlides application. Create the file ~/etc/services.d/openslides.ini
with the following content:
[program:openslides]
command=daphne -b 0.0.0.0 -p 8000 openslides.asgi:application
autostart=true
autorestart=true
stopsignal=INT
After creating the configuration, tell supervisord to refresh its configuration and start the service:
[isabell@stardust ~]$ supervisorctl reread
SERVICE: available
[isabell@stardust ~]$ supervisorctl update
SERVICE: added process group
[isabell@stardust ~]$ supervisorctl status
SERVICE RUNNING pid 26020, uptime 0:03:14
[isabell@stardust ~]$
If it’s not in state RUNNING, check your configuration.
Access OpenSlides¶
Now point your Browser to your installation URL https://isabell.uber.space
.
Use admin
as username and admin
as password for your first login. You should change this password at https://isabell.uber.space/users/password
immediately after login!
Configuration¶
You can find the configuration file of OpenSlides at ~/.config/openslides/settings.py
. There you can make settings for SMTP, Redis, SAML etc.
Updates¶
Note
Check the update feed regularly to stay informed about the newest version.
Note
Important: An update to version 3.4 and higher of OpenSlides is longer possible!
If there is a new version available, update the following command to update your OpenSlides python package:
[isabell@stardust ~]$ supervisorctl stop openslides
[isabell@stardust ~]$ pip3.7 install --upgrade openslides
[...]
Successfully uninstalled openslides-3.2
Running setup.py install for openslides ... done
Successfully installed openslides-3.3
[...]
[isabell@stardust ~]$ supervisorctl start openslides
[isabell@stardust ~]$
Backup¶
Backup the following directories:
~/.local/share/openslides/
~/.config/openslides/
Additionally, backup the MySQL database:
[isabell@stardust ~]$ mysqldump isabell_openslides | xz - > ~/isabell_openslides.sql.xz
Debugging¶
In case of problems, the log file ~/logs/supervisord.log
is the first point for you.
Moreover, you can adjust the logging of OpenSlides. For example, you can log the outputs to a file. To achieve that, edit the file ~/.config/openslides/settings.py
an replace the existing LOGGING
section with the following one:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'gunicorn': {
'format': '{asctime} [{process:d}] [{levelname}] {name} {message}',
'style': '{',
'datefmt': '[%Y-%m-%d %H:%M:%S %z]',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'gunicorn',
},
'file': {
'class': 'logging.FileHandler',
'filename': '/home/isabell/logs/openslides.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
},
'openslides': {
'handlers': ['file'],
'level': os.getenv('OPENSLIDES_LOG_LEVEL', 'INFO'),
}
},
}
This will log everything to the file /home/isabell/logs/openslides.log
instead being displayed in the console.
Tested with OpenSlides 3.3 and Uberspace 7.9.0.0
Written by: GodMod <godmod@eqdkp-plus.eu>