Page MenuHomeDevCentral

D1457.diff
No OneTemporary

D1457.diff

diff --git a/pillar/saas/mediawiki.sls b/pillar/saas/mediawiki.sls
--- a/pillar/saas/mediawiki.sls
+++ b/pillar/saas/mediawiki.sls
@@ -21,6 +21,7 @@
mediawiki_saas:
directory: /var/51-wwwroot/saas-mediawiki
mediawiki_directory: /srv/mediawiki
+ fastcgi_url: unix:/var/run/web/wikis.nasqueron.org/php-fpm.sock
db:
host: 127.0.0.1
user: mediawiki-saas
diff --git a/roles/saas-mediawiki/init.sls b/roles/saas-mediawiki/init.sls
--- a/roles/saas-mediawiki/init.sls
+++ b/roles/saas-mediawiki/init.sls
@@ -10,3 +10,4 @@
- .account
- .mediawiki
- .software
+ - .nginx
diff --git a/roles/saas-mediawiki/nginx/config.sls b/roles/saas-mediawiki/nginx/config.sls
new file mode 100644
--- /dev/null
+++ b/roles/saas-mediawiki/nginx/config.sls
@@ -0,0 +1,33 @@
+# -------------------------------------------------------------
+# Salt — MediaWiki farm
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# includes folder
+#
+# :: MediaWiki and SaaS location blocks
+# -------------------------------------------------------------
+
+{{ dirs.etc }}/nginx/includes:
+ file.recurse:
+ - source: salt://roles/saas-mediawiki/nginx/files/includes
+ - dir_mode: 755
+ - file_mode: 644
+ - template: jinja
+ - context:
+ saas: {{ pillar['mediawiki_saas'] }}
+
+# -------------------------------------------------------------
+# vhosts folder
+# -------------------------------------------------------------
+
+{{ dirs.etc }}/nginx/vhosts:
+ file.recurse:
+ - source: salt://roles/saas-mediawiki/nginx/files/vhosts
+ - dir_mode: 755
+ - file_mode: 644
diff --git a/roles/saas-mediawiki/nginx/files/includes/mediawiki-root b/roles/saas-mediawiki/nginx/files/includes/mediawiki-root
new file mode 100644
--- /dev/null
+++ b/roles/saas-mediawiki/nginx/files/includes/mediawiki-root
@@ -0,0 +1,71 @@
+# -------------------------------------------------------------
+# Webserver
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Site: agora.nasqueron.org
+# License: Trivial work, not eligible to copyright
+# Source file: roles/saas-mediawiki/nginx/files/includes/mediawiki-root
+# Description: Common settings for a wiki powered by MediaWiki
+# and served by our MediaWiki SaaS, with /<title> page links.
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# -------------------------------------------------------------
+# Requests for the wiki
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+root {{ saas.mediawiki_directory }};
+
+location / {
+ try_files $uri $uri/ /index.php?$query_string;
+}
+
+location /images {
+ alias /var/dataroot/$server_name/images;
+}
+
+location ~ ^/images/thumb/(archive/)?[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ {
+ #Note: this doesn't work with InstantCommons.
+ if (!-f $request_filename) {
+ rewrite ^/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /thumb.php?f=$1&width=$2;
+ rewrite ^/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /thumb.php?f=$1&width=$2&archived=1;
+ }
+}
+
+location /images/deleted { deny all; }
+location /cache { deny all; }
+location /languages { deny all; }
+location /maintenance { deny all; }
+location /serialized { deny all; }
+location ~ /.(svn|git)(/|$) { deny all; }
+location ~ /.ht { deny all; }
+location /mw-config { deny all; }
+
+location ~ \.php$ {
+ try_files $uri =404;
+ fastcgi_pass {{ saas.fastcgi_url }};
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include includes/fastcgi_params;
+}
+
+# -------------------------------------------------------------
+# Requests for the SaaS entry point
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+location = / {
+ fastcgi_pass {{ saas.fastcgi_url }};
+ fastcgi_param SCRIPT_FILENAME {{ saas.directory }}/index.php;
+ include includes/fastcgi_params;
+}
+
+location = /status {
+ fastcgi_pass {{ saas.fastcgi_url }};
+ fastcgi_param SCRIPT_FILENAME {{ saas.directory }}/index.php;
+ include includes/fastcgi_params;
+}
diff --git a/roles/saas-mediawiki/nginx/files/vhosts/nasqueron.org/agora.conf b/roles/saas-mediawiki/nginx/files/vhosts/nasqueron.org/agora.conf
new file mode 100644
--- /dev/null
+++ b/roles/saas-mediawiki/nginx/files/vhosts/nasqueron.org/agora.conf
@@ -0,0 +1,38 @@
+# -------------------------------------------------------------
+# Webserver
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Site: agora.nasqueron.org
+# License: Trivial work, not eligible to copyright
+# Source file: roles/saas-mediawiki/nginx/files/vhosts/nasqueron.org/agora.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+server {
+ listen 80;
+ listen [::]:80;
+ server_name agora.nasqueron.org;
+
+ include includes/letsencrypt;
+
+ return 301 https://agora.nasqueron.org$request_uri;
+}
+
+server {
+ server_name agora.nasqueron.org;
+
+ include includes/tls;
+ ssl_certificate /usr/local/etc/letsencrypt/live/agora.nasqueron.org/fullchain.pem;
+ ssl_certificate_key /usr/local/etc/letsencrypt/live/agora.nasqueron.org/privkey.pem;
+
+ error_log /var/log/www/nasqueron.org/agora-error.log;
+ access_log /var/log/www/nasqueron.org/agora-access.log;
+
+ include includes/mediawiki-root;
+}
diff --git a/roles/saas-mediawiki/init.sls b/roles/saas-mediawiki/nginx/init.sls
copy from roles/saas-mediawiki/init.sls
copy to roles/saas-mediawiki/nginx/init.sls
--- a/roles/saas-mediawiki/init.sls
+++ b/roles/saas-mediawiki/nginx/init.sls
@@ -2,11 +2,8 @@
# Salt — MediaWiki farm
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
-# Created: 2018-03-16
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- - .account
- - .mediawiki
- - .software
+ - .config

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 04:50 (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2261863
Default Alt Text
D1457.diff (6 KB)

Event Timeline