Skip to content
Snippets Groups Projects
Verified Commit 9cd978c2 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Merge branch 'master' of edugit.org:BiscuIT/BiscuIT-ng

parents aa061de6 cbd68ed7
No related branches found
No related tags found
No related merge requests found
Pipeline #315 passed with warnings
Showing
with 72 additions and 68 deletions
...@@ -65,6 +65,7 @@ deploy_demo-master: ...@@ -65,6 +65,7 @@ deploy_demo-master:
- grep -v "build:" docker-compose.yml | ssh root@demo-master.biscuit-sis.org - grep -v "build:" docker-compose.yml | ssh root@demo-master.biscuit-sis.org
env BISCUIT_IMAGE_TAG=${CI_COMMIT_REF_NAME} env BISCUIT_IMAGE_TAG=${CI_COMMIT_REF_NAME}
NGINX_HTTP_PORT=80 NGINX_HTTP_PORT=80
BISCUIT_maintenance__debug=true
docker-compose docker-compose
-p biscuit-${CI_ENVIRONMENT_SLUG} -p biscuit-${CI_ENVIRONMENT_SLUG}
-f /dev/stdin -f /dev/stdin
......
...@@ -82,6 +82,26 @@ giving the user control over these decisions is not possible. Developers ...@@ -82,6 +82,26 @@ giving the user control over these decisions is not possible. Developers
need to decide what should resonably be followed. need to decide what should resonably be followed.
The case on supporting non-free services
----------------------------------------
Defined by the `Free Software Definition`_, it is an essential freedom to
be allowed to use free software for any purpose, without limitation. Thus,
interoperability with non-free services shall not be ruled out, and the
BiscuIT project explicitly welcomes implementing support for
interoperability with non-free services.
However, to purposefullt foster free software and services, if
interoperability for a certain kind of non-free service is implemented, this
must be done in a generalised manner (i.e. using open protocols and
interfaces). For example, if implementing interoperability with some
cloud-hosted calendar provider can be implemented either through a
proprietary API, or through a standard iCalendar/Webcal interfaces, the
latter is to be preferred. Lacking such support, if a proprietary service
is connected through a proprietary, single-purpose interface, measures shall
be taken to also support alternative free services.
Text documents Text documents
-------------- --------------
...@@ -105,4 +125,5 @@ licence possible. ...@@ -105,4 +125,5 @@ licence possible.
.. _Sane software manifesto: https://sane-software.globalcode.info/ .. _Sane software manifesto: https://sane-software.globalcode.info/
.. _Accessibility Manifesto: http://accessibilitymanifesto.com/ .. _Accessibility Manifesto: http://accessibilitymanifesto.com/
.. _User Data Manifesto: https://userdatamanifesto.org/ .. _User Data Manifesto: https://userdatamanifesto.org/
.. _Free Software Definition: https://www.gnu.org/philosophy/free-sw.en.html
.. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _reStructuredText: http://docutils.sourceforge.net/rst.html
...@@ -42,8 +42,7 @@ RUN mkdir -p /var/lib/biscuit/media /var/lib/biscuit/static /var/lib/biscuit/bac ...@@ -42,8 +42,7 @@ RUN mkdir -p /var/lib/biscuit/media /var/lib/biscuit/static /var/lib/biscuit/bac
# Build messages and assets # Build messages and assets
RUN python manage.py compilemessages; \ RUN python manage.py compilemessages; \
python manage.py yarn install; \ python manage.py yarn install
python manage.py collectstatic --no-input --clear
# Clean up build dependencies # Clean up build dependencies
RUN apt-get remove --purge -y \ RUN apt-get remove --purge -y \
...@@ -56,9 +55,7 @@ RUN apt-get remove --purge -y \ ...@@ -56,9 +55,7 @@ RUN apt-get remove --purge -y \
apt-get clean -y; \ apt-get clean -y; \
pip uninstall -y poetry; \ pip uninstall -y poetry; \
rm -f /var/lib/apt/lists/*_*; \ rm -f /var/lib/apt/lists/*_*; \
rm -rf /root/.cache; \ rm -rf /root/.cache
rm -rf biscuit/node_modules; \
rm -rf /usr/local/lib/node_modules
# Declare a persistent volume for all data # Declare a persistent volume for all data
VOLUME /var/lib/biscuit VOLUME /var/lib/biscuit
......
...@@ -96,16 +96,6 @@ MENUS = { ...@@ -96,16 +96,6 @@ MENUS = {
} }
] ]
}, },
{
'name': _('Support'),
'url': '#',
'submenu': [
{
'name': _('Get support'),
'url': 'contact_form'
}
]
}
], ],
'DATA_MANAGEMENT_MENU': [ 'DATA_MANAGEMENT_MENU': [
], ],
......
# Generated by Django 2.2.8 on 2019-12-09 21:04
from django.contrib.auth import get_user_model
from django.db import migrations
def create_superuser(apps, schema_editor):
User = get_user_model()
if not User.objects.filter(is_superuser=True).exists():
User.objects.create_superuser(
username='admin',
email='root@example.com',
password='admin'
).save()
class Migration(migrations.Migration):
dependencies = [
('core', '0005_unlink_school'),
]
operations = [
migrations.RunPython(create_superuser)
]
...@@ -34,7 +34,9 @@ DEBUG = _settings.get('maintenance.debug', False) ...@@ -34,7 +34,9 @@ DEBUG = _settings.get('maintenance.debug', False)
INTERNAL_IPS = _settings.get('maintenance.internal_ips', []) INTERNAL_IPS = _settings.get('maintenance.internal_ips', [])
DEBUG_TOOLBAR_CONFIG = { DEBUG_TOOLBAR_CONFIG = {
'RENDER_PANELS': True, 'RENDER_PANELS': True,
'SHOW_COLLAPSED': True 'SHOW_COLLAPSED': True,
'JQUERY_URL': '',
'SHOW_TOOLBAR_CALLBACK': 'biscuit.core.util.core_helpers.dt_show_toolbar'
} }
ALLOWED_HOSTS = _settings.get('http.allowed_hosts', []) ALLOWED_HOSTS = _settings.get('http.allowed_hosts', [])
...@@ -65,7 +67,6 @@ INSTALLED_APPS = [ ...@@ -65,7 +67,6 @@ INSTALLED_APPS = [
'menu_generator', 'menu_generator',
'phonenumber_field', 'phonenumber_field',
'debug_toolbar', 'debug_toolbar',
'contact_form',
'django_select2', 'django_select2',
'hattori', 'hattori',
'django_otp.plugins.otp_totp', 'django_otp.plugins.otp_totp',
...@@ -89,7 +90,6 @@ STATICFILES_FINDERS = [ ...@@ -89,7 +90,6 @@ STATICFILES_FINDERS = [
MIDDLEWARE = [ MIDDLEWARE = [
# 'django.middleware.cache.UpdateCacheMiddleware', # 'django.middleware.cache.UpdateCacheMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware', 'django.middleware.locale.LocaleMiddleware',
...@@ -97,6 +97,7 @@ MIDDLEWARE = [ ...@@ -97,6 +97,7 @@ MIDDLEWARE = [
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django_otp.middleware.OTPMiddleware', 'django_otp.middleware.OTPMiddleware',
'impersonate.middleware.ImpersonateMiddleware', 'impersonate.middleware.ImpersonateMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
......
{# -*- engine:django -*- #}
{% extends "core/base.html" %}
{% load bootstrap4 i18n %}
{% block page_title %}BiscuIT SIS support{% endblock %}
{% block content %}
<h1>{% blocktrans %}Get support{% endblocktrans %}</h1>
<form method="post">
{% csrf_token %}
{% bootstrap_form form %}
<button type="submit" class="btn btn-dark">
{% blocktrans %}Send{% endblocktrans %}
</button>
</form>
{% endblock %}
From: {{ name }} <{{ email }}>
{{ body }}
{# -*- engine:django -*- #}
{% extends "core/base.html" %}
{% load bootstrap4 i18n %}
{% block page_title %}BiscuIT School Information System (SIS){% endblock %}
{% block content %}
<div class="alert alert-success" role="alert">
{% blocktrans %}
The message was successfully submitted.
{% endblocktrans %}
</div>
{% endblock %}
[BiscuIT Support]
...@@ -34,7 +34,6 @@ urlpatterns = [ ...@@ -34,7 +34,6 @@ urlpatterns = [
path('group/<int:id_>/edit', views.edit_group, name='edit_group_by_id'), path('group/<int:id_>/edit', views.edit_group, name='edit_group_by_id'),
path('', views.index, name='index'), path('', views.index, name='index'),
path('maintenance-mode/', include('maintenance_mode.urls')), path('maintenance-mode/', include('maintenance_mode.urls')),
path('contact/', include('contact_form.urls')),
path('impersonate/', include('impersonate.urls')), path('impersonate/', include('impersonate.urls')),
path('__i18n__/', include('django.conf.urls.i18n')), path('__i18n__/', include('django.conf.urls.i18n')),
path('select2/', include('django_select2.urls')), path('select2/', include('django_select2.urls')),
......
...@@ -2,9 +2,23 @@ from importlib import import_module ...@@ -2,9 +2,23 @@ from importlib import import_module
import pkgutil import pkgutil
from typing import Sequence from typing import Sequence
from django.conf import settings
from django.http import HttpRequest from django.http import HttpRequest
def dt_show_toolbar(request: HttpRequest) -> bool:
from debug_toolbar.middleware import show_toolbar # noqa
if not settings.DEBUG:
return False
if show_toolbar(request):
return True
elif hasattr(request, 'user') and request.user.is_superuser:
return True
return False
def get_app_packages() -> Sequence[str]: def get_app_packages() -> Sequence[str]:
""" Find all packages within the biscuit.apps namespace. """ """ Find all packages within the biscuit.apps namespace. """
......
...@@ -19,6 +19,7 @@ services: ...@@ -19,6 +19,7 @@ services:
- BISCUIT_http__allowed_hosts="['*']" - BISCUIT_http__allowed_hosts="['*']"
- BISCUIT_caching__memcached__address=memcached:11211 - BISCUIT_caching__memcached__address=memcached:11211
- BISCUIT_database__host=db - BISCUIT_database__host=db
- BISCUIT_maintenance__debug=${BISCUIT_maintenance__debug:-false}
depends_on: depends_on:
- db - db
- memcached - memcached
......
...@@ -19,6 +19,7 @@ done ...@@ -19,6 +19,7 @@ done
python manage.py flush --no-input python manage.py flush --no-input
python manage.py migrate python manage.py migrate
python manage.py collectstatic --no-input --clear
if [[ -n "$@" ]]; then if [[ -n "$@" ]]; then
exec "$@" exec "$@"
......
FROM nginx FROM nginx
RUN rm /etc/nginx/conf.d/default.conf RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN mkdir /var/lib/biscuit RUN mkdir /var/lib/biscuit
...@@ -204,17 +204,6 @@ version = "0.9.2" ...@@ -204,17 +204,6 @@ version = "0.9.2"
[package.dependencies] [package.dependencies]
Django = ">=1.8.0" Django = ">=1.8.0"
[[package]]
category = "main"
description = "A generic contact-form application for Django"
name = "django-contact-form"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "1.7"
[package.dependencies]
Django = ">=1.11"
[[package]] [[package]]
category = "main" category = "main"
description = "Running python crons in a Django project" description = "Running python crons in a Django project"
...@@ -1303,7 +1292,7 @@ more-itertools = "*" ...@@ -1303,7 +1292,7 @@ more-itertools = "*"
ldap = ["django-auth-ldap"] ldap = ["django-auth-ldap"]
[metadata] [metadata]
content-hash = "908e1e56f87aef8ccff2ce9a79bf335b5cb09896566d1dddb45c62c799c86310" content-hash = "bce86bce11298566a201539a09dd1f1123f3d1e48725419fcac72009f154cebe"
python-versions = "^3.7" python-versions = "^3.7"
[metadata.hashes] [metadata.hashes]
...@@ -1328,7 +1317,6 @@ django-auth-ldap = ["4d68d21058bd57a316a9e1fcd7a36d0f25d054d4d9d9ec85f766a499117 ...@@ -1328,7 +1317,6 @@ django-auth-ldap = ["4d68d21058bd57a316a9e1fcd7a36d0f25d054d4d9d9ec85f766a499117
django-bootstrap4 = ["3da770392819267eda2f774bcf832460af00db21089b94caf4df94be8a48c48c"] django-bootstrap4 = ["3da770392819267eda2f774bcf832460af00db21089b94caf4df94be8a48c48c"]
django-bulk-update = ["49a403392ae05ea872494d74fb3dfa3515f8df5c07cc277c3dc94724c0ee6985", "5ab7ce8a65eac26d19143cc189c0f041d5c03b9d1b290ca240dc4f3d6aaeb337"] django-bulk-update = ["49a403392ae05ea872494d74fb3dfa3515f8df5c07cc277c3dc94724c0ee6985", "5ab7ce8a65eac26d19143cc189c0f041d5c03b9d1b290ca240dc4f3d6aaeb337"]
django-common-helpers = ["2d56be6fa261d829a6a224f189bf276267b9082a17d613fe5f015dd4d65c17b4"] django-common-helpers = ["2d56be6fa261d829a6a224f189bf276267b9082a17d613fe5f015dd4d65c17b4"]
django-contact-form = ["b42b7e04d6af3318b8427c1eaf62385ec66da252aa79b607ee55d956c7af4a2d", "c31f73faa13f52efa81ac95f41007f3a84eca617f92773a1bed7ca90c61cb3ed"]
django-cron = ["08d22708c8b2ecab8cda989019a66c7e1e2424c59d822796fd45abf7731d261d"] django-cron = ["08d22708c8b2ecab8cda989019a66c7e1e2424c59d822796fd45abf7731d261d"]
django-dbbackup = ["9470e5d8bdaee4feb878b1b66c59eb9b27a131cccd648bf7cbfe70930acd4fc0"] django-dbbackup = ["9470e5d8bdaee4feb878b1b66c59eb9b27a131cccd648bf7cbfe70930acd4fc0"]
django-dbsettings = ["e3147ced54b7db3371df10df8845e4514aeae96720000bca1a01d0a6490a1404"] django-dbsettings = ["e3147ced54b7db3371df10df8845e4514aeae96720000bca1a01d0a6490a1404"]
......
...@@ -41,7 +41,6 @@ django-maintenance-mode = "^0.13.3" ...@@ -41,7 +41,6 @@ django-maintenance-mode = "^0.13.3"
django-ipware = "^2.1" django-ipware = "^2.1"
easy-thumbnails = "^2.6" easy-thumbnails = "^2.6"
django-image-cropping = "^1.2" django-image-cropping = "^1.2"
django-contact-form = "^1.7"
django-impersonate = "^1.4" django-impersonate = "^1.4"
python-memcached = "^1.59" python-memcached = "^1.59"
django-dbbackup = "^3.2" django-dbbackup = "^3.2"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment