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

rebase aplus 2406.4 again #90

Closed
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9cb9d46
assets: Change the logo
Aug 19, 2020
411a123
assets: CSS adjustments
Aug 19, 2020
708f6a8
diid/docs: point to diid-repo
fuzzylogic2000 Aug 17, 2020
e49cf50
config: Enable saml2 and add some configs
rmader Aug 20, 2020
a8ffe3a
apps/users: Add a saml2 specific helper func
rmader Aug 20, 2020
f6f93e9
templates: Adapt login experience slightly
rmader Aug 20, 2020
a23526c
docs: Add shibolleth docu for DIID
rmader Aug 20, 2020
b723d87
templates/email_base: removing fixed width and updating image file fi…
Oct 22, 2020
aedd3b1
saml2: Add test-server config
rmader Oct 22, 2020
b1c6fdc
apps: Add app with djangosaml2 overwrites
rmader Oct 22, 2020
83e34f9
users/forms: add aditional checkboxes and edit existing on signup for…
Oct 19, 2020
2234ee2
test/users: update tests to reflect additions to form
Nov 3, 2020
73f942a
diid: Add a default_idp setting
rmader Nov 3, 2020
ee2e538
translations: mark diid-specific translations via context "diid"
fuzzylogic2000 Nov 4, 2020
ffe7767
translations: use locale-fork for translations
rmader Nov 12, 2020
9d48d30
adds/djangosaml2_overwrites: Add a middleware to guard saml signup
rmader Nov 12, 2020
75dd8e6
ci: use github actions, remove unused travis
goapunk Nov 25, 2021
06a16d8
tests/user factory: add email address to DB after user was created
fuzzylogic2000 Jan 10, 2022
e252e23
tests/signup: disable signup tests that are redirected by django saml…
fuzzylogic2000 Jan 10, 2022
1d4a012
translations: makemessages
fuzzylogic2000 Jan 25, 2022
9cbec79
wording: change teilhabe.diid... to dialog.diid...
fuzzylogic2000 Jan 25, 2022
b6fc825
translations: makemessages
fuzzylogic2000 Jan 25, 2022
6c8f766
translations: add new translation
fuzzylogic2000 Jan 25, 2022
f9d453d
deps and pyup: use own requirements file for fork-specific packages
fuzzylogic2000 Jan 26, 2022
83feb2d
deps/py: update djangosaml2 to 1.3.5
fuzzylogic2000 Jan 26, 2022
2556058
Update djangosaml2 from 1.3.5 to 1.3.6
pyup-bot Mar 7, 2022
506a24d
Update djangosaml2 from 1.3.6 to 1.5.0
pyup-bot Apr 25, 2022
4ed0070
fix newsletter tests
goapunk Apr 28, 2022
18f5fef
tests: fix and reenable the user tests
goapunk Apr 28, 2022
864a8e3
renovate: only update fork packages
goapunk Aug 3, 2022
483c5ac
renovate: disable for npm
goapunk Aug 4, 2022
ace57fc
chore(deps): update dependency djangosaml2 to v1.5.1
renovate[bot] Aug 4, 2022
762107e
assest/images: update logo so correct size fixes #66
philli-m Feb 23, 2023
25effa1
assets/*: colour fixes from lib removal fixes #68 fixes #69
philli-m Feb 23, 2023
e292bc3
assets/images: add transparent logo for sharepic after rebase removed it
philli-m Feb 24, 2023
6ecb8e1
chore(deps): update dependency djangosaml2 to v1.5.8
renovate[bot] May 31, 2023
8b79879
apps/users: only allow university login
m4ra Oct 12, 2023
a59b391
Makefile: add documenattion for local saml set up scripts
philli-m Oct 11, 2023
2b821e5
apps/djangosamle2_overwrites: extend form_field to include additional…
philli-m Oct 11, 2023
93a2593
update translations
goapunk Oct 16, 2023
1383f94
add some missing translations
goapunk Oct 16, 2023
ef81c77
release v2306.2
goapunk Oct 16, 2023
e8a2d4b
chore(deps): update dependency djangosaml2 to v1.8.0
renovate[bot] Dec 20, 2023
74720cd
release v2312.1
goapunk Dec 27, 2023
09a85a7
apps/djangosaml2_overwrites: fix deprecation of ugettext
goapunk Jun 6, 2024
4346e70
chore(deps): update dependency djangosaml2 to v1.9.3
renovate[bot] Jun 6, 2024
38864c4
apps/djangosaml2_overwrites: add account logout view to allowed urls …
goapunk Jun 13, 2024
0765215
release v2406.1
goapunk Jun 17, 2024
ea9489d
update a4
goapunk Jun 20, 2024
f47670e
apps/users: use magic as a fallback to detect image mimetype if MIMEI…
goapunk Jun 19, 2024
3b75425
chore(deps): update dependency urllib3 to v2.2.2 [security]
renovate[bot] Jun 18, 2024
1b3d002
release v2406.3
m4ra Jun 24, 2024
21f0308
adhocracy-plus/templates: add missing password_set template
goapunk Jun 25, 2024
92e40a5
apps/accounts: add missing blocktranslate to account deletion email
goapunk Jun 25, 2024
6ec51eb
update translations
goapunk Jun 25, 2024
2468e6a
add changelog for password_set view
goapunk Jun 25, 2024
facb4fd
apps/users: make switching the language via the indicator also change
goapunk Jun 26, 2024
31bcffc
pull translations from transifex
m4ra Jun 27, 2024
7beb857
release v2406.4
m4ra Jun 27, 2024
c0f8503
config: Enable saml2 and add some configs
rmader Aug 20, 2020
72bd6b9
saml2: Add test-server config
rmader Oct 22, 2020
a1d87c9
apps: Add app with djangosaml2 overwrites
rmader Oct 22, 2020
5abb5c9
adds/djangosaml2_overwrites: Add a middleware to guard saml signup
rmader Nov 12, 2020
e376828
renovate: disable for npm
goapunk Aug 4, 2022
ee9f193
apps/users: only allow university login
m4ra Oct 12, 2023
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
826 changes: 34 additions & 792 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
45 changes: 45 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 Down
Loading