# # # add_dir "debian/examples" # # add_file "debian/examples/hooks.lua" # content [8515f74188693e01a8229d6e4776cfa7bb860d1d] # # add_file "debian/examples/read-permissions" # content [508670f8ad587f57e35d03abc9964c3989970c84] # # add_file "debian/examples/write-permissions" # content [15dc70902c8901e21c9d681498e4afc83d8ac4e3] # # add_file "debian/monotone-server.install" # content [57e1d4a2e8dbb77279ed479b58141a62d8fa456f] # # patch "contrib/monotone.bash_completion" # from [5beb8b066092f03674d44d816e6bd6030c3a55ad] # to [ef0ad6664f73f6883c18ef37269662fdfe59727d] # # patch "debian/control" # from [f1c5b0ff96d275a107367963c51d9b2afefa37e0] # to [11bbf3dbeaf10364dbe256ae7b28e5a66667bee1] # # patch "debian/monotone-server.README.Debian" # from [7b7ed61fad1f8a60a1b249dec1c6b3dad3acf733] # to [71a09cf5abfbbbd7f1832d3aff0f0696995d470c] # # patch "debian/monotone-server.monotone.default" # from [cc878bb238be3a201b688a57f4582e51a3f77238] # to [bff84a53e030bd46c60bc7bf20959d5c9cc18ca6] # # patch "debian/monotone-server.monotone.init" # from [735d5825d1f5c83028026acf4704741decea796b] # to [f4e8292bc93bd5d337b33b5afd50b882cdffb2c1] # # patch "debian/monotone-server.postinst" # from [2ac4a5b45afc9a5930090741e7477341d8c8c0d7] # to [1dfae8b57d9ea82b6ec9191296445b1db30854bd] # # patch "debian/monotone-server.postrm" # from [0e6c20d9f0358ac1b30051e5bfb9706d173edd2e] # to [372f97a388c0b985572caf2fb5820cb1cfa41537] # ============================================================ --- debian/examples/hooks.lua 8515f74188693e01a8229d6e4776cfa7bb860d1d +++ debian/examples/hooks.lua 8515f74188693e01a8229d6e4776cfa7bb860d1d @@ -0,0 +1,18 @@ +-- monotone hooks file + +-- This hook reads the passphrases file in the confdir (/etc/monotone) +function get_passphrase (keypair_id) + local permfile = io.open(get_confdir() .. "/passphrases", "r") + if (permfile == nil) then + return false + end + local line = permfile:read() + while (line ~= nil) do + local _, _, key, passphrase = string.find(line, "%s*([^%s]*)%s*([^%s]*)%s*") + if keypair_id == key then return passphrase end + line = permfile:read() + end + io.close(permfile) + return false +end + ============================================================ --- debian/examples/read-permissions 508670f8ad587f57e35d03abc9964c3989970c84 +++ debian/examples/read-permissions 508670f8ad587f57e35d03abc9964c3989970c84 @@ -0,0 +1,6 @@ +comment "Read permissions go here. See the manual for proper syntax" +pattern "tld.domain.branch" +allow "address@hidden" + +pattern "domain.tld/branch" +allow "address@hidden" ============================================================ --- debian/examples/write-permissions 15dc70902c8901e21c9d681498e4afc83d8ac4e3 +++ debian/examples/write-permissions 15dc70902c8901e21c9d681498e4afc83d8ac4e3 @@ -0,0 +1,1 @@ address@hidden ============================================================ --- debian/monotone-server.install 57e1d4a2e8dbb77279ed479b58141a62d8fa456f +++ debian/monotone-server.install 57e1d4a2e8dbb77279ed479b58141a62d8fa456f @@ -0,0 +1,1 @@ +debian/examples debian/monotone-server/usr/share/doc/monotone-server/ ============================================================ --- contrib/monotone.bash_completion 5beb8b066092f03674d44d816e6bd6030c3a55ad +++ contrib/monotone.bash_completion ef0ad6664f73f6883c18ef37269662fdfe59727d @@ -95,7 +95,8 @@ --full-version --xargs --ticker --nostd --norc --rcfile --key --db --root --verbose -k -d -@ -m -b -r --branch --message --date --author - --depth --execute --keydir --confdir' -- $cur) ) + --depth --execute --keydir --confdir + --key-to-push --bind' -- $cur) ) ;; * ) case $prev in ============================================================ --- debian/control f1c5b0ff96d275a107367963c51d9b2afefa37e0 +++ debian/control 11bbf3dbeaf10364dbe256ae7b28e5a66667bee1 @@ -21,7 +21,7 @@ Package: monotone-server Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, monotone (= ${Source-Version}), adduser +Depends: ${shlibs:Depends}, ${misc:Depends}, monotone (= ${Source-Version}), adduser, ucf (>= 0.28) Description: A distributed version (revision) control system Monotone is a free, distributed version control system. It provides fully disconnected operation, manages complete tree versions, keeps @@ -30,4 +30,4 @@ network protocol, performs history-sensitive merging, and delegates trust functions to client-side RSA certificates. . + This package contains files to make running a monotone server easier. - This package contains files to make running a monotone server eaiser. ============================================================ --- debian/monotone-server.README.Debian 7b7ed61fad1f8a60a1b249dec1c6b3dad3acf733 +++ debian/monotone-server.README.Debian 71a09cf5abfbbbd7f1832d3aff0f0696995d470c @@ -1,8 +1,14 @@ monotone for Debian ------------------- -In order to use the monotone-server package, monotone should first be -configured in the /etc/monotone/hooks.lua and /etc/default/monotone packages. -The server will not start until this is done. +In order to use the monotone-server package, the server should first be +configured in the /etc/monotone/write-permissions, +/etc/monotone/read-permissions, and /etc/default/monotone files. The server +will not start until this is done. +The read-permissions and write-permissions files are in the standard format as +specified in the monotone manual. The /etc/default/monotone file contains +options such as what interface the server should listen on and what branches it +should serve. + + -- Matthew A. Nicholson Sun, 4 Dec 2005 5:45:00 -0600 - -- Matthew A. Nicholson Sun, 30 Oct 2005 2:26:00 -0600 ============================================================ --- debian/monotone-server.monotone.default cc878bb238be3a201b688a57f4582e51a3f77238 +++ debian/monotone-server.monotone.default bff84a53e030bd46c60bc7bf20959d5c9cc18ca6 @@ -13,5 +13,6 @@ BRANCHES='tld.domain.* tld.domain.branch domain.tld/* - domain.tld/branch' + domain.tld/branch + address@hidden/branch' ============================================================ --- debian/monotone-server.monotone.init 735d5825d1f5c83028026acf4704741decea796b +++ debian/monotone-server.monotone.init f4e8292bc93bd5d337b33b5afd50b882cdffb2c1 @@ -50,7 +50,7 @@ --exec $DAEMON --chuid monotone --chdir $MTN_HOME -- \ --confdir=$MTN_CONFDIR --db=$DB --norc \ --rcfile=$MTN_CONFDIR/hooks.lua --keydir=$MTN_KEYDIR \ - serve $ADDRESS $BRANCHES >> /var/log/monotone.log 2>&1 & + --bind $ADDRESS serve $BRANCHES >> /var/log/monotone.log 2>&1 & } ============================================================ --- debian/monotone-server.postinst 2ac4a5b45afc9a5930090741e7477341d8c8c0d7 +++ debian/monotone-server.postinst 1dfae8b57d9ea82b6ec9191296445b1db30854bd @@ -30,14 +30,28 @@ MTN_CONFDIR=/etc/monotone MTN_KEYDIR=$MTN_HOME/keys - db_get monotone-server/manage + /usr/bin/ucf --debconf-ok /usr/share/doc/monotone-server/examples/write-permissions /etc/monotone/write-permissions + /usr/bin/ucf --debconf-ok /usr/share/doc/monotone-server/examples/read-permissions /etc/monotone/read-permissions + /usr/bin/ucf --debconf-ok /usr/share/doc/monotone-server/examples/hooks.lua /etc/monotone/hooks.lua + + # if this is our first install give config files correct permissions + if [ -z "$2" ]; then + chown monotone:monotone /etc/monotone/write-permissions + chown monotone:monotone /etc/monotone/read-permissions + chown monotone:monotone /etc/monotone/hooks.lua + chmod 0640 /etc/monotone/write-permissions + chmod 0640 /etc/monotone/read-permissions + chmod 0640 /etc/monotone/hooks.lua + fi + + db_get monotone-server/manage-db if [ -z "$RET" ]; then exit 0 fi # read our passphrase from a file - if [ -e "$MTN_HOME/$MTN_KEY.passphrase" ]; then - db_set monotone-server/passphrase "`cat $MTN_HOME/$MTN_KEY.passphrase`" + if [ -e "$MTN_HOME/passphrases" ]; then + db_set monotone-server/passphrase "`cat $MTN_HOME/passphrases | awk '{print $2}'`" fi db_get monotone-server/key @@ -59,9 +73,9 @@ chown monotone:monotone $MTN_HOME chown monotone:monotone $MTN_CONFDIR chown monotone:monotone $MTN_KEYDIR - chmod 0740 $MTN_HOME - chmod 0740 $MTN_CONFDIR - chmod 0740 $MTN_KEYDIR + chmod 0750 $MTN_HOME + chmod 0750 $MTN_CONFDIR + chmod 0750 $MTN_KEYDIR fi # if there is no database, create one @@ -100,8 +114,9 @@ information on manually upgrading your database." >&2) fi - echo "$MTN_KEY_PASSWD" > $MTN_HOME/$MTN_KEY.passphrase - chmod 0600 $MTN_HOME/$MTN_KEY.passphrase + echo "$MTN_KEY $MTN_KEY_PASSWD" > $MTN_CONFDIR/passphrases + chown monotone:monotone $MTN_CONFDIR/passphrases + chmod 0400 $MTN_CONFDIR/passphrases db_set monotone-server/passphrase "" ;; ============================================================ --- debian/monotone-server.postrm 0e6c20d9f0358ac1b30051e5bfb9706d173edd2e +++ debian/monotone-server.postrm 372f97a388c0b985572caf2fb5820cb1cfa41537 @@ -29,9 +29,19 @@ MTN_CONFDIR=/etc/monotone MTN_KEYDIR=$MTN_HOME/keys + # remove configs from ucf database and filesystem + /usr/bin/ucf --debconf-ok --purge /etc/monotone/write-permissions + /usr/bin/ucf --debconf-ok --purge /etc/monotone/read-permissions + /usr/bin/ucf --debconf-ok --purge /etc/monotone/hooks.lua + + rm -f /etc/monotone/write-permissions || true + rm -f /etc/monotone/read-permissions || true + rm -f /etc/monotone/hooks.lua || true + # remove database if debconf variable is set db_get monotone-server/purge-db if [ "$RET" = false ]; then + rm -f /etc/monotone/passphrases DELUSER_FLAGS="--remove-home" echo "deleting monotone database" >&2 fi @@ -41,6 +51,7 @@ echo "monotone user and group removed" >&2 + ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;;