Posts in category portable

We are back ! - 现在 thinkbase.net 运行在 Docker 之上

PortableTrac 已经支持 Linux(从 https://github.com/thinkbase/PortableTrac/commit/bc2702cc9ed56f566a43b9d00137ae81dafdb395 开始),于是 http://thinkbase.net 终于迁移到 Linux 上,并且使用 Docker 来进行运行环境。

基于 Docker 容器技术,要运行 thinkbase.net 的 Trac 系统只需要如下简单的几步即可:

  1. 在服务器上安装 docker:
    # 安装 docker.io
    sudo apt-get install docker.io
    
    # 将当前用户加入 docker 组,以便非 root 用户也可以使用 docker
    sudo gpasswd -a ${USER} docker
    sudo service docker restart
    
  1. 从 github 获取相关的 Dockerfile,构建运行镜像
    # [运行目录: ~/github$] - 获取需要的 Dockerfile 定义
    git clone -v --progress https://github.com/thinkbase/Dockerfiles
    
    # [运行目录: ~/github/Dockerfiles/01-init/01-ubuntu14.04$] - 构建基于 ubuntu 的基础镜像
    docker build --force-rm -t ubuntu:14.04-sshd .
    
    # [运行目录: ~/github/Dockerfiles/90-servers/trac-thinkbase.net$] - 构建 thinkbase.net trac 镜像
    docker build --force-rm -t trac-thinkbase.net:1.0 .
    
  1. 下面就可以创建容器并运行了:
    docker run -d -p 80:8080 -v ~/trac/private:/private --name trac-tk trac-thinkbase.net:1.0
    

PortableTrac 类似的系统

通过对比选择最佳开源的基于Web的项目管理工具 看到:

Trac 目前还无法同时管理多个项目,但如果作为一个单一项目的管理工具,它是一个很好的选择。大家可以使用 BitNamiTurnkey virtual appliance

发现这两个项目和现在 PortableTrac 的目标比较接近:

  • http://bitnami.com/stack/trac
    • 提供了一键安装的 Trac 安装程序和虚拟机映像,甚至还包括在上部署 Trac 服务器。
    • 提供了 Windows、Linux 和 OS X 上的安装程序;
  • http://www.turnkeylinux.org/trac
    • TurnKey Linux是基于Ubuntu的虚拟应用程序库,它将一些最好的开放源码软件集成到完备可用的解决方案中。每一个虚拟应用程序都为易用性进行了优化,并能 在数分钟内就部署在裸机、虚拟机及云中,每一个虚拟应用都可以光盘镜像或是虚拟机镜像的形式获得(来自 http://baike.baidu.com/view/9300243.htm )。

Portable Trac 简单介绍 - 兼谈为什么不选择 Redmine

Trac是一个轻量级的软件项目管理环境,如果在工作中涉及一个开发团队的管理并且关心项目管理工具的话,相信都在 TracRedmine 等工具之间进行过比较,网上简单搜索一下就可以查到以下有代表性的文章:

一般来说这些比较都认为 Redmine 更为优秀,尤其是

  • 可以同时管理多个项目;
  • 安装和部署比较方便(利用rake、rails的db migration安装很方便,Trac则要用到命令行的trac-admin进行配置,以及每个项目有单独的ini配置文件);
  • 使用比较简单(trac的很多功能都需要通过trac-admin在命令行方式下进行配置,不易上手,这方面Redmine则十分方便);

总体来看,缺乏内置的"多项目管理"功能支持算是 Trac 的硬伤,其他方面:

  • 对于开发者而言,命令行不是特别严重的问题,而且 Trac 的插件机制比较完善,http://trac-hacks.org/ 上有大量的插件可以实现基于 Web 界面的管理需求(例如: AccountManagerPlugin实现了内置的用户管理、TracIniAdminPanelPlugin支持通过Web方式调整Trac配置、SvnAuthzAdminPlugin支持Web方式调整SVN权限等等), Python 语言也算比较大众化,自己写一个插件也没有太大压力;
  • Trac 将维基融入了核心组件, 支持的更加彻底,而且其 Wiki 语法 功能强大并且可以通过插件扩展,这对于需要撰写大量文档的情况有不少帮助;而 Redmine 的 Wiki 功能实在太弱,实际使用的时候很不方便;事实上功能丰富的 Wiki 是 Trac 最大的优势;

本文介绍的 PortableTrac 其实是针对官方 Trac 的重新打包发布(目前只支持 Windows),其目的主要是简化 Trac 的安装配置过程,方便用户的使用,这方面的改进和增强包括:

  • 内置中文说明;
  • 自带的Python环境,已安装大量的常用插件,实现开箱即用,不再需要繁琐的安装和配置过程;
  • 已实现与 Apache httpd、SVN、Git 的集成;
  • 提供标准的数据备份和恢复功能;
  • 更详细的介绍可以参见 PortableTrac

下图演示如何简单的在几分钟之内解压并运行一个 Trac 实例(参考 PortableTrac/install),尤其适合初学者:
.

如果需要了解更多信息,请参考 在线演示站点.

PortableTrac and thinkbase.net - upgrade to Python 2.7.4

Original plan was upgrade to Portable Python 2.7.3.2, unfortunately this version is incompatible to mod_wsgi(See below error screenshot), the error message in stdout is :

>>> call "I:\thinkbase.net\github\PortableTrac\httpd\Apache2.2\bin\httpd.exe"
httpd.exe: Syntax error on line 504 of I:/thinkbase.net/github/PortableTrac/httpd/Apache2.2/conf/httpd.conf: Cannot load B:/Apache2.2/modules/mod_wsgi-win32-ap22py27-3.3.so into server: \xb6\xaf\xcc\xac\xc1\xb4\xbd\xd3\xbf\xe2(DLL)\xb3\xf5\xca\xbc\xbb\xaf\xc0\xfd\xb3\xcc\xca\xa7\xb0\xdc\xa1\xa3

The reason is the version of the Microsoft C/C++ compiler(http://code.google.com/p/modwsgi/wiki/InstallationOnWindows#Compiling_From_Source_Code To compile from source code you will need Microsoft C/C++ compiler for Windows. This must be the same version of the compiler as used to build the version of Python being used.).

So finally we chose the official python distribution(Python 2.7.4) and embeded the python runtime into PortableTrac, this is the construction of embeded python runtime, following is the way to embed official python:

  1. Download Python 2.7.4 Windows Installer''(python-2.7.4.msi)'', and install it to C:\Python27(Or else other folder you like);
  1. Download setuptools 0.6c11''(setuptools-0.6c11.win32-py2.7.exe)'' and install it.
  1. Copy files and folders in C:\Python27 into PortableTrac's PortablePython\App folder;
    • Before copy, delete *.pyc and *.pyo files;
  1. Copy %windir%\system32\python27.dll into PortableTrac's PortablePython\App folder;
  1. To make it work on Windows XP, copy following files into PortablePython\App folder:
    • VC90.CRT:
      c:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcm90.dll
      c:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcp90.dll
      c:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcr90.dll
      
    • The manifest(PortablePython\App\Microsoft.VC90.CRT.manifest), Copy from:
      c:\WINDOWS\WinSxS\Manifests\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375.manifest
      
  1. That's all, we commit the whole python runtime into PortableTrac Repository.

The benefit of embeding python runtime is the easy-trac-deploy: Just download from Github and uncompress it, python runtime is there ready.

Please follow the installation guide, download, then play it, best regards!

thinkbase.net 升级到 Trac 1.0.1

Trac 1.0 分支已经发布版本 1.0.1(参见 http://trac.edgewall.org/wiki/TracDev/ReleaseNotes/1.0#MaintenanceReleases), 因此今天将 http://thinkbase.net 站点(及其运行环境 PortableTrac)升级到这个版本.

主要工作

升级过程的主要工作包括升级 Trac 1.0.1 egg 包升级 Trac 环境, 详细步骤参见 TracUpgrade 或者 http://trac.edgewall.org/wiki/TracUpgrade ;

1. 安装 Trac 1.0.1

由于安装之前需要测试, 因此安装过程是在测试系统中进行的, 安装测试成功后, 将调整后的 PortableTrac 提交到 PortableTrac GitHub Repositories, 然后在正式系统中更新这个运行环境;

  • 主要命令:
    I:\thinkbase.net\github\PortableTrac-git>easy_install --upgrade Trac==1.0.1
    

2. 升级 Trac 环境

升级过程直接在正式系统中进行(此前已经在测试系统中经过测试了).

  • 主要命令:
    D:\thinkbase.net\PortableTrac-git>set SITE_BASE=D:\thinkbase.net\trac-thinkbase.net-git
    D:\thinkbase.net\PortableTrac-git>trac-admin.cmd trac upgrade
    D:\thinkbase.net\PortableTrac-git>trac-admin.cmd main upgrade
    D:\thinkbase.net\PortableTrac-git>trac-admin.cmd trac wiki upgrade
    D:\thinkbase.net\PortableTrac-git>trac-admin.cmd main wiki upgrade
    

详细操作日志

I:\thinkbase.net\github\PortableTrac-git>easy_install --upgrade Trac==1.0.1
[Current timestamp: 2013-02-18 周一 13-52-58.93]

>>> call easy_install.exe --prefix="I:\thinkbase.net\github\PortableTrac-git\trac" --upgrade Trac==1.0.1
Searching for Trac==1.0.1
Reading http://pypi.python.org/simple/Trac/
Reading http://trac.edgewall.org/
Reading http://trac.edgewall.org/wiki/TracDownload
Reading http://trac.edgewall.com/
Reading http://projects.edgewall.com/trac
Reading http://projects.edgewall.com/trac/wiki/TracDownload
Best match: Trac 1.0.1
Downloading http://download.edgewall.org/trac/Trac-1.0.1.win32.exe
Processing Trac-1.0.1.win32.exe
Deleting d:\temp\easy_install-yza88_\Trac-1.0.1-py2.7-win32.egg.tmp\EGG-INFO\scripts\trac-admin-script.py
Deleting d:\temp\easy_install-yza88_\Trac-1.0.1-py2.7-win32.egg.tmp\EGG-INFO\scripts\trac-admin.exe
Deleting d:\temp\easy_install-yza88_\Trac-1.0.1-py2.7-win32.egg.tmp\EGG-INFO\scripts\tracd-script.py
Deleting d:\temp\easy_install-yza88_\Trac-1.0.1-py2.7-win32.egg.tmp\EGG-INFO\scripts\tracd.exe
creating 'd:\temp\easy_install-yza88_\Trac-1.0.1-py2.7-win32.egg' and adding 'd:\temp\easy_install-yza88_\Trac-1.0.1-py2.7-win32.egg.tmp' to it
Moving Trac-1.0.1-py2.7-win32.egg to i:\thinkbase.net\github\portabletrac-git\trac\lib\site-packages
Removing trac 1.0 from easy-install.pth file
Adding Trac 1.0.1 to easy-install.pth file
Installing trac-admin-script.pyc script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts
Installing tracd-script.pyc script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts
Installing trac-admin-script.py script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts
Installing trac-admin.exe script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts
Installing trac-admin.exe.manifest script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts
Installing tracd-script.py script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts
Installing tracd.exe script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts
Installing tracd.exe.manifest script to I:\thinkbase.net\github\PortableTrac-git\trac/Scripts

Installed i:\thinkbase.net\github\portabletrac-git\trac\lib\site-packages\trac-1.0.1-py2.7-win32.egg
Processing dependencies for Trac==1.0.1
Finished processing dependencies for Trac==1.0.1

I:\thinkbase.net\github\PortableTrac-git>

================================================================================
================================================================================

D:\thinkbase.net\PortableTrac-git>set SITE_BASE=D:\thinkbase.net\trac-thinkbase.net-git

D:\thinkbase.net\PortableTrac-git>trac-admin.cmd trac upgrade
[Current timestamp: 2013-02-18 星期一 15-12-12.14]

>>> call python.exe  "D:\thinkbase.net\PortableTrac-git\trac\Scripts\trac-admin-script.py" "D:\thinkbase.net\trac-thinkbase.net-git\tracenv\trac" upgrade
Database is up to date, no upgrade necessary.

D:\thinkbase.net\PortableTrac-git>trac-admin.cmd main upgrade
[Current timestamp: 2013-02-18 星期一 15-12-26.48]

>>> call python.exe  "D:\thinkbase.net\PortableTrac-git\trac\Scripts\trac-admin-script.py" "D:\thinkbase.net\trac-thinkbase.net-git\tracenv\main" upgrade
Database is up to date, no upgrade necessary.

D:\thinkbase.net\PortableTrac-git>trac-admin.cmd trac wiki upgrade
[Current timestamp: 2013-02-18 星期一 15-12-35.62]

>>> call python.exe  "D:\thinkbase.net\PortableTrac-git\trac\Scripts\trac-admin-script.py" "D:\thinkbase.net\trac-thinkbase.net-git\tracenv\trac" wiki upgrade
  CamelCase is already up to date
  InterMapTxt already exists
  InterTrac is already up to date
  InterWiki is already up to date
  PageTemplates imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\PageTemplates
  RecentChanges is already up to date
  SandBox is already up to date
  TitleIndex is already up to date
  TracAccessibility is already up to date
  TracAdmin is already up to date
  TracBackup is already up to date
  TracBatchModify is already up to date
  TracBrowser is already up to date
  TracCgi is already up to date
  TracChangeset is already up to date
  TracEnvironment is already up to date
  TracFastCgi imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracFastCgi
  TracFineGrainedPermissions is already up to date
  TracGuide is already up to date
  TracImport is already up to date
  TracIni is already up to date
  TracInstall is already up to date
  TracInterfaceCustomization imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracInterfaceCustomization
  TracLinks is already up to date
  TracLogging is already up to date
  TracModPython is already up to date
  TracModWSGI is already up to date
  TracNavigation imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracNavigation
  TracNotification is already up to date
  TracPermissions imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracPermissions
  TracPlugins is already up to date
  TracQuery is already up to date
  TracReports imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracReports
  TracRepositoryAdmin imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracRepositoryAdmin
  TracRevisionLog is already up to date
  TracRoadmap is already up to date
  TracRss is already up to date
  TracSearch is already up to date
  TracStandalone imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracStandalone
  TracSupport is already up to date
  TracSyntaxColoring is already up to date
  TracTickets is already up to date
  TracTicketsCustomFields is already up to date
  TracTimeline is already up to date
  TracUnicode is already up to date
  TracUpgrade imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracUpgrade
  TracWiki is already up to date
  TracWorkflow imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracWorkflow
  WikiDeletePage is already up to date
  WikiFormatting is already up to date
  WikiHtml is already up to date
  WikiMacros imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\WikiMacros
  WikiNewPage imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\WikiNewPage
  WikiPageNames is already up to date
  WikiProcessors imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\WikiProcessors
  WikiRestructuredText is already up to date
  WikiRestructuredTextLinks is already up to date

D:\thinkbase.net\PortableTrac-git>trac-admin.cmd main wiki upgrade
[Current timestamp: 2013-02-18 星期一 15-12-46.85]

>>> call python.exe  "D:\thinkbase.net\PortableTrac-git\trac\Scripts\trac-admin-script.py" "D:\thinkbase.net\trac-thinkbase.net-git\tracenv\main" wiki upgrade
  CamelCase is already up to date
  InterMapTxt already exists
  InterTrac is already up to date
  InterWiki is already up to date
  PageTemplates imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\PageTemplates
  RecentChanges is already up to date
  SandBox is already up to date
  TitleIndex is already up to date
  TracAccessibility is already up to date
  TracAdmin is already up to date
  TracBackup is already up to date
  TracBatchModify is already up to date
  TracBrowser is already up to date
  TracCgi is already up to date
  TracChangeset is already up to date
  TracEnvironment is already up to date
  TracFastCgi imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracFastCgi
  TracFineGrainedPermissions is already up to date
  TracGuide is already up to date
  TracImport is already up to date
  TracIni is already up to date
  TracInstall is already up to date
  TracInterfaceCustomization imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracInterfaceCustomization
  TracLinks is already up to date
  TracLogging is already up to date
  TracModPython is already up to date
  TracModWSGI is already up to date
  TracNavigation imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracNavigation
  TracNotification is already up to date
  TracPermissions imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracPermissions
  TracPlugins is already up to date
  TracQuery is already up to date
  TracReports imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracReports
  TracRepositoryAdmin imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracRepositoryAdmin
  TracRevisionLog is already up to date
  TracRoadmap is already up to date
  TracRss is already up to date
  TracSearch is already up to date
  TracStandalone imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracStandalone
  TracSupport is already up to date
  TracSyntaxColoring is already up to date
  TracTickets is already up to date
  TracTicketsCustomFields is already up to date
  TracTimeline is already up to date
  TracUnicode is already up to date
  TracUpgrade imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracUpgrade
  TracWiki is already up to date
  TracWorkflow imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\TracWorkflow
  WikiDeletePage is already up to date
  WikiFormatting is already up to date
  WikiHtml is already up to date
  WikiMacros imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\WikiMacros
  WikiNewPage imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\WikiNewPage
  WikiPageNames is already up to date
  WikiProcessors imported from C:\Documents and Settings\Administrator\Application Data\Python-Eggs\trac-1.0.1-py2.7-win32.egg-tmp\trac\wiki\default-pages\WikiProcessors
  WikiRestructuredText is already up to date
  WikiRestructuredTextLinks is already up to date

D:\thinkbase.net\PortableTrac-git>