Skip to content

Commit 58652e9

Browse files
committed
Add initial synchronisation with Mailman
This allows syncronisation of mailing list ids from Mailman and they can then be added to a mailing list. At this point there is no actual synchronisation of memberships.
1 parent a5c43fb commit 58652e9

22 files changed

+563
-165
lines changed

.env.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ MAIL_TO_ERROR_REPORT_NAME='Database Wizards'
4040
4141
MAIL_TO_SUBSCRIPTION_NAME='Secretary of GEWIS'
4242

43-
MAILMAN_API_ENDPOINT=http://localhost:8020/3.1/
43+
MAILMAN_API_ENDPOINT=http://mailmanc:8001/3.1/
4444
MAILMAN_API_USERNAME=restadmin
4545
MAILMAN_API_PASSWORD=restpass
4646

.idea/php.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"require": {
1212
"php": "^8.2.0",
1313
"ext-intl": "*",
14+
"ext-memcached": "^3.2",
1415
"ext-pdo_pgsql": "*",
1516
"ext-pgsql": "*",
1617
"ext-zend-opcache": "*",
@@ -51,7 +52,9 @@
5152
"doctrine/doctrine-orm-module": "^5.3.0",
5253
"doctrine/doctrine-laminas-hydrator": "^3.2.0",
5354
"monolog/monolog": "^1.27",
54-
"cweagans/composer-patches": "^1.7.2"
55+
"cweagans/composer-patches": "^1.7.2",
56+
"laminas/laminas-cache": "^3.10.1",
57+
"laminas/laminas-cache-storage-adapter-memcached": "^2.4.0"
5558
},
5659
"require-dev": {
5760
"laminas/laminas-component-installer": "^3.1.0",

composer.lock

+94-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/modules.config.php

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
'Laminas\Validator',
2525
'DoctrineModule',
2626
'DoctrineORMModule',
27+
'Laminas\Cache\Storage\Adapter\Memcached',
2728
'Application',
2829
'Database',
2930
'Checker',

docker-compose.override.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
mailman-core:
3535
image: maxking/mailman-core:0.4
3636
container_name: mailman-core
37-
hostname: mailman-core
37+
hostname: mailmanc
3838
volumes:
3939
- ./mailman/core:/opt/mailman/
4040
depends_on:
@@ -51,7 +51,7 @@ services:
5151
mailman-web:
5252
image: maxking/mailman-web:0.4
5353
container_name: mailman-web
54-
hostname: mailman-web
54+
hostname: mailmanw
5555
depends_on:
5656
- postgresql
5757
volumes:

docker-compose.yml

+7
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,20 @@ services:
4848
# - LDAP_BINDUSER_PASS=
4949
# - LDAP_BASEDN=
5050
depends_on:
51+
- memcached
5152
- postfix
5253
volumes:
5354
- gewisdb_data:/code/data:rw
5455
- gewisdb_public:/code/public:rw
5556
networks:
5657
- gewisdb_network
5758
restart: unless-stopped
59+
memcached:
60+
image: memcached:alpine
61+
entrypoint: [ 'memcached', '-m 256' ]
62+
networks:
63+
- gewisdb_network
64+
restart: unless-stopped
5865
postfix:
5966
image: juanluisbaptiste/postfix
6067
env_file:

docker/web/development/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ RUN apk add --no-cache --virtual .build-deps \
44
$PHPIZE_DEPS \
55
curl-dev \
66
icu-dev \
7+
libmemcached-dev \
78
libpq-dev \
89
libzip-dev \
910
linux-headers \
@@ -27,6 +28,8 @@ RUN apk add --no-cache --virtual .build-deps \
2728
pdo_pgsql \
2829
pdo_sqlite \
2930
zip \
31+
&& pecl install memcached \
32+
&& docker-php-ext-enable memcached \
3033
&& pecl install xdebug \
3134
&& docker-php-ext-enable xdebug \
3235
&& rm -r /tmp/pear \

docker/web/production/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM php:8.2-fpm-alpine as php-target
33
RUN apk add --no-cache --virtual .build-deps \
44
curl-dev \
55
icu-dev \
6+
libmemcached-dev \
67
libpq-dev \
78
libzip-dev \
89
openldap-dev \
@@ -20,6 +21,9 @@ RUN apk add --no-cache --virtual .build-deps \
2021
pgsql \
2122
pdo_pgsql \
2223
zip \
24+
&& pecl install memcached \
25+
&& docker-php-ext-enable memcached \
26+
&& rm -r /tmp/pear \
2327
&& runtimeDeps="$( \
2428
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
2529
| tr ',' '\n' \

module/Database/config/module.config.php

+52-7
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,57 @@
515515
],
516516
'may_terminate' => true,
517517
'child_routes' => [
518-
'list-delete' => [
519-
'type' => Segment::class,
518+
'lists' => [
519+
'type' => Literal::class,
520520
'options' => [
521-
'route' => '/list/delete/:name',
522-
'constraints' => [
523-
'name' => '[a-zA-Z0-9_-]+',
524-
],
521+
'route' => '/lists',
525522
'defaults' => [
526-
'action' => 'deleteList',
523+
'action' => 'lists',
524+
],
525+
],
526+
'may_terminate' => true,
527+
'child_routes' => [
528+
'add' => [
529+
'type' => Literal::class,
530+
'options' => [
531+
'route' => '/add',
532+
'defaults' => [
533+
'action' => 'addList',
534+
],
535+
],
536+
],
537+
'edit' => [
538+
'type' => Segment::class,
539+
'options' => [
540+
'route' => '/edit/:name',
541+
'constraints' => [
542+
'name' => '[a-zA-Z0-9_-]+',
543+
],
544+
'defaults' => [
545+
'action' => 'editList',
546+
],
547+
],
548+
],
549+
'delete' => [
550+
'type' => Segment::class,
551+
'options' => [
552+
'route' => '/delete/:name',
553+
'constraints' => [
554+
'name' => '[a-zA-Z0-9_-]+',
555+
],
556+
'defaults' => [
557+
'action' => 'deleteList',
558+
],
559+
],
560+
],
561+
'sync' => [
562+
'type' => Literal::class,
563+
'options' => [
564+
'route' => '/sync',
565+
'defaults' => [
566+
'action' => 'syncLists',
567+
],
568+
],
527569
],
528570
],
529571
],
@@ -626,6 +668,9 @@
626668
'template_path_stack' => [
627669
'database' => __DIR__ . '/../view/',
628670
],
671+
'template_map' => [
672+
'database/settings/edit-list' => __DIR__ . '/../view/database/settings/add-list.phtml',
673+
],
629674
'strategies' => [
630675
'ViewJsonStrategy',
631676
],

0 commit comments

Comments
 (0)