Create a gist now

Instantly share code, notes, and snippets.

@atl /trac-init.sh
Last active Dec 11, 2015

Minimal initialization script to set up Trac in the Joyent Public Cloud
#!/usr/bin/sh
# Install trac
/opt/local/bin/pkgin -y in trac
# set up the base directory (set as default by the SMF manifest)
/opt/local/bin/mkdir /trac
/opt/local/bin/chown www:www /trac
# configure a minimal base environment
/opt/local/bin/sudo -u www /opt/local/bin/trac-admin /trac/test initenv "Test environment" sqlite:db/trac.db
## The following is definitely not recommended for production:
## running a wiki with no access controls is just asking for trouble!
# change trac to listen on the public IP address:
PUBLIC=$(/usr/sbin/ifconfig -a | /opt/local/bin/grep -A 1 net0 | /opt/local/bin/awk '/inet/ { print $2 }');
/usr/sbin/svccfg -s trac:default setprop config/listen_ip=astring: $PUBLIC
/usr/sbin/svcadm refresh trac:default
/usr/sbin/svcadm restart trac:default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment