Skip to content

Instantly share code, notes, and snippets.

@Philhil
Last active March 6, 2021 11:59
Show Gist options
  • Save Philhil/7f40a35772f5d1f34131cb48bc2b18a9 to your computer and use it in GitHub Desktop.
Save Philhil/7f40a35772f5d1f34131cb48bc2b18a9 to your computer and use it in GitHub Desktop.
Openslides HowTo

OpenSlides Setup Howto

Setup a OpenSlides 3.3 instance on Debian10 with https nginx reverse proxy and LetsEncrypt Cert:

Prerequirements

apt update

apt install htop

Some system basic safety things

apt install fail2ban

openslides requirements

sudo apt install apt-transport-https ca-certificates curl gnupg

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

apt install docker-ce docker-ce-cli containerd.io

Setup Reverseproxy (nginx)

apt install nginx

Configure nginx:

nano /etc/nginx/sites-enabled/default

server {
    server_name openslides.domainname.de os.domainname.de;

    location /ws {
            proxy_pass http://localhost:8000/ws;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
    }

    location /apps {
            proxy_pass http://localhost:8000;
    }
    location /media {
            proxy_pass http://localhost:8000;
    }
    location /rest {
            proxy_pass http://localhost:8000;
    }

    location / {
            proxy_pass http://localhost:8000;
    }
}

Certbot / LetsEncrypt: enter link description here

apt install snapd

snap install core; sudo snap refresh core

apt remove certbot

snap install --classic certbot

ln -s /snap/bin/certbot /usr/bin/certbot

Get Cert:

certbot --nginx

Setup openslides

install

Quelle: https://github.com/OpenSlides/OpenSlides/tree/3.3

git clone --branch 3.3 https://github.com/OpenSlides/OpenSlides.git --recurse-submodules

cd OpenSlides/docker/

./build.sh all

printf "DJANGO_SECRET_KEY='%s'\n" "$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 64)" > secrets/django.env

cp secrets/adminsecret.env.example secrets/adminsecret.env

nano secrets/adminsecret.env

EXTERNAL_HTTP_PORT=8000 m4 docker-compose.yml.m4 > docker-compose.yml

docker-compose up -d

docker-compose logs

configuration

There are a bunch of configuration possible:

nano docker-compose.yml

  • DEFAULT_FROM_EMAIL:
  • EMAIL_HOST:
  • EMAIL_HOST_PASSWORD:
  • EMAIL_HOST_USER: ""
  • EMAIL_PORT: 587
  • EMAIL_USE_SSL: ""
  • EMAIL_USE_TLS: "True" EMAIL_USE_TLS/EMAIL_USE_SSL are mutually exclusive, so only set one of those settings to True.
  • ENABLE_ELECTRONIC_VOTING: "True"
  • INSTANCE_DOMAIN: "https://domain.de"

Backup and Restore

tbd...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment