« メールで受け取ったファイルをSVNに登録する | トップページ | kanonをTrac1.0.1+MySQL対応に変更してみた »

2013年11月11日 (月)

kanonをTrac1.0.1対応に変更してみた

Tracを利用して社内システムを構築しようということになり、どうせならTracのバージョンを最新にあげたいなぁということでやってみました。確認したのはCentOS6.4のminimalインストールの状態から新規インストールしてSampleProjectを使ってみて問題がないかの確認だけです。超危険なので参考ということで…

やった内容は
  1. kanon-setupの修正
    • ネット上のリポジトリにSVNだけでなくGit,Hgを使えるように修正
    • Genshiのバージョン指定を外す
    • Babelのバージョン指定を外す
    • Tracは1.0.1を指定する
    • TracGitは標準になったのでインストールしない
    • TracMercurialはedgewallのhgから持ってくる
  2. resourceフォルダのplugin
    • Batchmodifyは標準になったのでインストールしない
    • Macropostはtrac-hacksのリポジトリから持ってくる
    • Themeengineリポジトリからインストール
    • ticketcloneは標準なのでインストールしない
  3. pluginlistにあるもの
    • tracsteinschartは動かなかったのでインストールしないことにした
  4. common/trac.iniのComponentから削除
    • ticket_clone.simpleticketclonebutton
    • batchmod.web_ui.*
  5. common/trac.iniのComponentに追加
    • tracopt.mimeview.enscript.enscriptrenderer = enabled
    • tracopt.mimeview.php.phprenderer = enabled
    • tracopt.perm.authz_policy.authzpolicy = enabled
    • tracopt.perm.config_perm_provider.extrapermissionsprovider = enabled
    • tracopt.ticket.clone.ticketclonebutton = enabled
    • tracopt.versioncontrol.git.git_fs.csetpropertyrenderer = enabled
    • tracopt.versioncontrol.git.git_fs.gitconnector = enabled
    • tracopt.versioncontrol.git.git_fs.gitwebprojectsrepositoryprovider = enabled
    • tracopt.versioncontrol.svn.svn_fs.subversionconnector = enabled
    • tracopt.versioncontrol.svn.svn_prop.subversionmergepropertydiffrenderer = enabled
    • tracopt.versioncontrol.svn.svn_prop.subversionmergepropertyrenderer = enabled
    • tracopt.versioncontrol.svn.svn_prop.subversionpropertyrenderer = enabled
パッチ
diff -r 6f8292651be4 etc/opt/kanon/trac-template/common/trac-1.0.ini
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/opt/kanon/trac-template/common/trac-1.0.ini   Mon Nov 11 23:08:37 2013 +0900
@@ -0,0 +1,214 @@
+# -*- coding: utf-8 -*-
+
+[attachment]
+max_size = 262144
+render_unsafe_content = false
+
+[browser]
+downloadable_paths = *
+hide_properties = svk:merge
+
+[changeset]
+max_diff_bytes = 10000000
+max_diff_files = 0
+wiki_format_messages = true
+
+[header_logo]
+alt =
+height = -1
+link = /trac
+src=site/logo.png
+width = -1
+
+[logging]
+log_file = trac.log
+log_level = INFO
+log_type = file
+
+[mimeviewer]
+enscript_modes = text/x-dylan:dylan:4
+enscript_path = enscript
+max_preview_size = 262144
+mime_map = text/x-trac-wiki:wiki
+php_path = php
+silvercity_modes =
+tab_width = 8
+
+[notification]
+always_notify_owner = false
+always_notify_reporter = false
+always_notify_updater = true
+ambiguous_char_width = double
+mime_encoding = base64
+smtp_always_bcc =
+smtp_always_cc =
+smtp_default_domain =
+smtp_enabled = false
+smtp_from = trac@localhost
+smtp_password =
+smtp_port = 25
+smtp_replyto = trac@localhost
+smtp_server = localhost
+smtp_subject_prefix = __default__
+smtp_user =
+use_public_cc = false
+use_short_addr = false
+use_tls = false
+
+[search]
+min_query_length = 2
+
+[ticket]
+default_component =
+default_milestone =
+default_priority = 通常
+default_type = タスク
+default_version =
+restrict_owner = false
+
+[timeline]
+changeset_long_messages = false
+changeset_show_files = 0
+default_daysback = 30
+ticket_show_details = true
+
+[trac]
+authz_file = /etc/opt/kanon/svnauthz
+nbase_url =
+check_auth_ip = true
+database = sqlite:db/trac.db
+default_charset = cp932
+#default_handler = TagsWikiModule
+htdocs_location =
+ignore_auth_case = false
+mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search
+metanav = login,logout,settings,help,about
+permission_store = DefaultPermissionStore
+permission_policies = PrivateWikiSystem, DefaultPermissionPolicy, LegacyAttachmentPolicy
+repository_type = svn
+request_filters = PageQueryModule
+templates_dir = /etc/opt/kanon/trac-template/default
+timeout = 20
+
+
+[wiki]
+ignore_missing_pages = true
+split_page_names = false
+
+[account-manager]
+htdigest_realm = kanon
+password_format = htdigest
+password_store = HtDigestStore
+password_file = /etc/opt/kanon/kanon_users.htdigest
+
+[components]
+tracext.git.* = enabled
+tracbzr.* = enabled
+tracext.hg.backend.csetpropertyrenderer = enabled
+tracext.hg.backend.hgdefaultpropertyrenderer = enabled
+tracext.hg.backend.hgextpropertyrenderer = enabled
+tracext.hg.backend.mercurialconnector = enabled
+datefield.filter.customfieldadmintweak = enabled
+datefield.filter.datefieldmodule = enabled
+iniadmin.iniadmin.iniadminplugin = enabled
+acct_mgr.* = enabled
+acct_mgr.admin.accountmanageradminpage = disabled
+addcomment.macro.addcommentmacro = enabled
+ganttcalendar.ticketgantt.* = enabled
+ganttcalendar.ticketcalendar.* = enabled
+ganttcalendar.complete_by_close.completeticketobserver = enabled
+ganttcalendar.ticketvalidator.ticketvalidator = enabled
+ganttcalendar.admin.* = enabled
+tracjsgantt.tracjsgantt.taacjsganttsupport = enabled
+tracjsgantt.tracjsgantt.tracjsganttchart = enabled
+tracjsgantt.tracjsgantt.tracjsganttsupport = enabled
+tracusermanager.* = enabled
+completeuser.web_ui.completeuserweb = enabled
+tracwysiwyg.* = enabled
+#hudsontracplus.* = enabled
+svnauthz.admin_ui.* = enabled
+advancedworkflow.controller.*  = enabled
+# batchmod.web_ui.* = enabled
+tracmsofficexml.* = enabled
+querychart.admin.adminpanel = enabled
+querychart.macro.macro = enabled
+querychart.model.ticketstatuslogmodelprovider = enabled
+reportinclude.macro.reportincludemacro = enabled
+reportinclude.web_ui.reportincludemodule = enabled
+xdocview.xdocview.xdocrenderer = enabled
+talm_importer.importer.importmodule = enabled
+tracautowikify.autowikify.autowikify = enabled
+graphviz.graphviz.graphviz = enabled
+tracsectionedit.web_ui.wikisectioneditmodule = enabled
+privatewiki.api.privatewikisystem = enabled
+newwikipagebutton.newwikipagebutton.newwikipagebuttonplugin = enabled
+workfloweditor.workfloweditor_admin.workflowchangehandler = enabled
+workfloweditor.workfloweditor_admin.workfloweditoradmin = enabled
+# ticket_clone.simpleticketclonebutton = enabled
+tracdragdrop.* = enabled
+tracopt.ticket.commit_updater.committicketreferencemacro = enabled
+tracopt.ticket.commit_updater.committicketupdater = enabled
+tracopt.ticket.deleter.ticketdeleter = enabled
+tracdiscussion.api.discussionapi = enabled
+tracdiscussion.init.discussioninit = enabled
+themeengine.* = enabled
+kanontheme.theme.kanontheme = enabled
+kanontheme.themewater.kanonwatertheme = enabled
+tracrpc.api.xmlrpcsystem = enabled
+tracrpc.json_rpc.jsonrpcprotocol = enabled
+tracrpc.search.searchrpc = enabled
+tracrpc.ticket.* = enabled
+tracrpc.web_ui.rpcweb = enabled
+tracrpc.wiki.wikirpc = enabled
+tracrpc.xml_rpc.xmlrpcprotocol = enabled
+customfieldadmin.api.customfields = enabled
+customfieldadmin.customfieldadmin.customfieldadminpage = enabled
+tracopt.mimeview.enscript.enscriptrenderer = enabled
+tracopt.mimeview.php.phprenderer = enabled
+tracopt.perm.authz_policy.authzpolicy = enabled
+tracopt.perm.config_perm_provider.extrapermissionsprovider = enabled
+tracopt.ticket.clone.ticketclonebutton = enabled
+tracopt.versioncontrol.git.git_fs.csetpropertyrenderer = enabled
+tracopt.versioncontrol.git.git_fs.gitconnector = enabled
+tracopt.versioncontrol.git.git_fs.gitwebprojectsrepositoryprovider = enabled
+tracopt.versioncontrol.svn.svn_fs.subversionconnector = enabled
+tracopt.versioncontrol.svn.svn_prop.subversionmergepropertydiffrenderer = enabled
+tracopt.versioncontrol.svn.svn_prop.subversionmergepropertyrenderer = enabled
+tracopt.versioncontrol.svn.svn_prop.subversionpropertyrenderer = enabled
+
+[datefield]
+format = ymd
+
+[hudson]
+display_subprojects = true
+feed_url = http://localhost/hudson/rssAll
+main_page = http://localhost/hudson/
+
+[discussion]
+title=フォーラム
+
+[project]
+footer=Powerd by<br />Kanon<br /> Ver 0.1
+
+[theme]
+enable_css = enabled
+
+[notification]
+#TracLightningのパッチを当てないとchange.authorは有効にならない
+#ticket_subject_template = $prefix #$ticket.id: [$change.author] $summary
+ticket_subject_template = $prefix #$ticket.id: $summary
+
+[importer]
+datetime_format = %Y/%m/%d
+
+[trac-jsgantt]
+date_format = %Y/%m/%d
+fields.finish = due_close
+fields.parent = parents
+fields.percent = complete
+fields.start = due_assign
+
+[hudsonplus]
+display_in_new_tab = true
+hudson_url = http://localhost:8080/jenkins/
+navigation_label = ビルド
diff -r 6f8292651be4 kanon-setup
--- a/kanon-setup       Tue Sep 03 02:25:18 2013 +0900
+++ b/kanon-setup       Mon Nov 11 23:08:37 2013 +0900
@@ -4,6 +4,7 @@
export KANON_OPT=/opt/kanon
export KANON_VAR=/var/opt/kanon
+export TRAC_VER=1.0
probe_debian() {
     if [ -f /etc/debian_version ]; then
@@ -226,7 +227,7 @@
else
     cp -frn etc/* /etc
fi
-
+cp etc/opt/kanon/trac-template/common/trac-1.0.ini /etc/opt/kanon/trac-template/common/trac.ini
### setup configuration
"$python" resource/virtualenv.py --distribute "$KANON_OPT"
@@ -272,19 +273,42 @@
     try_easy_install pygments
fi
-try_easy_install 'Genshi>=0.6,<0.7dev'
-try_easy_install 'Babel>=0.9.5,<1.0'
-try_easy_install 'Trac' http://www.i-act.co.jp/project/products/downloads/Trac-0.12.4.ja1.zip
-try_easy_install 'xlrd'
-try_easy_install 'xlwt'
-try_easy_install 'TracGit' https://github.com/hvr/trac-git-plugin/zipball/v0.12.0.5
-try_easy_install 'TracBzr'
-try_easy_install 'TracMercurial' http://svn.edgewall.org/repos/trac/plugins/0.12/mercurial-plugin
+if [ "$TRAC_VER" = "1.0" ]; then
+  try_easy_install 'Genshi'
+  try_easy_install 'Babel'
+#  try_easy_install 'Trac' http://www.i-act.co.jp/project/products/downloads/Trac-1.0.ja1.zip
+  try_easy_install 'Trac' http://download.edgewall.org/trac/Trac-1.0.1.zip
+  try_easy_install 'xlrd'
+  try_easy_install 'xlwt'
+#  try_easy_install 'TracGit' GitはTrac標準になった
+  try_easy_install 'TracBzr'
+#  try_easy_install 'TracMercurial' HGのpackageからインストールする
+else
+  try_easy_install 'Genshi>=0.6,<0.7dev'
+  try_easy_install 'Babel>=0.9.5,<1.0'
+  try_easy_install 'Trac' http://www.i-act.co.jp/project/products/downloads/Trac-0.12.4.ja1.zip
+  try_easy_install 'xlrd'
+  try_easy_install 'xlwt'
+  try_easy_install 'TracGit' https://github.com/hvr/trac-git-plugin/zipball/v0.12.0.5
+  try_easy_install 'TracBzr'
+  try_easy_install 'TracMercurial' http://svn.edgewall.org/repos/trac/plugins/0.12/mercurial-plugin
+fi
#resource/pluginsディレクトリのプラグインをインストール
pushd .
+if [ "$TRAC_VER" = "1.0" ]; then
+  RESOURCE_LIST=resource/trac-plugin-1.0
+  PLUGIN_LIST=pluginlist-1.0
+  PLUGIN_LIST_HG=pluginlist_hg-1.0
+  PLUGIN_LIST_GIT=pluginlist_git-1.0
+else
+  RESOURCE_LIST=resource/trac-plugin-0.12
+  PLUGIN_LIST=pluginlist
+  PLUGIN_LIST_HG=
+  PLUGIN_LIST_GIT=
+fi
-for i in `ls -1 resource/trac-plugins`; do
+for i in `cat $RESOURCE_LIST`; do
     rm -rf "resource/trac-plugins/$i/build" "resource/trac-plugins/$i/dist"
     if ! "$KANON_OPT/bin/easy_install" -Z --no-deps "resource/trac-plugins/$i"; then
         echo "*** STOP *** インストールに失敗しました: resource/trac-plugins/$i"
@@ -293,7 +317,7 @@
done
# install plugins from web site
-for i in `cat pluginlist`; do
+for i in `cat $PLUGIN_LIST`; do
     workdir=`mktemp -d /tmp/kanon_build.XXXXXXXX` || exit 1
     svn co -q $i $workdir
     if ! "$KANON_OPT/bin/easy_install" -Z $workdir; then
@@ -302,6 +326,30 @@
     fi
     rm -fr "$workdir"
done
+if [ "$PLUGIN_LIST_HG" != "" ]
+then
+  for i in `cat $PLUGIN_LIST_HG`; do
+      workdir=`mktemp -d /tmp/kanon_build.XXXXXXXX` || exit 1
+      hg clone $i $workdir
+      if ! "$KANON_OPT/bin/easy_install" -Z $workdir; then
+          echo "*** STOP *** インストールに失敗しました: $i"
+          exit 1
+      fi
+      rm -fr "$workdir"
+  done
+fi
+if [ "$PLUGIN_LIST_GIT" != "" ]
+then
+  for i in `cat $PLUGIN_LIST_GIT`; do
+      workdir=`mktemp -d /tmp/kanon_build.XXXXXXXX` || exit 1
+      git clone $i $workdir
+      if ! "$KANON_OPT/bin/easy_install" -Z $workdir; then
+          echo "*** STOP *** インストールに失敗しました: $i"
+          exit 1
+      fi
+      rm -fr "$workdir"
+  done
+fi
popd
diff -r 6f8292651be4 opt/kanon/bin/create-sample-project
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/opt/kanon/bin/create-sample-project       Mon Nov 11 23:08:37 2013 +0900
@@ -0,0 +1,14 @@
+#!/bin/bash
+svnadmin create /var/opt/kanon/svn/Sample
+cp /etc/opt/kanon/vcs-template/svn/* /var/opt/kanon/svn/Sample/hooks
+chown apache.apache -R /var/opt/kanon/svn/Sample
+# /opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample initenv Sample sqlite:db/trac.db svn /var/opt/kanon/svn/Sample
+/opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample initenv Sample sqlite:db/trac.db
+/opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample permission add anonymous DISCUSSION_VIEW
+/opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample permission add authenticated DISCUSSION_APPEND TICKET_EDIT_CC XML_RPC
+/opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample permission add admin TRAC_ADMIN
+/opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample permission add developer authenticated
+/opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample permission add leader MILESTONE_CREATE MILESTONE_MODIFY TICKET_ADMIN
+/opt/kanon/bin/trac-admin /var/opt/kanon/trac/Sample permission add guest developer
+chown apache.apache -R /var/opt/kanon/trac/Sample
+
diff -r 6f8292651be4 pluginlist-1.0
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pluginlist-1.0    Mon Nov 11 23:08:37 2013 +0900
@@ -0,0 +1,17 @@
+http://svn.sourceforge.jp/svnroot/shibuya-trac/sandbox/okamototk/tracsubticketsplugin
+http://trac-hacks.org/svn/iniadminplugin/0.11
+http://trac-hacks.org/svn/xmlrpcplugin/trunk
+http://trac-hacks.org/svn/customfieldadminplugin/0.11
+http://trac-hacks.org/svn/tracdragdropplugin/0.12
+http://trac-hacks.org/svn/tracwysiwygplugin/0.12
+http://trac-hacks.org/svn/exceldownloadplugin/0.12
+http://trac-hacks.org/svn/tocmacro/0.11
+http://trac-hacks.org/svn/macropostplugin/0.11
+http://trac-hacks.org/svn/addcommentmacro/0.11
+http://svn.sourceforge.jp/svnroot/shibuya-trac/plugins/ganttcalendarplugin/trunk
+http://svn.sourceforge.jp/svnroot/shibuya-trac/plugins/completeuserplugin/trunk
+http://svn.sourceforge.jp/svnroot/shibuya-trac/plugins/reportincludeplugin/trunk/0.12
+http://svn.sourceforge.jp/svnroot/shibuya-trac/plugins/trackanontheme/trunk
+http://svn.sourceforge.jp/svnroot/shibuya-trac/plugins/hudsontracplus/0.11
+http://svn.sourceforge.jp/svnroot/shibuya-trac/plugins/tracavatarplugin/branches/0.12-kanon
+http://trac-hacks.org/svn/themeengineplugin/trunk/
diff -r 6f8292651be4 pluginlist_hg-1.0
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pluginlist_hg-1.0 Mon Nov 11 23:08:37 2013 +0900
@@ -0,0 +1,1 @@
+http://hg.edgewall.org/trac/mercurial-plugin#1.0
diff -r 6f8292651be4 resource/trac-plugin-0.12
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/trac-plugin-0.12 Mon Nov 11 23:08:37 2013 +0900
@@ -0,0 +1,27 @@
+TracMacOSTheme
+acct_mgr
+advancedticketworkflow
+autowikifyplugin
+batchmodify
+datefield
+discussion
+hudsontracplus
+lightningtheme
+macropost
+mailarchiveplugin
+masterticketsplugin
+privatewikiplugin
+querychart
+searchhyperestraier
+sectioneditplugin
+svnauthzadminplugin
+themeengineplugin
+ticketclone
+ticketimportplugin
+timingandestimationplugin
+tracjsganttplugin
+tracnav
+tractags
+usermanager
+workfloweditorplugin
+xdocview
diff -r 6f8292651be4 resource/trac-plugin-1.0
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/trac-plugin-1.0  Mon Nov 11 23:08:37 2013 +0900
@@ -0,0 +1,23 @@
+TracMacOSTheme
+acct_mgr
+advancedticketworkflow
+autowikifyplugin
+datefield
+discussion
+hudsontracplus
+lightningtheme
+mailarchiveplugin
+masterticketsplugin
+privatewikiplugin
+querychart
+searchhyperestraier
+sectioneditplugin
+svnauthzadminplugin
+ticketimportplugin
+timingandestimationplugin
+tracjsganttplugin
+tracnav
+tractags
+usermanager
+workfloweditorplugin
+xdocview
今日はここまでということで

|

« メールで受け取ったファイルをSVNに登録する | トップページ | kanonをTrac1.0.1+MySQL対応に変更してみた »

Trac」カテゴリの記事

コメント

コメントを書く



(ウェブ上には掲載しません)


コメントは記事投稿者が公開するまで表示されません。



トラックバック


この記事へのトラックバック一覧です: kanonをTrac1.0.1対応に変更してみた:

« メールで受け取ったファイルをSVNに登録する | トップページ | kanonをTrac1.0.1+MySQL対応に変更してみた »