Setting up trac wiki: Difference between revisions

From Alpine Linux
(added warning that doc is obsolete)
(update to 1.10.6)
Line 1: Line 1:
{{Warning|This document is out-of-date. The trac package is missing in recent Alpine. See {{Issue|316}}.}}
This document describes how to set up a [http://trac.edgewall.org Trac] wiki. It is based on alpine 1.10.6 and should also be compatible with newer version.
== Initial Setup ==
This document is based on [http://distrib-coffee.ipsl.jussieu.fr/pub/linux/alpine/alpine/v1.7/iso/alpine-1.7.29-i386.iso alpine-1.7.29] and should also be compatible with newer version of [http://wiki.alpinelinux.org/w/index.php?title=Main_Page alpine].
 
Follow [http://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_basic_vserver Setting up a basic vserver] instructions on how to setup [http://wiki.alpinelinux.org/w/index.php?title=Main_Page alpine].<BR>
You would benefit in running your trac on disk.
 
== Installing programs ==
  apk_add trac
  apk_add python-dev
'''Note:''' 'python-dev' needs to be dependency for 'setuptools'.


== General notes on this tutorial ==
== General notes on this tutorial ==
Line 16: Line 6:
{| style="width: 450px;  background-color: #f8f8f8; border: 1px #ccc solid;"
{| style="width: 450px;  background-color: #f8f8f8; border: 1px #ccc solid;"
|'''Path to project:'''
|'''Path to project:'''
|/root/myproject
|/var/lib/trac/myproject
|-
|-
|'''Username:'''
|'''Username:'''
|tractester
|tracadmin
|-
|-
|'''Realm:'''
|'''Realm:'''
|mycompany.com
|example.com
|-
|-
|'''Password:'''
|'''Password:'''
Line 28: Line 18:
|-
|-
|'''Password file:'''
|'''Password file:'''
|/root/myproject/users.realm
|/var/lib/trac/myproject/users.realm
|}
|}


== Installing Trac ==
== Installing Trac ==
  easy_install trac
{{Cmd|apk add trac}}


== Creating a Project Environment ==
== Creating a Project Environment ==
Now lets initiate the environment
Now lets initiate the environment
  trac-admin /root/myproject initenv
{{Cmd|trac-admin /var/lib/trac/myproject initenv}}
* Enter some project name when prompted
* Enter some project name when prompted
* Leave svn-path '''empty''' (se note below)
'''Important:''' When prompted about svn, don't enter any value!<BR>
[http://distrib-coffee.ipsl.jussieu.fr/pub/linux/alpine/alpine/v1.7/iso/alpine-1.7.29-i386.iso alpine-1.7.29] is missing svn support for trac (standard svn support works though).


== Configuring Authentication/Security ==
== Configuring Authentication/Security ==
=== Create password-file ===
=== Create password-file ===
You need to create a password file containing this information
You need to create a password file containing this information
  echo -e "tractester:mycompany.com:secret\c" | md5sum - >> /root/myproject/users.htdigest
{{Cmd|<nowiki>echo -n "tracadmin:example.com:secret" | md5sum >> /var/lib/trac/myproject/users.htdigest</nowiki>}}
Now you need to edit the passwordfile '/root/myproject/users.htdigest' and append the username and realm in plaintext.
Now you need to edit the passwordfile '/var/lib/trac/myproject/users.htdigest' and append the username and realm in plaintext.
   tractester:mycompany.com:65f5e135c5ed43b1a1340a3188062fd6
   tracadmin:example.com:72842d9ffe3f4f63306a06756d2953ee
'''Note:''' Note that you need to remove the "-" and whitespaces at the end of the row!
{{Note|Note that you need to remove the "-" and whitespaces at the end of the row.}}


=== Admin-rights ===
=== Admin-rights ===
Next is to give admin-rights to your 'tractester' account
Next is to give admin-rights to your 'tractester' account
  trac-admin /root/myproject permission add tractester TRAC_ADMIN
{{Cmd|trac-admin /var/lib/trac/myproject permission add tractester TRAC_ADMIN}}


== Running/Testing the Standalone Server ==
== Running/Testing the Standalone Server ==
Lets test if your password-file and other configurations worked as they are supposed to.<BR>
Lets test if your password-file and other configurations worked as they are supposed to.<BR>
In case something is broken, this test would give you a hint on what's wrong.
In case something is broken, this test would give you a hint on what's wrong.
  tracd --port 8000 --auth=*,/root/myproject/users.htdigest,mycompany.com /root/myproject
{{Cmd|<nowiki>tracd --port 8000 --auth=*,/var/lib/trac/myproject/users.htdigest,example.com /var/lib/trac/myproject</nowiki>}}
'''Note:''' You could use a WebBrowser to see the 'trac' page while above process is running.
 
Try connect to trac with webbrowser on http://localhost:8000


== Configuration/Startup ==
== Configuration/Startup ==
Edit '/etc/conf.d/tracd' and configure your variables
Edit '/etc/conf.d/tracd' and configure your variables
  TRACD_PORT="80"
  TRACD_PORT="80"
  TRACD_OPTS="--auth=*,/root/myproject/users.htdigest,mycompany.com /root/myproject"
  TRACD_OPTS="--auth=*,/var/lib/trac/myproject/users.htdigest,example.com /var/lib/trac/myproject"
TRACD_USER="root"
TRACD_GROUP="root"


'''Note:''' Above user/group should probably not be 'root'.
Set ownership to be tracd
{{Cmd|chown -R tracd:tracd /var/lib/trac}}


== Configuration/Startup ==
== Configuration/Startup ==
Now you could start customizing your trac by editing '/root/myproject/conf/trac.ini'.
Now you could start customizing your trac by editing '/var/lib/trac/myproject/conf/trac.ini'.


== Startup ==
== Startup ==
Now it's time to fire up your trac.
Now it's time to fire up your trac.
  /etc/init.d/tracd start
{{Cmd|/etc/init.d/tracd start}}


== Backup ==
== Backup ==
To create a backup of a live TracEnvironment, simply run:
To create a backup of a live TracEnvironment, simply run:
  trac-admin /root/myproject hotcopy /path/to/backupdir
{{Cmd|trac-admin /var/lib/trac/myproject hotcopy /path/to/backupdir}}
Assuming you run your trac on disk, you won't need to '''lbu_ci''' to permanently save your settings.
 
== Other ==
It might be wise to configure your tracd to autostart at next reboot
rc_add -vk tracd


'''Note:''' And it would probably be wise to use other settings/filenames/folders than in this tutorial.
== Boot ==
Make it start during boot.
{{Cmd|rc-update add tracd}}

Revision as of 08:45, 11 June 2010

This document describes how to set up a Trac wiki. It is based on alpine 1.10.6 and should also be compatible with newer version.

General notes on this tutorial

In this tutorial we use these settings. These values will re-appear in various places in the upcoming example.
You can use whatever settings you like.

Path to project: /var/lib/trac/myproject
Username: tracadmin
Realm: example.com
Password: secret
Password file: /var/lib/trac/myproject/users.realm

Installing Trac

apk add trac

Creating a Project Environment

Now lets initiate the environment

trac-admin /var/lib/trac/myproject initenv

  • Enter some project name when prompted

Configuring Authentication/Security

Create password-file

You need to create a password file containing this information

echo -n "tracadmin:example.com:secret" | md5sum >> /var/lib/trac/myproject/users.htdigest

Now you need to edit the passwordfile '/var/lib/trac/myproject/users.htdigest' and append the username and realm in plaintext.

 tracadmin:example.com:72842d9ffe3f4f63306a06756d2953ee
Note: Note that you need to remove the "-" and whitespaces at the end of the row.

Admin-rights

Next is to give admin-rights to your 'tractester' account

trac-admin /var/lib/trac/myproject permission add tractester TRAC_ADMIN

Running/Testing the Standalone Server

Lets test if your password-file and other configurations worked as they are supposed to.
In case something is broken, this test would give you a hint on what's wrong.

tracd --port 8000 --auth=*,/var/lib/trac/myproject/users.htdigest,example.com /var/lib/trac/myproject

Try connect to trac with webbrowser on http://localhost:8000

Configuration/Startup

Edit '/etc/conf.d/tracd' and configure your variables

TRACD_PORT="80"
TRACD_OPTS="--auth=*,/var/lib/trac/myproject/users.htdigest,example.com /var/lib/trac/myproject"

Set ownership to be tracd

chown -R tracd:tracd /var/lib/trac

Configuration/Startup

Now you could start customizing your trac by editing '/var/lib/trac/myproject/conf/trac.ini'.

Startup

Now it's time to fire up your trac.

/etc/init.d/tracd start

Backup

To create a backup of a live TracEnvironment, simply run:

trac-admin /var/lib/trac/myproject hotcopy /path/to/backupdir

Boot

Make it start during boot.

rc-update add tracd