From 2bcab5d09802b3de5a164f0ea41574deb71697c0 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 18 Jun 2020 15:22:38 +0200 Subject: [PATCH 01/19] Repository restructure - moved all server related things into the folder `server`, so this configuration is parallel to the client. - All main "services" are now folders in the root directory - Added Dockerfiles to each service (currently server and client) - Added a docker compose configuration to start everything together. Currently there are heavy dependencies into https://github.com/OpenSlides/openslides-docker-compose - Resturctured the .gitignore. If someone needs something excluded, please add it to the right section. - Added initial build setup with Docker and docker-compose. - removed setup.py. We won't deliver OpenSlides via pip anymore. --- .gitignore | 108 +++++----- .travis.yml | 89 ++++---- DEVELOPMENT.rst | 190 +++++------------- Dockerfile | 30 --- README.rst | 169 +++------------- client/.dockerignore | 2 + client/README.md | 36 ---- client/angular.json | 2 +- client/build.sh | 9 + client/docker/Dockerfile | 23 +++ client/docker/nginx.conf | 56 ++++++ docker/build.sh | 4 + docker/docker-compose.yml | 162 +++++++++++++++ docker/secrets/admin.env.example | 3 + docker/secrets/user.env.example | 5 + haproxy/src/combined.pem | 83 ++++++++ haproxy/src/localhost-key.pem | 52 +++++ haproxy/src/localhost.pem | 31 +++ .../commands/createopenslidesuser.py | 32 --- server/.dockerignore | 2 + MANIFEST.in => server/MANIFEST.in | 0 SETTINGS.rst => server/SETTINGS.rst | 0 server/build.sh | 18 ++ server/docker/Dockerfile | 67 ++++++ server/docker/entrypoint | 14 ++ server/docker/entrypoint-db-setup | 77 +++++++ server/docker/settings.py | 170 ++++++++++++++++ {make => server/make}/README.rst | 0 {make => server/make}/__main__.py | 0 {make => server/make}/commands.py | 0 {make => server/make}/parser.py | 0 {make => server/make}/requirements.txt | 0 manage.py => server/manage.py | 0 {openslides => server/openslides}/__init__.py | 0 {openslides => server/openslides}/__main__.py | 0 .../openslides}/agenda/__init__.py | 0 .../openslides}/agenda/access_permissions.py | 0 .../openslides}/agenda/apps.py | 0 .../openslides}/agenda/config_variables.py | 0 .../agenda/migrations/0001_initial.py | 0 .../agenda/migrations/0002_item_duration.py | 0 .../migrations/0003_auto_20170818_1202.py | 0 .../agenda/migrations/0004_speaker_marked.py | 0 .../migrations/0005_auto_20180815_1109.py | 0 .../migrations/0006_auto_20190119_1425.py | 0 .../migrations/0007_list_of_speakers_1.py | 0 .../migrations/0007_list_of_speakers_2.py | 0 .../migrations/0007_list_of_speakers_3.py | 0 .../migrations/0008_default_ordering_item.py | 0 .../agenda/migrations/0009_item_tags.py | 0 .../openslides}/agenda/migrations/__init__.py | 0 .../openslides}/agenda/mixins.py | 0 .../openslides}/agenda/models.py | 0 .../openslides}/agenda/projector.py | 0 .../openslides}/agenda/serializers.py | 0 .../openslides}/agenda/signals.py | 0 .../openslides}/agenda/views.py | 0 {openslides => server/openslides}/asgi.py | 0 .../openslides}/assignments/__init__.py | 0 .../assignments/access_permissions.py | 0 .../openslides}/assignments/apps.py | 0 .../assignments/config_variables.py | 0 .../assignments/migrations/0001_initial.py | 0 .../0002_assignmentpoll_pollmethod.py | 0 .../migrations/0003_candidate_weight.py | 0 .../migrations/0004_auto_20180703_1523.py | 0 .../migrations/0005_auto_20180822_1042.py | 0 .../migrations/0006_auto_20190119_1425.py | 0 .../migrations/0007_assignment_attachments.py | 0 .../assignments/migrations/0008_voting_1.py | 0 .../assignments/migrations/0009_voting_2.py | 0 .../assignments/migrations/0010_voting_3.py | 0 .../assignments/migrations/0011_voting_4.py | 0 .../0012_assignment_vote_unique_together.py | 0 .../0013_rename_verbose_poll_types.py | 0 .../0014_remove_deprecated_slides.py | 0 .../assignments/migrations/__init__.py | 0 .../openslides}/assignments/models.py | 0 .../openslides}/assignments/projector.py | 0 .../openslides}/assignments/serializers.py | 0 .../openslides}/assignments/signals.py | 0 .../openslides}/assignments/views.py | 0 .../openslides}/core/__init__.py | 0 .../openslides}/core/access_permissions.py | 0 .../openslides}/core/apps.py | 0 .../openslides}/core/config.py | 0 .../openslides}/core/config_variables.py | 0 .../openslides}/core/exceptions.py | 0 .../openslides}/core/management/__init__.py | 0 .../core/management/commands/__init__.py | 0 .../core/management/commands/backupdb.py | 0 .../core/management/commands/changeconfig.py | 0 .../core/management/commands/migrate.py | 0 .../core/migrations/0001_initial.py | 0 .../core/migrations/0002_misc_features.py | 0 .../migrations/0003_auto_20161217_1158.py | 0 .../migrations/0004_auto_20170215_1624.py | 0 .../migrations/0005_auto_20170412_1258.py | 0 .../migrations/0006_auto_20180123_0903.py | 0 .../migrations/0007_auto_20180130_1400.py | 0 .../migrations/0008_changed_logo_fields.py | 0 .../migrations/0009_auto_20181118_2126.py | 0 .../migrations/0010_auto_20190118_1908.py | 0 .../migrations/0011_auto_20190119_0958.py | 0 .../migrations/0012_auto_20190119_1425.py | 0 .../migrations/0013_auto_20190119_1641.py | 0 .../migrations/0014_changed_default_font.py | 0 .../migrations/0015_auto_20190122_1216.py | 0 .../0016_projector_reference_projector.py | 0 .../migrations/0017_auto_20190219_2015.py | 0 .../migrations/0018_auto_20190222_1209.py | 0 .../core/migrations/0019_countdown_title_1.py | 0 .../core/migrations/0019_countdown_title_2.py | 0 .../0020_set_reference_projector.py | 0 .../migrations/0021_auto_20190415_0942.py | 0 .../migrations/0022_remove_chatmessage.py | 0 .../core/migrations/0023_chyron_colors.py | 0 .../migrations/0024_auto_20190605_1105.py | 0 .../core/migrations/0025_projector_color.py | 0 .../core/migrations/0026_projector_size_1.py | 0 .../core/migrations/0027_projector_size_2.py | 0 .../core/migrations/0028_projector_size_3.py | 0 .../0029_remove_history_restricted.py | 0 .../0030_voting_projection_defaults.py | 0 .../0031_projector_default_height.py | 0 .../migrations/0032_add_monospace_font.py | 0 .../migrations/0033_live_stream_permission.py | 0 .../openslides}/core/migrations/__init__.py | 0 .../openslides}/core/models.py | 0 .../openslides}/core/projector.py | 0 .../openslides}/core/serializers.py | 0 .../openslides}/core/signals.py | 0 .../openslides}/core/static/index.html | 0 .../openslides}/core/urls.py | 0 .../openslides}/core/views.py | 0 .../openslides}/global_settings.py | 0 .../openslides}/mediafiles/__init__.py | 0 .../mediafiles/access_permissions.py | 0 .../openslides}/mediafiles/apps.py | 0 .../openslides}/mediafiles/config.py | 0 .../mediafiles/management/__init__.py | 0 .../management/commands/__init__.py | 0 .../management/commands/export_mediafiles.py | 0 .../mediafiles/migrations/0001_initial.py | 0 .../migrations/0002_mediafile_private.py | 0 .../migrations/0003_auto_20190119_1425.py | 0 .../0004_directories_and_permissions_1.py | 0 .../0005_directories_and_permissions_2.py | 0 .../0006_directories_and_permissions_3.py | 0 .../migrations/0007_external_storage_1.py | 0 .../migrations/0008_external_storage_2.py | 0 .../mediafiles/migrations/__init__.py | 0 .../openslides}/mediafiles/models.py | 0 .../openslides}/mediafiles/projector.py | 0 .../openslides}/mediafiles/serializers.py | 0 .../openslides}/mediafiles/signals.py | 0 .../openslides}/mediafiles/utils.py | 0 .../openslides}/mediafiles/views.py | 0 .../openslides}/motions/__init__.py | 0 .../openslides}/motions/access_permissions.py | 0 .../openslides}/motions/apps.py | 0 .../openslides}/motions/config_variables.py | 0 .../openslides}/motions/exceptions.py | 0 .../motions/migrations/0001_initial.py | 0 .../motions/migrations/0002_misc_features.py | 0 .../migrations/0003_motion_comments.py | 0 ...nchangerecommendation_other_description.py | 0 .../migrations/0005_auto_20180202_1318.py | 0 .../migrations/0006_submitter_model.py | 0 .../0007_motionversion_amendment_data.py | 0 .../migrations/0008_auto_20180702_1128.py | 0 ...09_motionversion_modified_final_version.py | 0 .../migrations/0010_auto_20180822_1042.py | 0 .../migrations/0011_motion_version_1.py | 0 .../migrations/0011_motion_version_2.py | 0 .../migrations/0011_motion_version_3.py | 0 .../migrations/0011_motion_version_4.py | 0 .../migrations/0012_motion_comments.py | 0 .../0013_motion_sorting_and_statute.py | 0 ...014_motionchangerecommendation_internal.py | 0 .../migrations/0015_metadata_permission.py | 0 .../0016_merge_amendment_into_final.py | 0 .../0017_remove_state_action_word.py | 0 .../migrations/0018_auto_20190118_2101.py | 0 .../migrations/0019_auto_20190119_1025.py | 0 .../migrations/0020_auto_20190119_1425.py | 0 .../migrations/0021_state_access_level_1.py | 0 .../migrations/0021_state_access_level_2.py | 0 .../migrations/0021_state_access_level_3.py | 0 .../migrations/0022_auto_20190320_0840.py | 0 .../migrations/0023_remove_motion_log.py | 0 .../migrations/0024_state_restriction_1.py | 0 .../migrations/0024_state_restriction_2.py | 0 .../migrations/0024_state_restriction_3.py | 0 .../migrations/0025_motion_category_weight.py | 0 .../migrations/0026_rename_restriction.py | 0 .../migrations/0027_motion_block_internal.py | 0 .../motions/migrations/0028_subcategories.py | 0 .../0029_motioncommentsection_weight.py | 0 .../migrations/0030_state_css_classes_1.py | 0 .../migrations/0031_state_css_classes_2.py | 0 .../0032_category_cascade_delete.py | 0 .../motions/migrations/0033_voting_1.py | 0 .../motions/migrations/0034_voting_2.py | 0 .../0035_motion_vote_unique_together.py | 0 .../0036_rename_verbose_poll_types.py | 0 .../motions/migrations/__init__.py | 0 .../openslides}/motions/models.py | 0 .../openslides}/motions/numbering.py | 0 .../openslides}/motions/projector.py | 0 .../openslides}/motions/serializers.py | 0 .../openslides}/motions/signals.py | 0 .../openslides}/motions/views.py | 0 .../openslides}/poll/__init__.py | 0 .../openslides}/poll/access_permissions.py | 0 .../openslides}/poll/models.py | 0 .../openslides}/poll/serializers.py | 0 .../openslides}/poll/views.py | 0 {openslides => server/openslides}/routing.py | 0 .../openslides}/saml/README.md | 0 .../openslides}/saml/__init__.py | 0 .../openslides}/saml/apps.py | 0 .../openslides}/saml/exceptions.py | 0 .../openslides}/saml/management/__init__.py | 0 .../saml/management/commands/__init__.py | 0 .../commands/create-saml-settings.py | 0 .../openslides}/saml/saml_settings.json.tpl | 0 .../openslides}/saml/settings.py | 0 .../openslides}/saml/urls.py | 0 .../openslides}/saml/user_backend.py | 0 .../openslides}/saml/views.py | 0 .../openslides}/topics/__init__.py | 0 .../openslides}/topics/access_permissions.py | 0 .../openslides}/topics/apps.py | 0 .../topics/migrations/0001_initial.py | 0 .../openslides}/topics/migrations/__init__.py | 0 .../openslides}/topics/models.py | 0 .../openslides}/topics/projector.py | 0 .../openslides}/topics/serializers.py | 0 .../openslides}/topics/signals.py | 0 .../openslides}/topics/views.py | 0 {openslides => server/openslides}/urls.py | 0 .../openslides}/urls_apps.py | 0 .../openslides}/users/__init__.py | 0 .../openslides}/users/access_permissions.py | 0 .../openslides}/users/apps.py | 0 .../openslides}/users/config_variables.py | 3 +- .../openslides}/users/management/__init__.py | 0 .../users/management/commands/__init__.py | 0 .../commands/changedefaultadminpassword.py | 34 ++++ .../commands/createopenslidesuser.py | 57 ++++++ .../management/commands/createsuperuser.py | 0 .../commands/insecurechangepassword.py | 0 .../users/migrations/0001_initial.py | 0 .../0002_user_misc_default_groups.py | 0 .../users/migrations/0003_group.py | 0 .../users/migrations/0004_personalnote.py | 0 .../migrations/0005_personalnote_rework.py | 0 .../users/migrations/0006_user_email.py | 0 .../users/migrations/0007_superadmin.py | 0 .../users/migrations/0008_user_gender.py | 0 .../migrations/0009_auto_20190119_0941.py | 0 .../migrations/0010_auto_20190119_1447.py | 0 .../0011_postgresql_auth_group_id_sequence.py | 0 .../users/migrations/0012_user_auth_type.py | 0 .../users/migrations/0013_user_vote_weight.py | 0 .../migrations/0014_user_rename_permission.py | 0 .../openslides}/users/migrations/__init__.py | 0 .../openslides}/users/models.py | 0 .../openslides}/users/projector.py | 0 .../openslides}/users/serializers.py | 0 .../openslides}/users/signals.py | 0 .../openslides}/users/urls.py | 0 .../openslides}/users/user_backend.py | 0 .../openslides}/users/views.py | 0 .../openslides}/utils/__init__.py | 0 .../openslides}/utils/access_permissions.py | 0 .../openslides}/utils/arguments.py | 0 .../openslides}/utils/auth.py | 0 .../openslides}/utils/autoupdate.py | 0 .../openslides}/utils/cache.py | 0 .../openslides}/utils/cache_providers.py | 0 .../openslides}/utils/constants.py | 0 .../utils/consumer_autoupdate_strategy.py | 0 .../openslides}/utils/consumers.py | 0 .../openslides}/utils/exceptions.py | 0 .../openslides}/utils/locking.py | 0 .../openslides}/utils/logging.py | 0 .../openslides}/utils/main.py | 0 .../openslides}/utils/manager.py | 0 .../openslides}/utils/middleware.py | 0 .../openslides}/utils/migrations.py | 0 .../openslides}/utils/models.py | 0 .../openslides}/utils/plugins.py | 0 .../openslides}/utils/postgres.py | 0 .../openslides}/utils/projector.py | 0 .../openslides}/utils/redis.py | 6 +- .../utils/redis_connection_pool.py | 4 - .../openslides}/utils/rest_api.py | 0 .../openslides}/utils/schema_version.py | 0 .../openslides}/utils/settings.py.tpl | 0 .../openslides}/utils/startup.py | 0 .../openslides}/utils/stats.py | 0 .../openslides}/utils/timing.py | 0 .../openslides}/utils/utils.py | 0 .../openslides}/utils/validate.py | 0 .../openslides}/utils/views.py | 0 .../openslides}/utils/websocket.py | 0 .../utils/websocket_client_messages.py | 0 requirements.txt => server/requirements.txt | 0 .../requirements}/big_mode.txt | 0 .../requirements}/development.txt | 0 .../requirements}/production.txt | 0 setup.cfg => server/setup.cfg | 0 {tests => server/tests}/__init__.py | 0 {tests => server/tests}/common_groups.py | 0 {tests => server/tests}/conftest.py | 0 {tests => server/tests}/count_queries.py | 0 .../tests}/example_data_generator/README.rst | 0 .../tests}/example_data_generator/__init__.py | 0 .../tests}/example_data_generator/apps.py | 0 .../management/__init__.py | 0 .../management/commands/__init__.py | 0 .../commands/create-example-data.py | 0 .../tests}/integration/__init__.py | 0 .../tests}/integration/agenda/__init__.py | 0 .../tests}/integration/agenda/test_models.py | 0 .../tests}/integration/agenda/test_viewset.py | 0 .../integration/assignments/__init__.py | 0 .../integration/assignments/test_polls.py | 0 .../integration/assignments/test_viewset.py | 0 .../tests}/integration/core/__init__.py | 0 .../tests}/integration/core/test_views.py | 0 .../tests}/integration/core/test_viewset.py | 0 .../tests}/integration/helpers.py | 0 .../tests}/integration/mediafiles/__init__.py | 0 .../integration/mediafiles/test_viewset.py | 0 .../tests}/integration/motions/__init__.py | 0 .../integration/motions/test_motions.py | 0 .../tests}/integration/motions/test_polls.py | 0 .../tests}/integration/motions/test_views.py | 0 .../integration/motions/test_viewset.py | 0 .../integration/test_plugin/__init__.py | 0 .../tests}/integration/test_plugin/apps.py | 0 .../tests}/integration/topics/__init__.py | 0 .../tests}/integration/topics/test_viewset.py | 0 .../tests}/integration/users/__init__.py | 0 .../tests}/integration/users/test_views.py | 0 .../tests}/integration/users/test_viewset.py | 0 .../tests}/integration/utils/__init__.py | 0 .../integration/utils/test_consumers.py | 0 .../tests}/integration/websocket.py | 0 {tests => server/tests}/old/__init__.py | 0 .../tests}/old/agenda/__init__.py | 0 .../old/agenda/test_list_of_speakers.py | 0 .../tests}/old/config/__init__.py | 0 .../tests}/old/config/test_config.py | 0 .../tests}/old/motions/__init__.py | 0 .../tests}/old/motions/test_models.py | 0 {tests => server/tests}/old/utils/__init__.py | 0 .../tests}/old/utils/test_main.py | 0 {tests => server/tests}/settings.py | 0 {tests => server/tests}/test_case.py | 0 {tests => server/tests}/unit/__init__.py | 0 .../tests}/unit/agenda/__init__.py | 0 .../tests}/unit/agenda/test_models.py | 0 .../tests}/unit/agenda/test_projector.py | 0 .../tests}/unit/agenda/test_views.py | 0 .../tests}/unit/assignments/test_models.py | 0 .../tests}/unit/config/__init__.py | 0 .../tests}/unit/config/test_api.py | 0 {tests => server/tests}/unit/core/__init__.py | 0 .../tests}/unit/core/test_websocket.py | 0 .../tests}/unit/motions/__init__.py | 0 .../tests}/unit/motions/test_models.py | 0 .../tests}/unit/motions/test_projector.py | 0 .../tests}/unit/motions/test_views.py | 0 .../tests}/unit/users/__init__.py | 0 .../tests}/unit/users/test_models.py | 0 .../tests}/unit/users/test_serializers.py | 0 .../tests}/unit/users/test_user_backend.py | 0 .../tests}/unit/utils/__init__.py | 0 .../tests}/unit/utils/cache_provider.py | 0 .../tests}/unit/utils/test_cache.py | 0 .../tests}/unit/utils/test_utils.py | 0 .../tests}/unit/utils/test_validate.py | 0 .../tests}/unit/utils/test_views.py | 0 setup.py | 47 ----- .../1a586555-aece-4bca-bb65-0c10d5697fb5.ext | 1 + ...4524-f632-4b7f-844e-2bf089c0867a.some_file | 1 + .../20e1f927-e014-405d-81d1-af25b4e8513a.ext | 1 + ...759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 | 1 + .../3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext | 1 + .../3e15d6c6-820c-49a7-93ba-d360126d283b.ext | 1 + ...22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 | 1 + ...245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 | 1 + ...9ba-22a7-4717-ba33-9dde4a645440.some_file1 | 1 + .../8e772176-ea7f-46d8-befc-44bfb9223ffb.ext | 1 + .../8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext | 1 + .../9c5e5942-681a-43d5-b5ff-49f84c724b43.ext | 1 + .../a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext | 1 + ...103-0419-4678-b99a-a21af7107f75.some_file9 | 1 + ...0f1-184e-475d-a630-066edb0a3444.some_file5 | 1 + ...71c-2778-47bf-8bfa-4ff1d236ab46.some_file8 | 1 + .../b84b767a-3b74-4a2c-bc07-2aff514c4986.ext | 1 + .../bedae9bc-d384-4a39-9580-e9398e10cc60.txt | 1 + ...648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 | 1 + ...7c3-bbaa-4550-b97c-92119eb247d9.some_file3 | 1 + ...347-e62f-4cf2-97e3-caef681efa60.some_file0 | 1 + ...0-f97c-4c70-8044-087d723422e1.no_extension | 1 + 410 files changed, 1071 insertions(+), 536 deletions(-) delete mode 100644 Dockerfile create mode 100644 client/.dockerignore create mode 100755 client/build.sh create mode 100644 client/docker/Dockerfile create mode 100644 client/docker/nginx.conf create mode 100755 docker/build.sh create mode 100644 docker/docker-compose.yml create mode 100644 docker/secrets/admin.env.example create mode 100644 docker/secrets/user.env.example create mode 100644 haproxy/src/combined.pem create mode 100644 haproxy/src/localhost-key.pem create mode 100644 haproxy/src/localhost.pem delete mode 100644 openslides/users/management/commands/createopenslidesuser.py create mode 100644 server/.dockerignore rename MANIFEST.in => server/MANIFEST.in (100%) rename SETTINGS.rst => server/SETTINGS.rst (100%) create mode 100755 server/build.sh create mode 100644 server/docker/Dockerfile create mode 100755 server/docker/entrypoint create mode 100755 server/docker/entrypoint-db-setup create mode 100644 server/docker/settings.py rename {make => server/make}/README.rst (100%) rename {make => server/make}/__main__.py (100%) rename {make => server/make}/commands.py (100%) rename {make => server/make}/parser.py (100%) rename {make => server/make}/requirements.txt (100%) rename manage.py => server/manage.py (100%) rename {openslides => server/openslides}/__init__.py (100%) rename {openslides => server/openslides}/__main__.py (100%) rename {openslides => server/openslides}/agenda/__init__.py (100%) rename {openslides => server/openslides}/agenda/access_permissions.py (100%) rename {openslides => server/openslides}/agenda/apps.py (100%) rename {openslides => server/openslides}/agenda/config_variables.py (100%) rename {openslides => server/openslides}/agenda/migrations/0001_initial.py (100%) rename {openslides => server/openslides}/agenda/migrations/0002_item_duration.py (100%) rename {openslides => server/openslides}/agenda/migrations/0003_auto_20170818_1202.py (100%) rename {openslides => server/openslides}/agenda/migrations/0004_speaker_marked.py (100%) rename {openslides => server/openslides}/agenda/migrations/0005_auto_20180815_1109.py (100%) rename {openslides => server/openslides}/agenda/migrations/0006_auto_20190119_1425.py (100%) rename {openslides => server/openslides}/agenda/migrations/0007_list_of_speakers_1.py (100%) rename {openslides => server/openslides}/agenda/migrations/0007_list_of_speakers_2.py (100%) rename {openslides => server/openslides}/agenda/migrations/0007_list_of_speakers_3.py (100%) rename {openslides => server/openslides}/agenda/migrations/0008_default_ordering_item.py (100%) rename {openslides => server/openslides}/agenda/migrations/0009_item_tags.py (100%) rename {openslides => server/openslides}/agenda/migrations/__init__.py (100%) rename {openslides => server/openslides}/agenda/mixins.py (100%) rename {openslides => server/openslides}/agenda/models.py (100%) rename {openslides => server/openslides}/agenda/projector.py (100%) rename {openslides => server/openslides}/agenda/serializers.py (100%) rename {openslides => server/openslides}/agenda/signals.py (100%) rename {openslides => server/openslides}/agenda/views.py (100%) rename {openslides => server/openslides}/asgi.py (100%) rename {openslides => server/openslides}/assignments/__init__.py (100%) rename {openslides => server/openslides}/assignments/access_permissions.py (100%) rename {openslides => server/openslides}/assignments/apps.py (100%) rename {openslides => server/openslides}/assignments/config_variables.py (100%) rename {openslides => server/openslides}/assignments/migrations/0001_initial.py (100%) rename {openslides => server/openslides}/assignments/migrations/0002_assignmentpoll_pollmethod.py (100%) rename {openslides => server/openslides}/assignments/migrations/0003_candidate_weight.py (100%) rename {openslides => server/openslides}/assignments/migrations/0004_auto_20180703_1523.py (100%) rename {openslides => server/openslides}/assignments/migrations/0005_auto_20180822_1042.py (100%) rename {openslides => server/openslides}/assignments/migrations/0006_auto_20190119_1425.py (100%) rename {openslides => server/openslides}/assignments/migrations/0007_assignment_attachments.py (100%) rename {openslides => server/openslides}/assignments/migrations/0008_voting_1.py (100%) rename {openslides => server/openslides}/assignments/migrations/0009_voting_2.py (100%) rename {openslides => server/openslides}/assignments/migrations/0010_voting_3.py (100%) rename {openslides => server/openslides}/assignments/migrations/0011_voting_4.py (100%) rename {openslides => server/openslides}/assignments/migrations/0012_assignment_vote_unique_together.py (100%) rename {openslides => server/openslides}/assignments/migrations/0013_rename_verbose_poll_types.py (100%) rename {openslides => server/openslides}/assignments/migrations/0014_remove_deprecated_slides.py (100%) rename {openslides => server/openslides}/assignments/migrations/__init__.py (100%) rename {openslides => server/openslides}/assignments/models.py (100%) rename {openslides => server/openslides}/assignments/projector.py (100%) rename {openslides => server/openslides}/assignments/serializers.py (100%) rename {openslides => server/openslides}/assignments/signals.py (100%) rename {openslides => server/openslides}/assignments/views.py (100%) rename {openslides => server/openslides}/core/__init__.py (100%) rename {openslides => server/openslides}/core/access_permissions.py (100%) rename {openslides => server/openslides}/core/apps.py (100%) rename {openslides => server/openslides}/core/config.py (100%) rename {openslides => server/openslides}/core/config_variables.py (100%) rename {openslides => server/openslides}/core/exceptions.py (100%) rename {openslides => server/openslides}/core/management/__init__.py (100%) rename {openslides => server/openslides}/core/management/commands/__init__.py (100%) rename {openslides => server/openslides}/core/management/commands/backupdb.py (100%) rename {openslides => server/openslides}/core/management/commands/changeconfig.py (100%) rename {openslides => server/openslides}/core/management/commands/migrate.py (100%) rename {openslides => server/openslides}/core/migrations/0001_initial.py (100%) rename {openslides => server/openslides}/core/migrations/0002_misc_features.py (100%) rename {openslides => server/openslides}/core/migrations/0003_auto_20161217_1158.py (100%) rename {openslides => server/openslides}/core/migrations/0004_auto_20170215_1624.py (100%) rename {openslides => server/openslides}/core/migrations/0005_auto_20170412_1258.py (100%) rename {openslides => server/openslides}/core/migrations/0006_auto_20180123_0903.py (100%) rename {openslides => server/openslides}/core/migrations/0007_auto_20180130_1400.py (100%) rename {openslides => server/openslides}/core/migrations/0008_changed_logo_fields.py (100%) rename {openslides => server/openslides}/core/migrations/0009_auto_20181118_2126.py (100%) rename {openslides => server/openslides}/core/migrations/0010_auto_20190118_1908.py (100%) rename {openslides => server/openslides}/core/migrations/0011_auto_20190119_0958.py (100%) rename {openslides => server/openslides}/core/migrations/0012_auto_20190119_1425.py (100%) rename {openslides => server/openslides}/core/migrations/0013_auto_20190119_1641.py (100%) rename {openslides => server/openslides}/core/migrations/0014_changed_default_font.py (100%) rename {openslides => server/openslides}/core/migrations/0015_auto_20190122_1216.py (100%) rename {openslides => server/openslides}/core/migrations/0016_projector_reference_projector.py (100%) rename {openslides => server/openslides}/core/migrations/0017_auto_20190219_2015.py (100%) rename {openslides => server/openslides}/core/migrations/0018_auto_20190222_1209.py (100%) rename {openslides => server/openslides}/core/migrations/0019_countdown_title_1.py (100%) rename {openslides => server/openslides}/core/migrations/0019_countdown_title_2.py (100%) rename {openslides => server/openslides}/core/migrations/0020_set_reference_projector.py (100%) rename {openslides => server/openslides}/core/migrations/0021_auto_20190415_0942.py (100%) rename {openslides => server/openslides}/core/migrations/0022_remove_chatmessage.py (100%) rename {openslides => server/openslides}/core/migrations/0023_chyron_colors.py (100%) rename {openslides => server/openslides}/core/migrations/0024_auto_20190605_1105.py (100%) rename {openslides => server/openslides}/core/migrations/0025_projector_color.py (100%) rename {openslides => server/openslides}/core/migrations/0026_projector_size_1.py (100%) rename {openslides => server/openslides}/core/migrations/0027_projector_size_2.py (100%) rename {openslides => server/openslides}/core/migrations/0028_projector_size_3.py (100%) rename {openslides => server/openslides}/core/migrations/0029_remove_history_restricted.py (100%) rename {openslides => server/openslides}/core/migrations/0030_voting_projection_defaults.py (100%) rename {openslides => server/openslides}/core/migrations/0031_projector_default_height.py (100%) rename {openslides => server/openslides}/core/migrations/0032_add_monospace_font.py (100%) rename {openslides => server/openslides}/core/migrations/0033_live_stream_permission.py (100%) rename {openslides => server/openslides}/core/migrations/__init__.py (100%) rename {openslides => server/openslides}/core/models.py (100%) rename {openslides => server/openslides}/core/projector.py (100%) rename {openslides => server/openslides}/core/serializers.py (100%) rename {openslides => server/openslides}/core/signals.py (100%) rename {openslides => server/openslides}/core/static/index.html (100%) rename {openslides => server/openslides}/core/urls.py (100%) rename {openslides => server/openslides}/core/views.py (100%) rename {openslides => server/openslides}/global_settings.py (100%) rename {openslides => server/openslides}/mediafiles/__init__.py (100%) rename {openslides => server/openslides}/mediafiles/access_permissions.py (100%) rename {openslides => server/openslides}/mediafiles/apps.py (100%) rename {openslides => server/openslides}/mediafiles/config.py (100%) rename {openslides => server/openslides}/mediafiles/management/__init__.py (100%) rename {openslides => server/openslides}/mediafiles/management/commands/__init__.py (100%) rename {openslides => server/openslides}/mediafiles/management/commands/export_mediafiles.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0001_initial.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0002_mediafile_private.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0003_auto_20190119_1425.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0004_directories_and_permissions_1.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0005_directories_and_permissions_2.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0006_directories_and_permissions_3.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0007_external_storage_1.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/0008_external_storage_2.py (100%) rename {openslides => server/openslides}/mediafiles/migrations/__init__.py (100%) rename {openslides => server/openslides}/mediafiles/models.py (100%) rename {openslides => server/openslides}/mediafiles/projector.py (100%) rename {openslides => server/openslides}/mediafiles/serializers.py (100%) rename {openslides => server/openslides}/mediafiles/signals.py (100%) rename {openslides => server/openslides}/mediafiles/utils.py (100%) rename {openslides => server/openslides}/mediafiles/views.py (100%) rename {openslides => server/openslides}/motions/__init__.py (100%) rename {openslides => server/openslides}/motions/access_permissions.py (100%) rename {openslides => server/openslides}/motions/apps.py (100%) rename {openslides => server/openslides}/motions/config_variables.py (100%) rename {openslides => server/openslides}/motions/exceptions.py (100%) rename {openslides => server/openslides}/motions/migrations/0001_initial.py (100%) rename {openslides => server/openslides}/motions/migrations/0002_misc_features.py (100%) rename {openslides => server/openslides}/motions/migrations/0003_motion_comments.py (100%) rename {openslides => server/openslides}/motions/migrations/0004_motionchangerecommendation_other_description.py (100%) rename {openslides => server/openslides}/motions/migrations/0005_auto_20180202_1318.py (100%) rename {openslides => server/openslides}/motions/migrations/0006_submitter_model.py (100%) rename {openslides => server/openslides}/motions/migrations/0007_motionversion_amendment_data.py (100%) rename {openslides => server/openslides}/motions/migrations/0008_auto_20180702_1128.py (100%) rename {openslides => server/openslides}/motions/migrations/0009_motionversion_modified_final_version.py (100%) rename {openslides => server/openslides}/motions/migrations/0010_auto_20180822_1042.py (100%) rename {openslides => server/openslides}/motions/migrations/0011_motion_version_1.py (100%) rename {openslides => server/openslides}/motions/migrations/0011_motion_version_2.py (100%) rename {openslides => server/openslides}/motions/migrations/0011_motion_version_3.py (100%) rename {openslides => server/openslides}/motions/migrations/0011_motion_version_4.py (100%) rename {openslides => server/openslides}/motions/migrations/0012_motion_comments.py (100%) rename {openslides => server/openslides}/motions/migrations/0013_motion_sorting_and_statute.py (100%) rename {openslides => server/openslides}/motions/migrations/0014_motionchangerecommendation_internal.py (100%) rename {openslides => server/openslides}/motions/migrations/0015_metadata_permission.py (100%) rename {openslides => server/openslides}/motions/migrations/0016_merge_amendment_into_final.py (100%) rename {openslides => server/openslides}/motions/migrations/0017_remove_state_action_word.py (100%) rename {openslides => server/openslides}/motions/migrations/0018_auto_20190118_2101.py (100%) rename {openslides => server/openslides}/motions/migrations/0019_auto_20190119_1025.py (100%) rename {openslides => server/openslides}/motions/migrations/0020_auto_20190119_1425.py (100%) rename {openslides => server/openslides}/motions/migrations/0021_state_access_level_1.py (100%) rename {openslides => server/openslides}/motions/migrations/0021_state_access_level_2.py (100%) rename {openslides => server/openslides}/motions/migrations/0021_state_access_level_3.py (100%) rename {openslides => server/openslides}/motions/migrations/0022_auto_20190320_0840.py (100%) rename {openslides => server/openslides}/motions/migrations/0023_remove_motion_log.py (100%) rename {openslides => server/openslides}/motions/migrations/0024_state_restriction_1.py (100%) rename {openslides => server/openslides}/motions/migrations/0024_state_restriction_2.py (100%) rename {openslides => server/openslides}/motions/migrations/0024_state_restriction_3.py (100%) rename {openslides => server/openslides}/motions/migrations/0025_motion_category_weight.py (100%) rename {openslides => server/openslides}/motions/migrations/0026_rename_restriction.py (100%) rename {openslides => server/openslides}/motions/migrations/0027_motion_block_internal.py (100%) rename {openslides => server/openslides}/motions/migrations/0028_subcategories.py (100%) rename {openslides => server/openslides}/motions/migrations/0029_motioncommentsection_weight.py (100%) rename {openslides => server/openslides}/motions/migrations/0030_state_css_classes_1.py (100%) rename {openslides => server/openslides}/motions/migrations/0031_state_css_classes_2.py (100%) rename {openslides => server/openslides}/motions/migrations/0032_category_cascade_delete.py (100%) rename {openslides => server/openslides}/motions/migrations/0033_voting_1.py (100%) rename {openslides => server/openslides}/motions/migrations/0034_voting_2.py (100%) rename {openslides => server/openslides}/motions/migrations/0035_motion_vote_unique_together.py (100%) rename {openslides => server/openslides}/motions/migrations/0036_rename_verbose_poll_types.py (100%) rename {openslides => server/openslides}/motions/migrations/__init__.py (100%) rename {openslides => server/openslides}/motions/models.py (100%) rename {openslides => server/openslides}/motions/numbering.py (100%) rename {openslides => server/openslides}/motions/projector.py (100%) rename {openslides => server/openslides}/motions/serializers.py (100%) rename {openslides => server/openslides}/motions/signals.py (100%) rename {openslides => server/openslides}/motions/views.py (100%) rename {openslides => server/openslides}/poll/__init__.py (100%) rename {openslides => server/openslides}/poll/access_permissions.py (100%) rename {openslides => server/openslides}/poll/models.py (100%) rename {openslides => server/openslides}/poll/serializers.py (100%) rename {openslides => server/openslides}/poll/views.py (100%) rename {openslides => server/openslides}/routing.py (100%) rename {openslides => server/openslides}/saml/README.md (100%) rename {openslides => server/openslides}/saml/__init__.py (100%) rename {openslides => server/openslides}/saml/apps.py (100%) rename {openslides => server/openslides}/saml/exceptions.py (100%) rename {openslides => server/openslides}/saml/management/__init__.py (100%) rename {openslides => server/openslides}/saml/management/commands/__init__.py (100%) rename {openslides => server/openslides}/saml/management/commands/create-saml-settings.py (100%) rename {openslides => server/openslides}/saml/saml_settings.json.tpl (100%) rename {openslides => server/openslides}/saml/settings.py (100%) rename {openslides => server/openslides}/saml/urls.py (100%) rename {openslides => server/openslides}/saml/user_backend.py (100%) rename {openslides => server/openslides}/saml/views.py (100%) rename {openslides => server/openslides}/topics/__init__.py (100%) rename {openslides => server/openslides}/topics/access_permissions.py (100%) rename {openslides => server/openslides}/topics/apps.py (100%) rename {openslides => server/openslides}/topics/migrations/0001_initial.py (100%) rename {openslides => server/openslides}/topics/migrations/__init__.py (100%) rename {openslides => server/openslides}/topics/models.py (100%) rename {openslides => server/openslides}/topics/projector.py (100%) rename {openslides => server/openslides}/topics/serializers.py (100%) rename {openslides => server/openslides}/topics/signals.py (100%) rename {openslides => server/openslides}/topics/views.py (100%) rename {openslides => server/openslides}/urls.py (100%) rename {openslides => server/openslides}/urls_apps.py (100%) rename {openslides => server/openslides}/users/__init__.py (100%) rename {openslides => server/openslides}/users/access_permissions.py (100%) rename {openslides => server/openslides}/users/apps.py (100%) rename {openslides => server/openslides}/users/config_variables.py (98%) rename {openslides => server/openslides}/users/management/__init__.py (100%) rename {openslides => server/openslides}/users/management/commands/__init__.py (100%) create mode 100644 server/openslides/users/management/commands/changedefaultadminpassword.py create mode 100644 server/openslides/users/management/commands/createopenslidesuser.py rename {openslides => server/openslides}/users/management/commands/createsuperuser.py (100%) rename {openslides/core => server/openslides/users}/management/commands/insecurechangepassword.py (100%) rename {openslides => server/openslides}/users/migrations/0001_initial.py (100%) rename {openslides => server/openslides}/users/migrations/0002_user_misc_default_groups.py (100%) rename {openslides => server/openslides}/users/migrations/0003_group.py (100%) rename {openslides => server/openslides}/users/migrations/0004_personalnote.py (100%) rename {openslides => server/openslides}/users/migrations/0005_personalnote_rework.py (100%) rename {openslides => server/openslides}/users/migrations/0006_user_email.py (100%) rename {openslides => server/openslides}/users/migrations/0007_superadmin.py (100%) rename {openslides => server/openslides}/users/migrations/0008_user_gender.py (100%) rename {openslides => server/openslides}/users/migrations/0009_auto_20190119_0941.py (100%) rename {openslides => server/openslides}/users/migrations/0010_auto_20190119_1447.py (100%) rename {openslides => server/openslides}/users/migrations/0011_postgresql_auth_group_id_sequence.py (100%) rename {openslides => server/openslides}/users/migrations/0012_user_auth_type.py (100%) rename {openslides => server/openslides}/users/migrations/0013_user_vote_weight.py (100%) rename {openslides => server/openslides}/users/migrations/0014_user_rename_permission.py (100%) rename {openslides => server/openslides}/users/migrations/__init__.py (100%) rename {openslides => server/openslides}/users/models.py (100%) rename {openslides => server/openslides}/users/projector.py (100%) rename {openslides => server/openslides}/users/serializers.py (100%) rename {openslides => server/openslides}/users/signals.py (100%) rename {openslides => server/openslides}/users/urls.py (100%) rename {openslides => server/openslides}/users/user_backend.py (100%) rename {openslides => server/openslides}/users/views.py (100%) rename {openslides => server/openslides}/utils/__init__.py (100%) rename {openslides => server/openslides}/utils/access_permissions.py (100%) rename {openslides => server/openslides}/utils/arguments.py (100%) rename {openslides => server/openslides}/utils/auth.py (100%) rename {openslides => server/openslides}/utils/autoupdate.py (100%) rename {openslides => server/openslides}/utils/cache.py (100%) rename {openslides => server/openslides}/utils/cache_providers.py (100%) rename {openslides => server/openslides}/utils/constants.py (100%) rename {openslides => server/openslides}/utils/consumer_autoupdate_strategy.py (100%) rename {openslides => server/openslides}/utils/consumers.py (100%) rename {openslides => server/openslides}/utils/exceptions.py (100%) rename {openslides => server/openslides}/utils/locking.py (100%) rename {openslides => server/openslides}/utils/logging.py (100%) rename {openslides => server/openslides}/utils/main.py (100%) rename {openslides => server/openslides}/utils/manager.py (100%) rename {openslides => server/openslides}/utils/middleware.py (100%) rename {openslides => server/openslides}/utils/migrations.py (100%) rename {openslides => server/openslides}/utils/models.py (100%) rename {openslides => server/openslides}/utils/plugins.py (100%) rename {openslides => server/openslides}/utils/postgres.py (100%) rename {openslides => server/openslides}/utils/projector.py (100%) rename {openslides => server/openslides}/utils/redis.py (91%) rename {openslides => server/openslides}/utils/redis_connection_pool.py (94%) rename {openslides => server/openslides}/utils/rest_api.py (100%) rename {openslides => server/openslides}/utils/schema_version.py (100%) rename {openslides => server/openslides}/utils/settings.py.tpl (100%) rename {openslides => server/openslides}/utils/startup.py (100%) rename {openslides => server/openslides}/utils/stats.py (100%) rename {openslides => server/openslides}/utils/timing.py (100%) rename {openslides => server/openslides}/utils/utils.py (100%) rename {openslides => server/openslides}/utils/validate.py (100%) rename {openslides => server/openslides}/utils/views.py (100%) rename {openslides => server/openslides}/utils/websocket.py (100%) rename {openslides => server/openslides}/utils/websocket_client_messages.py (100%) rename requirements.txt => server/requirements.txt (100%) rename {requirements => server/requirements}/big_mode.txt (100%) rename {requirements => server/requirements}/development.txt (100%) rename {requirements => server/requirements}/production.txt (100%) rename setup.cfg => server/setup.cfg (100%) rename {tests => server/tests}/__init__.py (100%) rename {tests => server/tests}/common_groups.py (100%) rename {tests => server/tests}/conftest.py (100%) rename {tests => server/tests}/count_queries.py (100%) rename {tests => server/tests}/example_data_generator/README.rst (100%) rename {tests => server/tests}/example_data_generator/__init__.py (100%) rename {tests => server/tests}/example_data_generator/apps.py (100%) rename {tests => server/tests}/example_data_generator/management/__init__.py (100%) rename {tests => server/tests}/example_data_generator/management/commands/__init__.py (100%) rename {tests => server/tests}/example_data_generator/management/commands/create-example-data.py (100%) rename {tests => server/tests}/integration/__init__.py (100%) rename {tests => server/tests}/integration/agenda/__init__.py (100%) rename {tests => server/tests}/integration/agenda/test_models.py (100%) rename {tests => server/tests}/integration/agenda/test_viewset.py (100%) rename {tests => server/tests}/integration/assignments/__init__.py (100%) rename {tests => server/tests}/integration/assignments/test_polls.py (100%) rename {tests => server/tests}/integration/assignments/test_viewset.py (100%) rename {tests => server/tests}/integration/core/__init__.py (100%) rename {tests => server/tests}/integration/core/test_views.py (100%) rename {tests => server/tests}/integration/core/test_viewset.py (100%) rename {tests => server/tests}/integration/helpers.py (100%) rename {tests => server/tests}/integration/mediafiles/__init__.py (100%) rename {tests => server/tests}/integration/mediafiles/test_viewset.py (100%) rename {tests => server/tests}/integration/motions/__init__.py (100%) rename {tests => server/tests}/integration/motions/test_motions.py (100%) rename {tests => server/tests}/integration/motions/test_polls.py (100%) rename {tests => server/tests}/integration/motions/test_views.py (100%) rename {tests => server/tests}/integration/motions/test_viewset.py (100%) rename {tests => server/tests}/integration/test_plugin/__init__.py (100%) rename {tests => server/tests}/integration/test_plugin/apps.py (100%) rename {tests => server/tests}/integration/topics/__init__.py (100%) rename {tests => server/tests}/integration/topics/test_viewset.py (100%) rename {tests => server/tests}/integration/users/__init__.py (100%) rename {tests => server/tests}/integration/users/test_views.py (100%) rename {tests => server/tests}/integration/users/test_viewset.py (100%) rename {tests => server/tests}/integration/utils/__init__.py (100%) rename {tests => server/tests}/integration/utils/test_consumers.py (100%) rename {tests => server/tests}/integration/websocket.py (100%) rename {tests => server/tests}/old/__init__.py (100%) rename {tests => server/tests}/old/agenda/__init__.py (100%) rename {tests => server/tests}/old/agenda/test_list_of_speakers.py (100%) rename {tests => server/tests}/old/config/__init__.py (100%) rename {tests => server/tests}/old/config/test_config.py (100%) rename {tests => server/tests}/old/motions/__init__.py (100%) rename {tests => server/tests}/old/motions/test_models.py (100%) rename {tests => server/tests}/old/utils/__init__.py (100%) rename {tests => server/tests}/old/utils/test_main.py (100%) rename {tests => server/tests}/settings.py (100%) rename {tests => server/tests}/test_case.py (100%) rename {tests => server/tests}/unit/__init__.py (100%) rename {tests => server/tests}/unit/agenda/__init__.py (100%) rename {tests => server/tests}/unit/agenda/test_models.py (100%) rename {tests => server/tests}/unit/agenda/test_projector.py (100%) rename {tests => server/tests}/unit/agenda/test_views.py (100%) rename {tests => server/tests}/unit/assignments/test_models.py (100%) rename {tests => server/tests}/unit/config/__init__.py (100%) rename {tests => server/tests}/unit/config/test_api.py (100%) rename {tests => server/tests}/unit/core/__init__.py (100%) rename {tests => server/tests}/unit/core/test_websocket.py (100%) rename {tests => server/tests}/unit/motions/__init__.py (100%) rename {tests => server/tests}/unit/motions/test_models.py (100%) rename {tests => server/tests}/unit/motions/test_projector.py (100%) rename {tests => server/tests}/unit/motions/test_views.py (100%) rename {tests => server/tests}/unit/users/__init__.py (100%) rename {tests => server/tests}/unit/users/test_models.py (100%) rename {tests => server/tests}/unit/users/test_serializers.py (100%) rename {tests => server/tests}/unit/users/test_user_backend.py (100%) rename {tests => server/tests}/unit/utils/__init__.py (100%) rename {tests => server/tests}/unit/utils/cache_provider.py (100%) rename {tests => server/tests}/unit/utils/test_cache.py (100%) rename {tests => server/tests}/unit/utils/test_utils.py (100%) rename {tests => server/tests}/unit/utils/test_validate.py (100%) rename {tests => server/tests}/unit/utils/test_views.py (100%) delete mode 100644 setup.py create mode 100644 tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext create mode 100644 tests/file/20314524-f632-4b7f-844e-2bf089c0867a.some_file create mode 100644 tests/file/20e1f927-e014-405d-81d1-af25b4e8513a.ext create mode 100644 tests/file/2fc2a759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 create mode 100644 tests/file/3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext create mode 100644 tests/file/3e15d6c6-820c-49a7-93ba-d360126d283b.ext create mode 100644 tests/file/49b9a22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 create mode 100644 tests/file/5a77d245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 create mode 100644 tests/file/7ba289ba-22a7-4717-ba33-9dde4a645440.some_file1 create mode 100644 tests/file/8e772176-ea7f-46d8-befc-44bfb9223ffb.ext create mode 100644 tests/file/8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext create mode 100644 tests/file/9c5e5942-681a-43d5-b5ff-49f84c724b43.ext create mode 100644 tests/file/a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext create mode 100644 tests/file/aaa47103-0419-4678-b99a-a21af7107f75.some_file9 create mode 100644 tests/file/aaa850f1-184e-475d-a630-066edb0a3444.some_file5 create mode 100644 tests/file/b711871c-2778-47bf-8bfa-4ff1d236ab46.some_file8 create mode 100644 tests/file/b84b767a-3b74-4a2c-bc07-2aff514c4986.ext create mode 100644 tests/file/bedae9bc-d384-4a39-9580-e9398e10cc60.txt create mode 100644 tests/file/c3c20648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 create mode 100644 tests/file/d568f7c3-bbaa-4550-b97c-92119eb247d9.some_file3 create mode 100644 tests/file/ea0a2347-e62f-4cf2-97e3-caef681efa60.some_file0 create mode 100644 tests/file/ed25cc10-f97c-4c70-8044-087d723422e1.no_extension 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/udC/+W6ksowDQYJKoZIhvcNAQEL +BQAwOzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQgVGVzdDESMBAG +A1UEAwwJbG9jYWxob3N0MB4XDTIwMDgxNDA5MTEwN1oXDTMwMDgxMjA5MTEwN1ow +OzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQgVGVzdDESMBAGA1UE +AwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAk/TF +odKI6Bnnuxf3ePpvGkBgs9Aonmh18WRNzfyXsRTQVZD3e77NV0ac7w5cnAx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PaIRtF9haf +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+xvQxD/9VfoyOZst8ZM+/MyZcHjozBwphM +Nmf6rJJLKsCy4E2AWU5cYoyLRsuRmU4MLmRewsFBUtWrjzDjlYmeYFwV9dpjOK+w +VV+Yq65Uxgcf+rV+01wWWzDIKvgLzMfy7I8/lqjY0GhLno1FPdtvtF2AQuC81BEY +r8+I+t3zuKStrxOqH9gKbvvff1QQgWo0Z/vyxkhFdgqtbCNfx2vE9KLeoym8aL1m +oKRL02Tm14agxIVBPKZM7hEmzRUMR20VJeRbocoY4CCWnSnZqGNix8955nnus1J/ +PnLVTR//EOPLo91JIJYC3mY2akhclZPf00dVGRqTju8SM6JJqTv67e97+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Y +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/+W6ksowDQYJKoZIhvcNAQEL +BQAwOzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQgVGVzdDESMBAG +A1UEAwwJbG9jYWxob3N0MB4XDTIwMDgxNDA5MTEwN1oXDTMwMDgxMjA5MTEwN1ow +OzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQgVGVzdDESMBAGA1UE +AwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAk/TF +odKI6Bnnuxf3ePpvGkBgs9Aonmh18WRNzfyXsRTQVZD3e77NV0ac7w5cnAxGjHV7 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rTmIVhGxGWQ9y/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 From 030378b48add237392a611f73d8f139d22ca2a98 Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Fri, 14 Aug 2020 11:28:39 +0200 Subject: [PATCH 02/19] Rebase changes for current master --- .gitignore | 3 + haproxy/src/combined.pem | 83 ------------------- haproxy/src/localhost-key.pem | 52 ------------ haproxy/src/localhost.pem | 31 ------- .../1a586555-aece-4bca-bb65-0c10d5697fb5.ext | 1 - ...4524-f632-4b7f-844e-2bf089c0867a.some_file | 1 - .../20e1f927-e014-405d-81d1-af25b4e8513a.ext | 1 - ...759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 | 1 - .../3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext | 1 - .../3e15d6c6-820c-49a7-93ba-d360126d283b.ext | 1 - ...22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 | 1 - ...245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 | 1 - ...9ba-22a7-4717-ba33-9dde4a645440.some_file1 | 1 - .../8e772176-ea7f-46d8-befc-44bfb9223ffb.ext | 1 - .../8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext | 1 - .../9c5e5942-681a-43d5-b5ff-49f84c724b43.ext | 1 - .../a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext | 1 - ...103-0419-4678-b99a-a21af7107f75.some_file9 | 1 - ...0f1-184e-475d-a630-066edb0a3444.some_file5 | 1 - ...71c-2778-47bf-8bfa-4ff1d236ab46.some_file8 | 1 - .../b84b767a-3b74-4a2c-bc07-2aff514c4986.ext | 1 - .../bedae9bc-d384-4a39-9580-e9398e10cc60.txt | 1 - ...648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 | 1 - ...7c3-bbaa-4550-b97c-92119eb247d9.some_file3 | 1 - ...347-e62f-4cf2-97e3-caef681efa60.some_file0 | 1 - ...0-f97c-4c70-8044-087d723422e1.no_extension | 1 - 26 files changed, 3 insertions(+), 188 deletions(-) delete mode 100644 haproxy/src/combined.pem delete mode 100644 haproxy/src/localhost-key.pem delete mode 100644 haproxy/src/localhost.pem delete mode 100644 tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext delete mode 100644 tests/file/20314524-f632-4b7f-844e-2bf089c0867a.some_file delete mode 100644 tests/file/20e1f927-e014-405d-81d1-af25b4e8513a.ext delete mode 100644 tests/file/2fc2a759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 delete mode 100644 tests/file/3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext delete mode 100644 tests/file/3e15d6c6-820c-49a7-93ba-d360126d283b.ext delete mode 100644 tests/file/49b9a22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 delete mode 100644 tests/file/5a77d245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 delete mode 100644 tests/file/7ba289ba-22a7-4717-ba33-9dde4a645440.some_file1 delete mode 100644 tests/file/8e772176-ea7f-46d8-befc-44bfb9223ffb.ext delete mode 100644 tests/file/8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext delete mode 100644 tests/file/9c5e5942-681a-43d5-b5ff-49f84c724b43.ext delete mode 100644 tests/file/a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext delete mode 100644 tests/file/aaa47103-0419-4678-b99a-a21af7107f75.some_file9 delete mode 100644 tests/file/aaa850f1-184e-475d-a630-066edb0a3444.some_file5 delete mode 100644 tests/file/b711871c-2778-47bf-8bfa-4ff1d236ab46.some_file8 delete mode 100644 tests/file/b84b767a-3b74-4a2c-bc07-2aff514c4986.ext delete mode 100644 tests/file/bedae9bc-d384-4a39-9580-e9398e10cc60.txt delete mode 100644 tests/file/c3c20648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 delete mode 100644 tests/file/d568f7c3-bbaa-4550-b97c-92119eb247d9.some_file3 delete mode 100644 tests/file/ea0a2347-e62f-4cf2-97e3-caef681efa60.some_file0 delete mode 100644 tests/file/ed25cc10-f97c-4c70-8044-087d723422e1.no_extension diff --git a/.gitignore b/.gitignore index 9470a8042..2f9284fe1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,11 @@ Thumbs.db ## Compatibility # OS4-Submodules /openslides-*/ +/haproxy/ # Plugin development openslides_* +# Old OS3 stuff +/tests/ ## Server # Local user data (settings, database, media, search index, static files) diff --git a/haproxy/src/combined.pem b/haproxy/src/combined.pem deleted file mode 100644 index ac2ef6804..000000000 --- a/haproxy/src/combined.pem +++ /dev/null @@ -1,83 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFVzCCAz+gAwIBAgIUBcPjTF+PvAOcjrgx/udC/+W6ksowDQYJKoZIhvcNAQEL -BQAwOzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQgVGVzdDESMBAG -A1UEAwwJbG9jYWxob3N0MB4XDTIwMDgxNDA5MTEwN1oXDTMwMDgxMjA5MTEwN1ow -OzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQ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bFQzCKy88K/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 deleted file mode 100644 index 4eb8c7327..000000000 --- a/haproxy/src/localhost-key.pem +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCT9MWh0ojoGee7 -F/d4+m8aQGCz0CieaHXxZE3N/JexFNBVkPd7vs1XRpzvDlycDEaMdXtuo5hL8Pfk -Pq9BxsTOcdQjCuKXcbEAhesCrZVu76+xvQxD/9VfoyOZst8ZM+/MyZcHjozBwphM -Nmf6rJJLKsCy4E2AWU5cYoyLRsuRmU4MLmRewsFBUtWrjzDjlYmeYFwV9dpjOK+w -VV+Yq65Uxgcf+rV+01wWWzDIKvgLzMfy7I8/lqjY0GhLno1FPdtvtF2AQuC81BEY -r8+I+t3zuKStrxOqH9gKbvvff1QQgWo0Z/vyxk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BAKSckOSyPWsh/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 deleted file mode 100644 index 0de5ade50..000000000 --- a/haproxy/src/localhost.pem +++ /dev/null @@ -1,31 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFVzCCAz+gAwIBAgIUBcPjTF+PvAOcjrgx/udC/+W6ksowDQYJKoZIhvcNAQEL -BQAwOzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQgVGVzdDESMBAG -A1UEAwwJbG9jYWxob3N0MB4XDTIwMDgxNDA5MTEwN1oXDTMwMDgxMjA5MTEwN1ow -OzELMAkGA1UEBhMCREUxGDAWBgNVBAoMD1NlbGZzaWduZWQgVGVzdDES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k+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/tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext b/tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/1a586555-aece-4bca-bb65-0c10d5697fb5.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/20314524-f632-4b7f-844e-2bf089c0867a.some_file +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/20e1f927-e014-405d-81d1-af25b4e8513a.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/2fc2a759-0a0c-4ce8-965e-9b92a37cbf3f.some_file2 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/3d72e4e8-60d3-4a05-90d7-d3598b3e24c9.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/3e15d6c6-820c-49a7-93ba-d360126d283b.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/49b9a22a-db5d-407e-baa5-02d0aa4cf56f.some_file4 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/5a77d245-5127-4b4e-a52b-24ce2eae1a3b.some_file7 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/7ba289ba-22a7-4717-ba33-9dde4a645440.some_file1 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/8e772176-ea7f-46d8-befc-44bfb9223ffb.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/8fa11e3a-05e2-472d-9e08-dfa1d9b2404e.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/9c5e5942-681a-43d5-b5ff-49f84c724b43.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/a3bc4ff9-641f-420b-a24e-5a284bf6f6f9.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/aaa47103-0419-4678-b99a-a21af7107f75.some_file9 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/aaa850f1-184e-475d-a630-066edb0a3444.some_file5 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/b711871c-2778-47bf-8bfa-4ff1d236ab46.some_file8 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/b84b767a-3b74-4a2c-bc07-2aff514c4986.ext +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 6b584e8ec..000000000 --- a/tests/file/bedae9bc-d384-4a39-9580-e9398e10cc60.txt +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/c3c20648-33ee-4143-b1e8-3fdd4c33ac01.some_file6 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/d568f7c3-bbaa-4550-b97c-92119eb247d9.some_file3 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/ea0a2347-e62f-4cf2-97e3-caef681efa60.some_file0 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index 2617e929a..000000000 --- a/tests/file/ed25cc10-f97c-4c70-8044-087d723422e1.no_extension +++ /dev/null @@ -1 +0,0 @@ -some content. \ No newline at end of file From 683aed56bb88305a04f6fc02b57c0f12bf4aacd5 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 17 Jul 2020 15:27:46 +0200 Subject: [PATCH 03/19] server: Fix exec args in entrypoint --- server/docker/entrypoint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/docker/entrypoint b/server/docker/entrypoint index 47c3bbb9b..1ab56163e 100755 --- a/server/docker/entrypoint +++ b/server/docker/entrypoint @@ -11,4 +11,4 @@ printf 'Executing server: "%s"\n' "$*" # - 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 $* +exec "$@" From d48794ae8a9beb1ffea0592dbae125fd261bce43 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 13:22:44 +0200 Subject: [PATCH 04/19] Docker: Add YAML templates These templates were copied from https://github.com/OpenSlides/openslides-docker-compose and adapted for the new server-db-setup service. --- docker/docker-compose.yml | 162 ------------------------ docker/docker-compose.yml.m4 | 204 ++++++++++++++++++++++++++++++ docker/docker-stack.yml.m4 | 238 +++++++++++++++++++++++++++++++++++ 3 files changed, 442 insertions(+), 162 deletions(-) delete mode 100644 docker/docker-compose.yml create mode 100644 docker/docker-compose.yml.m4 create mode 100644 docker/docker-stack.yml.m4 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml deleted file mode 100644 index 27cbeff4b..000000000 --- a/docker/docker-compose.yml +++ /dev/null @@ -1,162 +0,0 @@ -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/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 new file mode 100644 index 000000000..d0d9fa1dc --- /dev/null +++ b/docker/docker-compose.yml.m4 @@ -0,0 +1,204 @@ +dnl This is a YAML template file. Simply translate it with m4 to create +dnl a standard configuration. Customizations can and should be added in .env +dnl by setting the appropriate variables. +dnl +dnl Usage: +dnl m4 docker-compose.yml.m4 > docker-compose.yml +dnl ( set -a; source .env; m4 docker-compose.yml.m4 ) > docker-compose.yml +dnl +dnl ---------------------------------------- +divert(-1)dnl +define(`read_env', `esyscmd(`printf "%s" "$$1"')') +define(`ifenvelse', `ifelse(read_env(`$1'),, `$2', read_env(`$1'))') + +define(`BACKEND_IMAGE', +ifenvelse(`DOCKER_OPENSLIDES_BACKEND_NAME', openslides/openslides-server):dnl +ifenvelse(`DOCKER_OPENSLIDES_BACKEND_TAG', latest)) +define(`FRONTEND_IMAGE', +ifenvelse(`DOCKER_OPENSLIDES_FRONTEND_NAME', openslides/openslides-client):dnl +ifenvelse(`DOCKER_OPENSLIDES_FRONTEND_TAG', latest)) + +define(`PRIMARY_DB', `ifenvelse(`PGNODE_REPMGR_PRIMARY', pgnode1)') + +define(`PGBOUNCER_NODELIST', +`ifelse(read_env(`PGNODE_2_ENABLED'), 1, `,pgnode2')`'dnl +ifelse(read_env(`PGNODE_3_ENABLED'), 1, `,pgnode3')') + +define(`PROJECT_DIR', ifdef(`PROJECT_DIR',PROJECT_DIR,.)) +define(`ADMIN_SECRET_AVAILABLE', `syscmd(`test -f 'PROJECT_DIR`/secrets/adminsecret.env')sysval') +define(`USER_SECRET_AVAILABLE', `syscmd(`test -f 'PROJECT_DIR`/secrets/usersecret.env')sysval') +divert(0)dnl +dnl ---------------------------------------- +# This configuration was created from a template file. Before making changes, +# please make sure that you do not have a process in place that would override +# your changes in the future. The accompanying .env file might be the correct +# place for customizations instead. +version: '3.4' + +x-osserver: + &default-osserver + image: BACKEND_IMAGE + networks: + - front + - back + restart: always +x-osserver-env: &default-osserver-env + INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" + DEFAULT_FROM_EMAIL: "ifenvelse(`DEFAULT_FROM_EMAIL', noreply@example.com)" + REDIS_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 1) +x-pgnode: &default-pgnode + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', 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 + REPMGR_WAL_ARCHIVE: "ifenvelse(`PGNODE_WAL_ARCHIVING', on)" + +services: + server: + << : *default-osserver + # 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: + - server-db-setup + environment: + << : *default-osserver-env + ifelse(read_env(`OPENSLIDES_BACKEND_SERVICE_REPLICAS'),,,deploy: + replicas: ifenvelse(`OPENSLIDES_BACKEND_SERVICE_REPLICAS', 1)) + + server-db-setup: + << : *default-osserver + entrypoint: /usr/local/sbin/entrypoint-db-setup + environment: + << : *default-osserver-env + ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) + ifelse(ADMIN_SECRET_AVAILABLE, 0,- os_admin) + ifelse(USER_SECRET_AVAILABLE, 0,- os_user) + depends_on: + - pgbouncer + - redis + - redis-slave + - redis-channels + + client: + image: FRONTEND_IMAGE + restart: always + depends_on: + - server + networks: + - front + ports: + - "127.0.0.1:ifenvelse(`EXTERNAL_HTTP_PORT', 8000):80" + + pgnode1: + << : *default-pgnode + environment: + << : *default-pgnode-env + REPMGR_NODE_ID: 1 + REPMGR_PRIMARY: ifelse(PRIMARY_DB, pgnode1, `# This is the primary', PRIMARY_DB) + volumes: + - "dbdata1:/var/lib/postgresql" +ifelse(read_env(`PGNODE_2_ENABLED'), 1, `' + pgnode2: + << : *default-pgnode + environment: + << : *default-pgnode-env + REPMGR_NODE_ID: 2 + REPMGR_PRIMARY: ifelse(PRIMARY_DB, pgnode2, `# This is the primary', PRIMARY_DB) + volumes: + - "dbdata2:/var/lib/postgresql") +ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' + pgnode3: + << : *default-pgnode + environment: + << : *default-pgnode-env + REPMGR_NODE_ID: 3 + REPMGR_PRIMARY: ifelse(PRIMARY_DB, pgnode3, `# This is the primary', PRIMARY_DB) + volumes: + - "dbdata3:/var/lib/postgresql") + + pgbouncer: + environment: + - PG_NODE_LIST=pgnode1`'PGBOUNCER_NODELIST + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-pgbouncer:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:pgbouncer + restart: always + networks: + back: + aliases: + - db + - postgres + dbnet: + postfix: + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-postfix:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:postfix + restart: always + environment: + MYHOSTNAME: "ifenvelse(`POSTFIX_MYHOSTNAME', localhost)" + RELAYHOST: "ifenvelse(`POSTFIX_RELAYHOST', localhost)" + networks: + - back + redis: + image: redis:alpine + restart: always + networks: + back: + aliases: + - rediscache + redis-slave: + image: redis:alpine + restart: always + command: ["redis-server", "--save", "", "--slaveof", "redis", "6379"] + depends_on: + - redis + networks: + back: + aliases: + - rediscache-slave + ifelse(read_env(`REDIS_RO_SERVICE_REPLICAS'),,,deploy: + replicas: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 1)) + redis-channels: + image: redis:alpine + restart: always + networks: + back: + media: + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', 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: +ifelse(read_env(`PGNODE_2_ENABLED'), 1, ` dbdata2:') +ifelse(read_env(`PGNODE_3_ENABLED'), 1, ` dbdata3:') + +networks: + front: + back: + dbnet: + +ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) + ifelse(ADMIN_SECRET_AVAILABLE, 0,os_admin: + file: ./secrets/adminsecret.env) + ifelse(USER_SECRET_AVAILABLE, 0,os_user: + file: ./secrets/usersecret.env) + +# vim: set sw=2 et: diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 new file mode 100644 index 000000000..238d13caf --- /dev/null +++ b/docker/docker-stack.yml.m4 @@ -0,0 +1,238 @@ +dnl This is a YAML template file. Simply translate it with m4 to create +dnl a standard configuration. Customizations can and should be added in .env +dnl by setting the appropriate variables. +dnl +dnl Usage: +dnl m4 docker-stack.yml.m4 > docker-stack.yml +dnl ( set -a; source .env; m4 docker-stack.yml.m4 ) > docker-stack.yml +dnl +dnl ---------------------------------------- +divert(-1)dnl +define(`read_env', `esyscmd(`printf "%s" "$$1"')') +define(`ifenvelse', `ifelse(read_env(`$1'),, `$2', read_env(`$1'))') + +define(`BACKEND_IMAGE', +ifenvelse(`DOCKER_OPENSLIDES_BACKEND_NAME', openslides/openslides-server):dnl +ifenvelse(`DOCKER_OPENSLIDES_BACKEND_TAG', latest)) +define(`FRONTEND_IMAGE', +ifenvelse(`DOCKER_OPENSLIDES_FRONTEND_NAME', openslides/openslides-client):dnl +ifenvelse(`DOCKER_OPENSLIDES_FRONTEND_TAG', latest)) + +define(`PRIMARY_DB', `ifenvelse(`PGNODE_REPMGR_PRIMARY', pgnode1)') + +define(`PGBOUNCER_NODELIST', +`ifelse(read_env(`PGNODE_2_ENABLED'), 1, `,pgnode2')`'dnl +ifelse(read_env(`PGNODE_3_ENABLED'), 1, `,pgnode3')') + +define(`PROJECT_DIR', ifdef(`PROJECT_DIR',PROJECT_DIR,.)) +define(`ADMIN_SECRET_AVAILABLE', `syscmd(`test -f 'PROJECT_DIR`/secrets/adminsecret.env')sysval') +define(`USER_SECRET_AVAILABLE', `syscmd(`test -f 'PROJECT_DIR`/secrets/usersecret.env')sysval') +divert(0)dnl +dnl ---------------------------------------- +# This configuration was created from a template file. Before making changes, +# please make sure that you do not have a process in place that would override +# your changes in the future. The accompanying .env file might be the correct +# place for customizations instead. +version: '3.4' + +x-osserver: + &default-osserver + image: BACKEND_IMAGE + networks: + - front + - back +x-osserver-env: &default-osserver-env + INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" + DEFAULT_FROM_EMAIL: "ifenvelse(`DEFAULT_FROM_EMAIL', noreply@example.com)" + REDIS_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 3) +x-pgnode: &default-pgnode + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-repmgr:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:repmgr + networks: + - dbnet + labels: + org.openslides.role: "postgres" + deploy: + replicas: 1 +x-pgnode-env: &default-pgnode-env + REPMGR_RECONNECT_ATTEMPTS: 30 + REPMGR_RECONNECT_INTERVAL: 10 + REPMGR_WAL_ARCHIVE: "ifenvelse(`PGNODE_WAL_ARCHIVING', on)" + +services: + server: + << : *default-osserver + # 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" + environment: + << : *default-osserver-env + deploy: + restart_policy: + condition: on-failure + delay: 5s + replicas: ifenvelse(`OPENSLIDES_BACKEND_SERVICE_REPLICAS', 1) + + server-db-setup: + << : *default-osserver + entrypoint: /usr/local/sbin/entrypoint-db-setup + environment: + << : *default-osserver-env + ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) + ifelse(ADMIN_SECRET_AVAILABLE, 0,- os_admin) + ifelse(USER_SECRET_AVAILABLE, 0,- os_user) + + client: + image: FRONTEND_IMAGE + networks: + - front + ports: + - "0.0.0.0:ifenvelse(`EXTERNAL_HTTP_PORT', 8000):80" + deploy: + replicas: ifenvelse(`OPENSLIDES_FRONTEND_SERVICE_REPLICAS', 1) + restart_policy: + condition: on-failure + delay: 5s + + pgnode1: + << : *default-pgnode + environment: + << : *default-pgnode-env + REPMGR_NODE_ID: 1 + REPMGR_PRIMARY: ifelse(PRIMARY_DB, pgnode1, `# This is the primary', PRIMARY_DB) + deploy: + placement: + constraints: ifenvelse(`PGNODE_1_PLACEMENT_CONSTR', [node.labels.openslides-db == dbnode1]) + volumes: + - "dbdata1:/var/lib/postgresql" +ifelse(read_env(`PGNODE_2_ENABLED'), 1, `' + pgnode2: + << : *default-pgnode + environment: + << : *default-pgnode-env + REPMGR_NODE_ID: 2 + REPMGR_PRIMARY: ifelse(PRIMARY_DB, pgnode2, `# This is the primary', PRIMARY_DB) + deploy: + placement: + constraints: ifenvelse(`PGNODE_2_PLACEMENT_CONSTR', [node.labels.openslides-db == dbnode2]) + volumes: + - "dbdata2:/var/lib/postgresql") +ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' + pgnode3: + << : *default-pgnode + environment: + << : *default-pgnode-env + REPMGR_NODE_ID: 3 + REPMGR_PRIMARY: ifelse(PRIMARY_DB, pgnode3, `# This is the primary', PRIMARY_DB) + deploy: + placement: + constraints: ifenvelse(`PGNODE_3_PLACEMENT_CONSTR', [node.labels.openslides-db == dbnode3]) + volumes: + - "dbdata3:/var/lib/postgresql") + + pgbouncer: + environment: + - PG_NODE_LIST=pgnode1`'PGBOUNCER_NODELIST + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-pgbouncer:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:pgbouncer + networks: + back: + aliases: + - db + - postgres + dbnet: + deploy: + restart_policy: + condition: on-failure + delay: 10s + placement: + constraints: ifenvelse(`PGBOUNCER_PLACEMENT_CONSTR', [node.role == manager]) + postfix: + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-postfix:latest + build: https://github.com/OpenSlides/openslides-docker-compose.git#:postfix + environment: + MYHOSTNAME: "ifenvelse(`POSTFIX_MYHOSTNAME', localhost)" + RELAYHOST: "ifenvelse(`POSTFIX_RELAYHOST', localhost)" + networks: + - back + deploy: + restart_policy: + condition: on-failure + delay: 5s + replicas: 1 + placement: + constraints: [node.role == manager] + redis: + image: redis:alpine + networks: + back: + aliases: + - rediscache + deploy: + replicas: 1 + restart_policy: + condition: on-failure + delay: 5s + redis-slave: + image: redis:alpine + command: ["redis-server", "--save", "", "--slaveof", "redis", "6379"] + networks: + back: + aliases: + - rediscache-slave + deploy: + replicas: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 3) + restart_policy: + condition: on-failure + delay: 5s + redis-channels: + image: redis:alpine + networks: + back: + deploy: + replicas: 1 + restart_policy: + condition: on-failure + delay: 5s + media: + image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-media-service:latest + build: https://github.com/OpenSlides/openslides-media-service.git + environment: + - CHECK_REQUEST_URL=server:8000/check-media/ + deploy: + replicas: ifenvelse(`MEDIA_SERVICE_REPLICAS', 8) + restart_policy: + condition: on-failure + delay: 10s + 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: +ifelse(read_env(`PGNODE_2_ENABLED'), 1, ` dbdata2:') +ifelse(read_env(`PGNODE_3_ENABLED'), 1, ` dbdata3:') + +networks: + front: + back: + driver_opts: + encrypted: "" + dbnet: + driver_opts: + encrypted: "" + +ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) + ifelse(ADMIN_SECRET_AVAILABLE, 0,os_admin: + file: ./secrets/adminsecret.env) + ifelse(USER_SECRET_AVAILABLE, 0,os_user: + file: ./secrets/usersecret.env) + +# vim: set sw=2 et: From 4f194a879478c90503fe4899570d789c8729b161 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 13:24:45 +0200 Subject: [PATCH 05/19] Docker: Add a Docker secret for the Django key We have decided against including an insecure default key with a mere warning. Therefore, unlike the admin and user secrets, the availability of this secret is a hard requirement. The instance will not be able to start before a secret has been generated manually or by a management tool. --- docker/docker-compose.yml.m4 | 9 +++++++-- docker/docker-stack.yml.m4 | 9 +++++++-- docker/secrets/django.env.example | 3 +++ server/build.sh | 8 -------- server/docker/entrypoint | 9 +++++++++ server/docker/entrypoint-db-setup | 9 +++++++++ 6 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 docker/secrets/django.env.example diff --git a/docker/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 index d0d9fa1dc..2c5902fd0 100644 --- a/docker/docker-compose.yml.m4 +++ b/docker/docker-compose.yml.m4 @@ -73,6 +73,8 @@ services: - server-db-setup environment: << : *default-osserver-env + secrets: + - django ifelse(read_env(`OPENSLIDES_BACKEND_SERVICE_REPLICAS'),,,deploy: replicas: ifenvelse(`OPENSLIDES_BACKEND_SERVICE_REPLICAS', 1)) @@ -81,7 +83,8 @@ services: entrypoint: /usr/local/sbin/entrypoint-db-setup environment: << : *default-osserver-env - ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) + secrets: + - django ifelse(ADMIN_SECRET_AVAILABLE, 0,- os_admin) ifelse(USER_SECRET_AVAILABLE, 0,- os_user) depends_on: @@ -195,7 +198,9 @@ networks: back: dbnet: -ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) +secrets: + django: + file: ./secrets/django.env ifelse(ADMIN_SECRET_AVAILABLE, 0,os_admin: file: ./secrets/adminsecret.env) ifelse(USER_SECRET_AVAILABLE, 0,os_user: diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 index 238d13caf..9ade06f77 100644 --- a/docker/docker-stack.yml.m4 +++ b/docker/docker-stack.yml.m4 @@ -71,6 +71,8 @@ services: # command: "daphne -b 0.0.0.0 -p 8000 openslides.asgi:application" environment: << : *default-osserver-env + secrets: + - django deploy: restart_policy: condition: on-failure @@ -82,7 +84,8 @@ services: entrypoint: /usr/local/sbin/entrypoint-db-setup environment: << : *default-osserver-env - ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) + secrets: + - django ifelse(ADMIN_SECRET_AVAILABLE, 0,- os_admin) ifelse(USER_SECRET_AVAILABLE, 0,- os_user) @@ -229,7 +232,9 @@ networks: driver_opts: encrypted: "" -ifelse(ADMIN_SECRET_AVAILABLE, 0, secrets:, USER_SECRET_AVAILABLE, 0, secrets:) +secrets: + django: + file: ./secrets/django.env ifelse(ADMIN_SECRET_AVAILABLE, 0,os_admin: file: ./secrets/adminsecret.env) ifelse(USER_SECRET_AVAILABLE, 0,os_user: diff --git a/docker/secrets/django.env.example b/docker/secrets/django.env.example new file mode 100644 index 000000000..100a0ed3f --- /dev/null +++ b/docker/secrets/django.env.example @@ -0,0 +1,3 @@ +# Define a secret key for Django +# https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/#secret-key +DJANGO_SECRET_KEY= diff --git a/server/build.sh b/server/build.sh index 234260600..8ce7ef779 100755 --- a/server/build.sh +++ b/server/build.sh @@ -7,12 +7,4 @@ printf "Server built on %s:\n\nBranch: %s\n\n%s\n" \ "$(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/entrypoint b/server/docker/entrypoint index 1ab56163e..b9388da92 100755 --- a/server/docker/entrypoint +++ b/server/docker/entrypoint @@ -2,6 +2,15 @@ set -e +# Set DJANGO_SECRET_KEY variable +source /run/secrets/django +[[ -n "$DJANGO_SECRET_KEY" ]] || { + echo "ERROR: Django secret key undefined! Cannot continue." + sleep 5 + exit 2 +} +export SECRET_KEY="$DJANGO_SECRET_KEY" + # TODO: env variable for this host wait-for-it -t 0 "server-db-setup:8000" diff --git a/server/docker/entrypoint-db-setup b/server/docker/entrypoint-db-setup index 2153196ac..acd327e06 100755 --- a/server/docker/entrypoint-db-setup +++ b/server/docker/entrypoint-db-setup @@ -15,6 +15,15 @@ EOF sleep 10 } +# Set DJANGO_SECRET_KEY variable +source /run/secrets/django +[[ -n "$DJANGO_SECRET_KEY" ]] || { + echo "ERROR: Django secret key undefined! Cannot continue." + sleep 5 + exit 2 +} +export SECRET_KEY="$DJANGO_SECRET_KEY" + # Configure database # TODO: env variables?? echo "postgres:5432:instancecfg:openslides:openslides" > "${HOME}/.pgpass" From 63c4bc3ff71fd29c0dfde8322a893b9ebe2feb9b Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 14:39:01 +0200 Subject: [PATCH 06/19] build.sh: Build config from template --- .gitignore | 1 + docker/build.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 2f9284fe1..71572ed17 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ cypress.json ## Deployment # Docker build artifacts +/docker/docker-compose.yml *-version.txt # secrets docker/secrets/*.env diff --git a/docker/build.sh b/docker/build.sh index b988c9723..cd60a72bb 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,4 +1,7 @@ #!/bin/bash ../server/build.sh -t openslides/openslides-server:latest ../client/build.sh -t openslides/openslides-client:latest + +[[ -f docker-compose.yml ]] || m4 < docker-compose.yml.m4 > docker-compose.yml + docker-compose build From 13db5687cbeae7a8739abdd44ef7f146135cbceb Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 15:21:31 +0200 Subject: [PATCH 07/19] README: Add Django secret info --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.rst b/README.rst index 41df8ea9c..3991557b9 100644 --- a/README.rst +++ b/README.rst @@ -27,6 +27,11 @@ You need to build the docker images for the client and server with this script:: $ ./build.sh +You must define a Django secret key in ``secrets/django.env``, for example:: + + $ printf "DJANGO_SECRET_KEY='%s'\n" \ + "$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 64)" > secrets/django.env + 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:: From 774fa4c20410a2702de5523a345fe093bdfe684c Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 15:21:35 +0200 Subject: [PATCH 08/19] README: Typos, language, formatting --- README.rst | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index 3991557b9..8abc3eccf 100644 --- a/README.rst +++ b/README.rst @@ -5,16 +5,18 @@ What is OpenSlides? =================== -OpenSlides is a free, web based presentation and assembly system for -managing and projecting agenda, motions and elections of an assembly. See +OpenSlides is a free, Web-based presentation and assembly system for +managing and projecting agenda, motions, and elections of assemblies. See https://openslides.com for more information. Installation ============ -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 `_. +The main deployment method is using Docker and docker-compose. You only need to +have these tools installed and no further dependencies. If you want a simpler +setup or are interested in developing, please refer to `development +instructions +`_. Note: This is temporary and will be replace with nice scripts... @@ -23,7 +25,8 @@ First, you have to clone this repository:: $ git clone https://github.com/OpenSlides/OpenSlides.git $ cd OpenSlides/docker/ -You need to build the docker images for the client and server with this script:: +You need to build the Docker images for the client and server with this +script:: $ ./build.sh @@ -32,17 +35,19 @@ You must define a Django secret key in ``secrets/django.env``, for example:: $ printf "DJANGO_SECRET_KEY='%s'\n" \ "$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 64)" > secrets/django.env -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:: +We also strongly recommend that you set a secure admin password but it is not +strictly required. If you do not set an admin password, the default login +credentials will be displayed on the login page. Setting the admin password:: $ 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):: +Afterwards, generate the configuration file:: + + EXTERNAL_HTTP_PORT=8000 m4 docker-compose.yml.m4 > docker-compose.yml + +Once the server and client have been built, you can use ``docker-compose`` as +usual (except for the ``build`` method):: $ docker-compose up $ # or: @@ -51,24 +56,23 @@ If the server and client are built, you can use ``docker-compose`` as usual $ # ... $ docker-compose down -OpenSlides is listening on port 8000. It can be changed in the -``docker/docker-compose.yml``. - 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 `_. +Feel free to open issues here on GitHub! Please use the right templates for +bugs and features, and use 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 ``server/requirements/production.txt`` and ``server/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``) +* several JavaScript packages (see ``client/package.json``) License and authors =================== From f694e9b2c465556f624ed44ad15ca56b40f33507 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 15:23:35 +0200 Subject: [PATCH 09/19] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 180ce4f27..f3aa9446d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -31,3 +31,4 @@ Authors of OpenSlides in chronological order of first contribution: Fadi Abbud Gabriel Meyer Joshua Sangmeister + Gernot Schulz From 9c9f268fbf3638cdc4b6be2d964dd864e62094ab Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 15:35:37 +0200 Subject: [PATCH 10/19] Docker: Shorten server-db-setup service name --- docker/docker-compose.yml.m4 | 4 ++-- docker/docker-stack.yml.m4 | 2 +- server/docker/entrypoint | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 index 2c5902fd0..db126094e 100644 --- a/docker/docker-compose.yml.m4 +++ b/docker/docker-compose.yml.m4 @@ -70,7 +70,7 @@ services: # Uncomment the following line to use daphne instead of gunicorn: # command: "daphne -b 0.0.0.0 -p 8000 openslides.asgi:application" depends_on: - - server-db-setup + - server-setup environment: << : *default-osserver-env secrets: @@ -78,7 +78,7 @@ services: ifelse(read_env(`OPENSLIDES_BACKEND_SERVICE_REPLICAS'),,,deploy: replicas: ifenvelse(`OPENSLIDES_BACKEND_SERVICE_REPLICAS', 1)) - server-db-setup: + server-setup: << : *default-osserver entrypoint: /usr/local/sbin/entrypoint-db-setup environment: diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 index 9ade06f77..e5b900c20 100644 --- a/docker/docker-stack.yml.m4 +++ b/docker/docker-stack.yml.m4 @@ -79,7 +79,7 @@ services: delay: 5s replicas: ifenvelse(`OPENSLIDES_BACKEND_SERVICE_REPLICAS', 1) - server-db-setup: + server-setup: << : *default-osserver entrypoint: /usr/local/sbin/entrypoint-db-setup environment: diff --git a/server/docker/entrypoint b/server/docker/entrypoint index b9388da92..3400c503e 100755 --- a/server/docker/entrypoint +++ b/server/docker/entrypoint @@ -12,7 +12,7 @@ source /run/secrets/django export SECRET_KEY="$DJANGO_SECRET_KEY" # TODO: env variable for this host -wait-for-it -t 0 "server-db-setup:8000" +wait-for-it -t 0 "server-setup:8000" printf 'Executing server: "%s"\n' "$*" From 418480bff571abc6a57929a8a065c93642f63f73 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 16:21:21 +0200 Subject: [PATCH 11/19] build.sh: Make build script more useful build.sh replaces docker-compose as an image build tool. Instead, all OpenSlides services can be built using this script which offers various important options such as tagging and configurable defaults. The now-redundant build instructions have been removed from the YAML templates. The almost identical server and client build scripts have been made fully identical. --- README.rst | 5 +- client/build.sh | 10 +--- client/docker/Dockerfile | 2 +- docker/build.sh | 104 +++++++++++++++++++++++++++++++++-- docker/docker-compose.yml.m4 | 4 -- docker/docker-stack.yml.m4 | 4 -- server/build.sh | 21 +++++-- 7 files changed, 119 insertions(+), 31 deletions(-) mode change 100755 => 120000 client/build.sh diff --git a/README.rst b/README.rst index 8abc3eccf..99e432b27 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,7 @@ First, you have to clone this repository:: You need to build the Docker images for the client and server with this script:: - $ ./build.sh + $ ./build.sh all You must define a Django secret key in ``secrets/django.env``, for example:: @@ -46,8 +46,7 @@ Afterwards, generate the configuration file:: EXTERNAL_HTTP_PORT=8000 m4 docker-compose.yml.m4 > docker-compose.yml -Once the server and client have been built, you can use ``docker-compose`` as -usual (except for the ``build`` method):: +Finally, you can start the instance using ``docker-compose``:: $ docker-compose up $ # or: diff --git a/client/build.sh b/client/build.sh deleted file mode 100755 index 3836ae214..000000000 --- a/client/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/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/build.sh b/client/build.sh new file mode 120000 index 000000000..b2207a97d --- /dev/null +++ b/client/build.sh @@ -0,0 +1 @@ +../server/build.sh \ No newline at end of file diff --git a/client/docker/Dockerfile b/client/docker/Dockerfile index 96f8f4f88..c12783299 100644 --- a/client/docker/Dockerfile +++ b/client/docker/Dockerfile @@ -16,7 +16,7 @@ COPY browserslist *.json ./ COPY src ./src RUN npm run build -COPY client-version.txt static/ +COPY docker/client-version.txt static/ FROM nginx COPY --from=nodejs /build/app/static /usr/share/nginx/html diff --git a/docker/build.sh b/docker/build.sh index cd60a72bb..c52ac54a3 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,7 +1,103 @@ #!/bin/bash -../server/build.sh -t openslides/openslides-server:latest -../client/build.sh -t openslides/openslides-client:latest -[[ -f docker-compose.yml ]] || m4 < docker-compose.yml.m4 > docker-compose.yml +set -e -docker-compose build +declare -A TARGETS +TARGETS=( + [client]="$(dirname "${BASH_SOURCE[0]}")/../client/docker/" + [server]="$(dirname "${BASH_SOURCE[0]}")/../server/docker/" + [media-service]="https://github.com/OpenSlides/openslides-media-service.git" + [pgbouncer]="https://github.com/OpenSlides/openslides-docker-compose.git#:pgbouncer" + [postfix]="https://github.com/OpenSlides/openslides-docker-compose.git#:postfix" + [repmgr]="https://github.com/OpenSlides/openslides-docker-compose.git#:repmgr" +) + +DOCKER_REPOSITORY="openslides" +DOCKER_TAG="latest" +CONFIG="/etc/osinstancectl" +OPTIONS=() +BUILT_IMAGES=() +DEFAULT_TARGETS=(server client) + +usage() { + cat << EOF +Usage: $(basename ${BASH_SOURCE[0]}) [] ... + +Options: + -D, --docker-repo Specify a Docker repository + (default: unspecified, i.e., system default) + -t, --tag Tag the Docker image (default: $DOCKER_TAG) + --no-cache Pass --no-cache to docker-build +EOF +} + +# Config file +if [[ -f "$CONFIG" ]]; then + echo "Found ${CONFIG} file." + source "$CONFIG" +fi + +shortopt="hr:D:t:" +longopt="help,docker-repo:,tag:,no-cache" +ARGS=$(getopt -o "$shortopt" -l "$longopt" -n "$ME" -- "$@") +if [ $? -ne 0 ]; then usage; exit 1; fi +eval set -- "$ARGS"; +unset ARGS + +# Parse options +while true; do + case "$1" in + -D|--docker-repo) + DOCKER_REPOSITORY="$2" + shift 2 + ;; + -t|--tag) + DOCKER_TAG="$2" + shift 2 + ;; + --no-cache) + OPTIONS+="--no-cache" + shift 1 + ;; + -h|--help) usage; exit 0 ;; + --) shift ; break ;; + *) usage; exit 1 ;; + esac +done + +SELECTED_TARGETS=($@) +[[ "${#SELECTED_TARGETS[@]}" -ge 1 ]] || SELECTED_TARGETS=("${DEFAULT_TARGETS[@]}") +[[ "${SELECTED_TARGETS[@]}" != "all" ]] || SELECTED_TARGETS=("${!TARGETS[@]}") + +for i in "${SELECTED_TARGETS[@]}"; do + + loc="${TARGETS[$i]}" + [[ -n "$loc" ]] || { + echo "ERROR: Cannot build ${i}: not configured." + continue + } + + img_name="openslides-${i}" + img="${img_name}:${DOCKER_TAG}" + if [[ -n "$DOCKER_REPOSITORY" ]]; then + img="${DOCKER_REPOSITORY}/${img}" + fi + + echo "Building $img..." + # Special instructions for local services + build_script="$(dirname "${BASH_SOURCE[0]}")/../${i}/build.sh" + if [[ -f "$build_script" ]]; then + . "$build_script" + else + docker build --tag "$img" --pull "${OPTIONS[@]}" "$loc" + fi + BUILT_IMAGES+=("$img") +done + +for img in "${BUILT_IMAGES[@]}"; do + read -p "Push image '$img' to repository? [y/N] " REPL + case "$REPL" in + Y|y|Yes|yes|YES) + docker push "$img" ;; + esac +done diff --git a/docker/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 index db126094e..1d001d5a2 100644 --- a/docker/docker-compose.yml.m4 +++ b/docker/docker-compose.yml.m4 @@ -48,7 +48,6 @@ x-osserver-env: &default-osserver-env REDIS_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 1) x-pgnode: &default-pgnode image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-repmgr:latest - build: https://github.com/OpenSlides/openslides-docker-compose.git#:repmgr networks: - dbnet labels: @@ -134,7 +133,6 @@ ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' environment: - PG_NODE_LIST=pgnode1`'PGBOUNCER_NODELIST image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-pgbouncer:latest - build: https://github.com/OpenSlides/openslides-docker-compose.git#:pgbouncer restart: always networks: back: @@ -144,7 +142,6 @@ ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' dbnet: postfix: image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-postfix:latest - build: https://github.com/OpenSlides/openslides-docker-compose.git#:postfix restart: always environment: MYHOSTNAME: "ifenvelse(`POSTFIX_MYHOSTNAME', localhost)" @@ -177,7 +174,6 @@ ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' back: media: image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-media-service:latest - build: https://github.com/OpenSlides/openslides-media-service.git environment: - CHECK_REQUEST_URL=server:8000/check-media/ restart: always diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 index e5b900c20..191e8aacf 100644 --- a/docker/docker-stack.yml.m4 +++ b/docker/docker-stack.yml.m4 @@ -47,7 +47,6 @@ x-osserver-env: &default-osserver-env REDIS_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 3) x-pgnode: &default-pgnode image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-repmgr:latest - build: https://github.com/OpenSlides/openslides-docker-compose.git#:repmgr networks: - dbnet labels: @@ -141,7 +140,6 @@ ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' environment: - PG_NODE_LIST=pgnode1`'PGBOUNCER_NODELIST image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-pgbouncer:latest - build: https://github.com/OpenSlides/openslides-docker-compose.git#:pgbouncer networks: back: aliases: @@ -156,7 +154,6 @@ ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' constraints: ifenvelse(`PGBOUNCER_PLACEMENT_CONSTR', [node.role == manager]) postfix: image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-postfix:latest - build: https://github.com/OpenSlides/openslides-docker-compose.git#:postfix environment: MYHOSTNAME: "ifenvelse(`POSTFIX_MYHOSTNAME', localhost)" RELAYHOST: "ifenvelse(`POSTFIX_RELAYHOST', localhost)" @@ -203,7 +200,6 @@ ifelse(read_env(`PGNODE_3_ENABLED'), 1, `' delay: 5s media: image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-media-service:latest - build: https://github.com/OpenSlides/openslides-media-service.git environment: - CHECK_REQUEST_URL=server:8000/check-media/ deploy: diff --git a/server/build.sh b/server/build.sh index 8ce7ef779..8d4439dc2 100755 --- a/server/build.sh +++ b/server/build.sh @@ -1,10 +1,19 @@ #!/bin/bash -cd "$(dirname "$0")" +cd "$(dirname "${BASH_SOURCE[0]}")" +service_name="$(basename "$PWD")" +version_file="docker/${service_name}-version.txt" -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 +{ + printf "${service_name^} built on %s:\n\n" "$(date)" + printf "Branch: %s\n" "$(git rev-parse --abbrev-ref HEAD)" + printf '\n' + git show -s --format=raw +} > "$version_file" -docker build -f docker/Dockerfile . $@ +docker build --tag "${img:-openslides/openslides-${service_name}:latest}" \ + --pull "${OPTIONS[@]}" -f docker/Dockerfile . + +rm "$version_file" || true +unset version_file +unset service_name From 1c0724341c6a37855da5f9e6e212463cb8af0a0e Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Fri, 14 Aug 2020 18:22:19 +0200 Subject: [PATCH 12/19] build.sh: More convenient way to push images Since build.sh now builds more than just two images, individual queries whether to push each image to a registry may become tedious. This patch replaces the queries with a single checklist menu. After making a selection, the images get pushed all at once. In the menu, all images are unchecked by default in order to prevent accidental uploads. This, too, may become tedious. In that case, the default could be flipped or a new option could be introduced. --- docker/build.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/docker/build.sh b/docker/build.sh index c52ac54a3..6813339f0 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -91,13 +91,22 @@ for i in "${SELECTED_TARGETS[@]}"; do else docker build --tag "$img" --pull "${OPTIONS[@]}" "$loc" fi - BUILT_IMAGES+=("$img") + BUILT_IMAGES+=("$img OFF") done -for img in "${BUILT_IMAGES[@]}"; do - read -p "Push image '$img' to repository? [y/N] " REPL - case "$REPL" in - Y|y|Yes|yes|YES) - docker push "$img" ;; - esac -done +if hash whiptail > /dev/null 2>&1; then + while read img; do + echo "Pushing ${img}." + docker push "$img" + done < <( whiptail --title "OpenSlides build script" \ + --checklist "Select images to push to their registry." \ + 25 78 16 --separate-output --noitem --clear \ + ${BUILT_IMAGES[@]} \ + 3>&2 2>&1 1>&3 ) +else + printf "\nSuccessfully built images:\n\n" + for i in "${BUILT_IMAGES[@]}"; do + read -r img x <<< "$i" + printf " - $img\n" + done +fi From d1640bc98d2eb017aa1d69c788d0855a9da766c0 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Sat, 15 Aug 2020 12:43:38 +0200 Subject: [PATCH 13/19] Docker: Add .env This file was copied from https://github.com/OpenSlides/openslides-docker-compose/ and still needs to be adjusted for the present setup. --- docker/.env | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docker/.env diff --git a/docker/.env b/docker/.env new file mode 100644 index 000000000..86d4c900e --- /dev/null +++ b/docker/.env @@ -0,0 +1,47 @@ +# OpenSlides instance configuration +# +# As well as environment variables for various services, this file contains +# variables used to persist custom settings for docker-compose.yml or +# docker-stack.yml. See the preamble of a docker-compose.yml.m4 or +# docker-stack.yml.m4 template for more information. +# +# Most variables are listed here only to facilitate discovery of the available +# options. Empty values cause the template's defaults to be inserted. + +# General +# ------- +INSTANCE_DOMAIN= +PROJECT_STACK_NAME= +EXTERNAL_HTTP_PORT= +DEFAULT_DOCKER_REGISTRY= + +# Docker Images +# ------------- +DOCKER_OPENSLIDES_BACKEND_NAME= +DOCKER_OPENSLIDES_BACKEND_TAG= +DOCKER_OPENSLIDES_FRONTEND_NAME= +DOCKER_OPENSLIDES_FRONTEND_TAG= + +# Database +# -------- +PGNODE_2_ENABLED= +PGNODE_3_ENABLED= +PGNODE_REPMGR_PRIMARY= +PGNODE_WAL_ARCHIVING= +PGNODE_1_PLACEMENT_CONSTR= +PGNODE_2_PLACEMENT_CONSTR= +PGNODE_3_PLACEMENT_CONSTR= +PGBOUNCER_PLACEMENT_CONSTR= + +# Service Replication +# ------------------- +OPENSLIDES_BACKEND_SERVICE_REPLICAS= +OPENSLIDES_FRONTEND_SERVICE_REPLICAS= +REDIS_RO_SERVICE_REPLICAS= +MEDIA_SERVICE_REPLICAS= + +# E-Mail +# ------ +DEFAULT_FROM_EMAIL= +POSTFIX_MYHOSTNAME= +POSTFIX_RELAYHOST= From 2b7e4d3d19e895f068775fd0950e91fe2ab6892b Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Sat, 15 Aug 2020 12:59:47 +0200 Subject: [PATCH 14/19] Docker: Add backend variables to .env and templates This setup chooses to avoid the env_file option available for Docker Compose files. Docker has a peculiar way of parsing variables which makes it, for example, include quotes verbatim. This is both confusing and incompatible with shells parsing the same file which is a requirement. For this reason, the configuration does not import the complete environment using env_file but assigns variables explicitly on a need-to-know basis in the YAML file, much like Docker secrets. Since the configuration is generated automatically, the burden on users is the same as with env_file: they only need to edit .env for customizations. --- docker/.env | 31 +++++++++++++++++++++++++++++++ docker/docker-compose.yml.m4 | 29 +++++++++++++++++++++++++++-- docker/docker-stack.yml.m4 | 29 +++++++++++++++++++++++++++-- 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/docker/.env b/docker/.env index 86d4c900e..876e249e3 100644 --- a/docker/.env +++ b/docker/.env @@ -45,3 +45,34 @@ MEDIA_SERVICE_REPLICAS= DEFAULT_FROM_EMAIL= POSTFIX_MYHOSTNAME= POSTFIX_RELAYHOST= + +# OpenSlides Backend settings (settings.py) +# ----------------------------------------- +# Features +ENABLE_SAML= +ENABLE_ELECTRONIC_VOTING= +# Connections +AUTOUPDATE_DELAY= +CONNECTION_POOL_LIMIT= +DATABASE_HOST= +DATABASE_PASSWORD= +DATABASE_PORT= +DATABASE_USER= +EMAIL_HOST= +EMAIL_HOST_PASSWORD= +EMAIL_HOST_USER= +EMAIL_PORT= +JITSI_DOMAIN= +JITSI_PASSWORD= +JITSI_ROOM_NAME= +REDIS_CHANNLES_HOST= +REDIS_CHANNLES_PORT= +REDIS_HOST= +REDIS_PORT= +REDIS_SLAVE_HOST= +REDIS_SLAVE_PORT= +REDIS_SLAVE_WAIT_TIMEOUT= +# Logging +DJANGO_LOG_LEVEL= +OPENSLIDES_LOG_LEVEL= +RESET_PASSWORD_VERBOSE_ERRORS= diff --git a/docker/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 index 1d001d5a2..b88a442b6 100644 --- a/docker/docker-compose.yml.m4 +++ b/docker/docker-compose.yml.m4 @@ -43,9 +43,34 @@ x-osserver: - back restart: always x-osserver-env: &default-osserver-env - INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" + AMOUNT_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 1) + AUTOUPDATE_DELAY: ifenvelse(`AUTOUPDATE_DELAY', 1) + CONNECTION_POOL_LIMIT: ifenvelse(`CONNECTION_POOL_LIMIT', 100) + DATABASE_HOST: "ifenvelse(`DATABASE_HOST', pgbouncer)" + DATABASE_PASSWORD: "ifenvelse(`DATABASE_PASSWORD', openslides)" + DATABASE_PORT: ifenvelse(`DATABASE_PORT', 5432) + DATABASE_USER: "ifenvelse(`DATABASE_USER', openslides)" DEFAULT_FROM_EMAIL: "ifenvelse(`DEFAULT_FROM_EMAIL', noreply@example.com)" - REDIS_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 1) + DJANGO_LOG_LEVEL: "ifenvelse(`DJANGO_LOG_LEVEL', INFO)" + EMAIL_HOST: "ifenvelse(`EMAIL_HOST', postfix)" + EMAIL_HOST_PASSWORD: "ifenvelse(`EMAIL_HOST_PASSWORD',)" + EMAIL_HOST_USER: "ifenvelse(`EMAIL_HOST_USER',)" + EMAIL_PORT: ifenvelse(`EMAIL_PORT', 25) + ENABLE_ELECTRONIC_VOTING: "ifenvelse(`ENABLE_ELECTRONIC_VOTING', False)" + ENABLE_SAML: "ifenvelse(`ENABLE_SAML', False)" + INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" + JITSI_DOMAIN: "ifenvelse(`JITSI_DOMAIN', None)" + JITSI_PASSWORD: "ifenvelse(`JITSI_PASSWORD', None)" + JITSI_ROOM_NAME: "ifenvelse(`JITSI_ROOM_NAME', None)" + OPENSLIDES_LOG_LEVEL: "ifenvelse(`OPENSLIDES_LOG_LEVEL', INFO)" + REDIS_CHANNLES_HOST: "ifenvelse(`REDIS_CHANNLES_HOST', redis-channels)" + REDIS_CHANNLES_PORT: ifenvelse(`REDIS_CHANNLES_PORT', 6379) + REDIS_HOST: "ifenvelse(`REDIS_HOST', redis)" + REDIS_PORT: ifenvelse(`REDIS_PORT', 6379) + REDIS_SLAVE_HOST: "ifenvelse(`REDIS_SLAVE_HOST', redis-slave)" + REDIS_SLAVE_PORT: ifenvelse(`REDIS_SLAVE_PORT', 6379) + REDIS_SLAVE_WAIT_TIMEOUT: ifenvelse(`REDIS_SLAVE_WAIT_TIMEOUT', 10000) + RESET_PASSWORD_VERBOSE_ERRORS: "ifenvelse(`RESET_PASSWORD_VERBOSE_ERRORS', False)" x-pgnode: &default-pgnode image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-repmgr:latest networks: diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 index 191e8aacf..a39c42232 100644 --- a/docker/docker-stack.yml.m4 +++ b/docker/docker-stack.yml.m4 @@ -42,9 +42,34 @@ x-osserver: - front - back x-osserver-env: &default-osserver-env - INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" + AMOUNT_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 3) + AUTOUPDATE_DELAY: ifenvelse(`AUTOUPDATE_DELAY', 1) + CONNECTION_POOL_LIMIT: ifenvelse(`CONNECTION_POOL_LIMIT', 100) + DATABASE_HOST: "ifenvelse(`DATABASE_HOST', pgbouncer)" + DATABASE_PASSWORD: "ifenvelse(`DATABASE_PASSWORD', openslides)" + DATABASE_PORT: ifenvelse(`DATABASE_PORT', 5432) + DATABASE_USER: "ifenvelse(`DATABASE_USER', openslides)" DEFAULT_FROM_EMAIL: "ifenvelse(`DEFAULT_FROM_EMAIL', noreply@example.com)" - REDIS_REPLICAS: ifenvelse(`REDIS_RO_SERVICE_REPLICAS', 3) + DJANGO_LOG_LEVEL: "ifenvelse(`DJANGO_LOG_LEVEL', INFO)" + EMAIL_HOST: "ifenvelse(`EMAIL_HOST', postfix)" + EMAIL_HOST_PASSWORD: "ifenvelse(`EMAIL_HOST_PASSWORD',)" + EMAIL_HOST_USER: "ifenvelse(`EMAIL_HOST_USER',)" + EMAIL_PORT: ifenvelse(`EMAIL_PORT', 25) + ENABLE_ELECTRONIC_VOTING: "ifenvelse(`ENABLE_ELECTRONIC_VOTING', False)" + ENABLE_SAML: "ifenvelse(`ENABLE_SAML', False)" + INSTANCE_DOMAIN: "ifenvelse(`INSTANCE_DOMAIN', http://example.com:8000)" + JITSI_DOMAIN: "ifenvelse(`JITSI_DOMAIN', None)" + JITSI_PASSWORD: "ifenvelse(`JITSI_PASSWORD', None)" + JITSI_ROOM_NAME: "ifenvelse(`JITSI_ROOM_NAME', None)" + OPENSLIDES_LOG_LEVEL: "ifenvelse(`OPENSLIDES_LOG_LEVEL', INFO)" + REDIS_CHANNLES_HOST: "ifenvelse(`REDIS_CHANNLES_HOST', redis-channels)" + REDIS_CHANNLES_PORT: ifenvelse(`REDIS_CHANNLES_PORT', 6379) + REDIS_HOST: "ifenvelse(`REDIS_HOST', redis)" + REDIS_PORT: ifenvelse(`REDIS_PORT', 6379) + REDIS_SLAVE_HOST: "ifenvelse(`REDIS_SLAVE_HOST', redis-slave)" + REDIS_SLAVE_PORT: ifenvelse(`REDIS_SLAVE_PORT', 6379) + REDIS_SLAVE_WAIT_TIMEOUT: ifenvelse(`REDIS_SLAVE_WAIT_TIMEOUT', 10000) + RESET_PASSWORD_VERBOSE_ERRORS: "ifenvelse(`RESET_PASSWORD_VERBOSE_ERRORS', False)" x-pgnode: &default-pgnode image: ifenvelse(`DEFAULT_DOCKER_REGISTRY', openslides)/openslides-repmgr:latest networks: From 3cb3ef29745db326e91bc00a5bff064b717b874c Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Sat, 15 Aug 2020 14:19:12 +0200 Subject: [PATCH 15/19] README: Include production setup info Now that this repository has become the entry point through which OpenSlides instances are configured, this patch transfers some relevant information formerly included in https://github.com/OpenSlides/openslides-docker-compose/ to this repository's README file. --- README.rst | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/README.rst b/README.rst index 99e432b27..cc63d4a9b 100644 --- a/README.rst +++ b/README.rst @@ -55,6 +55,70 @@ Finally, you can start the instance using ``docker-compose``:: $ # ... $ docker-compose down + +Docker Swarm Mode +----------------- + +OpenSlides may also be deployed in Swarm mode. Distributing instances over +multiple nodes may increase performance and offer failure resistance. + +An example configuration file, ``docker-stack.yml.m4``, is provided. Unlike +the Docker Compose setup, this configuration will most likely need to be +customized, especially its placement constraints and database-related +preferences. + +Before deploying an instance on Swarm, please see `Database Configuration`_ and +`Backups`_, and review your ``docker-stack.yml`` + + +Database Configuration +---------------------- + +It is fairly easy to get an OpenSlides instance up an running; however, for +production setups it is strongly advised to review the database configuration. + +By default, the primary database cluster will archive all WAL files in its +volume. Regularly pruning old data is left up to the host system, i.e., you. +Alternatively, you may disable WAL archiving by setting +``PGNODE_WAL_ARCHIVING=off`` in ``.env`` before starting the instance. + +The provided ``docker-stack.yml.m4`` file includes additional database +services which can act as hot standby clusters with automatic failover +functionality. To take advantage of this setup, the database services need to +be configured with proper placement constraints. Before relying on this setup, +please familiarize yourself with `repmgr `_. + + +Backups +------- + +All important data is stored in the database. Additionally, the project +directory should be included in backups to ensure a smooth recovery. + +The primary database usually runs in the ``pgnode1`` service (but see `Database +Configuration`_ above). +. +In some cases, it may be sufficient to generate SQL dumps with ``pg_dump`` +through ``docker exec`` to create backups. However, for proper incremental +backups, the host system can backup the cluster's data directory and WAL +archives. + +The cluster's data directory is available as a volume on the host system. +Additionally, the database archives its WAL files in the same volume by +default. This way, the host system can include the database volume in its +regular filesystem-based backup routine and create efficient database backups +suitable for point-in-time recovery. + +The `former management repository +`_ provides the +script `openslides-pg-mgr.sh` which can enable Postgres' backup mode in all +OpenSlides database containers. + +In Swarm mode, the primary database cluster may get placed on a number of +nodes. It is, therefore, crucial to restrict the placement of database +services to nodes on which appropriate backups have been configured. + + Bugs, features and development ================================ From 9a2d3a37602b92e1bff1cf22f4e3cc1472b36059 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Mon, 17 Aug 2020 14:19:51 +0200 Subject: [PATCH 16/19] Docker: Add SAML configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To configure SAML, ENABLE_SAML must be set to True in .env. Additionally, the following files must be provided in ./secrets/saml/: - sp.crt - sp.key - saml_settings.json The files will be added as Docker secrets. Even though saml_settings.json does not contain secret information per se it is nonetheless added as a secret for simplicity. Technically, the file is equally suited to be configured as a "Docker config". Please note: - This patch has not been tested yet. - python3-saml's version should probably be pinned. --- docker/docker-compose.yml.m4 | 12 ++++++++++++ docker/docker-stack.yml.m4 | 12 ++++++++++++ server/docker/Dockerfile | 10 ++++++++-- server/docker/entrypoint | 3 +++ server/docker/entrypoint-db-setup | 3 +++ server/docker/saml-setup.sh | 10 ++++++++++ server/requirements/saml.txt | 1 + 7 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 server/docker/saml-setup.sh create mode 100644 server/requirements/saml.txt diff --git a/docker/docker-compose.yml.m4 b/docker/docker-compose.yml.m4 index b88a442b6..69637ab42 100644 --- a/docker/docker-compose.yml.m4 +++ b/docker/docker-compose.yml.m4 @@ -99,6 +99,9 @@ services: << : *default-osserver-env secrets: - django + ifelse(read_env(`ENABLE_SAML'), `True',- saml_cert + - saml_key + - saml_config) ifelse(read_env(`OPENSLIDES_BACKEND_SERVICE_REPLICAS'),,,deploy: replicas: ifenvelse(`OPENSLIDES_BACKEND_SERVICE_REPLICAS', 1)) @@ -111,6 +114,9 @@ services: - django ifelse(ADMIN_SECRET_AVAILABLE, 0,- os_admin) ifelse(USER_SECRET_AVAILABLE, 0,- os_user) + ifelse(read_env(`ENABLE_SAML'), `True',- saml_cert + - saml_key + - saml_config) depends_on: - pgbouncer - redis @@ -226,5 +232,11 @@ secrets: file: ./secrets/adminsecret.env) ifelse(USER_SECRET_AVAILABLE, 0,os_user: file: ./secrets/usersecret.env) + ifelse(read_env(`ENABLE_SAML'), `True', saml_cert: + file: ./secrets/saml/sp.crt + saml_key: + file: ./secrets/saml/sp.key + saml_config: + file: ./secrets/saml/saml_settings.json) # vim: set sw=2 et: diff --git a/docker/docker-stack.yml.m4 b/docker/docker-stack.yml.m4 index a39c42232..acfb3a6d4 100644 --- a/docker/docker-stack.yml.m4 +++ b/docker/docker-stack.yml.m4 @@ -97,6 +97,9 @@ services: << : *default-osserver-env secrets: - django + ifelse(read_env(`ENABLE_SAML'), `True',- saml_cert + - saml_key + - saml_config) deploy: restart_policy: condition: on-failure @@ -112,6 +115,9 @@ services: - django ifelse(ADMIN_SECRET_AVAILABLE, 0,- os_admin) ifelse(USER_SECRET_AVAILABLE, 0,- os_user) + ifelse(read_env(`ENABLE_SAML'), `True',- saml_cert + - saml_key + - saml_config) client: image: FRONTEND_IMAGE @@ -260,5 +266,11 @@ secrets: file: ./secrets/adminsecret.env) ifelse(USER_SECRET_AVAILABLE, 0,os_user: file: ./secrets/usersecret.env) + ifelse(read_env(`ENABLE_SAML'), `True', saml_cert: + file: ./secrets/saml/sp.crt + saml_key: + file: ./secrets/saml/sp.key + saml_config: + file: ./secrets/saml/saml_settings.json) # vim: set sw=2 et: diff --git a/server/docker/Dockerfile b/server/docker/Dockerfile index e1c31a5a1..7b5d38484 100644 --- a/server/docker/Dockerfile +++ b/server/docker/Dockerfile @@ -50,8 +50,14 @@ RUN apt-get install --no-install-recommends -y \ 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 +RUN pip install -r requirements/production.txt -r requirements/big_mode.txt \ + -r requirements/saml.txt && \ + rm -rf /root/.cache/pip + +# SAML +COPY docker/saml-setup.sh /usr/local/lib/ +RUN mkdir -p /app/personal_data/var/certs/ && \ + chown -R openslides:openslides /app/personal_data/var/ USER openslides # the `empty` folder is used for the dummy http server für the migrate entrypoint to serve no files. diff --git a/server/docker/entrypoint b/server/docker/entrypoint index 3400c503e..732209a9d 100755 --- a/server/docker/entrypoint +++ b/server/docker/entrypoint @@ -11,6 +11,9 @@ source /run/secrets/django } export SECRET_KEY="$DJANGO_SECRET_KEY" +# SAML setup +. /usr/local/lib/saml-setup.sh + # TODO: env variable for this host wait-for-it -t 0 "server-setup:8000" diff --git a/server/docker/entrypoint-db-setup b/server/docker/entrypoint-db-setup index acd327e06..d2f70c464 100755 --- a/server/docker/entrypoint-db-setup +++ b/server/docker/entrypoint-db-setup @@ -82,5 +82,8 @@ if [[ -f /run/secrets/os_user ]]; then fi fi +# SAML setup +. /usr/local/lib/saml-setup.sh + 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/saml-setup.sh b/server/docker/saml-setup.sh new file mode 100644 index 000000000..ec98ea461 --- /dev/null +++ b/server/docker/saml-setup.sh @@ -0,0 +1,10 @@ +# SAML setup +if [[ "$ENABLE_SAML" = True ]]; then + echo "Setting up SAML" + for i in /run/secrets/saml_{cert,key,config}; do + [[ -f "$i" ]] || { echo "ERROR: $i not found!"; exit 3; } + done + ln -s /run/secrets/saml_cert /app/personal_data/var/certs/sp.crt + ln -s /run/secrets/saml_key /app/personal_data/var/certs/sp.key + ln -s /run/secrets/saml_config /app/personal_data/var/saml_settings.json +fi diff --git a/server/requirements/saml.txt b/server/requirements/saml.txt new file mode 100644 index 000000000..835c2af51 --- /dev/null +++ b/server/requirements/saml.txt @@ -0,0 +1 @@ +python3-saml From 251296f42f8393aff4f79520a924706de25c678e Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Wed, 19 Aug 2020 09:43:35 +0200 Subject: [PATCH 17/19] Docker: No longer install Vim in server --- server/docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/docker/Dockerfile b/server/docker/Dockerfile index 7b5d38484..17f08e8f6 100644 --- a/server/docker/Dockerfile +++ b/server/docker/Dockerfile @@ -37,8 +37,7 @@ RUN apt-get install --no-install-recommends -y \ iputils-ping \ netcat \ procps \ - traceroute \ - vim + traceroute # Install saml requirements RUN apt-get install --no-install-recommends -y \ From 9ddf9ddb8cd633ca49b8110ae76bcc7d8abb6b85 Mon Sep 17 00:00:00 2001 From: Finn Stutzenstein Date: Wed, 19 Aug 2020 15:25:35 +0200 Subject: [PATCH 18/19] fixed lost changes --- server/openslides/utils/redis_connection_pool.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/openslides/utils/redis_connection_pool.py b/server/openslides/utils/redis_connection_pool.py index 6366a33ff..51e8a2e88 100644 --- a/server/openslides/utils/redis_connection_pool.py +++ b/server/openslides/utils/redis_connection_pool.py @@ -5,8 +5,12 @@ 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): From 8faa2ad38f6ce890adb7f35b3634f122977c5436 Mon Sep 17 00:00:00 2001 From: Gernot Schulz Date: Wed, 19 Aug 2020 16:45:12 +0200 Subject: [PATCH 19/19] Docker: Add --ask-push option to build.sh --- docker/build.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/docker/build.sh b/docker/build.sh index 6813339f0..ce58dbd49 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -27,6 +27,7 @@ Options: -D, --docker-repo Specify a Docker repository (default: unspecified, i.e., system default) -t, --tag Tag the Docker image (default: $DOCKER_TAG) + --ask-push Offer to push newly built images to registry --no-cache Pass --no-cache to docker-build EOF } @@ -38,7 +39,7 @@ if [[ -f "$CONFIG" ]]; then fi shortopt="hr:D:t:" -longopt="help,docker-repo:,tag:,no-cache" +longopt="help,docker-repo:,tag:,ask-push,no-cache" ARGS=$(getopt -o "$shortopt" -l "$longopt" -n "$ME" -- "$@") if [ $? -ne 0 ]; then usage; exit 1; fi eval set -- "$ARGS"; @@ -55,6 +56,10 @@ while true; do DOCKER_TAG="$2" shift 2 ;; + --ask-push) + ASK_PUSH=1 + shift 1 + ;; --no-cache) OPTIONS+="--no-cache" shift 1 @@ -91,9 +96,22 @@ for i in "${SELECTED_TARGETS[@]}"; do else docker build --tag "$img" --pull "${OPTIONS[@]}" "$loc" fi - BUILT_IMAGES+=("$img OFF") + BUILT_IMAGES+=("$img ON") done +if [[ "${#BUILT_IMAGES[@]}" -ge 1 ]]; then + printf "\nSuccessfully built images:\n\n" + for i in "${BUILT_IMAGES[@]}"; do + read -r img x <<< "$i" + printf " - $img\n" + done +else + echo "No images were built." + exit 3 +fi + +[[ "$ASK_PUSH" ]] || exit 0 + if hash whiptail > /dev/null 2>&1; then while read img; do echo "Pushing ${img}." @@ -104,9 +122,13 @@ if hash whiptail > /dev/null 2>&1; then ${BUILT_IMAGES[@]} \ 3>&2 2>&1 1>&3 ) else - printf "\nSuccessfully built images:\n\n" + echo for i in "${BUILT_IMAGES[@]}"; do read -r img x <<< "$i" - printf " - $img\n" + read -p "Push image '$img' to repository? [Y/n] " REPL + case "$REPL" in + N|n|No|no|NO) exit 0;; + *) docker push "$img" ;; + esac done fi