diff --git a/Vagrantfile b/Vagrantfile index a292269b..ad9e787c 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -13,7 +13,7 @@ SERVERS = [ {:name => "hg", :codename => "noble"}, {:name => "loadbalancer", :codename => "noble", :ports => [20000, 20001, 20002, 20004, 20010, 20011]}, "mail", - "moin", + {:name => "moin", :codename => "noble"}, "planet", "pythontest", ] diff --git a/docs/guides/migration-recipe.md b/docs/guides/migration-recipe.md index 5f8befad..a87f7556 100644 --- a/docs/guides/migration-recipe.md +++ b/docs/guides/migration-recipe.md @@ -90,24 +90,29 @@ index 68387c9..7a8ace1 100644 ssh root@NNN.NNN.NNN.NNN ``` 2. Add Salt repositories for our current target version (add the apt-repo and install `salt-minion` package): - > **Note**: Ensure you are adding the correct key/repository for the version of Ubuntu you are using. + > **Note**: Ensure you are adding the correct key/repository for the version of Ubuntu you are using. > - > See [the Salt installation guide](https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/ubuntu.html) for more information. - ```console - UBUNTU_VERSION=$(lsb_release -rs) - ARCH=$(dpkg --print-architecture) - CODENAME=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d '=' -f 2) - - echo "Adding the SaltStack repository key for $UBUNTU_VERSION $CODENAME ($ARCH)..." - sudo curl -fsSL -o /etc/apt/keyrings/salt-archive-keyring-2024.gpg https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public - echo "Adding the SaltStack repository for $UBUNTU_VERSION $CODENAME ($ARCH)..." - echo "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2024.gpg arch=$ARCH] https://packages.broadcom.com/artifactory/saltproject-deb/ stable main" | sudo tee /etc/apt/sources.list.d/salt.list - echo "Pinning Salt to v3006.*" - RUN printf "Package: salt-*\nPin: version 3006.*\nPin-Priority: 1001\n" > /etc/apt/preferences.d/salt-pin-1001 + > See [the Salt installation guide](https://salt.tips/salt-install-guide/en/latest/topics/install-by-operating-system/linux-deb.html) for more information. + ```console + # Ensure keyrings dir exists + mkdir -m 755 -p /etc/apt/keyrings + + # Download and dearmor the public key + curl -fsSL https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public \ + | gpg --dearmor | sudo tee /etc/apt/keyrings/salt-archive-keyring.pgp > /dev/null + + # Create apt repo target configuration (DEB822 format) + curl -fsSL https://github.com/saltstack/salt-install-guide/releases/latest/download/salt.sources \ + | sudo tee /etc/apt/sources.list.d/salt.sources + + # Pin to Salt 3006 LTS + echo 'Package: salt-* + Pin: version 3006.* + Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/salt-pin-1001 ``` 3. Install and configure the salt-minion. On `$new-host`, run the command ```console - apt-get update -y && apt-get install -y --no-install-recommends salt-minion + sudo apt-get update -y && sudo apt-get install -y --no-install-recommends salt-minion ``` - On the `old-host`, look through `/etc/salt/minion.d*` to set up salt-minion configuration files to match on new-host: - Generate bash that will create these files diff --git a/pillar/base/haproxy.sls b/pillar/base/haproxy.sls index f1223597..646a9931 100644 --- a/pillar/base/haproxy.sls +++ b/pillar/base/haproxy.sls @@ -84,7 +84,7 @@ haproxy: - wiki.jython.org verify_host: moin.psf.io rate_limit: 50 - check: "HEAD /moin/HelpContents HTTP/1.1\\r\\nHost:\\ wiki.python.org" + check: "HEAD / HTTP/1.1\\r\\nHost:\\ wiki.python.org" svn: domains: diff --git a/pillar/base/moin.sls b/pillar/base/moin.sls deleted file mode 100644 index 0c6619a3..00000000 --- a/pillar/base/moin.sls +++ /dev/null @@ -1,21 +0,0 @@ -moin: - wikis: - python: - name: Python Wiki - regex: '^https?://[^/]+(:\d+)?/moin.*$' - logo: 'Python' - theme: europython - psf: - name: Private PSF Wiki - regex: '^https?://[^/]+(:\d+)?/psf.*$' - logo: Private PSF Wiki - acls: - before: "AdminGroup:read,write,delete,revert,admin" - default: "" - after: "MembersGroup:read,write,delete,revert All:" - linkspam: False - jython: - name: Jython Wiki - regex: '^https?://[^/]+(:\d+)?/jython.*$' - logo: 'JythonWiki ' - interwiki: JythonWiki diff --git a/pillar/dev/roles.sls b/pillar/dev/roles.sls index b9c7b12a..53ed2b72 100644 --- a/pillar/dev/roles.sls +++ b/pillar/dev/roles.sls @@ -83,6 +83,6 @@ roles: purpose: "" contact: "" moin: - pattern: "moin.vagrant.psf.io" - purpose: "" + pattern: "wiki.vagrant.psf.io" + purpose: "Static wiki archive" contact: "" diff --git a/pillar/dev/top.sls b/pillar/dev/top.sls index ba30da18..a1b3dd2b 100644 --- a/pillar/dev/top.sls +++ b/pillar/dev/top.sls @@ -90,5 +90,4 @@ base: 'wiki': - match: nodegroup - - moin - firewall.rs-lb-backend diff --git a/pillar/prod/roles.sls b/pillar/prod/roles.sls index 4188bf61..451685ad 100644 --- a/pillar/prod/roles.sls +++ b/pillar/prod/roles.sls @@ -87,7 +87,7 @@ roles: contact: "Infrastructure Staff" category: "infra-infra" moin: - pattern: "moin*.nyc1.psf.io" - purpose: "Hosts moin sites for wiki.python.org, wiki.jython.org" - contact: "lemburg" + pattern: "wiki*.nyc1.psf.io" + purpose: "Static wiki archive for wiki.python.org, wiki.jython.org" + contact: "Infrastructure Staff" category: "community" diff --git a/pillar/prod/top.sls b/pillar/prod/top.sls index ae588f28..26e9be93 100644 --- a/pillar/prod/top.sls +++ b/pillar/prod/top.sls @@ -87,7 +87,6 @@ base: 'moin': - match: nodegroup - - mail-opt-out - firewall.rs-lb-backend - backup.moin diff --git a/salt/moin/configs/farmconfig.py b/salt/moin/configs/farmconfig.py deleted file mode 100644 index afaad966..00000000 --- a/salt/moin/configs/farmconfig.py +++ /dev/null @@ -1,182 +0,0 @@ -# -*- coding: utf-8 -*- -# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a -# western country and you don't know that you use utf-8, you probably want to -# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode -# encoding) you MUST use: coding: utf-8 -# That setting must match the encoding your editor uses when you modify the -# settings below. If it does not, special non-ASCII chars will be wrong. - -""" - MoinMoin - Configuration for a wiki farm - - If you run a single wiki only, you can omit this file file and just - use wikiconfig.py - it will be used for every request we get in that - case. - - Note that there are more config options than you'll find in - the version of this file that is installed by default; see - the module MoinMoin.multiconfig for a full list of names and their - default values. - - Also, the URL http://moinmoin.wikiwikiweb.de/HelpOnConfiguration has - a list of config options. - - @copyright: 2000-2004 by Juergen Hermann - @license: GNU GPL, see COPYING for details. -""" - - -# Wikis in your farm -------------------------------------------------- - -# If you run multiple wikis, you need this list of pairs (wikiname, url -# regular expression). moin processes that list and tries to match the -# regular expression against the URL of this request - until it matches. -# Then it loads the .py config for handling that request. - -wikis = [ - # wikiname, url regular expression (no protocol, no port!) - ("python", r".*(python\.org)/moin(/.*|$)"), - ("psf", r".*(python\.org)/psf/.*"), - ("jython", r".*(python\.org)/jython.*"), -] - - -# Common configuration for all wikis ---------------------------------- - -# Everything that should be configured the same way should go here, -# anything else that should be different should go to the single wiki's -# config. -# In that single wiki's config, we will use the class FarmConfig we define -# below as the base config settings and only override what's different. -# -# In exactly the same way, we first include MoinMoin's Config Defaults here - -# this is to get everything to sane defaults, so we need to change only what -# we like to have different: - -from MoinMoin.config import multiconfig, url_prefix_static - -# Now we subclass this DefaultConfig. This means that we inherit every setting -# from the DefaultConfig, except those we explicitely define different. - -class FarmConfig(multiconfig.DefaultConfig): - url_prefix = '/wiki' - include_doctype = True - traceback_show = False - url_prefix_static = '/wiki' - - # until we are finished with the setup we don't want anonymous access - #acl_rights_default = u"MarcAndreLemburg,ReimarBauer:read,write,delete,revert All:" - # to disallow edits by users that are not logged in: - acl_rights_default = u"Known:read,write,delete,revert All:read" - - page_front_page = u"FrontPage" - - # Warning to display to users after 2013 wiki attack: - #page_header1 = """

Please note: This wiki is - #currently running in test mode after an attack on January 5 2013. - #All passwords were reset, so you will have to use the password recovery function to get a new - #password. To edit wiki pages, please log in first. See the wiki attack description page for more - #details. If you find problems, please report them to the pydotorg-www mailing list. - #

""" - - # as it isnt modified, it can be share between all instances: - data_underlay_dir = '/data/moin/instances/underlay/' - - shared_intermap = '/etc/moin/shared_intermap.txt' - - xapian_index_dir = '/data/moin/instances/xapian' - xapian_search = True - - # options people are likely to change due to personal taste - show_hosts = 1 # show hostnames? - nonexist_qm = 0 # show '?' for nonexistent? - backtick_meta = 1 # allow `inline typewriter`? - allow_extended_names = 1 # allow ["..."] markup? - edit_rows = 20 # editor size - edit_cols = 50 - max_macro_size = 50 # max size of RecentChanges in KB (0=unlimited) - bang_meta = 1 # use ! to escape WikiNames? - show_section_numbers = 0 # enumerate headlines? - user_checkbox_defaults = {'edit_on_doubleclick': 0} - - editor_default = 'text' - editor_force = True - editor_ui = 'text' - - # Charting needs "gdchart" installed! (None to disable charting) - chart_options = {'width': 600, 'height': 300} - - # Allow new user creation - actions_superuser = multiconfig.DefaultConfig.actions_superuser[:] - actions_superuser.remove('newaccount') - - # Disable certain actions that aren't very useful for us. - actions_excluded = multiconfig.DefaultConfig.actions_excluded[:] - # on default this is "xmlrpc", "CopyPages", "MyPages" - - # this disables the user to create a zip file from a page - # and download this file - actions_excluded.append('PackagePages') - # this disables the user to sync pages to an other wiki, this works onl - # if xmlrpc is enabled - actions_excluded.append('SyncPages') - # the content should not be rendered as docbook - actions_excluded.append('RenderAsDocbook') - # noone on this wikis wants to mass (un)subscribe users to a page - actions_excluded.append('SubscribeUser') - # makes it impossible for users to save a raw copy of the markup easy to a file - actions_excluded.append('Save') - - actions_excluded.append('Load') - actions_excluded.append('twikidraw') - actions_excluded.append('anywikidraw') - #check where that in 1.9 is used - #actions_excluded.append('cache') - actions_excluded.append('chart') - # can be removed after language packs are installed - #actions_excluded('LanguageSetup') - actions_excluded.append('pollsistersites') - # language setup only needs to be done after update/reinstall - actions_excluded.append('language_setup') - # don't need a server - actions_excluded.append('serveopenid') - actions_excluded.append('showtags') - actions_excluded.append('sisterpages') - actions_excluded.append('thread_monitor') - - # mail functions. use empty mail_smarthost to disable. - mail_smarthost = 'mail.python.org' - mail_from = 'Python Wiki ' - - language_default = 'en' - language_ignore_browser = True - - page_category_regex = ur'(?PCategory(?P\S+))' - page_dict_regex = ur'(?P(?P\S+)Dict)' - page_group_regex = ur'(?P(?P\S+)Group)' - page_template_regex = ur'(?P(?P\S+)Template)' - - #caching_formats = [] - - # Surge protection; see https://moinmo.in/HelpOnConfiguration/SurgeProtection - surge_action_limits = { # allow max. requests per
secs - # action: (count, dt) - 'show': (100, 60), - 'raw': (20, 40), # some people use this for css - 'AttachFile': (60, 60), - 'diff': (30, 60), - 'fullsearch': (10, 60), - 'edit': (10, 120), - 'rss_rc': (1, 60), - 'default': (60, 60), - } - surge_lockout_time = 120 # secs you get locked out when you ignore warnings - - # Link spam protection for public wikis (uncomment to enable). - # Needs a reliable internet connection. - from MoinMoin.security.antispam import SecurityPolicy - - diff --git a/salt/moin/configs/jython.py b/salt/moin/configs/jython.py deleted file mode 100644 index 7ceb5546..00000000 --- a/salt/moin/configs/jython.py +++ /dev/null @@ -1,156 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a -# western country and you don't know that you use utf-8, you probably want to -# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode -# encoding) you MUST use: coding: utf-8 -# That setting must match the encoding your editor uses when you modify the -# settings below. If it does not, special non-ASCII chars will be wrong. - -""" - MoinMoin - Configuration for a single wiki - - If you run a single wiki only, you can omit the farmconfig.py config - file and just use wikiconfig.py - it will be used for every request - we get in that case. - - Note that there are more config options than you'll find in - the version of this file that is installed by default; see - the module MoinMoin.multiconfig for a full list of names and their - default values. - - Also, the URL http://moinmoin.wikiwikiweb.de/HelpOnConfiguration has - a list of config options. - - @copyright: 2000-2005 by Juergen Hermann - @license: GNU GPL, see COPYING for details. -""" - -from farmconfig import FarmConfig - -class Config(FarmConfig): - - # Wiki identity ---------------------------------------------------- - - # Site name, used by default for wiki name-logo [Unicode] - sitename = u'JythonWiki' - - # Wiki logo. You can use an image, text or both. [Unicode] - # Example: u'My WikiMy Wiki' - # For no logo or text, use '' - logo_string = u'JythonWiki ' - - # The interwiki name used in interwiki links - interwikiname = 'JythonWiki' - - - # Critical setup --------------------------------------------------- - - # Misconfiguration here will render your wiki unusable. Check that - # all directories are accessible by the web server or moin server. - - # If you encounter problems, try to set data_dir and data_underlay_dir - # to absolute paths. - - # Where your mutable wiki pages are. You want to make regular - # backups of this directory. - data_dir = '/data/moin/instances/jython/data/' - - # Where read-only system and help page are. You might want to share - # this directory between several wikis. When you update MoinMoin, - # you can safely replace the underlay directory with a new one. This - # directory is part of MoinMoin distribution, you don't have to - # backup it. - ## data_underlay_dir = '/data/moin/instances/underlay/' - - # This must be '/wiki' for twisted and standalone. For CGI, it should - # match your Apache Alias setting. - ## url_prefix = 'http://wiki.python.org/wiki' - - - # Security ---------------------------------------------------------- - - # Security critical actions (disabled by default) - # Uncomment to enable options you like. - # IMPORTANT: grant yourself admin rights! replace YourName with - # your user name. See HelpOnAccessControlLists for more help. - acl_rights_before = u"BlockedUsersGroup: AdminGroup:read,write,delete,revert,admin" - - # Only users in the NewUsersGroup may edit pages, since we're simply - # getting too much spam and vandalism. MAL 2014-05-31 - acl_rights_default = u"EditorsGroup:read,write,delete,revert All:read" - - # Link spam protection for public wikis (Uncomment to enable) - # Needs a reliable internet connection. - from MoinMoin.security.antispam import SecurityPolicy - - - # User interface ---------------------------------------------------- - - # Add your wikis important pages at the end. It is not recommended to - # remove the default links. Leave room for user links - don't use - # more than 6 short items. - # You MUST use Unicode strings here, but you need not use localized - # page names for system and help pages, those will be used automatically - # according to the user selected language. [Unicode] - navi_bar = [ - # Will use page_front_page, (default FrontPage) - u'%(page_front_page)s', - u'RecentChanges', - u'FindPage', - u'HelpContents', - ] - - # The default theme anonymous or new users get - ##theme_default = 'jythonwiki' - - - # Language options -------------------------------------------------- - - # See http://moinmoin.wikiwikiweb.de/ConfigMarket for configuration in - # YOUR language that other people contributed. - - # The main wiki language, set the direction of the wiki pages - default_lang = 'en' - - # Content options --------------------------------------------------- - - # Show users hostnames in RecentChanges - show_hosts = 1 - - # Enumerate headlines? - show_section_numbers = 0 - - # Charts size, require gdchart (Set to None to disable). - chart_options = {'width': 600, 'height': 300} - - # Enable textchas. - textchas_disabled_group = u"TrustedEditorsGroup" - textchas = { - 'en': { - #u"Type peanut in here:": ur" *(?i)peanut *", - #u"Are you a friend or foe?": ur" *(?i)(friend|foe) *", - #u"Are you a bot, yes or no?": ur" *(?i)(no|yes) *", - #u"Say cheese:": ur" *(?i)cheese *", - #u"Say friend and enter:": ur" *(?i)friend *", - #u"What does J in jython stand for?": ur" *(?i)java *", - # New ones (2013-02-14): - #u"What does Jython's interactive prompt look like?": ur" *>>> *", - #u"Say green but do not say blue.": ur" *(?i)green *", - #u"What is the smallest number in 10, 5, 11, 15?": ur" *(?i)(5|five) *", - #u"What is George Washington's last name?": ur" *(?i)washington *", - #u"How many wings does a typical bird have?": ur" .*(?i)(2|two) .*", - # New ones 2013-03-20: - u"Which programming language does Jython implement?": ur" *(?i)python *", - u"Jython is written in": ur" *(?i)java *", - #u"What does Jython's interactive prompt look like?": ur" *>>> *", - u"What is van Rossum's first name?": ur" *(?i)guido *", - u"Which foundation protects the Jython IP?": ur" *(?i)(psf|python +software +foundation|python +software|python +foundation) *", - u"x = 1; x += 1; x ==": ur" *2 *", - u"x = 2; x /= 2; x ==": ur" *(1|1.0) *", - u"l = [1,2,3]; l.remove(1); l[0] ==": ur" *2 *", - u"l = [1,2,3]; del l[1]; l[0] ==": ur" *1 *", - u"s = 'guido'; s[3:5] ==": ur" *(?i)do *", - u"x = range(10,18,2)[2]; x ==": ur" *14 *", - u"x = map(lambda x:x**2,range(10))[3]; x ==": ur" *9 *", - }, - } diff --git a/salt/moin/configs/logrotate.conf b/salt/moin/configs/logrotate.conf deleted file mode 100644 index 05caa103..00000000 --- a/salt/moin/configs/logrotate.conf +++ /dev/null @@ -1,14 +0,0 @@ -/data/moin/instances/jython/data/event-log -/data/moin/instances/psf/data/event-log -/data/moin/instances/python/data/event-log -{ - rotate 4 - weekly - missingok - notifempty - compress - sharedscripts - postrotate - /etc/init.d/apache2 reload > /dev/null - endscript -} diff --git a/salt/moin/configs/moin.wsgi b/salt/moin/configs/moin.wsgi deleted file mode 100644 index 08ff5c06..00000000 --- a/salt/moin/configs/moin.wsgi +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: iso-8859-1 -*- -""" - MoinMoin - mod_wsgi driver script - - To use this, add those statements to your Apache's VirtualHost definition: - - # you will invoke your moin wiki at the root url, like http://servername/FrontPage: - WSGIScriptAlias / /some/path/moin.wsgi - - # create some wsgi daemons - use someuser.somegroup same as your data_dir: - WSGIDaemonProcess daemonname user=someuser group=somegroup processes=5 threads=10 maximum-requests=1000 umask=0007 - - # use the daemons we defined above to process requests! - WSGIProcessGroup daemonname - - @copyright: 2008 by MoinMoin:ThomasWaldmann - @license: GNU GPL, see COPYING for details. -""" - -import sys, os - -# a) Configuration of Python's code search path -# If you already have set up the PYTHONPATH environment variable for the -# stuff you see below, you don't need to do a1) and a2). - -# a1) Path of the directory where the MoinMoin code package is located. -# Needed if you installed with --prefix=PREFIX or you didn't use setup.py. -#sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages') - -# a2) Path of the directory where wikiconfig.py / farmconfig.py is located. -# See wiki/config/... for some sample config files. -sys.path.insert(0, '/etc/moin') - -# b) Configuration of moin's logging -# If you have set up MOINLOGGINGCONF environment variable, you don't need this! -# You also don't need this if you are happy with the builtin defaults. -# See wiki/config/logging/... for some sample config files. -#from MoinMoin import log -#log.load_config('/path/to/logging_configuration_file') - -from MoinMoin.web.serving import make_application - -# Creating the WSGI application -# use shared=True to have moin serve the builtin static docs -# use shared=False to not have moin serve static docs -# use shared='/my/path/to/htdocs' to serve static docs from that path -application = make_application(shared=True) -#application = make_application(shared=True, trusted_proxies=['140.211.10.66', '127.0.0.1']) - -# Apply proxy fixes to get moin to use HTTPS links -from werkzeug.middleware.proxy_fix import ProxyFix -application = ProxyFix(application) diff --git a/salt/moin/configs/moin_wsgi.py b/salt/moin/configs/moin_wsgi.py deleted file mode 100644 index 00b1b10e..00000000 --- a/salt/moin/configs/moin_wsgi.py +++ /dev/null @@ -1,34 +0,0 @@ -import os -import sys -import urlparse - -from MoinMoin.web.serving import make_application - -sys.path.insert(0, "/etc/moin") -os.environ['PYTHONIOENCODING'] = 'utf-8' - - -class ScriptFixerMiddleware(object): - - def __init__(self, application): - self.application = application - - def __call__(self, environ, start_response): - if not environ.get("SCRIPT_NAME"): - path = environ.get("PATH_INFO", "") - if path.startswith("/"): - path = path[1:] - - parsed = urlparse.urlparse(path) - - script_name = "/".join(parsed.path.split("/")[:1]) - if not script_name.startswith("/"): - script_name = "/" + script_name - - environ["SCRIPT_NAME"] = script_name - environ["PATH_INFO"] = "/".join(parsed.path.split("/")[1:]) - - return self.application(environ, start_response) - - -application = ScriptFixerMiddleware(make_application(shared=False)) diff --git a/salt/moin/configs/ports.apache.conf.jinja b/salt/moin/configs/ports.apache.conf.jinja deleted file mode 100644 index faa76d4e..00000000 --- a/salt/moin/configs/ports.apache.conf.jinja +++ /dev/null @@ -1,3 +0,0 @@ -{% set internal = salt["pillar.get"]("psf_internal_network") %} -Listen {{ salt["network.ip_addrs"](cidr=internal)[0] }}:9000 -Listen 127.0.0.1:9000 diff --git a/salt/moin/configs/psf.py b/salt/moin/configs/psf.py deleted file mode 100644 index 8ccad71f..00000000 --- a/salt/moin/configs/psf.py +++ /dev/null @@ -1,134 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a -# western country and you don't know that you use utf-8, you probably want to -# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode -# encoding) you MUST use: coding: utf-8 -# That setting must match the encoding your editor uses when you modify the -# settings below. If it does not, special non-ASCII chars will be wrong. - -""" - MoinMoin - Configuration for a single wiki - - If you run a single wiki only, you can omit the farmconfig.py config - file and just use wikiconfig.py - it will be used for every request - we get in that case. - - Note that there are more config options than you'll find in - the version of this file that is installed by default; see - the module MoinMoin.multiconfig for a full list of names and their - default values. - - Also, the URL http://moinmoin.wikiwikiweb.de/HelpOnConfiguration has - a list of config options. - - @copyright: 2000-2004 by Juergen Hermann - @license: GNU GPL, see COPYING for details. -""" - -from farmconfig import FarmConfig - -class Config(FarmConfig): - - # Wiki identity ---------------------------------------------------- - - # Site name, used by default for wiki name-logo [Unicode] - sitename = u'PSF Wiki' - - # Wiki logo. You can use an image, text or both. [Unicode] - # Example: u'My WikiMy Wiki' - # For no logo or text, use '' - #logo_string = sitename - logo_string = 'Private PSF Python Wiki' - - # Default theme - theme_default = 'europython' - - # The interwiki name used in interwiki links - interwikiname = None - - - # Critical setup --------------------------------------------------- - - # Misconfiguration here will render your wiki unusable. Check that - # all directories are accessible by the web server or moin server. - - # If you encounter problems, try to set data_dir and data_underlay_dir - # to absolute paths. - - # Where your mutable wiki pages are. You want to make regular - # backups of this directory. - data_dir = '/data/moin/instances/psf/data/' - - # Security ---------------------------------------------------------- - - # Security critical actions (disabled by default) - # Uncomment to enable options you like. - superuser = ['EWDurbin'] - - # IMPORTANT: grant yourself admin rights! replace YourName with - # your user name. See HelpOnAccessControlLists for more help. - acl_rights_before = u"AdminGroup:read,write,delete,revert,admin" - acl_rights_default = u"" - acl_rights_after = u"MembersGroup:read,write,delete,revert All:read" - - # Link spam protection for public wikis (Uncomment to enable) - # Needs a reliable internet connection. - #from MoinMoin.util.antispam import SecurityPolicy - - # Enable textchas. - textchas_disabled_group = u"MembersGroup" - textchas = { - 'en': { - #u"How many words are in this question?": ur" *(7|(?i)seven) *", - #u"What is Abraham Lincoln's first name?": ur" *(?i)abraham *", - #u"What does Python's interactive prompt look like?": ur" *>>> *", - u"What is van Rossum's first name?": ur" *(?i)guido *", - u"Which foundation protects the Python IP?": ur" *(?i)(psf|python +software +foundation|python +software|python +foundation) *", - u"x = 1; x += 1; x ==": ur" *(?i)(2|two) *", - u"x = 2; x /= 2; x ==": ur" *(?i)(1|1.0|one) *", - u"l = [1,2,3]; l.remove(1); l[0] ==": ur" *(?i)(2|two) *", - u"l = [1,2,3]; del l[1]; l[0] ==": ur" *(?i)(1|one) *", - u"s = 'guido'; s[3:5] ==": ur" *['\"]?(?i)do['\"]? *", - u"PyPI is also called": ur" *(?i)(cheese *shop) *", - u"The cheeseshop is also called": ur" *(?i)(py *pi) *", - }, - } - - # Add your wikis important pages at the end. It is not recommended to - # remove the default links. Leave room for user links - don't use - # more than 6 short items. - # You MUST use Unicode strings here, but you need not use localized - # page names for system and help pages, those will be used automatically - # according to the user selected language. [Unicode] - navi_bar = [ - # Will use page_front_page, (default FrontPage) - u'%(page_front_page)s', - u'Contents', - u'RecentChanges', - u'FindPage', - u'HelpContents', - ] - - page_footer2 = '

Unable to view page? See the FrontPage for instructions.

' - - # Language options -------------------------------------------------- - - # See http://moinmoin.wikiwikiweb.de/ConfigMarket for configuration in - # YOUR language that other people contributed. - - # The main wiki language, set the direction of the wiki pages - default_lang = 'en' - - # Content options --------------------------------------------------- - - # Show users hostnames in RecentChanges - show_hosts = 1 - - # Enumerate headlines? - show_section_numbers = 0 - - # Charts size, require gdchart (Set to None to disable). - chart_options = {'width': 600, 'height': 300} - - - diff --git a/salt/moin/configs/python.py b/salt/moin/configs/python.py deleted file mode 100644 index fcfce169..00000000 --- a/salt/moin/configs/python.py +++ /dev/null @@ -1,144 +0,0 @@ -# -*- coding: utf-8 -*- -# IMPORTANT! This encoding (charset) setting MUST be correct! If you live in a -# western country and you don't know that you use utf-8, you probably want to -# use iso-8859-1 (or some other iso charset). If you use utf-8 (a Unicode -# encoding) you MUST use: coding: utf-8 -# That setting must match the encoding your editor uses when you modify the -# settings below. If it does not, special non-ASCII chars will be wrong. - -""" - MoinMoin - Configuration for a single wiki - - If you run a single wiki only, you can omit the farmconfig.py config - file and just use wikiconfig.py - it will be used for every request - we get in that case. - - Note that there are more config options than you'll find in - the version of this file that is installed by default; see - the module MoinMoin.multiconfig for a full list of names and their - default values. - - Also, the URL http://moinmoin.wikiwikiweb.de/HelpOnConfiguration has - a list of config options. - - @copyright: 2000-2004 by Juergen Hermann - @license: GNU GPL, see COPYING for details. -""" - -from farmconfig import FarmConfig -from MoinMoin.auth import MoinAuth -from MoinMoin.auth.openidrp import OpenIDAuth - - -class Config(FarmConfig): - - # Wiki identity ---------------------------------------------------- - - # Site name, used by default for wiki name-logo [Unicode] - sitename = u'Python Wiki' - # Wiki logo. You can use an image, text or both. [Unicode] - # Example: u'My WikiMy Wiki' - # For no logo or text, use '' - #logo_string = sitename - logo_string = 'Python' - - theme_default = 'europython' - - - # The interwiki name used in interwiki links - interwikiname = None - - - # Critical setup --------------------------------------------------- - - # Misconfiguration here will render your wiki unusable. Check that - # all directories are accessible by the web server or moin server. - - # If you encounter problems, try to set data_dir and data_underlay_dir - # to absolute paths. - - # Where your mutable wiki pages are. You want to make regular - # backups of this directory. - data_dir = '/data/moin/instances/python/data/' - - # Security ---------------------------------------------------------- - - # mvl 110304 add openid. requires anonymous sessions - auth = [MoinAuth(),OpenIDAuth()] - cookie_lifetime=(1,12) - superuser = ['EWDurbin'] - - # Security critical actions (disabled by default) - # Uncomment to enable options you like. - - # IMPORTANT: grant yourself admin rights! replace YourName with - # your user name. See HelpOnAccessControlLists for more help. - acl_rights_before = u"BlockedUsersGroup: AdminGroup:read,write,delete,revert,admin" - - # Only users in the NewUsersGroup may edit pages, since we're simply - # getting too much spam and vandalism. MAL 2014-05-31 - acl_rights_default = u"EditorsGroup:read,write,delete,revert All:read" - - # Link spam protection for public wikis (Uncomment to enable) - # Needs a reliable internet connection. - from MoinMoin.security.antispam import SecurityPolicy - - # Enable textchas. - textchas_disabled_group = u"TrustedEditorsGroup" - textchas = { - 'en': { - #u"How many words are in this question?": ur" *(7|(?i)seven) *", - #u"What is Abraham Lincoln's first name?": ur" *(?i)abraham *", - #u"What does Python's interactive prompt look like?": ur" *>>> *", - u"What is van Rossum's first name?": ur" *(?i)guido *", - u"Which foundation protects the Python IP?": ur" *(?i)(psf|python +software +foundation|python +software|python +foundation) *", - u"x = 1; x += 1; x ==": ur" *(?i)(2|two) *", - u"x = 2; x /= 2; x ==": ur" *(?i)(1|1.0|one) *", - u"l = [1,2,3]; l.remove(1); l[0] ==": ur" *(?i)(2|two) *", - u"l = [1,2,3]; del l[1]; l[0] ==": ur" *(?i)(1|one) *", - u"s = 'guido'; s[3:5] ==": ur" *['\"]?(?i)do['\"]? *", - u"PyPI is also called": ur" *(?i)(cheese *shop) *", - u"The cheeseshop is also called": ur" *(?i)(py *pi) *", - }, - } - - # Mail -------------------------------------------------------------- - - # User interface ---------------------------------------------------- - - # Add your wikis important pages at the end. It is not recommended to - # remove the default links. Leave room for user links - don't use - # more than 6 short items. - # You MUST use Unicode strings here, but you need not use localized - # page names for system and help pages, those will be used automatically - # according to the user selected language. [Unicode] - navi_bar = [ - # Will use page_front_page, (default FrontPage) - u'%(page_front_page)s', - u'RecentChanges', - u'FindPage', - u'HelpContents', - ] - - page_footer2 = '

Unable to edit the page? See the FrontPage for instructions.

' - - # Language options -------------------------------------------------- - - # See http://moinmoin.wikiwikiweb.de/ConfigMarket for configuration in - # YOUR language that other people contributed. - - # The main wiki language, set the direction of the wiki pages - default_lang = 'en' - - # Content options --------------------------------------------------- - - # Show users hostnames in RecentChanges - show_hosts = 1 - - # Enumerate headlines? - show_section_numbers = 0 - - # Charts size, require gdchart (Set to None to disable). - chart_options = {'width': 600, 'height': 300} - - #show_timings = True diff --git a/salt/moin/configs/shared_intermap.txt b/salt/moin/configs/shared_intermap.txt deleted file mode 100644 index a14834e1..00000000 --- a/salt/moin/configs/shared_intermap.txt +++ /dev/null @@ -1,5 +0,0 @@ -PEP http://www.python.org/dev/peps/pep-$PAGE/ -SF http://bugs.python.org/issue$PAGE -PythonMac http://pythonmac.org/wiki/ -WxPython http://wiki.wxpython.org/index.cgi/ -ISBN http://www.amazon.com/exec/obidos/ASIN/$PAGE/pythonsoftwar-20 diff --git a/salt/moin/configs/wiki-static.conf b/salt/moin/configs/wiki-static.conf new file mode 100644 index 00000000..a032d68b --- /dev/null +++ b/salt/moin/configs/wiki-static.conf @@ -0,0 +1,19 @@ +server { + listen 9000 ssl; + server_name wiki.python.org wiki.jython.org moin.psf.io; + + ssl_certificate /etc/ssl/private/moin.psf.io.pem; + ssl_certificate_key /etc/ssl/private/moin.psf.io.pem; + + include fastly_params; + + error_log /var/log/nginx/wiki-static.error.log; + access_log /var/log/nginx/wiki-static.access.log main; + + root /data/www/wiki-static; + + location / { + index index.html; + try_files $uri $uri/ =404; + } +} diff --git a/salt/moin/configs/wiki.python.org.conf b/salt/moin/configs/wiki.python.org.conf deleted file mode 100644 index 15cd66cf..00000000 --- a/salt/moin/configs/wiki.python.org.conf +++ /dev/null @@ -1,80 +0,0 @@ - - ServerName moin.psf.io - ServerAlias wiki.python.org - ServerAlias wiki.jython.org - ServerAlias moin.nyc1.psf.io - - ServerAdmin webmaster@python.org - DocumentRoot /data/www/wiki - - # SSL settings - SSLEngine on - SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH EDH+aRSA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4" - SSLProtocol +TLSv1.2 - SSLCertificateKeyFile /etc/ssl/private/moin.psf.io.pem - SSLCertificateFile /etc/ssl/private/moin.psf.io.pem - #SSLCertificateKeyFile /etc/lego/certificates/wiki.python.org.key - #SSLCertificateFile /etc/lego/certificates/wiki.python.org.crt - #SSLCertificateChainFile /etc/lego/certificates/wiki.python.org.issuer.crt - - LogFormat "%h %l %u %t \"%r\" %>s %O %D \"%{Referer}i\" \"%{User-Agent}i\"" psf_moin - - CustomLog /var/log/apache2/wiki.access.log psf_moin - ErrorLog /var/log/apache2/wiki.error.log - #LogLevel info - LogLevel error - - - Require all granted - - - Require all granted - - - RemoteIPHeader X-Forwarded-For - RemoteIPInternalProxy 127.0.0.1 - RemoteIPInternalProxy {{ pillar["psf_internal_network"] }} - - Alias /wiki/python /data/moin/europython - Alias /wiki/europython /data/moin/europython - Alias /wiki /srv/moin/venv/lib/python2.7/site-packages/MoinMoin/web/static/htdocs - Alias /common /srv/moin/venv/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/common - - WSGIDaemonProcess moin processes=8 request-timeout=60 maximum-requests=100 restart-interval=600 graceful-timeout=45 display-name=wsgi-moin user=moin group=moin python-path=/srv/moin/venv/lib/python2.7/site-packages - WSGIProcessGroup moin - - SetEnvIf User-Agent SeznamBot bad_ua - - - # Spammers - # deny from xxx.xxx.xxx.xxx - deny from env=bad_ua - - - - SetHandler server-status - Require local - - - WSGIScriptAlias /moin /srv/moin/moin.wsgi - - # Spammers - # deny from xxx.xxx.xxx.xxx - deny from env=bad_ua - - - WSGIScriptAlias /psf /srv/moin/moin.wsgi - - # Spammers - # deny from xxx.xxx.xxx.xxx - deny from env=bad_ua - - - WSGIScriptAlias /jython /srv/moin/moin.wsgi - - # Spammers - # deny from xxx.xxx.xxx.xxx - deny from env=bad_ua - - - diff --git a/salt/moin/init.sls b/salt/moin/init.sls index bd4c8bc0..ba28ebbe 100644 --- a/salt/moin/init.sls +++ b/salt/moin/init.sls @@ -1,300 +1,32 @@ -moin: - group.present: - - system: True +include: + - nginx - user.present: - - home: /srv/moin - - groups: - - moin - - require: - - group: moin - -moin-pkgs: - pkg.installed: - - pkgs: - - build-essential - - python-docutils - - python-gdchart2 - - python-xapian - - python2.7 - - python2.7-dev - - curl - -www-data: - user.present: - - groups: - - www-data - - moin - - require: - - user: moin - - pkg: moin-pkgs - -pip: - cmd.run: - - name: curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - - creates: /usr/local/bin/pip2.7 - - umask: "022" - -virtualenv: - cmd.run: - - name: /usr/local/bin/pip2.7 install "virtualenv<21" - - creates: /usr/local/bin/virtualenv - - umask: "022" - -/srv/moin/venv: - virtualenv.managed: - - user: moin - - system_site_packages: True - - virtualenv_bin: /usr/local/bin/virtualenv - - python: /usr/bin/python2.7 - - require: - - cmd: virtualenv - - pip_pkgs: - - moin==1.9.11 - - python-openid==2.2.5 - -/srv/moin/moin.wsgi: - file.managed: - - source: salt://moin/configs/moin.wsgi - - user: moin - - group: moin - - mode: "0644" - - require: - - user: moin - - group: moin - -/etc/moin: +/data/www/wiki-static: file.directory: - user: root - group: root - dir_mode: "0755" + - makedirs: True -/etc/moin/python.py: - file.managed: - - source: salt://moin/configs/python.py - - template: jinja - - user: root - - group: root - - mode: "0644" - - require: - - file: /etc/moin - -/etc/moin/psf.py: - file.managed: - - source: salt://moin/configs/psf.py - - template: jinja - - user: root - - group: root - - mode: "0644" - - require: - - file: /etc/moin - -/etc/moin/jython.py: - file.managed: - - source: salt://moin/configs/jython.py - - template: jinja - - user: root - - group: root - - mode: "0644" - - require: - - file: /etc/moin - -/etc/moin/farmconfig.py: +/etc/nginx/sites.d/wiki-static.conf: file.managed: - - source: salt://moin/configs/farmconfig.py - - template: jinja + - source: salt://moin/configs/wiki-static.conf - user: root - group: root - mode: "0644" - require: - - file: /etc/moin - - file: /etc/moin/python.py - - file: /etc/moin/psf.py - - file: /etc/moin/jython.py + - file: /etc/nginx/sites.d/ + - pkg: nginx -/etc/moin/shared_intermap.txt: - file.managed: - - source: salt://moin/configs/shared_intermap.txt - - user: root - - group: root - - mode: "0644" - - require: - - file: /etc/moin - -apache2: - pkg.installed: - - pkgs: - - apache2 - - libapache2-mod-wsgi - service.running: - - enable: True - - reload: True - - require: - - pkg: apache2 - - watch: - - file: /etc/apache2/* - - file: /etc/apache2/sites-available/* - - file: /etc/apache2/sites-enabled/* - - file: /etc/apache2/mods-enabled/* - - file: /etc/ssl/private/moin.psf.io.pem - -/etc/apache2/mods-enabled/remoteip.load: - file.symlink: - - target: /etc/apache2/mods-available/remoteip.load - -/etc/apache2/mods-enabled/headers.load: - file.symlink: - - target: /etc/apache2/mods-available/headers.load - -/etc/apache2/mods-enabled/rewrite.load: - file.symlink: - - target: /etc/apache2/mods-available/rewrite.load - -/etc/apache2/mods-enabled/socache_shmcb.load: - file.symlink: - - target: /etc/apache2/mods-available/socache_shmcb.load - -/etc/apache2/mods-enabled/ssl.load: - file.symlink: - - target: /etc/apache2/mods-available/ssl.load - -/etc/apache2/mods-enabled/ssl.conf: - file.symlink: - - target: /etc/apache2/mods-available/ssl.conf - -/etc/apache2/mods-enabled/wsgi.load: - file.symlink: - - target: /etc/apache2/mods-available/wsgi.load - -/etc/apache2/mods-enabled/wsgi.conf: - file.symlink: - - target: /etc/apache2/mods-available/wsgi.conf - -/etc/apache2/ports.conf: - file.managed: - - source: salt://moin/configs/ports.apache.conf.jinja - - template: jinja - - user: root - - group: root - - mode: "0644" - - require: - - pkg: apache2 - -/etc/apache2/sites-available/wiki.python.org.conf: - file.managed: - - template: jinja - - source: salt://moin/configs/wiki.python.org.conf - - user: root - - group: root - - mode: "0644" - - require: - - pkg: apache2 - -/etc/apache2/sites-enabled/wiki.python.org.conf: - file.symlink: - - target: ../sites-available/wiki.python.org.conf - - user: root - - group: root - - mode: "0644" - -/etc/consul.d/service-moin.json: +/etc/consul.d/service-wiki.json: file.managed: - source: salt://consul/etc/service.jinja - template: jinja - context: - name: moin + name: wiki port: 9000 - user: root - group: root - mode: "0644" - require: - pkg: consul-pkgs - -/srv/moin/bin: - file.directory: - - user: moin - - group: moin - - mode: "0750" - - require: - - user: moin - - group: moin - -/srv/moin/bin/moin_maint_cleansessions.sh: - file.managed: - - source: salt://moin/scripts/moin_maint_cleansessions.sh - - user: moin - - group: moin - - mode: "0750" - - require: - - file: /srv/moin/bin - cron.present: - - user: moin - - hour: '*/6' - - minute: 0 - - require: - - file: /srv/moin/bin/moin_maint_cleansessions.sh - -/srv/moin/bin/moin_maint_cleansessions_all.sh: - file.managed: - - source: salt://moin/scripts/moin_maint_cleansessions_all.sh - - user: moin - - group: moin - - mode: "0750" - - require: - - file: /srv/moin/bin - cron.present: - - user: moin - - dayweek: mon - - hour: 3 - - minute: 0 - - require: - - file: /srv/moin/bin/moin_maint_cleansessions_all.sh - -/srv/moin/bin/moin_maint_cleanpage.sh: - file.managed: - - source: salt://moin/scripts/moin_maint_cleanpage.sh - - user: moin - - group: moin - - mode: "0750" - - require: - - file: /srv/moin/bin - cron.present: - - user: moin - - dayweek: sun - - hour: 3 - - minute: 0 - - require: - - file: /srv/moin/bin/moin_maint_cleanpage.sh - -/srv/moin/bin/moin_maint_index_rebuild.sh: - file.managed: - - source: salt://moin/scripts/moin_maint_index_rebuild.sh - - user: moin - - group: moin - - mode: "0750" - - require: - - file: /srv/moin/bin - cron.present: - - user: moin - - hour: 4 - - minute: 0 - - require: - - file: /srv/moin/bin/moin_maint_index_rebuild.sh - -/etc/logrotate.d/moin: - file.managed: - - source: salt://moin/configs/logrotate.conf - - user: root - - group: root - - mode: "0644" - -restart-apache2: - cron.present: - - name: /usr/bin/systemctl stop apache2; sleep 5; /usr/bin/systemctl start apache2 - - user: root - - minute: '0' - - hour: '4' - - daymonth: '*' - - month: '*' - - dayweek: '*' - - comment: 'Daily Apache2 restart for Moin wiki' diff --git a/salt/moin/scripts/moin_maint_cleanpage.sh b/salt/moin/scripts/moin_maint_cleanpage.sh deleted file mode 100644 index cfdab916..00000000 --- a/salt/moin/scripts/moin_maint_cleanpage.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -# Script to clean up unused and deleted wiki pages. -# -# This script has to be run using a cronjob once a day to -# prevent the number of unused pages from blowing up. -# -# WARNING: This script may only be run as moin user. -# - -# Make sure only moin can run our script -if [ "$(id -nu)" != "moin" ]; then - echo "This script must be run as moin user" 1>&2 - exit 1 -fi - -# Globals -DATE=`date +'%Y-%m-%d-%H%M%S'` - -# Clean sessions -cd /srv/moin/ -. venv/bin/activate - -# Clean up Python wiki -cd /data/moin/instances/python/data -echo "Clean up Python wiki..." -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/moin maint cleanpage > cleanpage.sh -# create maintenance dirs -mkdir trash deleted -# move the pages to trash/ and deleted/ -bash ./cleanpage.sh -# archive cleanup -tar cfz ../maintenance/$DATE.tgz cleanpage.sh deleted/ trash/ -rm -rf cleanpage.sh deleted trash - -# Clean up PSF wiki -cd /data/moin/instances/psf/data -echo "Clean up PSF wiki..." -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/psf maint cleanpage > cleanpage.sh -# create maintenance dirs -mkdir trash deleted -# move the pages to trash/ and deleted/ -bash ./cleanpage.sh -# archive cleanup -tar cfz ../maintenance/$DATE.tgz cleanpage.sh deleted/ trash/ -rm -rf cleanpage.sh deleted trash - -# Clean up Jython wiki -cd /data/moin/instances/jython/data -echo "Clean up Jython wiki..." -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/jython maint cleanpage > cleanpage.sh -# create maintenance dirs -mkdir trash deleted -# move the pages to trash/ and deleted/ -bash ./cleanpage.sh -# archive cleanup -tar cfz ../maintenance/$DATE.tgz cleanpage.sh deleted/ trash/ -rm -rf cleanpage.sh deleted trash diff --git a/salt/moin/scripts/moin_maint_cleansessions.sh b/salt/moin/scripts/moin_maint_cleansessions.sh deleted file mode 100644 index d1e06551..00000000 --- a/salt/moin/scripts/moin_maint_cleansessions.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# Script to clean up the outdated MoinMoin sessions. -# -# This script has to be run using a cronjob at least once a day -# to prevent the number of used inodes from blowing up. -# -# WARNING: This script may only be run as moin user. -# - -# Make sure only moin can run our script -if [ "$(id -nu)" != "moin" ]; then - echo "This script must be run as moin user" 1>&2 - exit 1 -fi - -# Clean sessions -cd /srv/moin/ -. venv/bin/activate -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/moin maint cleansessions -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/jython maint cleansessions -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/psf maint cleansessions diff --git a/salt/moin/scripts/moin_maint_cleansessions_all.sh b/salt/moin/scripts/moin_maint_cleansessions_all.sh deleted file mode 100644 index 0d7d6903..00000000 --- a/salt/moin/scripts/moin_maint_cleansessions_all.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# Script to clean out all MoinMoin sessions (including ones which -# are marked to not expire). -# -# This script should be run every week or month to prevent the -# number of used inodes from blowing up. -# -# WARNING: This script may only be run as moin user. -# - -# Make sure only moin can run our script -if [ "$(id -nu)" != "moin" ]; then - echo "This script must be run as moin user" 1>&2 - exit 1 -fi - -# Clean sessions -cd /srv/moin/ -. venv/bin/activate -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/moin maint cleansessions --all -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/jython maint cleansessions --all -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/psf maint cleansessions --all diff --git a/salt/moin/scripts/moin_maint_index_rebuild.sh b/salt/moin/scripts/moin_maint_index_rebuild.sh deleted file mode 100644 index 526acd32..00000000 --- a/salt/moin/scripts/moin_maint_index_rebuild.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Script to rebuild the MoinMoin Xapian indexes. -# -# WARNING: This script may only be run as moin user. -# - -# Make sure only moin can run our script -if [ "$(id -nu)" != "moin" ]; then - echo "This script must be run as moin user" 1>&2 - exit 1 -fi - -# Rebuild indexes -cd /srv/moin/ -. venv/bin/activate - -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/moin index build --mode=rebuild -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/jython index build --mode=rebuild -moin --config-dir=/etc/moin --wiki-url=http://wiki.python.org/psf index build --mode=rebuild