Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 06 rebase aplus #91

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8cde829
assets: Change the logo
Aug 19, 2020
b33e579
assets: CSS adjustments
Aug 19, 2020
76a0626
diid/docs: point to diid-repo
fuzzylogic2000 Aug 17, 2020
bb3aa32
config: Enable saml2 and add some configs
rmader Aug 20, 2020
9f7cbe7
apps/users: Add a saml2 specific helper func
rmader Aug 20, 2020
36c9982
templates: Adapt login experience slightly
rmader Aug 20, 2020
7fb2361
docs: Add shibolleth docu for DIID
rmader Aug 20, 2020
33b8172
templates/email_base: removing fixed width and updating image file fi…
Oct 22, 2020
987711d
saml2: Add test-server config
rmader Oct 22, 2020
b433f04
apps: Add app with djangosaml2 overwrites
rmader Oct 22, 2020
82ba8b0
users/forms: add aditional checkboxes and edit existing on signup for…
Oct 19, 2020
2b89b46
test/users: update tests to reflect additions to form
Nov 3, 2020
2fcc1bc
diid: Add a default_idp setting
rmader Nov 3, 2020
1ee51f0
translations: mark diid-specific translations via context "diid"
fuzzylogic2000 Nov 4, 2020
be685ee
translations: use locale-fork for translations
rmader Nov 12, 2020
d994c8f
adds/djangosaml2_overwrites: Add a middleware to guard saml signup
rmader Nov 12, 2020
70dd512
ci: use github actions, remove unused travis
goapunk Nov 25, 2021
ea29d15
tests/user factory: add email address to DB after user was created
fuzzylogic2000 Jan 10, 2022
30c7b31
tests/signup: disable signup tests that are redirected by django saml…
fuzzylogic2000 Jan 10, 2022
e371cf1
translations: makemessages
fuzzylogic2000 Jan 25, 2022
024eb03
wording: change teilhabe.diid... to dialog.diid...
fuzzylogic2000 Jan 25, 2022
0a2b6b3
translations: makemessages
fuzzylogic2000 Jan 25, 2022
5a1f958
translations: add new translation
fuzzylogic2000 Jan 25, 2022
581058c
deps and pyup: use own requirements file for fork-specific packages
fuzzylogic2000 Jan 26, 2022
3d88fb6
deps/py: update djangosaml2 to 1.3.5
fuzzylogic2000 Jan 26, 2022
cd03f72
Update djangosaml2 from 1.3.5 to 1.3.6
pyup-bot Mar 7, 2022
275423b
Update djangosaml2 from 1.3.6 to 1.5.0
pyup-bot Apr 25, 2022
8e64967
fix newsletter tests
goapunk Apr 28, 2022
91535fa
tests: fix and reenable the user tests
goapunk Apr 28, 2022
66c75b4
renovate: only update fork packages
goapunk Aug 3, 2022
89b1e56
renovate: disable for npm
goapunk Aug 4, 2022
870b828
chore(deps): update dependency djangosaml2 to v1.5.1
renovate[bot] Aug 4, 2022
667b885
assest/images: update logo so correct size fixes #66
philli-m Feb 23, 2023
e55b37d
assets/*: colour fixes from lib removal fixes #68 fixes #69
philli-m Feb 23, 2023
a22c50d
assets/images: add transparent logo for sharepic after rebase removed it
philli-m Feb 24, 2023
108f152
chore(deps): update dependency djangosaml2 to v1.5.8
renovate[bot] May 31, 2023
0ee5927
apps/users: only allow university login
m4ra Oct 12, 2023
4e514e6
Makefile: add documenattion for local saml set up scripts
philli-m Oct 11, 2023
21d4aca
apps/djangosamle2_overwrites: extend form_field to include additional…
philli-m Oct 11, 2023
c816c70
update translations
goapunk Oct 16, 2023
89ff359
add some missing translations
goapunk Oct 16, 2023
46f0eec
release v2306.2
goapunk Oct 16, 2023
9855be4
chore(deps): update dependency djangosaml2 to v1.8.0
renovate[bot] Dec 20, 2023
204c17f
release v2312.1
goapunk Dec 27, 2023
bafd3f1
apps/djangosaml2_overwrites: fix deprecation of ugettext
goapunk Jun 6, 2024
af7574d
chore(deps): update dependency djangosaml2 to v1.9.3
renovate[bot] Jun 6, 2024
466c337
apps/djangosaml2_overwrites: add account logout view to allowed urls …
goapunk Jun 13, 2024
5a124a5
release v2406.1
goapunk Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
841 changes: 13 additions & 828 deletions CHANGELOG.md

Large diffs are not rendered by default.

25 changes: 23 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ VIRTUAL_ENV ?= venv
NODE_BIN = node_modules/.bin
SOURCE_DIRS = adhocracy-plus apps tests
ARGUMENTS=$(filter-out $(firstword $(MAKECMDGOALS)), $(MAKECMDGOALS))
PORT = 8004

# for mac os gsed is needed (brew install gnu-sed and brew install gsed)
SED = sed
Expand Down Expand Up @@ -52,6 +53,8 @@ help:
@echo " make celery-worker-start -- starts the celery worker in the foreground"
@echo " make celery-worker-status -- lists all registered tasks and active worker nodes"
@echo " make celery-worker-dummy-task -- calls the dummy task and prints result from redis"
@echo " make saml-install -- script to install local version of single sign-in in docker container"
@echo " make saml-server -- script to run local version of single sign-in in docker container"
@echo

.PHONY: install
Expand All @@ -76,13 +79,13 @@ fixtures:

.PHONY: server
server:
$(VIRTUAL_ENV)/bin/python manage.py runserver 8004
$(VIRTUAL_ENV)/bin/python manage.py runserver $(PORT)

.PHONY: watch
watch:
trap 'kill %1' KILL; \
npm run watch & \
$(VIRTUAL_ENV)/bin/python manage.py runserver 8004
$(VIRTUAL_ENV)/bin/python manage.py runserver $(PORT)

.PHONY: background
background:
Expand Down Expand Up @@ -232,3 +235,21 @@ celery-worker-status:
.PHONY: celery-worker-dummy-task
celery-worker-dummy-task:
$(VIRTUAL_ENV)/bin/celery --app adhocracy-plus call dummy_task | awk '{print "celery-task-meta-"$$0}' | xargs redis-cli get | python3 -m json.tool

.PHONY: saml-install
CERTS_DIR := ${CURDIR}/adhocracy-plus/config/settings/saml
saml-install:
docker pull kristophjunge/test-saml-idp
openssl req -nodes -new -x509 -keyout ${CERTS_DIR}/private.key -out ${CERTS_DIR}/cert.pem -subj \
"/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=example.com"

.PHONY: saml-server
saml-server:
cp ${PWD}/scripts/saml2_authsources.php /tmp/saml2_authsources.php
chmod 755 /tmp/saml2_authsources.php
test ! -z "${LIQD_NO_SSO_LOGIN}" || docker run -p 8080:8080 -p 8443:8443 \
-e SIMPLESAMLPHP_SP_ENTITY_ID=http://app.example.com \
-e SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=http://localhost:$(PORT)/saml2/acs/ \
-e SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE=http://localhost:$(PORT)/saml2/ls/ \
-v /tmp/saml2_authsources.php:/var/www/simplesamlphp/config/authsources.php \
kristophjunge/test-saml-idp
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[adhocracy.plus](https://adhocracy.plus/) is a free Open-Source participation platform maintained and primarily developed by Liquid Democracy e.V.. It is based on [adhocracy 4](https://github.com/liqd/adhocracy4) and [Django](https://github.com/django/django).

![Build Status](https://github.com/liqd/adhocracy-plus/actions/workflows/django.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/liqd/adhocracy-plus/badge.svg?branch=main)](https://coveralls.io/github/liqd/adhocracy-plus?branch=main)
![Build Status](https://github.com/liqd/diid-adplus/actions/workflows/django.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/liqd/diid-adplus/badge.svg?branch=main)](https://coveralls.io/github/liqd/diid-adplus?branch=main)

## Getting started

Expand All @@ -21,8 +21,8 @@ adhocracy+ is designed to make online participation easy and accessible to every

### Installation

git clone https://github.com/liqd/adhocracy-plus.git
cd adhocracy-plus
git clone https://gitlab.cs.uni-duesseldorf.de/diid/diid_adplus.git
cd diid_adplus
make install
make fixtures

Expand Down
Binary file modified adhocracy-plus/assets/images/email_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adhocracy-plus/assets/images/favicon/favicon-16x16.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adhocracy-plus/assets/images/favicon/favicon-32x32.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adhocracy-plus/assets/images/favicon/favicon-96x96.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adhocracy-plus/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions adhocracy-plus/assets/images/logo.svg

This file was deleted.

Binary file added adhocracy-plus/assets/images/logo_sharepic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion adhocracy-plus/assets/scss/_utility.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.u-hhu {
color: $brand-primary;
font-weight: bold;
}

.u-overlap-top {
margin-top: (-1.5 * $padding);
}
Expand Down Expand Up @@ -112,7 +117,7 @@
}

.u-page-ribbon {
background: linear-gradient(to right, $brand-primary, $brand-primary 33%, $brand-secondary 66%, $brand-secondary);
background: $brand-primary;
height: 0.5em;
}

Expand Down
20 changes: 11 additions & 9 deletions adhocracy-plus/assets/scss/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// subset of bootstrap variables
$brand-primary: #2d40cc; // ultramarine
$brand-primary: #006ab3 !default; // dark blue

$brand-secondary: #90efe4 !default; // terquoise
$brand-secondary: #d9e9f4 !default; // greeny blue
$brand-secondary-dark: #57bab1 !default; // same as above

$brand-tertiary: #008dc5 !default; // prussian blue
$brand-tertiary: #73add5 !default; // lighter blue

/* Don't use variables but hex-values here as they should not be overwritten on organisation pages */
$brand-success: #a3ef90 !default;
$brand-success: #d7e4ac !default;
$brand-info: $brand-primary !default; // $brand-primary from platform.scss
$brand-warning: #ffc107 !default;
$brand-danger: #a72b1e !default;
$brand-warning: #f9d2a6 !default;
$brand-danger: #e9aab3 !default;

$primary: $brand-primary !default;
$secondary: $brand-secondary !default;
Expand Down Expand Up @@ -42,10 +43,11 @@ $print-link: #005cb4 !default;

$brand-primary-tint: lighten($brand-primary, 47%) !default;
$brand-secondary-tint: lighten($brand-secondary, 20%) !default;
$brand-tertiary-tint: lighten($brand-tertiary, 55%) !default;
$brand-tertiary-tint: lighten($brand-tertiary, 30%) !default;

$bg-light: #f7f7f7;
$bg-tertiary: $brand-tertiary-tint !default;
$bg-tertiary: #d9e9f4 !default;
$bg-secondary: #c1d9e1 !default;
$bg-light: #fbfbfb;

$demi-bold: 600;
$headings-font-weight: $demi-bold !default;
Expand Down
8 changes: 4 additions & 4 deletions adhocracy-plus/assets/scss/components/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ $messages-margin-bottom: 25px;
.alert {
margin: 0;
padding: (1.2 * $padding) $padding;
background-color: $brand-primary-tint;
background-color: lighten($brand-info, 30%);
color: $text-color;
text-align: center;
border-radius: 0;
flex: 1 1 auto;
}

.alert--success {
background-color: lighten($brand-success, 15);
background-color: $brand-success;
color: $text-color;
}

.alert--error,
.alert--danger {
background-color: lighten($brand-danger, 50);
background-color: $brand-danger;
color: $text-color;
}

.alert--warning {
background-color: lighten($brand-warning, 30);
background-color: $brand-warning;
color: $text-color;
}

Expand Down
4 changes: 2 additions & 2 deletions adhocracy-plus/assets/scss/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}

.btn.btn--light {
@include button($brand-tertiary, $text-color, $text-color, 57%);
@include button($brand-tertiary, $text-color, $text-color, 30%);
}

.btn.btn--primary {
Expand All @@ -78,7 +78,7 @@
}

.btn.btn--secondary-filled {
@include button-bg($brand-secondary, $brand-secondary, $print-black, 10%);
@include button-bg($brand-secondary, $brand-secondary, $print-black, 3%);
}

.btn.btn--bg-tertiary {
Expand Down
2 changes: 1 addition & 1 deletion adhocracy-plus/assets/scss/components/_header_upper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@

@media screen and (min-width: $breakpoint) {
.header-upper__brand-img {
height: 2.5rem;
height: 3.5rem;
}
}
2 changes: 1 addition & 1 deletion adhocracy-plus/assets/scss/components/_list_item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@

.list-item__cta {
text-transform: uppercase;
color: $brand-info;
color: $brand-primary;
box-shadow: none;
}
4 changes: 2 additions & 2 deletions adhocracy-plus/assets/scss/components/_poll.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $checkbox-size: 20px;
}

.poll-row__bar {
background-color: $brand-primary-tint;
background-color: $brand-tertiary-tint;
position: absolute;
top: 0;
bottom: 0;
Expand All @@ -102,7 +102,7 @@ $checkbox-size: 20px;
}

.poll__highlight {
background-color: $brand-tertiary-tint;
background-color: $brand-primary-tint;
}

.poll__btn--wrapper {
Expand Down
11 changes: 9 additions & 2 deletions adhocracy-plus/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.humanize",
"apps.djangosaml2_overwrites",
"djangosaml2",
"django_ckeditor_5",
"widget_tweaks",
"rest_framework",
Expand All @@ -40,6 +42,7 @@
"rules.apps.AutodiscoverRulesConfig",
"easy_thumbnails",
"parler",

# Wagtail cms components
"wagtail.contrib.forms",
"wagtail.contrib.redirects",
Expand Down Expand Up @@ -126,19 +129,21 @@
"apps.users.middleware.SetUserLanguageCookieMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.middleware.common.CommonMiddleware",
"djangosaml2.middleware.SamlSessionMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
"allauth.account.middleware.AccountMiddleware",
'apps.djangosaml2_overwrites.middlewares.SamlSignupMiddleware',
)

ROOT_URLCONF = "adhocracy-plus.config.urls"

LOCALE_PATHS = [
# use the first line in branches and forks to keep the original translations
# from main branch and overwrite or add extra translations in fork
# os.path.join(BASE_DIR, 'locale-fork/locale'),
os.path.join(BASE_DIR, "locale-source/locale")
os.path.join(BASE_DIR, "locale-fork/locale"),
os.path.join(BASE_DIR, "locale-source/locale"),
]

TEMPLATES = [
Expand Down Expand Up @@ -273,6 +278,7 @@
"rules.permissions.ObjectPermissionBackend",
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
"djangosaml2.backends.Saml2Backend",
)

ACCOUNT_ADAPTER = "apps.users.adapters.AccountAdapter"
Expand Down Expand Up @@ -684,3 +690,4 @@
},
},
}
USER_REGISTRATION = False
46 changes: 46 additions & 0 deletions adhocracy-plus/config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,51 @@

CELERY_TASK_ALWAYS_EAGER = True

# DIID specific test saml2 config
from os import path

import saml2
import saml2.saml

BASEDIR = path.dirname(path.abspath(__file__))

SAML_CONFIG = {
'entityid': 'http://app.example.com',
'allow_unknown_attributes': True,
'attribute_map_dir': path.join(BASEDIR, 'saml', 'attribute-maps'),
'service': {
'sp': {
'name': 'Federated Django sample SP',
'name_id_format': saml2.saml.NAMEID_FORMAT_PERSISTENT,
'endpoints': {
'single_logout_service': [
('http://localhost:8004/saml2/ls/', saml2.BINDING_HTTP_REDIRECT),
('http://localhost:8004/saml2/ls/post', saml2.BINDING_HTTP_POST),
],
'assertion_consumer_service': [
('http://localhost:8004/saml2/acs/', saml2.BINDING_HTTP_POST),
],
},
'required_attributes': ['mail'],
},
},
'metadata': {
'remote': [{"url": "http://localhost:8080/simplesaml/saml2/idp/metadata.php"},],
},
'key_file': path.join(BASEDIR, 'saml', 'private.key'),
'cert_file': path.join(BASEDIR, 'saml', 'cert.pem'),
'encryption_keypairs': [{
'key_file': path.join(BASEDIR, 'saml', 'private.key'),
'cert_file': path.join(BASEDIR, 'saml', 'cert.pem'),
}],
'debug': 1,
}
SAML_DJANGO_USER_MAIN_ATTRIBUTE = 'email'
SAML_LOGOUT_REQUEST_PREFERRED_BINDING = saml2.BINDING_HTTP_REDIRECT
SAML_ATTRIBUTE_MAPPING = {
'mail': ['email', 'set_username_from_email'],
}

# The local.py import happens at the end of this file so that it can overwrite
# any defaults in dev.py.
# Special cases are:
Expand All @@ -61,3 +106,4 @@
CKEDITOR_CONFIGS["video-editor"]["embed_provider"] = CKEDITOR_URL
except NameError:
pass

Loading