diff --git a/.gitignore b/.gitignore index 19c7bd08b..9470a8042 100644 --- a/.gitignore +++ b/.gitignore @@ -1,63 +1,9 @@ -# General +## General *.pyc *.swp *.swo *.log *~ - -# Virtual Environment -.virtualenv*/* -.venv/* - -# Javascript tools and libraries -node_modules/* -bower_components/* - -# OS4-Submodules -/openslides-* - -# OS3+ -/server/ -/haproxy/ - -# Local user data (settings, database, media, search index, static files) -personal_data/* -openslides/static/* -collected-static/* - -# Package building/IDE -docs/_build/* -*.egg-info -build/* -dist/* -debug/* -.DS_Store -.idea -*.code-workspace - -# Unit test and coverage reports -.coverage -tests/file/* -tests/db.sqlite3.test -.pytest_cache - -# Plugin development -openslides_* - -# Mypy cache for typechecking -.mypy_cache - -# OpenSlides 3 Client - -# compiled output -client/dist -client/tmp -client/out-tsc -client/documentation - -# dependencies -client/node_modules - # IDEs and editors /.idea .project @@ -66,13 +12,50 @@ client/node_modules *.launch .settings/ *.sublime-workspace - -# IDE - VSCode .vscode/* +*.code-workspace +# System Files +.DS_Store +Thumbs.db +# Virtual Environment +.virtualenv*/* +.venv/* -# misc +## Compatibility +# OS4-Submodules +/openslides-*/ +# Plugin development +openslides_* + +## Server +# Local user data (settings, database, media, search index, static files) +personal_data/* +server/personal_data/* +server/openslides/static/* +# Unit test and coverage reports +.coverage +server/tests/file/* +server/tests/db.sqlite3.test +.pytest_cache +# Package building +*.egg-info +# Mypy cache for typechecking +.mypy_cache + +## OpenSlides 3 Client +# Javascript tools and libraries +**/node_modules/* +**/bower_components/* +# compiled output +client/dist +client/static +client/tmp +client/out-tsc +# docs +client/documentation Compodoc Compodocmodules +# build artifacts client/.sass-cache client/connect.lock client/coverage @@ -85,8 +68,9 @@ client/yarn.lock package-lock.json client/package-lock.json cypress.json -*-version.txt -# System Files -client/.DS_Store -client/Thumbs.db +## Deployment +# Docker build artifacts +*-version.txt +# secrets +docker/secrets/*.env diff --git a/.travis.yml b/.travis.yml index 172fee17a..dc89cfd38 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ dist: xenial -sudo: true +os: linux cache: - directories: - $HOME/.cache/pip - client/node_modules -matrix: +jobs: include: - stage: "Dependencies" name: "Installing dependencies for python" @@ -15,11 +15,12 @@ matrix: - "3.6" cache: pip: true - install: + before_install: - python --version - - pip install --upgrade setuptools pip - - pip install --upgrade --requirement requirements/development.txt - - pip install --upgrade .[big_mode] + - cd server + install: + - pip install --upgrade pip + - pip install --upgrade --requirement requirements.txt - pip freeze script: skip @@ -36,15 +37,11 @@ matrix: install: - npm install script: skip + - stage: "Run tests" name: "Client: Testing" language: node_js node_js: "12.18" - apt: - sources: - - google-chrome - packages: - - google-chrome-stable services: - xvfb install: @@ -79,36 +76,6 @@ matrix: - cd client - npm run build-debug - - name: "Server: Tests Python 3.6" - language: python - python: - - "3.6" - script: - - mypy openslides/ tests/ - - pytest --cov --cov-fail-under=75 - - - name: "Server: Tests Python 3.7" - language: python - python: - - "3.7" - script: - - flake8 openslides tests - - isort --check-only --diff --recursive openslides tests - - black --check --diff --target-version py36 openslides tests - - mypy openslides/ tests/ - - pytest --cov --cov-fail-under=75 - - - name: "Server: Tests Python 3.8" - language: python - python: - - "3.8" - script: - - flake8 openslides tests - - isort --check-only --diff --recursive openslides tests - - black --check --diff --target-version py36 openslides tests - - mypy openslides/ tests/ - - pytest --cov --cov-fail-under=75 - - name: "Client: Linting" language: node_js node_js: "12.18" @@ -123,13 +90,51 @@ matrix: - cd client - npm run prettify-check + - name: "Server: Tests Python 3.6" + language: python + python: + - "3.6" + before_install: + - cd server + script: + - mypy openslides/ tests/ + - pytest --cov --cov-fail-under=75 + + - name: "Server: Tests Python 3.7" + language: python + python: + - "3.7" + before_install: + - cd server + script: + - flake8 openslides tests + - isort --check-only --diff --recursive openslides tests + - black --check --diff --target-version py36 openslides tests + - mypy openslides/ tests/ + - pytest --cov --cov-fail-under=75 + + - name: "Server: Tests Python 3.8" + language: python + python: + - "3.8" + before_install: + - cd server + script: + - flake8 openslides tests + - isort --check-only --diff --recursive openslides tests + - black --check --diff --target-version py36 openslides tests + - mypy openslides/ tests/ + - pytest --cov --cov-fail-under=75 + - name: "Server: Tests Startup Routine Python 3.7" language: python python: - "3.7" + before_install: + - cd server script: - set -e - python manage.py createsettings - python manage.py migrate - - python manage.py runserver --noreload & (sleep 15 && kill $(ps aux | grep 'manage.py runserver' | head -n -1 | awk '{print $2}')) + - python manage.py runserver --noreload & (sleep 20 && kill $(ps aux | grep 'manage.py runserver' | head -n -1 | awk '{print $2}')) - set +e diff --git a/DEVELOPMENT.rst b/DEVELOPMENT.rst index 6d619818d..3acec6905 100644 --- a/DEVELOPMENT.rst +++ b/DEVELOPMENT.rst @@ -2,12 +2,12 @@ OpenSlides Development ======================== -This instruction helps you to setup a development environment for OpenSlides. +This instruction helps you to setup a development environment for OpenSlides. A +simple dev setup will be configured without the need of the docker-compose +setup. There are only the server running without a cache and a sqlite database +and the client as an development server. -Installation and start of the development version -================================================= - 1. Installation on GNU/Linux or Mac OS X ---------------------------------------- @@ -37,15 +37,30 @@ Clone current master version from `OpenSlides GitHub repository c. Setup a virtual Python environment (optional) '''''''''''''''''''''''''''''''''''''''''''''''' -See step 1. b. in the installation section in the `README.rst -`_. +You can setup a virtual Python environment using the virtual environment +(venv) package for Python to install OpenSlides as non-root user. This will +allow for encapsulated dependencies. They will be installed in the virtual +environment and not globally on your system. +Setup and activate the virtual environment:: -d. Finish the server -'''''''''''''''''''' + $ python3 -m venv .virtualenv + $ source .virtualenv/bin/activate + +You can exit the environment with:: + + $ deactivate + +d. Server +''''''''' + +Go into the server's directory:: + + $ cd server/ Install all required Python packages:: + $ pip install --upgrade setuptools pip $ pip install --requirement requirements.txt Create a settings file, run migrations and start the server:: @@ -54,41 +69,29 @@ Create a settings file, run migrations and start the server:: $ python manage.py migrate $ python manage.py runserver +All you data (database, config, mediafiles) are stored in ``personal_data/var``. To get help on the command line options run:: $ python manage.py --help Later you might want to restart the server with one of the following commands. -To start OpenSlides with this command and to avoid opening new browser windows -run:: +To run the OpenSlides server execute:: - $ python manage.py start --no-browser + $ python manage.py runserver When debugging something email related change the email backend to console:: - $ python manage.py start --debug-email + $ python manage.py runserver --debug-email +The server is available under http://localhost:8000. Especially the rest interface +might be important during development: http://localhost:8000/rest/ (The trailing +slash is important!). -e. Debugging the server -''''''''''''''''''''''' +e. Client +''''''''' -If you wish to have even further debugging, enable `django-extensions -`_ in the ``settings.py`` by adding -``django_extensions`` to the list of ``INSTALLED_PLLUGINS``. Make sure, you -install the following packages:: - - $ pip install Werkzeug pyparsing pydot django-extensions - -You can start the enhanced debugging-server via:: - - $ python manage.py runserver_plus - - -f. Setup and start the client -''''''''''''''''''''''''''''' - -Go in the client's directory in a second command-line interface:: +Go in the client's directory:: $ cd client/ @@ -97,14 +100,7 @@ Install all dependencies and start the development server:: $ npm install $ npm start -Now the client is available under ``localhost:4200``. - -If you want to provide the client statically, you can build it via:: - - $ npm run build - -The build client files are availible from the root directory in -``openslides/static`` and can be provided via NGINX. +After a while, the client is available under http://localhost:4200. 2. Installation on Windows @@ -140,12 +136,6 @@ a. Running server tests To run some server tests see `.travis.yml `_. -You can generate an class-structure image when having `django_extensions` -enabled (see above):: - - $ python manage.py graph_models -a -g -o my_project_visualized.png - - b. Client tests and commands '''''''''''''''''''''''''''' @@ -169,53 +159,23 @@ README.md using following command:: $ npm run licenses -OpenSlides in big mode -====================== +4. Notes for running OpenSlides in larger setups +------------------------------------------------ -To install OpenSlides for big assemblies (in 'big mode') you have to setup some -additional components and configurations. In the 'big mode' you should use a webserver -like NGINX to serve the static and media files as proxy server in front of your OpenSlides -interface server. You should also use a database like PostgreSQL. Use Redis as channels backend, -cache backend and session engine. Finally you should use gunicorn with uvicorn as interface server. +For productive setups refer to the docker-compose setup described in the main +`README`_. +While develpment it might be handy to use a cache and another database. +PostgreSQL is recommended and Redis necessary as a cache. Both can be set up in +the ``settings.py``. Please consider reading the `OpenSlides configuration +`_ page +to find out about all configurations, especially when using OpenSlides for big +assemblies. -1. Install and configure PostgreSQL and Redis ---------------------------------------------- - -Install `PostgreSQL `_ and `Redis -`_. For Ubuntu 18.04 e. g. run:: - - $ sudo apt-get install postgresql libpq-dev redis-server - -Be sure that database and redis server is running. For Ubuntu 18.04 e. g. this -was done automatically if you used the package manager. - -Then add database user and database. For Ubuntu 18.04 e. g. run:: - - $ sudo -u postgres createuser --pwprompt --createdb openslides - $ sudo -u postgres createdb --owner=openslides openslides - - -2. Change OpenSlides settings ------------------------------ - -Create OpenSlides settings file if it does not exist:: - - $ python manage.py createsettings - -Change OpenSlides settings file (usually called settings.py): Setup -`DATABASES` entry as mentioned in the settings file. Set `use_redis` to -`True`. - -Populate your new database:: - - $ python manage.py migrate - - -3. Run OpenSlides ------------------ - -To start Daphne run:: +If you followed the instructions and installed the pip requirements form the +``requirements.py`` all needed dependencies for another worker are installed. +Instead of running ``python manage.py runserver`` you can use daphne or gunicorn +(the latter is used in the prod setup):: $ export DJANGO_SETTINGS_MODULE=settings $ export PYTHONPATH=personal_data/var/ @@ -226,57 +186,3 @@ server:: $ gunicorn -w 4 -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker openslides.asgi:application - -4. Use NGINX (optional) ------------------------ - -When using NGINX as a proxy for delivering static files the performance of the -setup will increase. - -This is an example ``nginx.conf`` configuration for Daphne listing on port -8000:: - - worker_processes 1; - - events { - worker_connections 1024; - } - - http { - server { - listen 80; - server_name localhost; - - root $YOUR_OS_ROOT_FOLDER/openslides/static; - index index.html index.htm; - include /etc/nginx/mime.types; - - client_max_body_size 100M; - - gzip on; - gzip_min_length 1000; - gzip_proxied expired no-cache no-store private auth; - gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; - - location / { - try_files $uri $uri/ /index.html; - } - location /apps { - proxy_pass http://localhost:8000; - } - location /media { - proxy_pass http://localhost:8000; - } - location /rest { - proxy_set_header Host $http_host; - proxy_pass http://localhost:8000; - } - location /ws { - proxy_pass http://localhost:8000; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - } - - } - } diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 317031865..000000000 --- a/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM python:3.7-slim - -RUN mkdir /app - -RUN apt -y update && \ - apt -y upgrade && \ - apt install -y libpq-dev curl wget xz-utils bzip2 git gcc gnupg2 make g++ -RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - -RUN apt -y install nodejs -RUN npm install -g @angular/cli@latest -RUN useradd -m openslides -RUN chown -R openslides /app -WORKDIR /app -COPY . /app -RUN rm -rf /app/.virtualenv* && \ - rm -rf /app/client/node_modules -RUN chown -R openslides /app - -# Installing python dependencies -RUN pip install -r requirements.txt -RUN rm -rf /var/lib/apt/lists/* - -# installing client -USER openslides -RUN ng config -g cli.warnings.versionMismatch false && \ - cd client && \ - npm install -RUN cd client && \ - npm run build && \ - ./node_modules/.bin/compodoc -t -p src/tsconfig.app.json -n 'OpenSlides Documentation' -d ../openslides/static/doc -e html diff --git a/README.rst b/README.rst index 7aaeda0d1..41df8ea9c 100644 --- a/README.rst +++ b/README.rst @@ -9,167 +9,62 @@ OpenSlides is a free, web based presentation and assembly system for managing and projecting agenda, motions and elections of an assembly. See https://openslides.com for more information. - Installation ============ -The OpenSlides server runs everywhere where Python is running (for example on -GNU/Linux, Mac or Windows). For the OpenSlides client a current web browser is required. +The main deployment method is using docker and docker-compose. You just need +both installed and no further dependencies. If you want a simpler setup or are +interesed in developing, please refer to `development instructions `_. +Note: This is temporary and will be replace with nice scripts... -1. Installation on GNU/Linux or Mac OS X ----------------------------------------- +First, you have to clone this repository:: -a. Check requirements -''''''''''''''''''''' + $ git clone https://github.com/OpenSlides/OpenSlides.git + $ cd OpenSlides/docker/ -Make sure that you have installed `Python (>= 3.6) `_ -on your system. +You need to build the docker images for the client and server with this script:: -Additional you need build-essential packages, header files and a static -library for Python and also the pyvenv-3 binary package for python3. + $ ./build.sh -E.g. run on Debian/Ubuntu:: +We strongly recomment to set an initial admin password and create a second +non-admin user. Both are not strictly required (and a missing admin password will print warnings on the +startup), but if you want to have a secure setup, do:: - $ sudo apt-get install build-essential python3-dev python3-venv + $ cp secrets/admin.env.example secrets/admin.env + $ cp secrets/user.env.example secrets/user.env + $ vi secrets/admin.env + $ vi secrets/user.env +If the server and client are built, you can use ``docker-compose`` as usual +(except for the ``build`` method):: -b. Setup a virtual Python environment (optional) -'''''''''''''''''''''''''''''''''''''''''''''''' + $ docker-compose up + $ # or: + $ docker-compose up -d + $ docker-compose logs + $ # ... + $ docker-compose down -You can setup a virtual Python environment using the virtual environment -(venv) package for Python to install OpenSlides as non-root user. +OpenSlides is listening on port 8000. It can be changed in the +``docker/docker-compose.yml``. -Create your OpenSlides directory and change to it:: - - $ mkdir OpenSlides - $ cd OpenSlides - -Setup and activate the virtual environment:: - - $ python3 -m venv .virtualenv - $ source .virtualenv/bin/activate - $ pip install --upgrade setuptools pip - - -c. Install OpenSlides -''''''''''''''''''''' - -To install OpenSlides just run:: - - $ pip install openslides - -This installs the latest stable version. To install a specific (beta) -version use ``openslides==x.y``. - -You can also use the package from the `OpenSlides website -`_. Download latest OpenSlides release as -compressed tar archive and run:: - - $ pip install openslides-x.y.tar.gz - -This will install all required Python packages (see -``requirements/production.txt``). - - -d. Start OpenSlides -''''''''''''''''''' - -To start OpenSlides simply run:: - - $ openslides - -If you run this command the first time, a new database and the admin account -(Username: ``admin``, Password: ``admin``) will be created. Please change the -password after first login! - -OpenSlides will start a webserver. It will also try to open the webinterface in -your default webbrowser. The server will try to listen on the local ip address -on port 8000. That means that the server will be available to everyone on your -local network (at least for commonly used network configurations). - -If you use a virtual environment (see step b.), do not forget to activate -the environment before restart after you closed the terminal:: - - $ source .virtualenv/bin/activate - -To get help on the command line options run:: - - $ openslides --help - -You can store settings, database and other personal files in a local -subdirectory and use these files e. g. if you want to run multiple -instances of OpenSlides:: - - $ openslides start --local-installation - - -2. Installation on Windows --------------------------- - -Follow the instructions above (1. Installation on GNU/Linux or Mac OS X) but care -of the following variations. - -To get Python download and run the latest `Python 3.7 32-bit (x86) executable -installer `_. Note that the 32-bit -installer is required even on a 64-bit Windows system. If you use the 64-bit -installer, step 1c of the instruction might fail unless you installed some -packages manually. - -In some cases you have to install `MS Visual C++ 2015 build tools -`_ before you -install the required python packages for OpenSlides (unfortunately Twisted -needs it). - -To setup and activate the virtual environment in step 1b use:: - - > .virtualenv\Scripts\activate.bat - -All other commands are the same as for GNU/Linux and Mac OS X. - - -3. Installation with Docker ---------------------------- - -The installation instruction for (1) and (2) described a way to use OpenSlides in a -'small mode' with max 10 concurrent clients. To install OpenSlides for big assemblies -('big mode') you have to setup some additional components and configurations. - -The easiest way to run the OpenSlides 'big mode' environment (with PostgreSQL, Redis -and NGINX) with Docker Compose: use our docker compose suite. Follow the instruction in -the `openslides-docker-compose Repository `_. - -To install and configure all components of our 'big mode' manually you can read the -`big-mode-instruction `_ - - -Configuration -============= - -Please consider reading the `OpenSlides configuration -`_ page to -find out about all configurations, especially when using OpenSlides for big -assemblies. - - -Development -=========== - -To setup a development environment for OpenSlides follow the instruction of -`DEVELOPMENT.rst -`_. +Bugs, features and development +================================ +Feel free to create issues here in GitHub! Please use the right templates for +bugs and features and using them correctly. Pull requests are also welcome; for +a general overview of the development setup refer the `development instructions `_. Used software ============= OpenSlides uses the following projects or parts of them: -* Several Python packages (see ``requirements/production.txt`` and ``requirements/big_mode.txt``). +* Several Python packages (see ``server/requirements/production.txt`` and ``server/requirements/big_mode.txt``). * Several JavaScript packages (see ``client/package.json``) - License and authors =================== diff --git a/client/.dockerignore b/client/.dockerignore new file mode 100644 index 000000000..c64be75ec --- /dev/null +++ b/client/.dockerignore @@ -0,0 +1,2 @@ +.git +**/node_modules diff --git a/client/README.md b/client/README.md index c763c89c9..56736020f 100644 --- a/client/README.md +++ b/client/README.md @@ -1,31 +1,5 @@ # OpenSlides 3 Client -Prototype application for OpenSlides 3.0 (Client). -Currently under constant heavy maintenance. - -## Development Info - -As an Angular project, Angular CLI is highly recommended to create components and services. -See https://angular.io/guide/quickstart for details. - -### Contribution Info - -Please respect the code-style defined in `.editorconf` and `.pretierrc`. - -Code alignment should be automatically corrected by the pre-commit hooks. -Adjust your editor to the `.editorconfig` to avoid surprises. -See https://editorconfig.org/ for details. - -### Pre-Commit Hooks - -Before commiting, new code will automatically be aligned to the definitions set in the -`.prettierrc`. -Furthermore, new code has to pass linting. - -Our pre-commit hooks are: -`pretty-quick --staged` and `lint` -See `package.json` for details. - ### Documentation Info The documentation can be generated by running `npm run compodoc`. @@ -38,16 +12,6 @@ command. If no port specified, it will try to use 8080. Please document new code using JSDoc tags. See https://compodoc.app/guides/jsdoc-tags.html for details. -### Development server - -Run `npm start` for a development server. Navigate to `http://localhost:4200/`. -The app will automatically reload if you change any of the source files. - -A running OpenSlides (2.2 or higher) instance is expected on port 8000. - -Start OpenSlides as usual using -`python manage.py start --no-browser --host 0.0.0.0` - ### Translation We are using ngx-translate for translation purposes. diff --git a/client/angular.json b/client/angular.json index 88799e93a..2bf95353b 100644 --- a/client/angular.json +++ b/client/angular.json @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "../openslides/static", + "outputPath": "static", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", diff --git a/client/build.sh b/client/build.sh new file mode 100755 index 000000000..3836ae214 --- /dev/null +++ b/client/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd "$(dirname "$0")" + +printf "Client built on %s:\n\nBranch: %s\n\n%s\n" \ + "$(date)" \ + "$(git rev-parse --abbrev-ref HEAD)" \ + "$(git show -s --format=raw)" > client-version.txt +docker build -f docker/Dockerfile . $@ diff --git a/client/docker/Dockerfile b/client/docker/Dockerfile new file mode 100644 index 000000000..96f8f4f88 --- /dev/null +++ b/client/docker/Dockerfile @@ -0,0 +1,23 @@ +FROM node:13 AS nodejs + +RUN mkdir -p /build/app +WORKDIR /build/app +RUN useradd -m openslides +RUN chown -R openslides /build/app + +USER root +RUN npm install -g @angular/cli@^9 +RUN ng config -g cli.warnings.versionMismatch false + +USER openslides +COPY package.json . +RUN npm install +COPY browserslist *.json ./ +COPY src ./src +RUN npm run build + +COPY client-version.txt static/ + +FROM nginx +COPY --from=nodejs /build/app/static /usr/share/nginx/html +COPY docker/nginx.conf /etc/nginx/nginx.conf diff --git a/client/docker/nginx.conf b/client/docker/nginx.conf new file mode 100644 index 000000000..7ac70cf3b --- /dev/null +++ b/client/docker/nginx.conf @@ -0,0 +1,56 @@ +worker_processes auto; + +events { + worker_connections 32000; +} + +http { + server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html index.htm; + include /etc/nginx/mime.types; + + # Optimizations for OpenSlides + client_max_body_size 100M; + proxy_connect_timeout 300s; + proxy_read_timeout 300s; + + proxy_set_header Host $http_host; + + gzip on; + gzip_min_length 1000; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; + + location /apps { + proxy_pass http://server:8000; + } + location /media/ { + proxy_pass http://media:8000; + } + location /rest { + proxy_pass http://server:8000; + } + location /ws { + proxy_pass http://server:8000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + location /server-version.txt { + proxy_pass http://server:8000; + } + + location = /basic_status { + stub_status; + } + + location / { + try_files $uri $uri/ /index.html; + } + + } +} diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 000000000..b988c9723 --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash +../server/build.sh -t openslides/openslides-server:latest +../client/build.sh -t openslides/openslides-client:latest +docker-compose build diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 000000000..27cbeff4b --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,162 @@ +version: '3.4' + +# @Gernot: TODO env file +x-server-env: &default-server-env + SECRET_KEY: "TODO" + # @Gernot: TODO secret key generation. -> secret? + INSTANCE_DOMAIN: "http://example.com:8000" +x-pgnode: &default-pgnode + image: openslides/openslides-repmgr:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:repmgr + networks: + - dbnet + labels: + org.openslides.role: "postgres" + restart: always +x-pgnode-env: &default-pgnode-env + REPMGR_RECONNECT_ATTEMPTS: 30 + REPMGR_RECONNECT_INTERVAL: 10 + +services: + server: + image: openslides/openslides-server:latest + networks: + - front + - back + restart: always + # Below is the default command. You can uncomment it to override the + # number of workers, for example: + # command: "gunicorn -w 8 --preload -b 0.0.0.0:8000 + # -k uvicorn.workers.UvicornWorker openslides.asgi:application" + # + # Uncomment the following line to use daphne instead of gunicorn: + # command: "daphne -b 0.0.0.0 -p 8000 openslides.asgi:application" + depends_on: + - postfix + - media + - pgbouncer + - redis + - redis-slave + - redis-channels + environment: + << : *default-server-env + secrets: + - os_admin + - os_user + + server-db-setup: + image: openslides/openslides-server:latest + networks: + - back + restart: always + entrypoint: /usr/local/sbin/entrypoint-db-setup + depends_on: + - pgbouncer + - redis + - redis-slave + - redis-channels + environment: + << : *default-server-env + secrets: + - os_admin + - os_user + + client: + image: openslides/openslides-client:latest + restart: always + depends_on: + - server + networks: + - front + ports: + - "127.0.0.1:8000:80" + + pgnode1: + << : *default-pgnode + environment: + << : *default-pgnode-env + REPMGR_NODE_ID: 1 + REPMGR_PRIMARY: # empty; this *is* the primary + volumes: + - "dbdata1:/var/lib/postgresql" + # Note: You can add more postgres nodes by copying the template + # and replacing all %X% with the number of the pgnode. Remember + # to add all pgnodes to the pgbouncer below! + # pgnode%X%: + # << : *default-pgnode + # environment: + # << : *default-pgnode-env + # REPMGR_NODE_ID: %X% + # REPMGR_PRIMARY: pgnode1 + # volumes: + # - "dbdata%X%:/var/lib/postgresql" + + pgbouncer: + # environment: + # - PG_NODE_LIST=pgnode1,pgnode2,pgnode3 + image: openslides/openslides-pgbouncer:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:pgbouncer + restart: always + networks: + back: + aliases: + - db + - postgres + dbnet: + postfix: + image: openslides/openslides-postfix:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:postfix + restart: always + environment: + MYHOSTNAME: localhost + RELAYHOST: localhost + networks: + - back + redis: + image: redis:alpine + restart: always + networks: + - back + redis-slave: + image: redis:alpine + restart: always + command: ["redis-server", "--save", "", "--slaveof", "redis", "6379"] + depends_on: + - redis + networks: + - back + redis-channels: + image: redis:alpine + restart: always + networks: + - back + media: + image: openslides/openslides-media-service:latest + build: https://github.com/OpenSlides/openslides-media-service.git + environment: + - CHECK_REQUEST_URL=server:8000/check-media/ + restart: always + networks: + front: + back: + # Override command to run more workers per task + # command: ["gunicorn", "-w", "4", "--preload", "-b", + # "0.0.0.0:8000", "src.mediaserver:app"] + +volumes: + dbdata1: + dbdata2: + dbdata3: + +networks: + front: + back: + dbnet: + +secrets: + os_admin: + file: ./secrets/admin.env + os_user: + file: ./secrets/user.env + +# vim: set ft=yaml sw=2 et: diff --git a/docker/secrets/admin.env.example b/docker/secrets/admin.env.example new file mode 100644 index 000000000..d2c92f4e2 --- /dev/null +++ b/docker/secrets/admin.env.example @@ -0,0 +1,3 @@ +## secrets/adminsecret.env is sourced by the server container to set the initial +## admin user password. +# OPENSLIDES_ADMIN_PASSWORD="" diff --git a/docker/secrets/user.env.example b/docker/secrets/user.env.example new file mode 100644 index 000000000..d4a334bc0 --- /dev/null +++ b/docker/secrets/user.env.example @@ -0,0 +1,5 @@ +## Example user credential configuration +# OPENSLIDES_USER_FIRSTNAME="John" +# OPENSLIDES_USER_LASTNAME="Doe" +# OPENSLIDES_USER_PASSWORD="" +# OPENSLIDES_USER_EMAIL="john@example.com" diff --git a/haproxy/src/combined.pem b/haproxy/src/combined.pem new file mode 100644 index 000000000..ac2ef6804 --- /dev/null +++ b/haproxy/src/combined.pem @@ -0,0 +1,83 @@ +-----BEGIN CERTIFICATE----- +MIIFVzCCAz+gAwIBAgIUBcPjTF+PvAOcjrgx/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jQzLwhIWzvDtla7Umj0/nDiNAQwLiJ/RAVy1fv +NDciwHN/5E+WCi0jYgdgyJ39VBREqMJaAvBX4u0CggEBAKSckOSyPWsh/buJzc4Z +D3pgCXZ9vBCh7CsumIOqPgzXRoqges3IlYSBilv1AEfGGTdJlrutsGmSMjj3NQjj +hbcWvbHIveCgligXRASwquBTIMen+m65anf+u7j771wcMhbFQzCKy88K/afPMxdY +fjEKKUwVh70LilvT2NPY+8jeWIZiCozHt8HsMaAPnaCdx9L6P3hg8YWtO5kfekIE +KoFU+J7h2Etvkhfkqz4Hp/FLRZrxOZDtG9lvQfmGrKWjpiXAZrQgEjPaIRtF9haf +wopSxneI5Dhv44PAdWNHjyzVypmQRGUEbgzpNfkWn3XZnN79I+BQFVJvwW0jFOm1 +7VsCggEBALD1gVBb+vb72nQQaRls25DR3BPJPBiJPs0CbkYDDyywbB/Pk/2GqQuT +ObK9B4igmvu/zrjynOIKWPL530430n+NkQArIDjMKJKCM7Z+mNnQojJeUM6xEbj+ +duuZbFJ1VrZd+1sy/YtUo5k43Nc1PAFXs639UPN2h71vx78ftb88DoeZRRqfUy25 +H6/h+KH1Hiqn38nUm1WI8mHL7d3uMLb1GReYPVXBn/y0VbjZ8M3k71339DTBj7AU +zCg9bcY9pn+AZorN9BnpwqU36rP5TjZhlzG0Oa04ipn9RrF49k38qfSdtBTQCKaD +zY79cblfI1bop2NlQ7f3S/82OQWwX7E= +-----END PRIVATE KEY----- diff --git a/haproxy/src/localhost-key.pem b/haproxy/src/localhost-key.pem new file mode 100644 index 000000000..4eb8c7327 --- /dev/null +++ b/haproxy/src/localhost-key.pem @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCT9MWh0ojoGee7 +F/d4+m8aQGCz0CieaHXxZE3N/JexFNBVkPd7vs1XRpzvDlycDEaMdXtuo5hL8Pfk +Pq9BxsTOcdQjCuKXcbEAhesCrZVu76+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h1QzAE6V2lsdGxP/1VZlI4cFS06+4C +6lev3OxFmmTkjHm+DUzAdvH7x3ywu4hlA3zLvYqxiTECygMaMMryzw2K9aqKJqD1 +RlvLzwn1dV6RLv8syw0rLmeOQ8jQzLwhIWzvDtla7Umj0/nDiNAQwLiJ/RAVy1fv +NDciwHN/5E+WCi0jYgdgyJ39VBREqMJaAvBX4u0CggEBAKSckOSyPWsh/buJzc4Z +D3pgCXZ9vBCh7CsumIOqPgzXRoqges3IlYSBilv1AEfGGTdJlrutsGmSMjj3NQjj +hbcWvbHIveCgligXRASwquBTIMen+m65anf+u7j771wcMhbFQzCKy88K/afPMxdY +fjEKKUwVh70LilvT2NPY+8jeWIZiCozHt8HsMaAPnaCdx9L6P3hg8YWtO5kfekIE +KoFU+J7h2Etvkhfkqz4Hp/FLRZrxOZDtG9lvQfmGrKWjpiXAZrQgEjPaIRtF9haf +wopSxneI5Dhv44PAdWNHjyzVypmQRGUEbgzpNfkWn3XZnN79I+BQFVJvwW0jFOm1 +7VsCggEBALD1gVBb+vb72nQQaRls25DR3BPJPBiJPs0CbkYDDyywbB/Pk/2GqQuT +ObK9B4igmvu/zrjynOIKWPL530430n+NkQArIDjMKJKCM7Z+mNnQojJeUM6xEbj+ +duuZbFJ1VrZd+1sy/YtUo5k43Nc1PAFXs639UPN2h71vx78ftb88DoeZRRqfUy25 +H6/h+KH1Hiqn38nUm1WI8mHL7d3uMLb1GReYPVXBn/y0VbjZ8M3k71339DTBj7AU +zCg9bcY9pn+AZorN9BnpwqU36rP5TjZhlzG0Oa04ipn9RrF49k38qfSdtBTQCKaD +zY79cblfI1bop2NlQ7f3S/82OQWwX7E= +-----END PRIVATE KEY----- diff --git a/haproxy/src/localhost.pem b/haproxy/src/localhost.pem new file mode 100644 index 000000000..0de5ade50 --- /dev/null +++ b/haproxy/src/localhost.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFVzCCAz+gAwIBAgIUBcPjTF+PvAOcjrgx/udC/+W6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8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAHpdUoBq +MorSgFSqIu8lI6sISpGfjPLQOAM7cN4ZvI4gVEx6eXqHl2rePrPkJi2auZ4f6xM2 +2s7cb6t6i3MyiKgK3mWUqV+V6F8xfU0KGqI7d2aL6wTo9N9SunpwZNAzQ7O2W3M2 ++liQj+mJhMLaIzbDk+2kybT2ox7kHNbxhww2NtRvqQogJPZWWUSCpYuVi9km1JLz +TEYumknnIAQHUdYUOoXRRj80jwxN6gFac33Dn/PZkC8ntyKpVNyFSKtD5Uj9Pj6z +5C/AnVjqJlLJ+/dowXtLOyvgUrTmIVhGxGWQ9y/JHWKJZhI7WNB2kNGU6UnLCcGX +2j5RpMoQY61KYBrJrAFFXd421EcGAtDufyuPAxdwppWXcRDxRrf7H6WU4rq8GewC +iETnxFUV5utzyzlUDklFS+JubHW5DkqrVHOYuYc5ZokQseTMJqoWWzNuQI5vPG9f +wSJLOqTSn9PvUC+25YKsyGR7SHhzbIVWDa6ctAQRGWo+1YnOOrdDW6IxewEn08Jg +MpHgvghQfTgSOYKXny5SFfG//dfEzauDEX0Ypc84DCy92NCcD8Y4ib7SkvkYvhz2 +0CWbEBmWPLn/gVJ3gKrXrfzQuTBpAmiQ1bLXklSIbRuK7iK0kxccLK944QGm3KN9 +F6Vo+CsgqLIwTXTE62cPfoJLM3+cYGygn7On +-----END CERTIFICATE----- diff --git a/openslides/users/management/commands/createopenslidesuser.py b/openslides/users/management/commands/createopenslidesuser.py deleted file mode 100644 index 4e8a58191..000000000 --- a/openslides/users/management/commands/createopenslidesuser.py +++ /dev/null @@ -1,32 +0,0 @@ -from django.core.management.base import BaseCommand - -from ...models import User - - -class Command(BaseCommand): - """ - Command to create an OpenSlides user. - """ - - help = "Creates an OpenSlides user." - - def add_arguments(self, parser): - parser.add_argument("first_name", help="The first name of the new user.") - parser.add_argument("last_name", help="The last name of the new user.") - parser.add_argument("username", help="The username of the new user.") - parser.add_argument("password", help="The password of the new user.") - parser.add_argument("groups_id", help="The group id of the new user.") - parser.add_argument("--email", help="The email address of the new user.") - - def handle(self, *args, **options): - user_data = { - "first_name": options["first_name"], - "last_name": options["last_name"], - "default_password": options["password"], - "email": options["email"] or "", - } - user = User.objects.create_user( - options["username"], options["password"], skip_autoupdate=True, **user_data - ) - if options["groups_id"].isdigit(): - user.groups.add(int(options["groups_id"])) diff --git a/server/.dockerignore b/server/.dockerignore new file mode 100644 index 000000000..d646835b4 --- /dev/null +++ b/server/.dockerignore @@ -0,0 +1,2 @@ +*.pyc +__pycache__/ diff --git a/MANIFEST.in b/server/MANIFEST.in similarity index 100% rename from MANIFEST.in rename to server/MANIFEST.in diff --git a/SETTINGS.rst b/server/SETTINGS.rst similarity index 100% rename from SETTINGS.rst rename to server/SETTINGS.rst diff --git a/server/build.sh b/server/build.sh new file mode 100755 index 000000000..234260600 --- /dev/null +++ b/server/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +cd "$(dirname "$0")" + +printf "Server built on %s:\n\nBranch: %s\n\n%s\n" \ + "$(date)" \ + "$(git rev-parse --abbrev-ref HEAD)" \ + "$(git show -s --format=raw)" > docker/server-version.txt + +# @Gernot: TODO +# SECRET_KEY=$(head /dev/urandom | tr -dc 'A-Za-z0-9!"#$%&()*+,-./:;<=>?@[]^_`{|}~' | head -c 64) +# sed: \/& must be escaped... +# ESCAPED_SECRET_KEY=$(printf "%s\n" "$SECRET_KEY" | sed -e 's/[\/&]/\\&/g') +# sed -i \ +# -e "/SECRET_KEY/s/%%secret-key%%/$ESCAPED_SECRET_KEY/" \ +# docker/settings.py + +docker build -f docker/Dockerfile . $@ diff --git a/server/docker/Dockerfile b/server/docker/Dockerfile new file mode 100644 index 000000000..e1c31a5a1 --- /dev/null +++ b/server/docker/Dockerfile @@ -0,0 +1,67 @@ +FROM python:3.7-slim AS base + +ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_PRIORITY critical +ENV DEBCONF_NOWARNINGS yes +ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE 1 + +# Variables relevant for CMD +ENV DJANGO_SETTINGS_MODULE settings +ENV PYTHONPATH personal_data/var/ + +RUN mkdir -p /app +WORKDIR /app +RUN useradd -m openslides +RUN chown -R openslides /app + +RUN apt-get -y update && apt-get -y upgrade && \ + apt-get install --no-install-recommends -y \ + apt-transport-https \ + bzip2 \ + curl \ + g++ \ + gcc \ + git \ + gnupg2 \ + libpq-dev \ + make \ + postgresql-client \ + rsync \ + wait-for-it \ + wget \ + xz-utils + +# Install additional tools +RUN apt-get install --no-install-recommends -y \ + dnsutils \ + iputils-ping \ + netcat \ + procps \ + traceroute \ + vim + +# Install saml requirements +RUN apt-get install --no-install-recommends -y \ + libxml2-dev \ + libxmlsec1-dev \ + libxmlsec1-openssl \ + pkg-config + +RUN rm -rf /var/lib/apt/lists/* + +COPY requirements /app/requirements +RUN pip install -r requirements/production.txt -r requirements/big_mode.txt && \ + rm -rf /root/.cache/pip + +USER openslides +# the `empty` folder is used for the dummy http server für the migrate entrypoint to serve no files. +RUN mkdir /app/empty +COPY docker/entrypoint /usr/local/sbin/ +COPY docker/entrypoint-db-setup /usr/local/sbin/ +COPY docker/settings.py /app/personal_data/var/settings.py +COPY manage.py /app/ +COPY openslides /app/openslides +COPY docker/server-version.txt /app/openslides/core/static/server-version.txt +ENTRYPOINT ["/usr/local/sbin/entrypoint"] +CMD ["gunicorn", "-w", "8", "--preload", "-b", "0.0.0.0:8000", "-k", \ + "uvicorn.workers.UvicornWorker", "openslides.asgi:application"] diff --git a/server/docker/entrypoint b/server/docker/entrypoint new file mode 100755 index 000000000..47c3bbb9b --- /dev/null +++ b/server/docker/entrypoint @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# TODO: env variable for this host +wait-for-it -t 0 "server-db-setup:8000" + +printf 'Executing server: "%s"\n' "$*" + +# Expected commands are one of: +# - daphne -b 0.0.0.0 -p 8000 openslides.asgi:application +# - gunicorn -w 4 -b 0.0.0.0:8000 -k uvicorn.workers.UvicornWorker \ +# openslides.asgi:application +exec $* diff --git a/server/docker/entrypoint-db-setup b/server/docker/entrypoint-db-setup new file mode 100755 index 000000000..2153196ac --- /dev/null +++ b/server/docker/entrypoint-db-setup @@ -0,0 +1,77 @@ +#!/bin/bash + +set -e + +warn_insecure_admin() { + cat <<-EOF + + ============================================== + WARNING + ============================================== + + WARNING: INSECURE ADMIN ACCOUNT CONFIGURATION! + +EOF + sleep 10 +} + +# Configure database +# TODO: env variables?? +echo "postgres:5432:instancecfg:openslides:openslides" > "${HOME}/.pgpass" +chmod 600 "${HOME}/.pgpass" + +until pg_isready -h db; do + echo "Waiting for Postgres cluster to become available..." + sleep 3 +done + +# Wait for redis +wait-for-it redis:6379 +wait-for-it redis-slave:6379 +wait-for-it redis-channels:6379 + +echo 'running migrations' +python manage.py migrate + +# Admin +if [[ -f /run/secrets/os_admin ]]; then + echo "Retrieving secure admin password" + source /run/secrets/os_admin + if [[ -n "${OPENSLIDES_ADMIN_PASSWORD}" ]]; then + echo "Changing admin password" + python manage.py changedefaultadminpassword "${OPENSLIDES_ADMIN_PASSWORD}" + else + warn_insecure_admin + fi +else + warn_insecure_admin +fi + +# Main user +if [[ -f /run/secrets/os_user ]]; then + echo "Retrieving secure user credentials" + source /run/secrets/os_user + if [[ -n "${OPENSLIDES_USER_FIRSTNAME}" ]] && + [[ -n "${OPENSLIDES_USER_LASTNAME}" ]] && + [[ -n "${OPENSLIDES_USER_PASSWORD}" ]]; then + user_name="${OPENSLIDES_USER_FIRSTNAME} ${OPENSLIDES_USER_LASTNAME}" + echo "Adding user: ${user_name}" + # createopenslidesuser: error: the following arguments are required: + # first_name, last_name, username, password, groups_id + # email is optional + # userid forces to to only create a user with this id, if it not exists before. + python manage.py createopenslidesuser \ + --userid 2 \ + --email "${OPENSLIDES_USER_EMAIL:-}" \ + "${OPENSLIDES_USER_FIRSTNAME}" \ + "${OPENSLIDES_USER_LASTNAME}" \ + "${user_name}" \ + "${OPENSLIDES_USER_PASSWORD}" \ + 2 + else + echo "Incomplete user account data. Skipping account creation." + fi +fi + +echo "Done migrating and setting up user accounts..." +python -m http.server --directory /app/empty --bind 0.0.0.0 8000 diff --git a/server/docker/settings.py b/server/docker/settings.py new file mode 100644 index 000000000..ddffedb97 --- /dev/null +++ b/server/docker/settings.py @@ -0,0 +1,170 @@ +""" +Settings file for OpenSlides. + +For more information on this file, see +https://github.com/OpenSlides/OpenSlides/blob/master/SETTINGS.rst +""" + +import os +from openslides.global_settings import * + + +class MissingEnvironmentVariable(Exception): + pass + + +undefined = object() + + +def get_env(name, default=undefined, cast=str): + env = os.environ.get(name) + default_extension = "" + if env is None: + env = default + default_extension = " (default)" + + if env is undefined: + raise MissingEnvironmentVariable(name) + + if cast is bool: + env = env in ("1", "true", "True") + else: + env = cast(env) + + if env is None: + print(f"{name}={default_extension}", flush=True) + else: + print(f'{name}="{env}"{default_extension}', flush=True) + return env + + +# The directory for user specific data files + +OPENSLIDES_USER_DATA_DIR = "/app/personal_data/var" + +SECRET_KEY = get_env("SECRET_KEY") +DEBUG = False + +# Controls the verbosity on errors during a reset password. If enabled, an error +# will be shown, if there does not exist a user with a given email address. So one +# can check, if a email is registered. If this is not wanted, disable verbose +# messages. An success message will always be shown. +RESET_PASSWORD_VERBOSE_ERRORS = get_env("RESET_PASSWORD_VERBOSE_ERRORS", True, bool) + +AUTOUPDATE_DELAY = get_env("AUTOUPDATE_DELAY", 1, int) + +# Email settings +# For SSL/TLS specific settings see https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend +EMAIL_HOST = get_env("EMAIL_HOST", "postfix") +EMAIL_PORT = get_env("EMAIL_PORT", 25, int) +EMAIL_HOST_USER = get_env("EMAIL_HOST_USER", "") +EMAIL_HOST_PASSWORD = get_env("EMAIL_HOST_PASSWORD", "") +DEFAULT_FROM_EMAIL = get_env("DEFAULT_FROM_EMAIL", "noreply@example.com") + +# Increasing Upload size to 100mb (default is 2.5mb) +DATA_UPLOAD_MAX_MEMORY_SIZE = 104857600 + +# Database +# https://docs.djangoproject.com/en/1.10/ref/settings/#databases + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": "openslides", + "USER": get_env("DATABASE_USER", "openslides"), + "PASSWORD": get_env("DATABASE_PASSWORD", "openslides"), + "HOST": get_env("DATABASE_HOST", "db"), + "PORT": get_env("DATABASE_PORT", "5432"), + }, + "mediafiles": { + "ENGINE": "django.db.backends.postgresql", + "NAME": "mediafiledata", + "USER": get_env("DATABASE_USER", "openslides"), + "PASSWORD": get_env("DATABASE_PASSWORD", "openslides"), + "HOST": get_env("DATABASE_HOST", "db"), + "PORT": get_env("DATABASE_PORT", "5432"), + }, +} + +# Redis +REDIS_HOST = get_env("REDIS_HOST", "redis") +REDIS_PORT = get_env("REDIS_PORT", 6379, int) +REDIS_SLAVE_HOST = get_env("REDIS_SLAVE_HOST", "redis-slave") +REDIS_SLAVE_PORT = get_env("REDIS_SLAVE_PORT", 6379, int) +REDIS_CHANNLES_HOST = get_env("REDIS_CHANNLES_HOST", "redis-channels") +REDIS_CHANNLES_PORT = get_env("REDIS_CHANNLES_PORT", 6379, int) +REDIS_SLAVE_WAIT_TIMEOUT = get_env("REDIS_SLAVE_WAIT_TIMEOUT", 10000, int) + +# Django Channels +CHANNEL_LAYERS = { + "default": { + "BACKEND": "channels_redis.core.RedisChannelLayer", + "CONFIG": { + "hosts": [(REDIS_CHANNLES_HOST, REDIS_CHANNLES_PORT)], + "capacity": 10000, + }, + }, +} + +# Collection Cache +REDIS_ADDRESS = f"redis://{REDIS_HOST}:{REDIS_PORT}/0" +REDIS_READ_ONLY_ADDRESS = f"redis://{REDIS_SLAVE_HOST}:{REDIS_SLAVE_PORT}/0" +AMOUNT_REPLICAS = get_env("AMOUNT_REPLICAS", 1) +CONNECTION_POOL_LIMIT = get_env("CONNECTION_POOL_LIMIT", 100, int) + +# Session backend +SESSION_ENGINE = "redis_sessions.session" +SESSION_REDIS = { + "host": REDIS_HOST, + "port": REDIS_PORT, + "db": 0, + "prefix": "session", + "socket_timeout": 2, +} + +# SAML integration +ENABLE_SAML = get_env("ENABLE_SAML", False, bool) +if ENABLE_SAML: + INSTALLED_APPS += ["openslides.saml"] + +# TODO: More saml stuff... + +# Controls if electronic voting (means non-analog polls) are enabled. +ENABLE_ELECTRONIC_VOTING = get_env("ENABLE_ELECTRONIC_VOTING", False, bool) + +# Jitsi integration +JITSI_DOMAIN = get_env("JITSI_DOMAIN", None) +JITSI_ROOM_NAME = get_env("JITSI_ROOM_NAME", None) +JITSI_PASSWORD = get_env("JITSI_PASSWORD", None) + +TIME_ZONE = "Europe/Berlin" +STATICFILES_DIRS = [os.path.join(OPENSLIDES_USER_DATA_DIR, "static")] + STATICFILES_DIRS +STATIC_ROOT = os.path.join(OPENSLIDES_USER_DATA_DIR, "collected-static") +MEDIA_ROOT = os.path.join(OPENSLIDES_USER_DATA_DIR, "media", "") + +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",}, + }, + "loggers": { + "django": { + "handlers": ["console"], + "level": get_env("DJANGO_LOG_LEVEL", "INFO"), + }, + "openslides": { + "handlers": ["console"], + "level": get_env("OPENSLIDES_LOG_LEVEL", "INFO"), + }, + }, +} + +SETTINGS_FILEPATH = __file__ diff --git a/make/README.rst b/server/make/README.rst similarity index 100% rename from make/README.rst rename to server/make/README.rst diff --git a/make/__main__.py b/server/make/__main__.py similarity index 100% rename from make/__main__.py rename to server/make/__main__.py diff --git a/make/commands.py b/server/make/commands.py similarity index 100% rename from make/commands.py rename to server/make/commands.py diff --git a/make/parser.py b/server/make/parser.py similarity index 100% rename from make/parser.py rename to server/make/parser.py diff --git a/make/requirements.txt b/server/make/requirements.txt similarity index 100% rename from make/requirements.txt rename to server/make/requirements.txt diff --git a/manage.py b/server/manage.py similarity index 100% rename from manage.py rename to server/manage.py diff --git a/openslides/__init__.py b/server/openslides/__init__.py similarity index 100% rename from openslides/__init__.py rename to server/openslides/__init__.py diff --git a/openslides/__main__.py b/server/openslides/__main__.py similarity index 100% rename from openslides/__main__.py rename to server/openslides/__main__.py diff --git a/openslides/agenda/__init__.py b/server/openslides/agenda/__init__.py similarity index 100% rename from openslides/agenda/__init__.py rename to server/openslides/agenda/__init__.py diff --git a/openslides/agenda/access_permissions.py b/server/openslides/agenda/access_permissions.py similarity index 100% rename from openslides/agenda/access_permissions.py rename to server/openslides/agenda/access_permissions.py diff --git a/openslides/agenda/apps.py b/server/openslides/agenda/apps.py similarity index 100% rename from openslides/agenda/apps.py rename to server/openslides/agenda/apps.py diff --git a/openslides/agenda/config_variables.py b/server/openslides/agenda/config_variables.py similarity index 100% rename from openslides/agenda/config_variables.py rename to server/openslides/agenda/config_variables.py diff --git a/openslides/agenda/migrations/0001_initial.py b/server/openslides/agenda/migrations/0001_initial.py similarity index 100% rename from openslides/agenda/migrations/0001_initial.py rename to server/openslides/agenda/migrations/0001_initial.py diff --git a/openslides/agenda/migrations/0002_item_duration.py b/server/openslides/agenda/migrations/0002_item_duration.py similarity index 100% rename from openslides/agenda/migrations/0002_item_duration.py rename to server/openslides/agenda/migrations/0002_item_duration.py diff --git a/openslides/agenda/migrations/0003_auto_20170818_1202.py b/server/openslides/agenda/migrations/0003_auto_20170818_1202.py similarity index 100% rename from openslides/agenda/migrations/0003_auto_20170818_1202.py rename to server/openslides/agenda/migrations/0003_auto_20170818_1202.py diff --git a/openslides/agenda/migrations/0004_speaker_marked.py b/server/openslides/agenda/migrations/0004_speaker_marked.py similarity index 100% rename from openslides/agenda/migrations/0004_speaker_marked.py rename to server/openslides/agenda/migrations/0004_speaker_marked.py diff --git a/openslides/agenda/migrations/0005_auto_20180815_1109.py b/server/openslides/agenda/migrations/0005_auto_20180815_1109.py similarity index 100% rename from openslides/agenda/migrations/0005_auto_20180815_1109.py rename to server/openslides/agenda/migrations/0005_auto_20180815_1109.py diff --git a/openslides/agenda/migrations/0006_auto_20190119_1425.py b/server/openslides/agenda/migrations/0006_auto_20190119_1425.py similarity index 100% rename from openslides/agenda/migrations/0006_auto_20190119_1425.py rename to server/openslides/agenda/migrations/0006_auto_20190119_1425.py diff --git a/openslides/agenda/migrations/0007_list_of_speakers_1.py b/server/openslides/agenda/migrations/0007_list_of_speakers_1.py similarity index 100% rename from openslides/agenda/migrations/0007_list_of_speakers_1.py rename to server/openslides/agenda/migrations/0007_list_of_speakers_1.py diff --git a/openslides/agenda/migrations/0007_list_of_speakers_2.py b/server/openslides/agenda/migrations/0007_list_of_speakers_2.py similarity index 100% rename from openslides/agenda/migrations/0007_list_of_speakers_2.py rename to server/openslides/agenda/migrations/0007_list_of_speakers_2.py diff --git a/openslides/agenda/migrations/0007_list_of_speakers_3.py b/server/openslides/agenda/migrations/0007_list_of_speakers_3.py similarity index 100% rename from openslides/agenda/migrations/0007_list_of_speakers_3.py rename to server/openslides/agenda/migrations/0007_list_of_speakers_3.py diff --git a/openslides/agenda/migrations/0008_default_ordering_item.py b/server/openslides/agenda/migrations/0008_default_ordering_item.py similarity index 100% rename from openslides/agenda/migrations/0008_default_ordering_item.py rename to server/openslides/agenda/migrations/0008_default_ordering_item.py diff --git a/openslides/agenda/migrations/0009_item_tags.py b/server/openslides/agenda/migrations/0009_item_tags.py similarity index 100% rename from openslides/agenda/migrations/0009_item_tags.py rename to server/openslides/agenda/migrations/0009_item_tags.py diff --git a/openslides/agenda/migrations/__init__.py b/server/openslides/agenda/migrations/__init__.py similarity index 100% rename from openslides/agenda/migrations/__init__.py rename to server/openslides/agenda/migrations/__init__.py diff --git a/openslides/agenda/mixins.py b/server/openslides/agenda/mixins.py similarity index 100% rename from openslides/agenda/mixins.py rename to server/openslides/agenda/mixins.py diff --git a/openslides/agenda/models.py b/server/openslides/agenda/models.py similarity index 100% rename from openslides/agenda/models.py rename to server/openslides/agenda/models.py diff --git a/openslides/agenda/projector.py b/server/openslides/agenda/projector.py similarity index 100% rename from openslides/agenda/projector.py rename to server/openslides/agenda/projector.py diff --git a/openslides/agenda/serializers.py b/server/openslides/agenda/serializers.py similarity index 100% rename from openslides/agenda/serializers.py rename to server/openslides/agenda/serializers.py diff --git a/openslides/agenda/signals.py b/server/openslides/agenda/signals.py similarity index 100% rename from openslides/agenda/signals.py rename to server/openslides/agenda/signals.py diff --git a/openslides/agenda/views.py b/server/openslides/agenda/views.py similarity index 100% rename from openslides/agenda/views.py rename to server/openslides/agenda/views.py diff --git a/openslides/asgi.py b/server/openslides/asgi.py similarity index 100% rename from openslides/asgi.py rename to server/openslides/asgi.py diff --git a/openslides/assignments/__init__.py b/server/openslides/assignments/__init__.py similarity index 100% rename from openslides/assignments/__init__.py rename to server/openslides/assignments/__init__.py diff --git a/openslides/assignments/access_permissions.py b/server/openslides/assignments/access_permissions.py similarity index 100% rename from openslides/assignments/access_permissions.py rename to server/openslides/assignments/access_permissions.py diff --git a/openslides/assignments/apps.py b/server/openslides/assignments/apps.py similarity index 100% rename from openslides/assignments/apps.py rename to server/openslides/assignments/apps.py diff --git a/openslides/assignments/config_variables.py b/server/openslides/assignments/config_variables.py similarity index 100% rename from openslides/assignments/config_variables.py rename to server/openslides/assignments/config_variables.py diff --git a/openslides/assignments/migrations/0001_initial.py b/server/openslides/assignments/migrations/0001_initial.py similarity index 100% rename from openslides/assignments/migrations/0001_initial.py rename to server/openslides/assignments/migrations/0001_initial.py diff --git a/openslides/assignments/migrations/0002_assignmentpoll_pollmethod.py b/server/openslides/assignments/migrations/0002_assignmentpoll_pollmethod.py similarity index 100% rename from openslides/assignments/migrations/0002_assignmentpoll_pollmethod.py rename to server/openslides/assignments/migrations/0002_assignmentpoll_pollmethod.py diff --git a/openslides/assignments/migrations/0003_candidate_weight.py b/server/openslides/assignments/migrations/0003_candidate_weight.py similarity index 100% rename from openslides/assignments/migrations/0003_candidate_weight.py rename to server/openslides/assignments/migrations/0003_candidate_weight.py diff --git a/openslides/assignments/migrations/0004_auto_20180703_1523.py b/server/openslides/assignments/migrations/0004_auto_20180703_1523.py similarity index 100% rename from openslides/assignments/migrations/0004_auto_20180703_1523.py rename to server/openslides/assignments/migrations/0004_auto_20180703_1523.py diff --git a/openslides/assignments/migrations/0005_auto_20180822_1042.py b/server/openslides/assignments/migrations/0005_auto_20180822_1042.py similarity index 100% rename from openslides/assignments/migrations/0005_auto_20180822_1042.py rename to server/openslides/assignments/migrations/0005_auto_20180822_1042.py diff --git a/openslides/assignments/migrations/0006_auto_20190119_1425.py b/server/openslides/assignments/migrations/0006_auto_20190119_1425.py similarity index 100% rename from openslides/assignments/migrations/0006_auto_20190119_1425.py rename to server/openslides/assignments/migrations/0006_auto_20190119_1425.py diff --git a/openslides/assignments/migrations/0007_assignment_attachments.py b/server/openslides/assignments/migrations/0007_assignment_attachments.py similarity index 100% rename from openslides/assignments/migrations/0007_assignment_attachments.py rename to server/openslides/assignments/migrations/0007_assignment_attachments.py diff --git a/openslides/assignments/migrations/0008_voting_1.py b/server/openslides/assignments/migrations/0008_voting_1.py similarity index 100% rename from openslides/assignments/migrations/0008_voting_1.py rename to server/openslides/assignments/migrations/0008_voting_1.py diff --git a/openslides/assignments/migrations/0009_voting_2.py b/server/openslides/assignments/migrations/0009_voting_2.py similarity index 100% rename from openslides/assignments/migrations/0009_voting_2.py rename to server/openslides/assignments/migrations/0009_voting_2.py diff --git a/openslides/assignments/migrations/0010_voting_3.py b/server/openslides/assignments/migrations/0010_voting_3.py similarity index 100% rename from openslides/assignments/migrations/0010_voting_3.py rename to server/openslides/assignments/migrations/0010_voting_3.py diff --git a/openslides/assignments/migrations/0011_voting_4.py b/server/openslides/assignments/migrations/0011_voting_4.py similarity index 100% rename from openslides/assignments/migrations/0011_voting_4.py rename to server/openslides/assignments/migrations/0011_voting_4.py diff --git a/openslides/assignments/migrations/0012_assignment_vote_unique_together.py b/server/openslides/assignments/migrations/0012_assignment_vote_unique_together.py similarity index 100% rename from openslides/assignments/migrations/0012_assignment_vote_unique_together.py rename to server/openslides/assignments/migrations/0012_assignment_vote_unique_together.py diff --git a/openslides/assignments/migrations/0013_rename_verbose_poll_types.py b/server/openslides/assignments/migrations/0013_rename_verbose_poll_types.py similarity index 100% rename from openslides/assignments/migrations/0013_rename_verbose_poll_types.py rename to server/openslides/assignments/migrations/0013_rename_verbose_poll_types.py diff --git a/openslides/assignments/migrations/0014_remove_deprecated_slides.py b/server/openslides/assignments/migrations/0014_remove_deprecated_slides.py similarity index 100% rename from openslides/assignments/migrations/0014_remove_deprecated_slides.py rename to server/openslides/assignments/migrations/0014_remove_deprecated_slides.py diff --git a/openslides/assignments/migrations/__init__.py b/server/openslides/assignments/migrations/__init__.py similarity index 100% rename from openslides/assignments/migrations/__init__.py rename to server/openslides/assignments/migrations/__init__.py diff --git a/openslides/assignments/models.py b/server/openslides/assignments/models.py similarity index 100% rename from openslides/assignments/models.py rename to server/openslides/assignments/models.py diff --git a/openslides/assignments/projector.py b/server/openslides/assignments/projector.py similarity index 100% rename from openslides/assignments/projector.py rename to server/openslides/assignments/projector.py diff --git a/openslides/assignments/serializers.py b/server/openslides/assignments/serializers.py similarity index 100% rename from openslides/assignments/serializers.py rename to server/openslides/assignments/serializers.py diff --git a/openslides/assignments/signals.py b/server/openslides/assignments/signals.py similarity index 100% rename from openslides/assignments/signals.py rename to server/openslides/assignments/signals.py diff --git a/openslides/assignments/views.py b/server/openslides/assignments/views.py similarity index 100% rename from openslides/assignments/views.py rename to server/openslides/assignments/views.py diff --git a/openslides/core/__init__.py b/server/openslides/core/__init__.py similarity index 100% rename from openslides/core/__init__.py rename to server/openslides/core/__init__.py diff --git a/openslides/core/access_permissions.py b/server/openslides/core/access_permissions.py similarity index 100% rename from openslides/core/access_permissions.py rename to server/openslides/core/access_permissions.py diff --git a/openslides/core/apps.py b/server/openslides/core/apps.py similarity index 100% rename from openslides/core/apps.py rename to server/openslides/core/apps.py diff --git a/openslides/core/config.py b/server/openslides/core/config.py similarity index 100% rename from openslides/core/config.py rename to server/openslides/core/config.py diff --git a/openslides/core/config_variables.py b/server/openslides/core/config_variables.py similarity index 100% rename from openslides/core/config_variables.py rename to server/openslides/core/config_variables.py diff --git a/openslides/core/exceptions.py b/server/openslides/core/exceptions.py similarity index 100% rename from openslides/core/exceptions.py rename to server/openslides/core/exceptions.py diff --git a/openslides/core/management/__init__.py b/server/openslides/core/management/__init__.py similarity index 100% rename from openslides/core/management/__init__.py rename to server/openslides/core/management/__init__.py diff --git a/openslides/core/management/commands/__init__.py b/server/openslides/core/management/commands/__init__.py similarity index 100% rename from openslides/core/management/commands/__init__.py rename to server/openslides/core/management/commands/__init__.py diff --git a/openslides/core/management/commands/backupdb.py b/server/openslides/core/management/commands/backupdb.py similarity index 100% rename from openslides/core/management/commands/backupdb.py rename to server/openslides/core/management/commands/backupdb.py diff --git a/openslides/core/management/commands/changeconfig.py b/server/openslides/core/management/commands/changeconfig.py similarity index 100% rename from openslides/core/management/commands/changeconfig.py rename to server/openslides/core/management/commands/changeconfig.py diff --git a/openslides/core/management/commands/migrate.py b/server/openslides/core/management/commands/migrate.py similarity index 100% rename from openslides/core/management/commands/migrate.py rename to server/openslides/core/management/commands/migrate.py diff --git a/openslides/core/migrations/0001_initial.py b/server/openslides/core/migrations/0001_initial.py similarity index 100% rename from openslides/core/migrations/0001_initial.py rename to server/openslides/core/migrations/0001_initial.py diff --git a/openslides/core/migrations/0002_misc_features.py b/server/openslides/core/migrations/0002_misc_features.py similarity index 100% rename from openslides/core/migrations/0002_misc_features.py rename to server/openslides/core/migrations/0002_misc_features.py diff --git a/openslides/core/migrations/0003_auto_20161217_1158.py b/server/openslides/core/migrations/0003_auto_20161217_1158.py similarity index 100% rename from openslides/core/migrations/0003_auto_20161217_1158.py rename to server/openslides/core/migrations/0003_auto_20161217_1158.py diff --git a/openslides/core/migrations/0004_auto_20170215_1624.py b/server/openslides/core/migrations/0004_auto_20170215_1624.py similarity index 100% rename from openslides/core/migrations/0004_auto_20170215_1624.py rename to server/openslides/core/migrations/0004_auto_20170215_1624.py diff --git a/openslides/core/migrations/0005_auto_20170412_1258.py b/server/openslides/core/migrations/0005_auto_20170412_1258.py similarity index 100% rename from openslides/core/migrations/0005_auto_20170412_1258.py rename to server/openslides/core/migrations/0005_auto_20170412_1258.py diff --git a/openslides/core/migrations/0006_auto_20180123_0903.py b/server/openslides/core/migrations/0006_auto_20180123_0903.py similarity index 100% rename from openslides/core/migrations/0006_auto_20180123_0903.py rename to server/openslides/core/migrations/0006_auto_20180123_0903.py diff --git a/openslides/core/migrations/0007_auto_20180130_1400.py b/server/openslides/core/migrations/0007_auto_20180130_1400.py similarity index 100% rename from openslides/core/migrations/0007_auto_20180130_1400.py rename to server/openslides/core/migrations/0007_auto_20180130_1400.py diff --git a/openslides/core/migrations/0008_changed_logo_fields.py b/server/openslides/core/migrations/0008_changed_logo_fields.py similarity index 100% rename from openslides/core/migrations/0008_changed_logo_fields.py rename to server/openslides/core/migrations/0008_changed_logo_fields.py diff --git a/openslides/core/migrations/0009_auto_20181118_2126.py b/server/openslides/core/migrations/0009_auto_20181118_2126.py similarity index 100% rename from openslides/core/migrations/0009_auto_20181118_2126.py rename to server/openslides/core/migrations/0009_auto_20181118_2126.py diff --git a/openslides/core/migrations/0010_auto_20190118_1908.py b/server/openslides/core/migrations/0010_auto_20190118_1908.py similarity index 100% rename from openslides/core/migrations/0010_auto_20190118_1908.py rename to server/openslides/core/migrations/0010_auto_20190118_1908.py diff --git a/openslides/core/migrations/0011_auto_20190119_0958.py b/server/openslides/core/migrations/0011_auto_20190119_0958.py similarity index 100% rename from openslides/core/migrations/0011_auto_20190119_0958.py rename to server/openslides/core/migrations/0011_auto_20190119_0958.py diff --git a/openslides/core/migrations/0012_auto_20190119_1425.py b/server/openslides/core/migrations/0012_auto_20190119_1425.py similarity index 100% rename from openslides/core/migrations/0012_auto_20190119_1425.py rename to server/openslides/core/migrations/0012_auto_20190119_1425.py diff --git a/openslides/core/migrations/0013_auto_20190119_1641.py b/server/openslides/core/migrations/0013_auto_20190119_1641.py similarity index 100% rename from openslides/core/migrations/0013_auto_20190119_1641.py rename to server/openslides/core/migrations/0013_auto_20190119_1641.py diff --git a/openslides/core/migrations/0014_changed_default_font.py b/server/openslides/core/migrations/0014_changed_default_font.py similarity index 100% rename from openslides/core/migrations/0014_changed_default_font.py rename to server/openslides/core/migrations/0014_changed_default_font.py diff --git a/openslides/core/migrations/0015_auto_20190122_1216.py b/server/openslides/core/migrations/0015_auto_20190122_1216.py similarity index 100% rename from openslides/core/migrations/0015_auto_20190122_1216.py rename to server/openslides/core/migrations/0015_auto_20190122_1216.py diff --git a/openslides/core/migrations/0016_projector_reference_projector.py b/server/openslides/core/migrations/0016_projector_reference_projector.py similarity index 100% rename from openslides/core/migrations/0016_projector_reference_projector.py rename to server/openslides/core/migrations/0016_projector_reference_projector.py diff --git a/openslides/core/migrations/0017_auto_20190219_2015.py b/server/openslides/core/migrations/0017_auto_20190219_2015.py similarity index 100% rename from openslides/core/migrations/0017_auto_20190219_2015.py rename to server/openslides/core/migrations/0017_auto_20190219_2015.py diff --git a/openslides/core/migrations/0018_auto_20190222_1209.py b/server/openslides/core/migrations/0018_auto_20190222_1209.py similarity index 100% rename from openslides/core/migrations/0018_auto_20190222_1209.py rename to server/openslides/core/migrations/0018_auto_20190222_1209.py diff --git a/openslides/core/migrations/0019_countdown_title_1.py b/server/openslides/core/migrations/0019_countdown_title_1.py similarity index 100% rename from openslides/core/migrations/0019_countdown_title_1.py rename to server/openslides/core/migrations/0019_countdown_title_1.py diff --git a/openslides/core/migrations/0019_countdown_title_2.py b/server/openslides/core/migrations/0019_countdown_title_2.py similarity index 100% rename from openslides/core/migrations/0019_countdown_title_2.py rename to server/openslides/core/migrations/0019_countdown_title_2.py diff --git a/openslides/core/migrations/0020_set_reference_projector.py b/server/openslides/core/migrations/0020_set_reference_projector.py similarity index 100% rename from openslides/core/migrations/0020_set_reference_projector.py rename to server/openslides/core/migrations/0020_set_reference_projector.py diff --git a/openslides/core/migrations/0021_auto_20190415_0942.py b/server/openslides/core/migrations/0021_auto_20190415_0942.py similarity index 100% rename from openslides/core/migrations/0021_auto_20190415_0942.py rename to server/openslides/core/migrations/0021_auto_20190415_0942.py diff --git a/openslides/core/migrations/0022_remove_chatmessage.py b/server/openslides/core/migrations/0022_remove_chatmessage.py similarity index 100% rename from openslides/core/migrations/0022_remove_chatmessage.py rename to server/openslides/core/migrations/0022_remove_chatmessage.py diff --git a/openslides/core/migrations/0023_chyron_colors.py b/server/openslides/core/migrations/0023_chyron_colors.py similarity index 100% rename from openslides/core/migrations/0023_chyron_colors.py rename to server/openslides/core/migrations/0023_chyron_colors.py diff --git a/openslides/core/migrations/0024_auto_20190605_1105.py b/server/openslides/core/migrations/0024_auto_20190605_1105.py similarity index 100% rename from openslides/core/migrations/0024_auto_20190605_1105.py rename to server/openslides/core/migrations/0024_auto_20190605_1105.py diff --git a/openslides/core/migrations/0025_projector_color.py b/server/openslides/core/migrations/0025_projector_color.py similarity index 100% rename from openslides/core/migrations/0025_projector_color.py rename to server/openslides/core/migrations/0025_projector_color.py diff --git a/openslides/core/migrations/0026_projector_size_1.py b/server/openslides/core/migrations/0026_projector_size_1.py similarity index 100% rename from openslides/core/migrations/0026_projector_size_1.py rename to server/openslides/core/migrations/0026_projector_size_1.py diff --git a/openslides/core/migrations/0027_projector_size_2.py b/server/openslides/core/migrations/0027_projector_size_2.py similarity index 100% rename from openslides/core/migrations/0027_projector_size_2.py rename to server/openslides/core/migrations/0027_projector_size_2.py diff --git a/openslides/core/migrations/0028_projector_size_3.py b/server/openslides/core/migrations/0028_projector_size_3.py similarity index 100% rename from openslides/core/migrations/0028_projector_size_3.py rename to server/openslides/core/migrations/0028_projector_size_3.py diff --git a/openslides/core/migrations/0029_remove_history_restricted.py b/server/openslides/core/migrations/0029_remove_history_restricted.py similarity index 100% rename from openslides/core/migrations/0029_remove_history_restricted.py rename to server/openslides/core/migrations/0029_remove_history_restricted.py diff --git a/openslides/core/migrations/0030_voting_projection_defaults.py b/server/openslides/core/migrations/0030_voting_projection_defaults.py similarity index 100% rename from openslides/core/migrations/0030_voting_projection_defaults.py rename to server/openslides/core/migrations/0030_voting_projection_defaults.py diff --git a/openslides/core/migrations/0031_projector_default_height.py b/server/openslides/core/migrations/0031_projector_default_height.py similarity index 100% rename from openslides/core/migrations/0031_projector_default_height.py rename to server/openslides/core/migrations/0031_projector_default_height.py diff --git a/openslides/core/migrations/0032_add_monospace_font.py b/server/openslides/core/migrations/0032_add_monospace_font.py similarity index 100% rename from openslides/core/migrations/0032_add_monospace_font.py rename to server/openslides/core/migrations/0032_add_monospace_font.py diff --git a/openslides/core/migrations/0033_live_stream_permission.py b/server/openslides/core/migrations/0033_live_stream_permission.py similarity index 100% rename from openslides/core/migrations/0033_live_stream_permission.py rename to server/openslides/core/migrations/0033_live_stream_permission.py diff --git a/openslides/core/migrations/__init__.py b/server/openslides/core/migrations/__init__.py similarity index 100% rename from openslides/core/migrations/__init__.py rename to server/openslides/core/migrations/__init__.py diff --git a/openslides/core/models.py b/server/openslides/core/models.py similarity index 100% rename from openslides/core/models.py rename to server/openslides/core/models.py diff --git a/openslides/core/projector.py b/server/openslides/core/projector.py similarity index 100% rename from openslides/core/projector.py rename to server/openslides/core/projector.py diff --git a/openslides/core/serializers.py b/server/openslides/core/serializers.py similarity index 100% rename from openslides/core/serializers.py rename to server/openslides/core/serializers.py diff --git a/openslides/core/signals.py b/server/openslides/core/signals.py similarity index 100% rename from openslides/core/signals.py rename to server/openslides/core/signals.py diff --git a/openslides/core/static/index.html b/server/openslides/core/static/index.html similarity index 100% rename from openslides/core/static/index.html rename to server/openslides/core/static/index.html diff --git a/openslides/core/urls.py b/server/openslides/core/urls.py similarity index 100% rename from openslides/core/urls.py rename to server/openslides/core/urls.py diff --git a/openslides/core/views.py b/server/openslides/core/views.py similarity index 100% rename from openslides/core/views.py rename to server/openslides/core/views.py diff --git a/openslides/global_settings.py b/server/openslides/global_settings.py similarity index 100% rename from openslides/global_settings.py rename to server/openslides/global_settings.py diff --git a/openslides/mediafiles/__init__.py b/server/openslides/mediafiles/__init__.py similarity index 100% rename from openslides/mediafiles/__init__.py rename to server/openslides/mediafiles/__init__.py diff --git a/openslides/mediafiles/access_permissions.py b/server/openslides/mediafiles/access_permissions.py similarity index 100% rename from openslides/mediafiles/access_permissions.py rename to server/openslides/mediafiles/access_permissions.py diff --git a/openslides/mediafiles/apps.py b/server/openslides/mediafiles/apps.py similarity index 100% rename from openslides/mediafiles/apps.py rename to server/openslides/mediafiles/apps.py diff --git a/openslides/mediafiles/config.py b/server/openslides/mediafiles/config.py similarity index 100% rename from openslides/mediafiles/config.py rename to server/openslides/mediafiles/config.py diff --git a/openslides/mediafiles/management/__init__.py b/server/openslides/mediafiles/management/__init__.py similarity index 100% rename from openslides/mediafiles/management/__init__.py rename to server/openslides/mediafiles/management/__init__.py diff --git a/openslides/mediafiles/management/commands/__init__.py b/server/openslides/mediafiles/management/commands/__init__.py similarity index 100% rename from openslides/mediafiles/management/commands/__init__.py rename to server/openslides/mediafiles/management/commands/__init__.py diff --git a/openslides/mediafiles/management/commands/export_mediafiles.py b/server/openslides/mediafiles/management/commands/export_mediafiles.py similarity index 100% rename from openslides/mediafiles/management/commands/export_mediafiles.py rename to server/openslides/mediafiles/management/commands/export_mediafiles.py diff --git a/openslides/mediafiles/migrations/0001_initial.py b/server/openslides/mediafiles/migrations/0001_initial.py similarity index 100% rename from openslides/mediafiles/migrations/0001_initial.py rename to server/openslides/mediafiles/migrations/0001_initial.py diff --git a/openslides/mediafiles/migrations/0002_mediafile_private.py b/server/openslides/mediafiles/migrations/0002_mediafile_private.py similarity index 100% rename from openslides/mediafiles/migrations/0002_mediafile_private.py rename to server/openslides/mediafiles/migrations/0002_mediafile_private.py diff --git a/openslides/mediafiles/migrations/0003_auto_20190119_1425.py b/server/openslides/mediafiles/migrations/0003_auto_20190119_1425.py similarity index 100% rename from openslides/mediafiles/migrations/0003_auto_20190119_1425.py rename to server/openslides/mediafiles/migrations/0003_auto_20190119_1425.py diff --git a/openslides/mediafiles/migrations/0004_directories_and_permissions_1.py b/server/openslides/mediafiles/migrations/0004_directories_and_permissions_1.py similarity index 100% rename from openslides/mediafiles/migrations/0004_directories_and_permissions_1.py rename to server/openslides/mediafiles/migrations/0004_directories_and_permissions_1.py diff --git a/openslides/mediafiles/migrations/0005_directories_and_permissions_2.py b/server/openslides/mediafiles/migrations/0005_directories_and_permissions_2.py similarity index 100% rename from openslides/mediafiles/migrations/0005_directories_and_permissions_2.py rename to server/openslides/mediafiles/migrations/0005_directories_and_permissions_2.py diff --git a/openslides/mediafiles/migrations/0006_directories_and_permissions_3.py b/server/openslides/mediafiles/migrations/0006_directories_and_permissions_3.py similarity index 100% rename from openslides/mediafiles/migrations/0006_directories_and_permissions_3.py rename to server/openslides/mediafiles/migrations/0006_directories_and_permissions_3.py diff --git a/openslides/mediafiles/migrations/0007_external_storage_1.py b/server/openslides/mediafiles/migrations/0007_external_storage_1.py similarity index 100% rename from openslides/mediafiles/migrations/0007_external_storage_1.py rename to server/openslides/mediafiles/migrations/0007_external_storage_1.py diff --git a/openslides/mediafiles/migrations/0008_external_storage_2.py b/server/openslides/mediafiles/migrations/0008_external_storage_2.py similarity index 100% rename from openslides/mediafiles/migrations/0008_external_storage_2.py rename to server/openslides/mediafiles/migrations/0008_external_storage_2.py diff --git a/openslides/mediafiles/migrations/__init__.py b/server/openslides/mediafiles/migrations/__init__.py similarity index 100% rename from openslides/mediafiles/migrations/__init__.py rename to server/openslides/mediafiles/migrations/__init__.py diff --git a/openslides/mediafiles/models.py b/server/openslides/mediafiles/models.py similarity index 100% rename from openslides/mediafiles/models.py rename to server/openslides/mediafiles/models.py diff --git a/openslides/mediafiles/projector.py b/server/openslides/mediafiles/projector.py similarity index 100% rename from openslides/mediafiles/projector.py rename to server/openslides/mediafiles/projector.py diff --git a/openslides/mediafiles/serializers.py b/server/openslides/mediafiles/serializers.py similarity index 100% rename from openslides/mediafiles/serializers.py rename to server/openslides/mediafiles/serializers.py diff --git a/openslides/mediafiles/signals.py b/server/openslides/mediafiles/signals.py similarity index 100% rename from openslides/mediafiles/signals.py rename to server/openslides/mediafiles/signals.py diff --git a/openslides/mediafiles/utils.py b/server/openslides/mediafiles/utils.py similarity index 100% rename from openslides/mediafiles/utils.py rename to server/openslides/mediafiles/utils.py diff --git a/openslides/mediafiles/views.py b/server/openslides/mediafiles/views.py similarity index 100% rename from openslides/mediafiles/views.py rename to server/openslides/mediafiles/views.py diff --git a/openslides/motions/__init__.py b/server/openslides/motions/__init__.py similarity index 100% rename from openslides/motions/__init__.py rename to server/openslides/motions/__init__.py diff --git a/openslides/motions/access_permissions.py b/server/openslides/motions/access_permissions.py similarity index 100% rename from openslides/motions/access_permissions.py rename to server/openslides/motions/access_permissions.py diff --git a/openslides/motions/apps.py b/server/openslides/motions/apps.py similarity index 100% rename from openslides/motions/apps.py rename to server/openslides/motions/apps.py diff --git a/openslides/motions/config_variables.py b/server/openslides/motions/config_variables.py similarity index 100% rename from openslides/motions/config_variables.py rename to server/openslides/motions/config_variables.py diff --git a/openslides/motions/exceptions.py b/server/openslides/motions/exceptions.py similarity index 100% rename from openslides/motions/exceptions.py rename to server/openslides/motions/exceptions.py diff --git a/openslides/motions/migrations/0001_initial.py b/server/openslides/motions/migrations/0001_initial.py similarity index 100% rename from openslides/motions/migrations/0001_initial.py rename to server/openslides/motions/migrations/0001_initial.py diff --git a/openslides/motions/migrations/0002_misc_features.py b/server/openslides/motions/migrations/0002_misc_features.py similarity index 100% rename from openslides/motions/migrations/0002_misc_features.py rename to server/openslides/motions/migrations/0002_misc_features.py diff --git a/openslides/motions/migrations/0003_motion_comments.py b/server/openslides/motions/migrations/0003_motion_comments.py similarity index 100% rename from openslides/motions/migrations/0003_motion_comments.py rename to server/openslides/motions/migrations/0003_motion_comments.py diff --git a/openslides/motions/migrations/0004_motionchangerecommendation_other_description.py b/server/openslides/motions/migrations/0004_motionchangerecommendation_other_description.py similarity index 100% rename from openslides/motions/migrations/0004_motionchangerecommendation_other_description.py rename to server/openslides/motions/migrations/0004_motionchangerecommendation_other_description.py diff --git a/openslides/motions/migrations/0005_auto_20180202_1318.py b/server/openslides/motions/migrations/0005_auto_20180202_1318.py similarity index 100% rename from openslides/motions/migrations/0005_auto_20180202_1318.py rename to server/openslides/motions/migrations/0005_auto_20180202_1318.py diff --git a/openslides/motions/migrations/0006_submitter_model.py b/server/openslides/motions/migrations/0006_submitter_model.py similarity index 100% rename from openslides/motions/migrations/0006_submitter_model.py rename to server/openslides/motions/migrations/0006_submitter_model.py diff --git a/openslides/motions/migrations/0007_motionversion_amendment_data.py b/server/openslides/motions/migrations/0007_motionversion_amendment_data.py similarity index 100% rename from openslides/motions/migrations/0007_motionversion_amendment_data.py rename to server/openslides/motions/migrations/0007_motionversion_amendment_data.py diff --git a/openslides/motions/migrations/0008_auto_20180702_1128.py b/server/openslides/motions/migrations/0008_auto_20180702_1128.py similarity index 100% rename from openslides/motions/migrations/0008_auto_20180702_1128.py rename to server/openslides/motions/migrations/0008_auto_20180702_1128.py diff --git a/openslides/motions/migrations/0009_motionversion_modified_final_version.py b/server/openslides/motions/migrations/0009_motionversion_modified_final_version.py similarity index 100% rename from openslides/motions/migrations/0009_motionversion_modified_final_version.py rename to server/openslides/motions/migrations/0009_motionversion_modified_final_version.py diff --git a/openslides/motions/migrations/0010_auto_20180822_1042.py b/server/openslides/motions/migrations/0010_auto_20180822_1042.py similarity index 100% rename from openslides/motions/migrations/0010_auto_20180822_1042.py rename to server/openslides/motions/migrations/0010_auto_20180822_1042.py diff --git a/openslides/motions/migrations/0011_motion_version_1.py b/server/openslides/motions/migrations/0011_motion_version_1.py similarity index 100% rename from openslides/motions/migrations/0011_motion_version_1.py rename to server/openslides/motions/migrations/0011_motion_version_1.py diff --git a/openslides/motions/migrations/0011_motion_version_2.py b/server/openslides/motions/migrations/0011_motion_version_2.py similarity index 100% rename from openslides/motions/migrations/0011_motion_version_2.py rename to server/openslides/motions/migrations/0011_motion_version_2.py diff --git a/openslides/motions/migrations/0011_motion_version_3.py b/server/openslides/motions/migrations/0011_motion_version_3.py similarity index 100% rename from openslides/motions/migrations/0011_motion_version_3.py rename to server/openslides/motions/migrations/0011_motion_version_3.py diff --git a/openslides/motions/migrations/0011_motion_version_4.py b/server/openslides/motions/migrations/0011_motion_version_4.py similarity index 100% rename from openslides/motions/migrations/0011_motion_version_4.py rename to server/openslides/motions/migrations/0011_motion_version_4.py diff --git a/openslides/motions/migrations/0012_motion_comments.py b/server/openslides/motions/migrations/0012_motion_comments.py similarity index 100% rename from openslides/motions/migrations/0012_motion_comments.py rename to server/openslides/motions/migrations/0012_motion_comments.py diff --git a/openslides/motions/migrations/0013_motion_sorting_and_statute.py b/server/openslides/motions/migrations/0013_motion_sorting_and_statute.py similarity index 100% rename from openslides/motions/migrations/0013_motion_sorting_and_statute.py rename to server/openslides/motions/migrations/0013_motion_sorting_and_statute.py diff --git a/openslides/motions/migrations/0014_motionchangerecommendation_internal.py b/server/openslides/motions/migrations/0014_motionchangerecommendation_internal.py similarity index 100% rename from openslides/motions/migrations/0014_motionchangerecommendation_internal.py rename to server/openslides/motions/migrations/0014_motionchangerecommendation_internal.py diff --git a/openslides/motions/migrations/0015_metadata_permission.py b/server/openslides/motions/migrations/0015_metadata_permission.py similarity index 100% rename from openslides/motions/migrations/0015_metadata_permission.py rename to server/openslides/motions/migrations/0015_metadata_permission.py diff --git a/openslides/motions/migrations/0016_merge_amendment_into_final.py b/server/openslides/motions/migrations/0016_merge_amendment_into_final.py similarity index 100% rename from openslides/motions/migrations/0016_merge_amendment_into_final.py rename to server/openslides/motions/migrations/0016_merge_amendment_into_final.py diff --git a/openslides/motions/migrations/0017_remove_state_action_word.py b/server/openslides/motions/migrations/0017_remove_state_action_word.py similarity index 100% rename from openslides/motions/migrations/0017_remove_state_action_word.py rename to server/openslides/motions/migrations/0017_remove_state_action_word.py diff --git a/openslides/motions/migrations/0018_auto_20190118_2101.py b/server/openslides/motions/migrations/0018_auto_20190118_2101.py similarity index 100% rename from openslides/motions/migrations/0018_auto_20190118_2101.py rename to server/openslides/motions/migrations/0018_auto_20190118_2101.py diff --git a/openslides/motions/migrations/0019_auto_20190119_1025.py b/server/openslides/motions/migrations/0019_auto_20190119_1025.py similarity index 100% rename from openslides/motions/migrations/0019_auto_20190119_1025.py rename to server/openslides/motions/migrations/0019_auto_20190119_1025.py diff --git a/openslides/motions/migrations/0020_auto_20190119_1425.py b/server/openslides/motions/migrations/0020_auto_20190119_1425.py similarity index 100% rename from openslides/motions/migrations/0020_auto_20190119_1425.py rename to server/openslides/motions/migrations/0020_auto_20190119_1425.py diff --git a/openslides/motions/migrations/0021_state_access_level_1.py b/server/openslides/motions/migrations/0021_state_access_level_1.py similarity index 100% rename from openslides/motions/migrations/0021_state_access_level_1.py rename to server/openslides/motions/migrations/0021_state_access_level_1.py diff --git a/openslides/motions/migrations/0021_state_access_level_2.py b/server/openslides/motions/migrations/0021_state_access_level_2.py similarity index 100% rename from openslides/motions/migrations/0021_state_access_level_2.py rename to server/openslides/motions/migrations/0021_state_access_level_2.py diff --git a/openslides/motions/migrations/0021_state_access_level_3.py b/server/openslides/motions/migrations/0021_state_access_level_3.py similarity index 100% rename from openslides/motions/migrations/0021_state_access_level_3.py rename to server/openslides/motions/migrations/0021_state_access_level_3.py diff --git a/openslides/motions/migrations/0022_auto_20190320_0840.py b/server/openslides/motions/migrations/0022_auto_20190320_0840.py similarity index 100% rename from openslides/motions/migrations/0022_auto_20190320_0840.py rename to server/openslides/motions/migrations/0022_auto_20190320_0840.py diff --git a/openslides/motions/migrations/0023_remove_motion_log.py b/server/openslides/motions/migrations/0023_remove_motion_log.py similarity index 100% rename from openslides/motions/migrations/0023_remove_motion_log.py rename to server/openslides/motions/migrations/0023_remove_motion_log.py diff --git a/openslides/motions/migrations/0024_state_restriction_1.py b/server/openslides/motions/migrations/0024_state_restriction_1.py similarity index 100% rename from openslides/motions/migrations/0024_state_restriction_1.py rename to server/openslides/motions/migrations/0024_state_restriction_1.py diff --git a/openslides/motions/migrations/0024_state_restriction_2.py b/server/openslides/motions/migrations/0024_state_restriction_2.py similarity index 100% rename from openslides/motions/migrations/0024_state_restriction_2.py rename to server/openslides/motions/migrations/0024_state_restriction_2.py diff --git a/openslides/motions/migrations/0024_state_restriction_3.py b/server/openslides/motions/migrations/0024_state_restriction_3.py similarity index 100% rename from openslides/motions/migrations/0024_state_restriction_3.py rename to server/openslides/motions/migrations/0024_state_restriction_3.py diff --git a/openslides/motions/migrations/0025_motion_category_weight.py b/server/openslides/motions/migrations/0025_motion_category_weight.py similarity index 100% rename from openslides/motions/migrations/0025_motion_category_weight.py rename to server/openslides/motions/migrations/0025_motion_category_weight.py diff --git a/openslides/motions/migrations/0026_rename_restriction.py b/server/openslides/motions/migrations/0026_rename_restriction.py similarity index 100% rename from openslides/motions/migrations/0026_rename_restriction.py rename to server/openslides/motions/migrations/0026_rename_restriction.py diff --git a/openslides/motions/migrations/0027_motion_block_internal.py b/server/openslides/motions/migrations/0027_motion_block_internal.py similarity index 100% rename from openslides/motions/migrations/0027_motion_block_internal.py rename to server/openslides/motions/migrations/0027_motion_block_internal.py diff --git a/openslides/motions/migrations/0028_subcategories.py b/server/openslides/motions/migrations/0028_subcategories.py similarity index 100% rename from openslides/motions/migrations/0028_subcategories.py rename to server/openslides/motions/migrations/0028_subcategories.py diff --git a/openslides/motions/migrations/0029_motioncommentsection_weight.py b/server/openslides/motions/migrations/0029_motioncommentsection_weight.py similarity index 100% rename from openslides/motions/migrations/0029_motioncommentsection_weight.py rename to server/openslides/motions/migrations/0029_motioncommentsection_weight.py diff --git a/openslides/motions/migrations/0030_state_css_classes_1.py b/server/openslides/motions/migrations/0030_state_css_classes_1.py similarity index 100% rename from openslides/motions/migrations/0030_state_css_classes_1.py rename to server/openslides/motions/migrations/0030_state_css_classes_1.py diff --git a/openslides/motions/migrations/0031_state_css_classes_2.py b/server/openslides/motions/migrations/0031_state_css_classes_2.py similarity index 100% rename from openslides/motions/migrations/0031_state_css_classes_2.py rename to server/openslides/motions/migrations/0031_state_css_classes_2.py diff --git a/openslides/motions/migrations/0032_category_cascade_delete.py b/server/openslides/motions/migrations/0032_category_cascade_delete.py similarity index 100% rename from openslides/motions/migrations/0032_category_cascade_delete.py rename to server/openslides/motions/migrations/0032_category_cascade_delete.py diff --git a/openslides/motions/migrations/0033_voting_1.py b/server/openslides/motions/migrations/0033_voting_1.py similarity index 100% rename from openslides/motions/migrations/0033_voting_1.py rename to server/openslides/motions/migrations/0033_voting_1.py diff --git a/openslides/motions/migrations/0034_voting_2.py b/server/openslides/motions/migrations/0034_voting_2.py similarity index 100% rename from openslides/motions/migrations/0034_voting_2.py rename to server/openslides/motions/migrations/0034_voting_2.py diff --git a/openslides/motions/migrations/0035_motion_vote_unique_together.py b/server/openslides/motions/migrations/0035_motion_vote_unique_together.py similarity index 100% rename from openslides/motions/migrations/0035_motion_vote_unique_together.py rename to server/openslides/motions/migrations/0035_motion_vote_unique_together.py diff --git a/openslides/motions/migrations/0036_rename_verbose_poll_types.py b/server/openslides/motions/migrations/0036_rename_verbose_poll_types.py similarity index 100% rename from openslides/motions/migrations/0036_rename_verbose_poll_types.py rename to server/openslides/motions/migrations/0036_rename_verbose_poll_types.py diff --git a/openslides/motions/migrations/__init__.py b/server/openslides/motions/migrations/__init__.py similarity index 100% rename from openslides/motions/migrations/__init__.py rename to server/openslides/motions/migrations/__init__.py diff --git a/openslides/motions/models.py b/server/openslides/motions/models.py similarity index 100% rename from openslides/motions/models.py rename to server/openslides/motions/models.py diff --git a/openslides/motions/numbering.py b/server/openslides/motions/numbering.py similarity index 100% rename from openslides/motions/numbering.py rename to server/openslides/motions/numbering.py diff --git a/openslides/motions/projector.py b/server/openslides/motions/projector.py similarity index 100% rename from openslides/motions/projector.py rename to server/openslides/motions/projector.py diff --git a/openslides/motions/serializers.py b/server/openslides/motions/serializers.py similarity index 100% rename from openslides/motions/serializers.py rename to server/openslides/motions/serializers.py diff --git a/openslides/motions/signals.py b/server/openslides/motions/signals.py similarity index 100% rename from openslides/motions/signals.py rename to server/openslides/motions/signals.py diff --git a/openslides/motions/views.py b/server/openslides/motions/views.py similarity index 100% rename from openslides/motions/views.py rename to server/openslides/motions/views.py diff --git a/openslides/poll/__init__.py b/server/openslides/poll/__init__.py similarity index 100% rename from openslides/poll/__init__.py rename to server/openslides/poll/__init__.py diff --git a/openslides/poll/access_permissions.py b/server/openslides/poll/access_permissions.py similarity index 100% rename from openslides/poll/access_permissions.py rename to server/openslides/poll/access_permissions.py diff --git a/openslides/poll/models.py b/server/openslides/poll/models.py similarity index 100% rename from openslides/poll/models.py rename to server/openslides/poll/models.py diff --git a/openslides/poll/serializers.py b/server/openslides/poll/serializers.py similarity index 100% rename from openslides/poll/serializers.py rename to server/openslides/poll/serializers.py diff --git a/openslides/poll/views.py b/server/openslides/poll/views.py similarity index 100% rename from openslides/poll/views.py rename to server/openslides/poll/views.py diff --git a/openslides/routing.py b/server/openslides/routing.py similarity index 100% rename from openslides/routing.py rename to server/openslides/routing.py diff --git a/openslides/saml/README.md b/server/openslides/saml/README.md similarity index 100% rename from openslides/saml/README.md rename to server/openslides/saml/README.md diff --git a/openslides/saml/__init__.py b/server/openslides/saml/__init__.py similarity index 100% rename from openslides/saml/__init__.py rename to server/openslides/saml/__init__.py diff --git a/openslides/saml/apps.py b/server/openslides/saml/apps.py similarity index 100% rename from openslides/saml/apps.py rename to server/openslides/saml/apps.py diff --git a/openslides/saml/exceptions.py b/server/openslides/saml/exceptions.py similarity index 100% rename from openslides/saml/exceptions.py rename to server/openslides/saml/exceptions.py diff --git a/openslides/saml/management/__init__.py b/server/openslides/saml/management/__init__.py similarity index 100% rename from openslides/saml/management/__init__.py rename to server/openslides/saml/management/__init__.py diff --git a/openslides/saml/management/commands/__init__.py b/server/openslides/saml/management/commands/__init__.py similarity index 100% rename from openslides/saml/management/commands/__init__.py rename to server/openslides/saml/management/commands/__init__.py diff --git a/openslides/saml/management/commands/create-saml-settings.py b/server/openslides/saml/management/commands/create-saml-settings.py similarity index 100% rename from openslides/saml/management/commands/create-saml-settings.py rename to server/openslides/saml/management/commands/create-saml-settings.py diff --git a/openslides/saml/saml_settings.json.tpl b/server/openslides/saml/saml_settings.json.tpl similarity index 100% rename from openslides/saml/saml_settings.json.tpl rename to server/openslides/saml/saml_settings.json.tpl diff --git a/openslides/saml/settings.py b/server/openslides/saml/settings.py similarity index 100% rename from openslides/saml/settings.py rename to server/openslides/saml/settings.py diff --git a/openslides/saml/urls.py b/server/openslides/saml/urls.py similarity index 100% rename from openslides/saml/urls.py rename to server/openslides/saml/urls.py diff --git a/openslides/saml/user_backend.py b/server/openslides/saml/user_backend.py similarity index 100% rename from openslides/saml/user_backend.py rename to server/openslides/saml/user_backend.py diff --git a/openslides/saml/views.py b/server/openslides/saml/views.py similarity index 100% rename from openslides/saml/views.py rename to server/openslides/saml/views.py diff --git a/openslides/topics/__init__.py b/server/openslides/topics/__init__.py similarity index 100% rename from openslides/topics/__init__.py rename to server/openslides/topics/__init__.py diff --git a/openslides/topics/access_permissions.py b/server/openslides/topics/access_permissions.py similarity index 100% rename from openslides/topics/access_permissions.py rename to server/openslides/topics/access_permissions.py diff --git a/openslides/topics/apps.py b/server/openslides/topics/apps.py similarity index 100% rename from openslides/topics/apps.py rename to server/openslides/topics/apps.py diff --git a/openslides/topics/migrations/0001_initial.py b/server/openslides/topics/migrations/0001_initial.py similarity index 100% rename from openslides/topics/migrations/0001_initial.py rename to server/openslides/topics/migrations/0001_initial.py diff --git a/openslides/topics/migrations/__init__.py b/server/openslides/topics/migrations/__init__.py similarity index 100% rename from openslides/topics/migrations/__init__.py rename to server/openslides/topics/migrations/__init__.py diff --git a/openslides/topics/models.py b/server/openslides/topics/models.py similarity index 100% rename from openslides/topics/models.py rename to server/openslides/topics/models.py diff --git a/openslides/topics/projector.py b/server/openslides/topics/projector.py similarity index 100% rename from openslides/topics/projector.py rename to server/openslides/topics/projector.py diff --git a/openslides/topics/serializers.py b/server/openslides/topics/serializers.py similarity index 100% rename from openslides/topics/serializers.py rename to server/openslides/topics/serializers.py diff --git a/openslides/topics/signals.py b/server/openslides/topics/signals.py similarity index 100% rename from openslides/topics/signals.py rename to server/openslides/topics/signals.py diff --git a/openslides/topics/views.py b/server/openslides/topics/views.py similarity index 100% rename from openslides/topics/views.py rename to server/openslides/topics/views.py diff --git a/openslides/urls.py b/server/openslides/urls.py similarity index 100% rename from openslides/urls.py rename to server/openslides/urls.py diff --git a/openslides/urls_apps.py b/server/openslides/urls_apps.py similarity index 100% rename from openslides/urls_apps.py rename to server/openslides/urls_apps.py diff --git a/openslides/users/__init__.py b/server/openslides/users/__init__.py similarity index 100% rename from openslides/users/__init__.py rename to server/openslides/users/__init__.py diff --git a/openslides/users/access_permissions.py b/server/openslides/users/access_permissions.py similarity index 100% rename from openslides/users/access_permissions.py rename to server/openslides/users/access_permissions.py diff --git a/openslides/users/apps.py b/server/openslides/users/apps.py similarity index 100% rename from openslides/users/apps.py rename to server/openslides/users/apps.py diff --git a/openslides/users/config_variables.py b/server/openslides/users/config_variables.py similarity index 98% rename from openslides/users/config_variables.py rename to server/openslides/users/config_variables.py index fe3d5336f..82683e1f4 100644 --- a/openslides/users/config_variables.py +++ b/server/openslides/users/config_variables.py @@ -1,3 +1,4 @@ +import os from textwrap import dedent from openslides.core.config import ConfigVariable @@ -76,7 +77,7 @@ def get_config_variables(): # TODO: Use Django's URLValidator here. yield ConfigVariable( name="users_pdf_url", - default_value="http://example.com:8000", + default_value=os.getenv("INSTANCE_DOMAIN", default="http://example.com:8000"), label="System URL", help_text="Used for QRCode in PDF of access data.", weight=540, diff --git a/openslides/users/management/__init__.py b/server/openslides/users/management/__init__.py similarity index 100% rename from openslides/users/management/__init__.py rename to server/openslides/users/management/__init__.py diff --git a/openslides/users/management/commands/__init__.py b/server/openslides/users/management/commands/__init__.py similarity index 100% rename from openslides/users/management/commands/__init__.py rename to server/openslides/users/management/commands/__init__.py diff --git a/server/openslides/users/management/commands/changedefaultadminpassword.py b/server/openslides/users/management/commands/changedefaultadminpassword.py new file mode 100644 index 000000000..c34a1d4b6 --- /dev/null +++ b/server/openslides/users/management/commands/changedefaultadminpassword.py @@ -0,0 +1,34 @@ +from django.core.management.base import BaseCommand + +from openslides.users.models import User + + +class Command(BaseCommand): + """ + Command to change a user's password. + """ + + help = "Changes the admin password, if he exists (username='admin') and the password is the default one ('admin')." + + def add_arguments(self, parser): + parser.add_argument("password", help="The new password of the admin") + + def handle(self, *args, **options): + try: + user = User.objects.get(username="admin") + except User.DoesNotExist: + self.stdout.write( + self.style.ERROR("There is no user with the username 'admin'.") + ) + return + + if user.check_password("admin"): + user.set_password(options["password"]) + user.save(skip_autoupdate=True) + self.stdout.write( + self.style.SUCCESS("Password of user admin successfully changed.") + ) + else: + self.stdout.write( + self.style.NOTICE("The admin has not the default password. Done.") + ) diff --git a/server/openslides/users/management/commands/createopenslidesuser.py b/server/openslides/users/management/commands/createopenslidesuser.py new file mode 100644 index 000000000..d85bba7bf --- /dev/null +++ b/server/openslides/users/management/commands/createopenslidesuser.py @@ -0,0 +1,57 @@ +from django.core.management.base import BaseCommand + +from ...models import User + + +class Command(BaseCommand): + """ + Command to create an OpenSlides user. + """ + + help = "Creates an OpenSlides user." + + def add_arguments(self, parser): + user_id_help = ( + "The id of the user. If given, the user will only be created with this id, if" + + " there is no user with this id. The user will not be updated, if the user already exist." + ) + parser.add_argument("first_name", help="The first name of the new user.") + parser.add_argument("last_name", help="The last name of the new user.") + parser.add_argument("username", help="The username of the new user.") + parser.add_argument("password", help="The password of the new user.") + parser.add_argument("groups_id", help="The group id of the new user.") + parser.add_argument("--email", help="The email address of the new user.") + parser.add_argument("--userid", help=user_id_help) + + def handle(self, *args, **options): + userid = None + try: + userid = int(options["userid"]) + except (ValueError, TypeError): + pass + + user_data = { + "first_name": options["first_name"], + "last_name": options["last_name"], + "default_password": options["password"], + "email": options["email"] or "", + } + if userid is None or not User.objects.filter(pk=userid).exists(): + if userid is not None: + user_data["pk"] = userid + + user = User.objects.create_user( + options["username"], + options["password"], + skip_autoupdate=True, + **user_data, + ) + if options["groups_id"].isdigit(): + user.groups.add(int(options["groups_id"])) + self.stdout.write( + self.style.SUCCESS(f"Created user {options['username']}.") + ) + else: + self.stdout.write( + self.style.NOTICE(f"A user with id {userid} already exists.") + ) diff --git a/openslides/users/management/commands/createsuperuser.py b/server/openslides/users/management/commands/createsuperuser.py similarity index 100% rename from openslides/users/management/commands/createsuperuser.py rename to server/openslides/users/management/commands/createsuperuser.py diff --git a/openslides/core/management/commands/insecurechangepassword.py b/server/openslides/users/management/commands/insecurechangepassword.py similarity index 100% rename from openslides/core/management/commands/insecurechangepassword.py rename to server/openslides/users/management/commands/insecurechangepassword.py diff --git a/openslides/users/migrations/0001_initial.py b/server/openslides/users/migrations/0001_initial.py similarity index 100% rename from openslides/users/migrations/0001_initial.py rename to server/openslides/users/migrations/0001_initial.py diff --git a/openslides/users/migrations/0002_user_misc_default_groups.py b/server/openslides/users/migrations/0002_user_misc_default_groups.py similarity index 100% rename from openslides/users/migrations/0002_user_misc_default_groups.py rename to server/openslides/users/migrations/0002_user_misc_default_groups.py diff --git a/openslides/users/migrations/0003_group.py b/server/openslides/users/migrations/0003_group.py similarity index 100% rename from openslides/users/migrations/0003_group.py rename to server/openslides/users/migrations/0003_group.py diff --git a/openslides/users/migrations/0004_personalnote.py b/server/openslides/users/migrations/0004_personalnote.py similarity index 100% rename from openslides/users/migrations/0004_personalnote.py rename to server/openslides/users/migrations/0004_personalnote.py diff --git a/openslides/users/migrations/0005_personalnote_rework.py b/server/openslides/users/migrations/0005_personalnote_rework.py similarity index 100% rename from openslides/users/migrations/0005_personalnote_rework.py rename to server/openslides/users/migrations/0005_personalnote_rework.py diff --git a/openslides/users/migrations/0006_user_email.py b/server/openslides/users/migrations/0006_user_email.py similarity index 100% rename from openslides/users/migrations/0006_user_email.py rename to server/openslides/users/migrations/0006_user_email.py diff --git a/openslides/users/migrations/0007_superadmin.py b/server/openslides/users/migrations/0007_superadmin.py similarity index 100% rename from openslides/users/migrations/0007_superadmin.py rename to server/openslides/users/migrations/0007_superadmin.py diff --git a/openslides/users/migrations/0008_user_gender.py b/server/openslides/users/migrations/0008_user_gender.py similarity index 100% rename from openslides/users/migrations/0008_user_gender.py rename to server/openslides/users/migrations/0008_user_gender.py diff --git a/openslides/users/migrations/0009_auto_20190119_0941.py b/server/openslides/users/migrations/0009_auto_20190119_0941.py similarity index 100% rename from openslides/users/migrations/0009_auto_20190119_0941.py rename to server/openslides/users/migrations/0009_auto_20190119_0941.py diff --git a/openslides/users/migrations/0010_auto_20190119_1447.py b/server/openslides/users/migrations/0010_auto_20190119_1447.py similarity index 100% rename from openslides/users/migrations/0010_auto_20190119_1447.py rename to server/openslides/users/migrations/0010_auto_20190119_1447.py diff --git a/openslides/users/migrations/0011_postgresql_auth_group_id_sequence.py b/server/openslides/users/migrations/0011_postgresql_auth_group_id_sequence.py similarity index 100% rename from openslides/users/migrations/0011_postgresql_auth_group_id_sequence.py rename to server/openslides/users/migrations/0011_postgresql_auth_group_id_sequence.py diff --git a/openslides/users/migrations/0012_user_auth_type.py b/server/openslides/users/migrations/0012_user_auth_type.py similarity index 100% rename from openslides/users/migrations/0012_user_auth_type.py rename to server/openslides/users/migrations/0012_user_auth_type.py diff --git a/openslides/users/migrations/0013_user_vote_weight.py b/server/openslides/users/migrations/0013_user_vote_weight.py similarity index 100% rename from openslides/users/migrations/0013_user_vote_weight.py rename to server/openslides/users/migrations/0013_user_vote_weight.py diff --git a/openslides/users/migrations/0014_user_rename_permission.py b/server/openslides/users/migrations/0014_user_rename_permission.py similarity index 100% rename from openslides/users/migrations/0014_user_rename_permission.py rename to server/openslides/users/migrations/0014_user_rename_permission.py diff --git a/openslides/users/migrations/__init__.py b/server/openslides/users/migrations/__init__.py similarity index 100% rename from openslides/users/migrations/__init__.py rename to server/openslides/users/migrations/__init__.py diff --git a/openslides/users/models.py b/server/openslides/users/models.py similarity index 100% rename from openslides/users/models.py rename to server/openslides/users/models.py diff --git a/openslides/users/projector.py b/server/openslides/users/projector.py similarity index 100% rename from openslides/users/projector.py rename to server/openslides/users/projector.py diff --git a/openslides/users/serializers.py b/server/openslides/users/serializers.py similarity index 100% rename from openslides/users/serializers.py rename to server/openslides/users/serializers.py diff --git a/openslides/users/signals.py b/server/openslides/users/signals.py similarity index 100% rename from openslides/users/signals.py rename to server/openslides/users/signals.py diff --git a/openslides/users/urls.py b/server/openslides/users/urls.py similarity index 100% rename from openslides/users/urls.py rename to server/openslides/users/urls.py diff --git a/openslides/users/user_backend.py b/server/openslides/users/user_backend.py similarity index 100% rename from openslides/users/user_backend.py rename to server/openslides/users/user_backend.py diff --git a/openslides/users/views.py b/server/openslides/users/views.py similarity index 100% rename from openslides/users/views.py rename to server/openslides/users/views.py diff --git a/openslides/utils/__init__.py b/server/openslides/utils/__init__.py similarity index 100% rename from openslides/utils/__init__.py rename to server/openslides/utils/__init__.py diff --git a/openslides/utils/access_permissions.py b/server/openslides/utils/access_permissions.py similarity index 100% rename from openslides/utils/access_permissions.py rename to server/openslides/utils/access_permissions.py diff --git a/openslides/utils/arguments.py b/server/openslides/utils/arguments.py similarity index 100% rename from openslides/utils/arguments.py rename to server/openslides/utils/arguments.py diff --git a/openslides/utils/auth.py b/server/openslides/utils/auth.py similarity index 100% rename from openslides/utils/auth.py rename to server/openslides/utils/auth.py diff --git a/openslides/utils/autoupdate.py b/server/openslides/utils/autoupdate.py similarity index 100% rename from openslides/utils/autoupdate.py rename to server/openslides/utils/autoupdate.py diff --git a/openslides/utils/cache.py b/server/openslides/utils/cache.py similarity index 100% rename from openslides/utils/cache.py rename to server/openslides/utils/cache.py diff --git a/openslides/utils/cache_providers.py b/server/openslides/utils/cache_providers.py similarity index 100% rename from openslides/utils/cache_providers.py rename to server/openslides/utils/cache_providers.py diff --git a/openslides/utils/constants.py b/server/openslides/utils/constants.py similarity index 100% rename from openslides/utils/constants.py rename to server/openslides/utils/constants.py diff --git a/openslides/utils/consumer_autoupdate_strategy.py b/server/openslides/utils/consumer_autoupdate_strategy.py similarity index 100% rename from openslides/utils/consumer_autoupdate_strategy.py rename to server/openslides/utils/consumer_autoupdate_strategy.py diff --git a/openslides/utils/consumers.py b/server/openslides/utils/consumers.py similarity index 100% rename from openslides/utils/consumers.py rename to server/openslides/utils/consumers.py diff --git a/openslides/utils/exceptions.py b/server/openslides/utils/exceptions.py similarity index 100% rename from openslides/utils/exceptions.py rename to server/openslides/utils/exceptions.py diff --git a/openslides/utils/locking.py b/server/openslides/utils/locking.py similarity index 100% rename from openslides/utils/locking.py rename to server/openslides/utils/locking.py diff --git a/openslides/utils/logging.py b/server/openslides/utils/logging.py similarity index 100% rename from openslides/utils/logging.py rename to server/openslides/utils/logging.py diff --git a/openslides/utils/main.py b/server/openslides/utils/main.py similarity index 100% rename from openslides/utils/main.py rename to server/openslides/utils/main.py diff --git a/openslides/utils/manager.py b/server/openslides/utils/manager.py similarity index 100% rename from openslides/utils/manager.py rename to server/openslides/utils/manager.py diff --git a/openslides/utils/middleware.py b/server/openslides/utils/middleware.py similarity index 100% rename from openslides/utils/middleware.py rename to server/openslides/utils/middleware.py diff --git a/openslides/utils/migrations.py b/server/openslides/utils/migrations.py similarity index 100% rename from openslides/utils/migrations.py rename to server/openslides/utils/migrations.py diff --git a/openslides/utils/models.py b/server/openslides/utils/models.py similarity index 100% rename from openslides/utils/models.py rename to server/openslides/utils/models.py diff --git a/openslides/utils/plugins.py b/server/openslides/utils/plugins.py similarity index 100% rename from openslides/utils/plugins.py rename to server/openslides/utils/plugins.py diff --git a/openslides/utils/postgres.py b/server/openslides/utils/postgres.py similarity index 100% rename from openslides/utils/postgres.py rename to server/openslides/utils/postgres.py diff --git a/openslides/utils/projector.py b/server/openslides/utils/projector.py similarity index 100% rename from openslides/utils/projector.py rename to server/openslides/utils/projector.py diff --git a/openslides/utils/redis.py b/server/openslides/utils/redis.py similarity index 91% rename from openslides/utils/redis.py rename to server/openslides/utils/redis.py index d5ff24065..23cbfffff 100644 --- a/openslides/utils/redis.py +++ b/server/openslides/utils/redis.py @@ -36,8 +36,10 @@ else: read_only_redis_amount_replicas = getattr(settings, "AMOUNT_REPLICAS", 1) logger.info(f"AMOUNT_REPLICAS={read_only_redis_amount_replicas}") - read_only_redis_wait_timeout = getattr(settings, "WAIT_TIMEOUT", 1000) - logger.info(f"WAIT_TIMEOUT={read_only_redis_wait_timeout}") + read_only_redis_wait_timeout = getattr( + settings, "REDIS_SLAVE_WAIT_TIMEOUT", 1000 + ) + logger.info(f"REDIS_SLAVE_WAIT_TIMEOUT={read_only_redis_wait_timeout}") else: logger.info("Redis is not configured.") diff --git a/openslides/utils/redis_connection_pool.py b/server/openslides/utils/redis_connection_pool.py similarity index 94% rename from openslides/utils/redis_connection_pool.py rename to server/openslides/utils/redis_connection_pool.py index 51e8a2e88..6366a33ff 100644 --- a/openslides/utils/redis_connection_pool.py +++ b/server/openslides/utils/redis_connection_pool.py @@ -5,12 +5,8 @@ import aioredis from channels_redis.core import ConnectionPool as ChannelRedisConnectionPool from django.conf import settings -from . import logging - -logger = logging.getLogger(__name__) connection_pool_limit = getattr(settings, "CONNECTION_POOL_LIMIT", 100) -logger.info(f"CONNECTION_POOL_LIMIT={connection_pool_limit}") class InvalidConnection(Exception): diff --git a/openslides/utils/rest_api.py b/server/openslides/utils/rest_api.py similarity index 100% rename from openslides/utils/rest_api.py rename to server/openslides/utils/rest_api.py diff --git a/openslides/utils/schema_version.py b/server/openslides/utils/schema_version.py similarity index 100% rename from openslides/utils/schema_version.py rename to server/openslides/utils/schema_version.py diff --git a/openslides/utils/settings.py.tpl b/server/openslides/utils/settings.py.tpl similarity index 100% rename from openslides/utils/settings.py.tpl rename to server/openslides/utils/settings.py.tpl diff --git a/openslides/utils/startup.py b/server/openslides/utils/startup.py similarity index 100% rename from openslides/utils/startup.py rename to server/openslides/utils/startup.py diff --git a/openslides/utils/stats.py b/server/openslides/utils/stats.py similarity index 100% rename from openslides/utils/stats.py rename to server/openslides/utils/stats.py diff --git a/openslides/utils/timing.py b/server/openslides/utils/timing.py similarity index 100% rename from openslides/utils/timing.py rename to server/openslides/utils/timing.py diff --git a/openslides/utils/utils.py b/server/openslides/utils/utils.py similarity index 100% rename from openslides/utils/utils.py rename to server/openslides/utils/utils.py diff --git a/openslides/utils/validate.py b/server/openslides/utils/validate.py similarity index 100% rename from openslides/utils/validate.py rename to server/openslides/utils/validate.py diff --git a/openslides/utils/views.py b/server/openslides/utils/views.py similarity index 100% rename from openslides/utils/views.py rename to server/openslides/utils/views.py diff --git a/openslides/utils/websocket.py b/server/openslides/utils/websocket.py similarity index 100% rename from openslides/utils/websocket.py rename to server/openslides/utils/websocket.py diff --git a/openslides/utils/websocket_client_messages.py b/server/openslides/utils/websocket_client_messages.py similarity index 100% rename from openslides/utils/websocket_client_messages.py rename to server/openslides/utils/websocket_client_messages.py diff --git a/requirements.txt b/server/requirements.txt similarity index 100% rename from requirements.txt rename to server/requirements.txt diff --git a/requirements/big_mode.txt b/server/requirements/big_mode.txt similarity index 100% rename from requirements/big_mode.txt rename to server/requirements/big_mode.txt diff --git a/requirements/development.txt b/server/requirements/development.txt similarity index 100% rename from requirements/development.txt rename to server/requirements/development.txt diff --git a/requirements/production.txt b/server/requirements/production.txt similarity index 100% rename from requirements/production.txt rename to server/requirements/production.txt diff --git a/setup.cfg b/server/setup.cfg similarity index 100% rename from setup.cfg rename to server/setup.cfg diff --git a/tests/__init__.py b/server/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to server/tests/__init__.py diff --git a/tests/common_groups.py b/server/tests/common_groups.py similarity index 100% rename from tests/common_groups.py rename to server/tests/common_groups.py diff --git a/tests/conftest.py b/server/tests/conftest.py similarity index 100% rename from tests/conftest.py rename to server/tests/conftest.py diff --git a/tests/count_queries.py b/server/tests/count_queries.py similarity index 100% rename from tests/count_queries.py rename to server/tests/count_queries.py diff --git a/tests/example_data_generator/README.rst b/server/tests/example_data_generator/README.rst similarity index 100% rename from tests/example_data_generator/README.rst rename to server/tests/example_data_generator/README.rst diff --git a/tests/example_data_generator/__init__.py b/server/tests/example_data_generator/__init__.py similarity index 100% rename from tests/example_data_generator/__init__.py rename to server/tests/example_data_generator/__init__.py diff --git a/tests/example_data_generator/apps.py b/server/tests/example_data_generator/apps.py similarity index 100% rename from tests/example_data_generator/apps.py rename to server/tests/example_data_generator/apps.py diff --git a/tests/example_data_generator/management/__init__.py b/server/tests/example_data_generator/management/__init__.py similarity index 100% rename from tests/example_data_generator/management/__init__.py rename to server/tests/example_data_generator/management/__init__.py diff --git a/tests/example_data_generator/management/commands/__init__.py b/server/tests/example_data_generator/management/commands/__init__.py similarity index 100% rename from tests/example_data_generator/management/commands/__init__.py rename to server/tests/example_data_generator/management/commands/__init__.py diff --git a/tests/example_data_generator/management/commands/create-example-data.py b/server/tests/example_data_generator/management/commands/create-example-data.py similarity index 100% rename from tests/example_data_generator/management/commands/create-example-data.py rename to server/tests/example_data_generator/management/commands/create-example-data.py diff --git a/tests/integration/__init__.py b/server/tests/integration/__init__.py similarity index 100% rename from tests/integration/__init__.py rename to server/tests/integration/__init__.py diff --git a/tests/integration/agenda/__init__.py b/server/tests/integration/agenda/__init__.py similarity index 100% rename from tests/integration/agenda/__init__.py rename to server/tests/integration/agenda/__init__.py diff --git a/tests/integration/agenda/test_models.py b/server/tests/integration/agenda/test_models.py similarity index 100% rename from tests/integration/agenda/test_models.py rename to server/tests/integration/agenda/test_models.py diff --git a/tests/integration/agenda/test_viewset.py b/server/tests/integration/agenda/test_viewset.py similarity index 100% rename from tests/integration/agenda/test_viewset.py rename to server/tests/integration/agenda/test_viewset.py diff --git a/tests/integration/assignments/__init__.py b/server/tests/integration/assignments/__init__.py similarity index 100% rename from tests/integration/assignments/__init__.py rename to server/tests/integration/assignments/__init__.py diff --git a/tests/integration/assignments/test_polls.py b/server/tests/integration/assignments/test_polls.py similarity index 100% rename from tests/integration/assignments/test_polls.py rename to server/tests/integration/assignments/test_polls.py diff --git a/tests/integration/assignments/test_viewset.py b/server/tests/integration/assignments/test_viewset.py similarity index 100% rename from tests/integration/assignments/test_viewset.py rename to server/tests/integration/assignments/test_viewset.py diff --git a/tests/integration/core/__init__.py b/server/tests/integration/core/__init__.py similarity index 100% rename from tests/integration/core/__init__.py rename to server/tests/integration/core/__init__.py diff --git a/tests/integration/core/test_views.py b/server/tests/integration/core/test_views.py similarity index 100% rename from tests/integration/core/test_views.py rename to server/tests/integration/core/test_views.py diff --git a/tests/integration/core/test_viewset.py b/server/tests/integration/core/test_viewset.py similarity index 100% rename from tests/integration/core/test_viewset.py rename to server/tests/integration/core/test_viewset.py diff --git a/tests/integration/helpers.py b/server/tests/integration/helpers.py similarity index 100% rename from tests/integration/helpers.py rename to server/tests/integration/helpers.py diff --git a/tests/integration/mediafiles/__init__.py b/server/tests/integration/mediafiles/__init__.py similarity index 100% rename from tests/integration/mediafiles/__init__.py rename to server/tests/integration/mediafiles/__init__.py diff --git a/tests/integration/mediafiles/test_viewset.py b/server/tests/integration/mediafiles/test_viewset.py similarity index 100% rename from tests/integration/mediafiles/test_viewset.py rename to server/tests/integration/mediafiles/test_viewset.py diff --git a/tests/integration/motions/__init__.py b/server/tests/integration/motions/__init__.py similarity index 100% rename from tests/integration/motions/__init__.py rename to server/tests/integration/motions/__init__.py diff --git a/tests/integration/motions/test_motions.py b/server/tests/integration/motions/test_motions.py similarity index 100% rename from tests/integration/motions/test_motions.py rename to server/tests/integration/motions/test_motions.py diff --git a/tests/integration/motions/test_polls.py b/server/tests/integration/motions/test_polls.py similarity index 100% rename from tests/integration/motions/test_polls.py rename to server/tests/integration/motions/test_polls.py diff --git a/tests/integration/motions/test_views.py b/server/tests/integration/motions/test_views.py similarity index 100% rename from tests/integration/motions/test_views.py rename to server/tests/integration/motions/test_views.py diff --git a/tests/integration/motions/test_viewset.py b/server/tests/integration/motions/test_viewset.py similarity index 100% rename from tests/integration/motions/test_viewset.py rename to server/tests/integration/motions/test_viewset.py diff --git a/tests/integration/test_plugin/__init__.py b/server/tests/integration/test_plugin/__init__.py similarity index 100% rename from tests/integration/test_plugin/__init__.py rename to server/tests/integration/test_plugin/__init__.py diff --git a/tests/integration/test_plugin/apps.py b/server/tests/integration/test_plugin/apps.py similarity index 100% rename from tests/integration/test_plugin/apps.py rename to server/tests/integration/test_plugin/apps.py diff --git a/tests/integration/topics/__init__.py b/server/tests/integration/topics/__init__.py similarity index 100% rename from tests/integration/topics/__init__.py rename to server/tests/integration/topics/__init__.py diff --git a/tests/integration/topics/test_viewset.py b/server/tests/integration/topics/test_viewset.py similarity index 100% rename from tests/integration/topics/test_viewset.py rename to server/tests/integration/topics/test_viewset.py diff --git a/tests/integration/users/__init__.py b/server/tests/integration/users/__init__.py similarity index 100% rename from tests/integration/users/__init__.py rename to server/tests/integration/users/__init__.py diff --git a/tests/integration/users/test_views.py b/server/tests/integration/users/test_views.py similarity index 100% rename from tests/integration/users/test_views.py rename to server/tests/integration/users/test_views.py diff --git a/tests/integration/users/test_viewset.py b/server/tests/integration/users/test_viewset.py similarity index 100% rename from tests/integration/users/test_viewset.py rename to server/tests/integration/users/test_viewset.py diff --git a/tests/integration/utils/__init__.py b/server/tests/integration/utils/__init__.py similarity index 100% rename from tests/integration/utils/__init__.py rename to server/tests/integration/utils/__init__.py diff --git a/tests/integration/utils/test_consumers.py b/server/tests/integration/utils/test_consumers.py similarity index 100% rename from tests/integration/utils/test_consumers.py rename to server/tests/integration/utils/test_consumers.py diff --git a/tests/integration/websocket.py b/server/tests/integration/websocket.py similarity index 100% rename from tests/integration/websocket.py rename to server/tests/integration/websocket.py diff --git a/tests/old/__init__.py b/server/tests/old/__init__.py similarity index 100% rename from tests/old/__init__.py rename to server/tests/old/__init__.py diff --git a/tests/old/agenda/__init__.py b/server/tests/old/agenda/__init__.py similarity index 100% rename from tests/old/agenda/__init__.py rename to server/tests/old/agenda/__init__.py diff --git a/tests/old/agenda/test_list_of_speakers.py b/server/tests/old/agenda/test_list_of_speakers.py similarity index 100% rename from tests/old/agenda/test_list_of_speakers.py rename to server/tests/old/agenda/test_list_of_speakers.py diff --git a/tests/old/config/__init__.py b/server/tests/old/config/__init__.py similarity index 100% rename from tests/old/config/__init__.py rename to server/tests/old/config/__init__.py diff --git a/tests/old/config/test_config.py b/server/tests/old/config/test_config.py similarity index 100% rename from tests/old/config/test_config.py rename to server/tests/old/config/test_config.py diff --git a/tests/old/motions/__init__.py b/server/tests/old/motions/__init__.py similarity index 100% rename from tests/old/motions/__init__.py rename to server/tests/old/motions/__init__.py diff --git a/tests/old/motions/test_models.py b/server/tests/old/motions/test_models.py similarity index 100% rename from tests/old/motions/test_models.py rename to server/tests/old/motions/test_models.py diff --git a/tests/old/utils/__init__.py b/server/tests/old/utils/__init__.py similarity index 100% rename from tests/old/utils/__init__.py rename to server/tests/old/utils/__init__.py diff --git a/tests/old/utils/test_main.py b/server/tests/old/utils/test_main.py similarity index 100% rename from tests/old/utils/test_main.py rename to server/tests/old/utils/test_main.py diff --git a/tests/settings.py b/server/tests/settings.py similarity index 100% rename from tests/settings.py rename to server/tests/settings.py diff --git a/tests/test_case.py b/server/tests/test_case.py similarity index 100% rename from tests/test_case.py rename to server/tests/test_case.py diff --git a/tests/unit/__init__.py b/server/tests/unit/__init__.py similarity index 100% rename from tests/unit/__init__.py rename to server/tests/unit/__init__.py diff --git a/tests/unit/agenda/__init__.py b/server/tests/unit/agenda/__init__.py similarity index 100% rename from tests/unit/agenda/__init__.py rename to server/tests/unit/agenda/__init__.py diff --git a/tests/unit/agenda/test_models.py b/server/tests/unit/agenda/test_models.py similarity index 100% rename from tests/unit/agenda/test_models.py rename to server/tests/unit/agenda/test_models.py diff --git a/tests/unit/agenda/test_projector.py b/server/tests/unit/agenda/test_projector.py similarity index 100% rename from tests/unit/agenda/test_projector.py rename to server/tests/unit/agenda/test_projector.py diff --git a/tests/unit/agenda/test_views.py b/server/tests/unit/agenda/test_views.py similarity index 100% rename from tests/unit/agenda/test_views.py rename to server/tests/unit/agenda/test_views.py diff --git a/tests/unit/assignments/test_models.py b/server/tests/unit/assignments/test_models.py similarity index 100% rename from tests/unit/assignments/test_models.py rename to server/tests/unit/assignments/test_models.py diff --git a/tests/unit/config/__init__.py b/server/tests/unit/config/__init__.py similarity index 100% rename from tests/unit/config/__init__.py rename to server/tests/unit/config/__init__.py diff --git a/tests/unit/config/test_api.py b/server/tests/unit/config/test_api.py similarity index 100% rename from tests/unit/config/test_api.py rename to server/tests/unit/config/test_api.py diff --git a/tests/unit/core/__init__.py b/server/tests/unit/core/__init__.py similarity index 100% rename from tests/unit/core/__init__.py rename to server/tests/unit/core/__init__.py diff --git a/tests/unit/core/test_websocket.py b/server/tests/unit/core/test_websocket.py similarity index 100% rename from tests/unit/core/test_websocket.py rename to server/tests/unit/core/test_websocket.py diff --git a/tests/unit/motions/__init__.py b/server/tests/unit/motions/__init__.py similarity index 100% rename from tests/unit/motions/__init__.py rename to server/tests/unit/motions/__init__.py diff --git a/tests/unit/motions/test_models.py b/server/tests/unit/motions/test_models.py similarity index 100% rename from tests/unit/motions/test_models.py rename to server/tests/unit/motions/test_models.py diff --git a/tests/unit/motions/test_projector.py b/server/tests/unit/motions/test_projector.py similarity index 100% rename from tests/unit/motions/test_projector.py rename to server/tests/unit/motions/test_projector.py diff --git a/tests/unit/motions/test_views.py b/server/tests/unit/motions/test_views.py similarity index 100% rename from tests/unit/motions/test_views.py rename to server/tests/unit/motions/test_views.py diff --git a/tests/unit/users/__init__.py b/server/tests/unit/users/__init__.py similarity index 100% rename from tests/unit/users/__init__.py rename to server/tests/unit/users/__init__.py diff --git a/tests/unit/users/test_models.py b/server/tests/unit/users/test_models.py similarity index 100% rename from tests/unit/users/test_models.py rename to server/tests/unit/users/test_models.py diff --git a/tests/unit/users/test_serializers.py b/server/tests/unit/users/test_serializers.py similarity index 100% rename from tests/unit/users/test_serializers.py rename to server/tests/unit/users/test_serializers.py diff --git a/tests/unit/users/test_user_backend.py b/server/tests/unit/users/test_user_backend.py similarity index 100% rename from tests/unit/users/test_user_backend.py rename to server/tests/unit/users/test_user_backend.py diff --git a/tests/unit/utils/__init__.py b/server/tests/unit/utils/__init__.py similarity index 100% rename from tests/unit/utils/__init__.py rename to server/tests/unit/utils/__init__.py diff --git a/tests/unit/utils/cache_provider.py b/server/tests/unit/utils/cache_provider.py similarity index 100% rename from tests/unit/utils/cache_provider.py rename to server/tests/unit/utils/cache_provider.py diff --git a/tests/unit/utils/test_cache.py b/server/tests/unit/utils/test_cache.py similarity index 100% rename from tests/unit/utils/test_cache.py rename to server/tests/unit/utils/test_cache.py diff --git a/tests/unit/utils/test_utils.py b/server/tests/unit/utils/test_utils.py similarity index 100% rename from tests/unit/utils/test_utils.py rename to server/tests/unit/utils/test_utils.py diff --git a/tests/unit/utils/test_validate.py b/server/tests/unit/utils/test_validate.py similarity index 100% rename from tests/unit/utils/test_validate.py rename to server/tests/unit/utils/test_validate.py diff --git a/tests/unit/utils/test_views.py b/server/tests/unit/utils/test_views.py similarity index 100% rename from tests/unit/utils/test_views.py rename to server/tests/unit/utils/test_views.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 06a20988b..000000000 --- a/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python - -from setuptools import find_packages, setup - -from openslides import __author__ as openslides_author -from openslides import __description__ as openslides_description -from openslides import __version__ as openslides_version -from openslides import __license__ as openslides_license -from openslides import __url__ as openslides_url - -with open("README.rst") as readme: - long_description = readme.read() - -with open("requirements/production.txt") as requirements_production: - install_requires = requirements_production.readlines() - -with open("requirements/big_mode.txt") as requirements_big_mode: - extras_requires = requirements_big_mode.readlines() - -setup( - name="openslides", - author=openslides_author, - author_email="support@openslides.com", - description=openslides_description, - license=openslides_license, - long_description=long_description, - url=openslides_url, - version=openslides_version, - classifiers=[ - # http://pypi.python.org/pypi?%3Aaction=list_classifiers - # 'Development Status :: 3 - Alpha', - "Development Status :: 4 - Beta", - # 'Development Status :: 5 - Production/Stable', - "Environment :: Web Environment", - "Framework :: Django", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - ], - packages=find_packages(exclude=["tests", "tests.*"]), - include_package_data=True, - install_requires=install_requires, - extras_require={"big_mode": extras_requires}, - entry_points={"console_scripts": ["openslides = openslides.__main__:main"]}, -) diff --git a/tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext b/tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/20314524-f632-4b7f-844e-2bf089c0867a.some_file b/tests/file/20314524-f632-4b7f-844e-2bf089c0867a.some_file new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/20314524-f632-4b7f-844e-2bf089c0867a.some_file @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/20e1f927-e014-405d-81d1-af25b4e8513a.ext b/tests/file/20e1f927-e014-405d-81d1-af25b4e8513a.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/20e1f927-e014-405d-81d1-af25b4e8513a.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/2fc2a759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 b/tests/file/2fc2a759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/2fc2a759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext b/tests/file/3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/3e15d6c6-820c-49a7-93ba-d360126d283b.ext b/tests/file/3e15d6c6-820c-49a7-93ba-d360126d283b.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/3e15d6c6-820c-49a7-93ba-d360126d283b.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/49b9a22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 b/tests/file/49b9a22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/49b9a22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/5a77d245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 b/tests/file/5a77d245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/5a77d245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/7ba289ba-22a7-4717-ba33-9dde4a645440.some_file1 b/tests/file/7ba289ba-22a7-4717-ba33-9dde4a645440.some_file1 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/7ba289ba-22a7-4717-ba33-9dde4a645440.some_file1 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/8e772176-ea7f-46d8-befc-44bfb9223ffb.ext b/tests/file/8e772176-ea7f-46d8-befc-44bfb9223ffb.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/8e772176-ea7f-46d8-befc-44bfb9223ffb.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext b/tests/file/8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/9c5e5942-681a-43d5-b5ff-49f84c724b43.ext b/tests/file/9c5e5942-681a-43d5-b5ff-49f84c724b43.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/9c5e5942-681a-43d5-b5ff-49f84c724b43.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext b/tests/file/a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/aaa47103-0419-4678-b99a-a21af7107f75.some_file9 b/tests/file/aaa47103-0419-4678-b99a-a21af7107f75.some_file9 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/aaa47103-0419-4678-b99a-a21af7107f75.some_file9 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/aaa850f1-184e-475d-a630-066edb0a3444.some_file5 b/tests/file/aaa850f1-184e-475d-a630-066edb0a3444.some_file5 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/aaa850f1-184e-475d-a630-066edb0a3444.some_file5 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/b711871c-2778-47bf-8bfa-4ff1d236ab46.some_file8 b/tests/file/b711871c-2778-47bf-8bfa-4ff1d236ab46.some_file8 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/b711871c-2778-47bf-8bfa-4ff1d236ab46.some_file8 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/b84b767a-3b74-4a2c-bc07-2aff514c4986.ext b/tests/file/b84b767a-3b74-4a2c-bc07-2aff514c4986.ext new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/b84b767a-3b74-4a2c-bc07-2aff514c4986.ext @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/bedae9bc-d384-4a39-9580-e9398e10cc60.txt b/tests/file/bedae9bc-d384-4a39-9580-e9398e10cc60.txt new file mode 100644 index 000000000..6b584e8ec --- /dev/null +++ b/tests/file/bedae9bc-d384-4a39-9580-e9398e10cc60.txt @@ -0,0 +1 @@ +content \ No newline at end of file diff --git a/tests/file/c3c20648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 b/tests/file/c3c20648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/c3c20648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/d568f7c3-bbaa-4550-b97c-92119eb247d9.some_file3 b/tests/file/d568f7c3-bbaa-4550-b97c-92119eb247d9.some_file3 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/d568f7c3-bbaa-4550-b97c-92119eb247d9.some_file3 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/ea0a2347-e62f-4cf2-97e3-caef681efa60.some_file0 b/tests/file/ea0a2347-e62f-4cf2-97e3-caef681efa60.some_file0 new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/ea0a2347-e62f-4cf2-97e3-caef681efa60.some_file0 @@ -0,0 +1 @@ +some content. \ No newline at end of file diff --git a/tests/file/ed25cc10-f97c-4c70-8044-087d723422e1.no_extension b/tests/file/ed25cc10-f97c-4c70-8044-087d723422e1.no_extension new file mode 100644 index 000000000..2617e929a --- /dev/null +++ b/tests/file/ed25cc10-f97c-4c70-8044-087d723422e1.no_extension @@ -0,0 +1 @@ +some content. \ No newline at end of file