Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Setting up MoinMoin in a FreeNAS 11.2 iocage jail ====== Create a jail and attach the storage into the JAIL at this location: /usr/local/www/wiki/data {{:blog:moin-jail-mount.png}} Login to the jail and install moin this version will do nicely. <code> # pkg search moin moinmoin-1.9.10 Easy to use, full-featured and extensible wiki software package </code> Install MoinMoin and run the recommend steps installing from a package. <code> # pkg install -y moinmoin </code> Setup for WSGI <code bash> export MOINSCRIPT="moin.wsgi" export MOINDIR="/usr/local/share/moin" export MOINDEST="/usr/local/www/wiki" export CGIUSER="www" export CGIGROUP="www" mkdir -p ${MOINDEST}/data mkdir -p ${MOINDEST}/underlay cp -R ${MOINDIR}/data ${MOINDEST} cp -R ${MOINDIR}/underlay ${MOINDEST} chmod -R u+rw,go-ws ${MOINDEST}/data install -m 0555 ${MOINDIR}/config/wikiconfig.py ${MOINDEST} test -z "${MOINSCRIPT}" || \ install -m 0555 ${MOINDIR}/server/${MOINSCRIPT} ${MOINDEST} chown -R ${CGIUSER}:${CGIGROUP} ${MOINDEST} </code> ===== NGINX setup===== Based very closely around * https://wiki.freebsd.org/Ports/www/moinmoin Install nginx and uwsgi server <code> pkg install -y nginx uwsgi </code> Replace /usr/local/etc/nginx/nginx.conf with <code> worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name wiki.local; location / { uwsgi_pass unix:/var/run/moin.sock; include uwsgi_params; } location ~ ^/moin_static[0-9]+/(.*) { alias /usr/local/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/$1; } } } </code> NOTE: Its important to access the server by a DNS name in the nginx.conf file that resolves to the jail IP. Not doing this will result in the NGINX server not being able to correctly lookup the static content. Append to /etc/rc.conf <code> uwsgi_enable="YES" uwsgi_configfile="/usr/local/www/wiki/uwsgi.ini" uwsgi_uid="www" uwsgi_gid="www" nginx_enable="YES" </code> Create /usr/local/www/wiki/uwsgi.ini <code ini> [uwsgi] socket = /var/run/moin.sock chmod-socket = 660 chdir = /usr/local/www/wiki wsgi-file = moin.wsgi master workers = 3 max-requests = 200 harakiri = 30 die-on-term </code> ===== Wiki config ===== Allow anybody to edit anything and for them to create their own account. Add the acl_rights_default entries and uncomment page_front_page and actions_superuser. /usr/local/www/wiki/wikiconfig.py <code python> class Config(multiconfig.DefaultConfig): # Critical setup --------------------------------------------------- # Directory containing THIS wikiconfig: wikiconfig_dir = os.path.abspath(os.path.dirname(__file__)) acl_rights_default = u"All:read,write,delete,revert,admin" page_front_page = u'FrontPage' actions_superuser = multiconfig.DefaultConfig.actions_superuser[:] actions_superuser.remove('newaccount') </code> Start it up <code> service uwsgi start service ngnix start </code> ===== Xapian ===== Speeding up searching by enabling xapian <code> pkg install xapian-core py27-xapian </code> /usr/local/www/wiki/wikiconfig.py <code py> xapian_search = True xapian_stemming = True </code> Restart <code> service uwsgi restart </code> You can check to see if its enabled by navigating to SystemInfo ===== Installing the umlsequence diagram plugin ===== Grab the plugin: https://moinmo.in/ParserMarket/UmlSequence and install the file umlsequence.py into /usr/local/www/wiki/data/plugin/parser/ File with all modification presented below: {{ :blog:umlsequence.zip |}} Install additional packages into the jail: * plotutils -> supplies pic2plot * ImageMagick7-nox11 -> supplied convert <code> pkg update -f pkg install plotutils pkg install ImageMagick7-nox11 </code> We need to edit the umlsequence.py source code to adjust where the required utilities are installed. pic2plot path change <code> # Launch pic2plot => postscript os.system ('/usr/local/bin/pic2plot -T ps "%s" > "%s" 2>"%s"' % (pic, ps, err)) </code> The convert program would not run with just the path to the program. The path /usr/local/bin has to be in the PATH env var. <code> # Run the postprocessing/conversion chain cmd = 'PATH=$PATH:/usr/local/bin convert -density %dx%d "%s" "%s"' % (opt_percent, opt_percent, ps, pngpath) os.system(cmd) </code> ==== Enabling the alternative format specification ==== The src code was modified to include the alt= switch so that original and alternative could be supported in the wiki. <code> *************** *** 804,813 **** --- 804,815 ---- opt_dbg = False opt_help = None opt_percent = 100 + opt_alt = False for (key, val) in self.attrs.items (): val = val [1:-1] if key == 'debug': opt_dbg = int (val) elif key == 'help': opt_help = val + elif key == 'alt': opt_alt = True elif key == 'percent': opt_percent = int (val) else: self.request.write (formatter.rawHTML (""" *************** *** 845,851 **** lines = raw.split ('\n') # alternate syntax support ! lines = self._convert_from_alternate_1 (lines) # debug ? post-print if opt_dbg==2: --- 847,854 ---- lines = raw.split ('\n') # alternate syntax support ! if opt_alt: ! lines = self._convert_from_alternate_1 (lines) # debug ? post-print if opt_dbg==2: </code> Using the alternate format to draw diagrams <code> {{{#!umlsequence alt=1 S : s:Switch P : p:Pump S -> P run() S -> P stop() }}} </code> {{:blog:autogenerated--umlsequence-parser--357f3dbd7ee218986aa7756eb799090202e72976.png|}} The original syntax * http://www.spinellis.gr/umlgraph/doc/index.html <code> {{{#!umlsequence # Object definition object(S,"s:Switch"); object(P,"p:Pump"); # Message exchange message(S,P,"run()"); message(S,P,"stop()"); # Object lifeline completion complete(S); complete(P); }}} </code> {{:blog:autogenerated--umlsequence-parser--1401eea742299922731372bcf85288fe16ec2ed2.png|}} {{tag>freenas moinmoin wiki jail iocage}} ~~LINKBACK~~ blog/setting_up_moinmoin_in_a_freenas_11.2_iocage_jail.txt Last modified: 2019/06/25 23:46by brett