diff --git a/pillar/role/wiki.sls b/pillar/role/wiki.sls index a49e09c..ce0c11f 100644 --- a/pillar/role/wiki.sls +++ b/pillar/role/wiki.sls @@ -16,9 +16,11 @@ mediawiki_1_27: # availale options: # alias: wikimove.opensuse.org # bento_lang: en + # dbmysql5: False # only needed for old-en and old-de, defaults to True # dbpass: not_in_salt_yet # lang: en # readonly_msg: 'This wiki is in read-only mode for maintenance!' + # robots: robots-disallow.txt # filename in salt/profile/wiki/files/ # site_notice: 'This wiki has been moved and updated recently. If you encounter any issue, please let us know by mail to admin@opensuse.org.' cn: dbpass: not_in_salt_yet @@ -41,6 +43,7 @@ mediawiki_1_27: bento_lang: en dbpass: not_in_salt_yet lang: en + robots: robots-disallow.txt site_notice: 'This is a test wiki. You are more than welcome to do test edits, but please keep in mind that all changes will be lost when we import a newer database dump.' es: dbpass: not_in_salt_yet @@ -66,14 +69,18 @@ mediawiki_1_27: old-de: bento_lang: de dbpass: not_in_salt_yet + dbmysql5: False lang: de readonly_msg: 'Dieses Wiki ist ein Archiv und kann nicht bearbeitet werden.' + robots: robots-disallow.txt site_notice: 'Dieses Wiki ist ein Archiv (Stand: 2011) des alten openSUSE-Wikis. Das aktuelle openSUSE-Wiki finden Sie unter [https://de.opensuse.org de.opensuse.org].' old-en: bento_lang: en + dbmysql5: False dbpass: not_in_salt_yet lang: en readonly_msg: 'This wiki is an archive and cannot be edited.' + robots: robots-disallow.txt site_notice: 'This wiki is an archive (from 2011) of the old openSUSE wiki. You can find the up to date openSUSE wiki at [https://en.opensuse.org en.opensuse.org].' pl: dbpass: not_in_salt_yet diff --git a/salt/profile/wiki/docroot.sls b/salt/profile/wiki/docroot.sls index 67b6772..e4a9fb4 100644 --- a/salt/profile/wiki/docroot.sls +++ b/salt/profile/wiki/docroot.sls @@ -51,6 +51,12 @@ - source: salt://profile/wiki/files/wiki_settings.php - template: jinja +{% if data.get('robots') %} +/srv/www//{{ wiki }}.opensuse.org/public/robots.txt: + file.managed: + - source: salt://profile/wiki/files/{{ data.robots }} +{% endif %} + {%endfor%} # SQL commands to migrate old hit counter data diff --git a/salt/profile/wiki/files/LocalSettings.php b/salt/profile/wiki/files/LocalSettings.php index 172c5b8..ae3767e 100644 --- a/salt/profile/wiki/files/LocalSettings.php +++ b/salt/profile/wiki/files/LocalSettings.php @@ -60,9 +60,6 @@ $wgEmailAuthentication = false; # If you're on MySQL 3.x, this next line must be FALSE: $wgDBmysql4 = true; -# Experimental charset support for MySQL 4.1/5.0. -$wgDBmysql5 = true; - # File Cache #$wgUseFileCache = true; /* default: false */ #$wgFileCacheDirectory = "/srv/www/htdocs/cache"; diff --git a/salt/profile/wiki/files/httpd2-prefork.apparmor b/salt/profile/wiki/files/httpd2-prefork.apparmor index 70476fc..a2094ba 100644 --- a/salt/profile/wiki/files/httpd2-prefork.apparmor +++ b/salt/profile/wiki/files/httpd2-prefork.apparmor @@ -129,9 +129,13 @@ profile httpd2-prefork /usr/sbin/httpd{,2}-prefork flags=(complain,attach_discon /srv/www/{{wiki}}.opensuse.org/cache/* rw, /srv/www/{{wiki}}.opensuse.org/public/ r, /srv/www/{{wiki}}.opensuse.org/public/** r, + /srv/www/{{wiki}}.opensuse.org/public/images/**/ rw, /srv/www/{{wiki}}.opensuse.org/public/images/**.@{wiki_upload_extensions} rw, + /srv/www/{{wiki}}.opensuse.org/public/images/deleted/**/index.html rw, /srv/www/{{wiki}}.opensuse.org/public/images/lockdir/*.lock rwk, /srv/www/{{wiki}}.opensuse.org/public/images/temp/*/*/*\!php??????. rw, + /srv/www/{{wiki}}.opensuse.org/public/images/temp/**/index.html rw, + /srv/www/{{wiki}}.opensuse.org/public/images/temp/.htaccess rw, /srv/www/{{wiki}}.opensuse.org/public/images/temp/localcopy_* rw, /srv/www/{{wiki}}.opensuse.org/public/images/temp/ResourceLoaderImage?????? rw, /srv/www/{{wiki}}.opensuse.org/public/images/temp/svg_*/ rw, diff --git a/salt/profile/wiki/files/robots-disallow.txt b/salt/profile/wiki/files/robots-disallow.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/salt/profile/wiki/files/robots-disallow.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/salt/profile/wiki/files/wiki_settings.php b/salt/profile/wiki/files/wiki_settings.php index ec56948..c082503 100644 --- a/salt/profile/wiki/files/wiki_settings.php +++ b/salt/profile/wiki/files/wiki_settings.php @@ -22,4 +22,11 @@ $wgSiteNotice = '{{ data.site_notice }}'; {% if data.has_key('readonly_msg') %} $wgReadOnly = '{{ data.readonly_msg }}'; +$wgIgnoreImageErrors=true; # avoid error message for thumbnails, see https://www.mediawiki.org/wiki/Manual:$wgReadOnly {% endif %} + +{%- if data.has_key('dbmysql5') and not data.get('dbmysql5') %} +$wgDBmysql5 = false; # old-en and old-de don't work with utf8 DB connection +{%- else %} +$wgDBmysql5 = true; +{%- endif %}