User:Bourke/Trac

MPDL

trac
trac project at edgewall installiert ist version 0.12.2

André handover documentation on trac.

Tracsetup

create a new trac project

link between trac project and subversion repository via project admin repositories (default svn repository location is correct: /var/lib/svn/repos/hosting). then resynchronizse via trac-admin.

TODO: the trac project at freshmeat.net can be subscribed for security advisories and updates.

nutzerverwaltung
account-maske

accountlist

Openid server (account-manager) maintains the /var/auth/htpasswd (alternative, use htpasswd utility)

vm43:1 11:17:36 /var/openid # ps aux|grep openid openid   3965  0.0  0.0  11148  1136 ? S   Nov10   0:00 /bin/sh /var/openid/openid/AppServer -d /var/openid/openid openid   3967  0.2  0.6 306724 25216 ? Sl  Nov10 134:17 /var/openid/bin/python Launch.py ThreadedAppServer -d /var/openid/openid

served via /etc/nginx.conf

location /accounts { proxy_pass http://127.0.0.1:8089; }

Trac plugins
2 plugins (written by A. Wobst) for vlib only. listtags (list items having a particular tag) and tracfeed (rss-feed are made visible in trace pages). Vlib needs both of these (and they existed in similar forms in earlier trac versions).

direct access t otrac db
for example, display all uses of a TagIt macros across all wiki dbs.

srvd:/var/trac/projects# for d in *; do echo -e "$d "; echo "select count(*),name from wiki where text like '%TagIt(%' group by name;"|sqlite3 $d/db/trac.db;done

trac@lrdev:~/projects/epubtk$ echo "select text from wiki;"|sqlite3 db/trac.db|sed '/TagIt(/!d;s/.*TagIt/TagIt/;s/).*/)/'|sort|uniq

documentation / best practise in trac
SubversionSetup

CreateSubversionRepository

MLReswatch
auf vm43 user mlreswatch

vm43:5 15:40:23 /usr/local # su - mlreswatch mlreswatch@vm43:5 15:40:35 ~ > crontab -l PYTHON=/usr/local/mlreswatch/bin/python CRONPY=/usr/local/mlreswatch/mlreswatch/cron.py CFG=/usr/local/mlreswatch/mlreswatch/prod.cfg LOGDIR=/var/lib/mlreswatch/logs 11 17 * * * ${PYTHON} ${CRONPY} basic ${CFG} > ${LOGDIR}/mlreswatch_basic 2>&1 03 21 * * mon ${PYTHON} ${CRONPY} extended ${CFG} MPG01 > ${LOGDIR}/mlreswatch_extended 2>&1 03 21 * * tue ${PYTHON} ${CRONPY} extended ${CFG} MPG02 > ${LOGDIR}/mlreswatch_extended 2>&1 03 21 * * wed ${PYTHON} ${CRONPY} extended ${CFG} MPG03 > ${LOGDIR}/mlreswatch_extended 2>&1 03 21 * * thu ${PYTHON} ${CRONPY} extended ${CFG} MPG04 > ${LOGDIR}/mlreswatch_extended 2>&1 03 21 * * fri ${PYTHON} ${CRONPY} extended ${CFG} MPG05 > ${LOGDIR}/mlreswatch_extended 2>&1 03 21 * * sat ${PYTHON} ${CRONPY} extended ${CFG} MPG06 > ${LOGDIR}/mlreswatch_extended 2>&1 03 21 * * sun ${PYTHON} ${CRONPY} extended ${CFG} MPG07 > ${LOGDIR}/mlreswatch_extended 2>&1
 * 1) DO NOT EDIT THIS FILE - edit the master and reinstall.
 * 2) (/tmp/crontab.XXXXXd8vfm installed on Tue Dec  6 11:44:12 2011)
 * 3) (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
 * 1) mlreswatch
 * 1) mlreswatch

mlreswatch@vm43:5 15:40:38 ~ > ps aux|grep mlres root    14463  0.3  5.7 526232 232488 ? Sl  Dec01  90:36 /usr/local/mlreswatch/bin/python -- /usr/local/mlreswatch/mlreswatch/start-mlreswatch.py /usr/local/mlreswatch/mlreswatch/prod.cfg 468     16356  0.0  0.0  11148  1348 ?        Ss   Dec15   0:00 /bin/sh -c ${PYTHON} ${CRONPY} basic ${CFG} > ${LOGDIR}/mlreswatch_basic 2>&1 468     16357  0.0  2.6 275232 106224 ?       Sl   Dec15   0:52 /usr/local/mlreswatch/bin/python /usr/local/mlreswatch/mlreswatch/cron.py basic /usr/local/mlreswatch/mlreswatch/prod.cfg

Userids anlegen über htpasswd2 /etc/auth/mlreswatch-htpasswd bourke

Zugriff über mlreswatch web-frontend

mdbase
unter vm43.mpdl.mpg.de (devtools) unter /var/auth

vm43:1 10:57:02 /var/auth # ls htpasswd  nginx_mdbase_allow

nginx_mdbase_allow wird automatisch erzeugt aus

Unter /etc/nginx hauptkonfigurationsdatei nginx.conf


 * 1) section: allow access from ip-addres in /var/auth/nginx_mdbase_allow

location /mdbase {           location ~ /\.svn/ { deny all; } include /var/auth/nginx_mdbase_allow; deny  all; root  /var/lib/svn/checkouts; autoindex on; }

automatic creation of nginx_mdbase_allow

vm43:1 11:04:49 /etc/nginx # cat /etc/cron.d/crontab 58 23 * * * root /usr/bin/python /etc/config_repos/vm43.mpdl.mpg.de/scripts/update_mpgintern.py

fetches ip-addresses from http://www.mpdl.mpg.de/seco-irmapubl/exportcidr (margit palzenberger) and updates local file then restarts nginx

db
pg version 8.3.1

postgres db tinyurl, owner tinyurl

tinyurl=> \d List of relations Schema |     Name      |   Type   |  Owner ++--+- public | tinyurl       | table    | tinyurl public | tinyurl_id_seq | sequence | tinyurl (2 rows)

tinyurl=> \d tinyurl; Table "public.tinyurl" Column |      Type        |                      Modifiers +---+-- id    | integer           | not null default nextval('tinyurl_id_seq'::regclass) url   | character varying | Indexes: "tinyurl_pkey" PRIMARY KEY, btree (id) "tinyurl_url_index" btree (url)

tinyurl=> select count(*) from tinyurl; count

566368 (1 row)

abfrage dauert 2 minuten (io bound).

total size of table on disk: 286 MB

MPDLMonitor
läuft auf vm41

erreichbar (dauert!) über http://vm41.mpdl.mpg.de/monitor/cgi

run via

13 * * * * root /usr/bin/python /usr/local/monitor/cronjob.py --db=/var/monitor/db.sqlite --email=forkel@mpdl.mpg.de,wobsta@livingreviews.org --smtp=localhost
 * 1) cat /etc/cron.d/vm41.mpdl.mpg.de
 * 2) 45 * * * * root /bin/echo `/bin/date` >> /root/test.log
 * 1) 13 3 1 * * root /usr/bin/python /usr/local/monitor/cronjob.py --db=/var/monitor/db.sqlite rotatedb

"configured" directly in python script /usr/local/monitor/cronjob.py

for example:

'misc': [ HttpStatusTest(           'brill@ingentaconnect',            'http://www.ingentaconnect.com/content/brill',            200,            email_on_fail='overkamp@mpdl.mpg.de',            ), HttpStatusTest(           'pubman',            'http://pubman.mpdl.mpg.de/pubman/',            200,            email_on_fail='pubman-support@gwdg.de',            ),

vm42
sporadische Alarms

vm43 / devtools
vm43: subversion, trac, mdbase checkout, mlreswatch. documented at

projects/hosting/vm43

documentation of the old (golm) environment
setup in golm