Add diagrams extension and service

This commit is contained in:
Adam Goldsmith 2022-03-18 23:15:25 -04:00
parent 8aafb6a6a0
commit c61d56b862
6 changed files with 56 additions and 1 deletions

View File

@ -83,6 +83,8 @@ RUN git clone --depth 1 -b REL${MEDIAWIKI_MAJOR_VERSION/./_} \
RUN git clone --depth 1 -b REL${MEDIAWIKI_MAJOR_VERSION/./_} \ RUN git clone --depth 1 -b REL${MEDIAWIKI_MAJOR_VERSION/./_} \
https://gerrit.wikimedia.org/r/mediawiki/extensions/ApprovedRevs \ https://gerrit.wikimedia.org/r/mediawiki/extensions/ApprovedRevs \
/var/www/html/extensions/ApprovedRevs /var/www/html/extensions/ApprovedRevs
RUN a2enmod proxy_http proxy_html
COPY apache-mediawiki.conf /etc/apache2/sites-available/000-default.conf
# reset back to default shell # reset back to default shell
SHELL ["/bin/sh", "-c"] SHELL ["/bin/sh", "-c"]

View File

@ -226,6 +226,9 @@ wfLoadExtension( 'CSS' );
wfLoadExtension( 'Widgets' ); wfLoadExtension( 'Widgets' );
wfLoadExtension( 'ApprovedRevs' ); wfLoadExtension( 'ApprovedRevs' );
wfLoadExtension( 'Diagrams' );
$wgDiagramsServiceUrl ='https://wiki.claremontmakerspace.org/diagrams';
require_once "$IP/extensions/QRLite/QRLite.php"; require_once "$IP/extensions/QRLite/QRLite.php";
wfLoadExtension( 'ExternalData' ); wfLoadExtension( 'ExternalData' );

21
apache-mediawiki.conf Normal file
View File

@ -0,0 +1,21 @@
<VirtualHost *:80>
ServerAdmin webmaster@claremontmakerspace.org
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
AllowEncodedSlashes NoDecode
ProxyPass /diagrams/ http://diagrams:5003/diagrams/
# ProxyPassReverse /diagrams/ http://diagrams:5003/
ProxyPreserveHost On
# <Location /diagrams/>
# ProxyPassReverse /
# SetOutputFilter proxy-html
# ProxyHTMLURLMap http://diagrams:5003/ /diagrams/
# ProxyHTMLURLMap / /diagrams/
# </Location>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

View File

@ -2,7 +2,8 @@
"require": { "require": {
"mediawiki/semantic-media-wiki": "^4.0", "mediawiki/semantic-media-wiki": "^4.0",
"mediawiki/semantic-scribunto": "^2.0", "mediawiki/semantic-scribunto": "^2.0",
"mediawiki/data-transfer": "^1.0"
"mediawiki/semantic-result-formats": "^4.0", "mediawiki/semantic-result-formats": "^4.0",
"mediawiki/data-transfer": "^1.0",
"samwilson/diagrams": "^0.9"
} }
} }

19
diagrams/Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM alpine as source
RUN apk add git curl
RUN git clone https://github.com/ad1217/diagrams -b fix-stuff
RUN curl -L http://sourceforge.net/projects/plantuml/files/plantuml.jar/download -o diagrams/plantuml.jar
FROM python:3-alpine
COPY --from=source diagrams diagrams
WORKDIR diagrams
# TODO: missing mscgen
RUN apk add graphviz openjdk8-jre
RUN pip3 install -r dgs/requirements.txt gunicorn
VOLUME /root/.diagrams
env SCRIPT_NAME=/diagrams
CMD ["gunicorn", "dgs.webserver:app", "--bind", "0.0.0.0:5003", "--forwarded-allow-ips=*"]

View File

@ -12,6 +12,13 @@ services:
- ./LocalSettings.php:/var/www/html/LocalSettings.php:ro - ./LocalSettings.php:/var/www/html/LocalSettings.php:ro
- ./secrets.php:/var/www/html/secrets.php:ro - ./secrets.php:/var/www/html/secrets.php:ro
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:ro - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:ro
diagrams:
build: ./diagrams
restart: always
volumes:
- diagrams-vol:/root/.diagrams
database: database:
image: mariadb image: mariadb
volumes: volumes:
@ -22,5 +29,7 @@ services:
MYSQL_DATABASE: mediawiki MYSQL_DATABASE: mediawiki
#MYSQL_USER and MYSQL_PASSWORD in .env #MYSQL_USER and MYSQL_PASSWORD in .env
MYSQL_RANDOM_ROOT_PASSWORD: 'yes' MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes: volumes:
mysql-vol: mysql-vol:
diagrams-vol: