[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-commits-diffs] net.venge.monotone.contrib.usher.path-instead-o
From: |
code |
Subject: |
[Monotone-commits-diffs] net.venge.monotone.contrib.usher.path-instead-of-server: 01984ec8240da5e8a0b160ff85f6ee244fe9e41d |
Date: |
Wed, 1 Jun 2011 11:43:39 +0200 (CEST) |
revision: 01984ec8240da5e8a0b160ff85f6ee244fe9e41d
date: 2011-06-01T08:25:36
author: Richard Levitte <address@hidden>
branch: net.venge.monotone.contrib.usher.path-instead-of-server
changelog:
An attempt to rename 'server' to 'path' in the hope that it makes things clearer
manifest:
format_version "1"
new_manifest [b7366d06368b5f124768c8acc2ec46786289e3a1]
old_revision [1336ca3b4c1b316eeeec33f333f7506dcc40a858]
patch "doc/usher.conf.man"
from [8a61220224fda6b45ff661f6d1f0b0565c31db17]
to [9e2bfc0d71fe84aa57bc1da7a04987b42b6c9add]
patch "doc/usher.man"
from [26c13c38c1676d8b6d998041fdcf2f9b58a291af]
to [877bfd079b55b4b6c4a6a2683a4b129d3b1dbef1]
patch "src/administrator.cc"
from [e81924a2d5c53fd38a0656ebb078356e8588095d]
to [612fa18aa0fc478dda6108d4446741b7317cb149]
patch "src/basic_io_serverlist_reader.cc"
from [08fd4a087e2949cff41f2c67818e2dec8062a710]
to [5e22bbc627cf9628e622b1bf1849338dea8d023e]
patch "src/io.cc"
from [322a107ba4bc1d2ec7e9c2ad005937b64ad109e6]
to [6477499a3512faf4b99b545a3ba55c729c3873ad]
patch "src/io.hh"
from [c4a8f9a5a56a6282ac22551c144b614b7d0536d4]
to [b6ea862ac67f64e11d310e354dff06471ea8c314]
patch "utils/usherctl.in"
from [cf6734a3e684e0c3e842f74a8474d2f0dac3fd82]
to [925b3148ef6c70d4377638058249c703d55d84be]
============================================================
--- src/administrator.cc e81924a2d5c53fd38a0656ebb078356e8588095d
+++ src/administrator.cc 612fa18aa0fc478dda6108d4446741b7317cb149
@@ -550,7 +550,7 @@ administrator::reload_conffile()
{
std::ifstream ifs(conffile.c_str());
vector<string> delims;
- delims.push_back("server");
+ delims.push_back("path");
basic_io::stanza_reader reader(ifs, delims);
basic_io::stanza st;
bool ok = reader.get(st);
============================================================
--- src/basic_io_serverlist_reader.cc 08fd4a087e2949cff41f2c67818e2dec8062a710
+++ src/basic_io_serverlist_reader.cc 5e22bbc627cf9628e622b1bf1849338dea8d023e
@@ -39,7 +39,7 @@ basic_io_serverlist_reader::get_next()
bool ok = reader->get(st);
if (st.items.empty())
ok = false;
- else if (st.items[0].key != "server")
+ else if (st.items[0].key != "path")
{
return get_next();
}
@@ -51,7 +51,7 @@ basic_io_serverlist_reader::get_next()
for (vector<basic_io::item>::iterator i = st.items.begin();
i != st.items.end(); ++i)
{
- if (i->key == "server")
+ if (i->key == "path")
{
if (i->values.empty())
{
@@ -115,7 +115,7 @@ basic_io_serverlist_reader::begin_readin
{
}
vector<string> delims;
- delims.push_back("server");
+ delims.push_back("path");
reader.reset(new basic_io::stanza_reader(ifs, delims));
return ifs;
}
============================================================
--- src/io.cc 322a107ba4bc1d2ec7e9c2ad005937b64ad109e6
+++ src/io.cc 6477499a3512faf4b99b545a3ba55c729c3873ad
@@ -66,6 +66,18 @@ ostream &basic_io::operator<<(ostream &o
}
+static void deal_with_deprecation(item &i)
+{
+ // TO BE REMOVED IN USHER 2.0!
+ if (i.key == "server")
+ {
+ std::cerr
+ << "Warning: deprecated key 'server' used, please use 'path' instead"
+ << std::endl;
+ i.key = "path";
+ }
+}
+
istream &basic_io::operator>>(istream &in, item &i)
{
i.key.clear();
@@ -83,10 +95,12 @@ istream &basic_io::operator>>(istream &i
value v;
in >> v;
i.values.push_back(v);
+ deal_with_deprecation(i);
}
else if (!got_key && c != '[' && c != '"')
{
in >> i.key;
+ deal_with_deprecation(i);
i.longest = i.key.size();
got_key = true;
}
============================================================
--- src/io.hh c4a8f9a5a56a6282ac22551c144b614b7d0536d4
+++ src/io.hh b6ea862ac67f64e11d310e354dff06471ea8c314
@@ -17,6 +17,7 @@
#include <string>
#include <iostream>
#include <vector>
+#include <map>
#include <set>
namespace basic_io {
@@ -55,7 +56,7 @@ namespace basic_io {
set<string> delims;
item last_read;
stanza_reader(istream &i, vector<string> const &d)
- : is(i), delims(d.begin(), d.end())
+ : is(i), delims(d.begin(), d.end())
{
}
bool get(stanza &st);
============================================================
--- utils/usherctl.in cf6734a3e684e0c3e842f74a8474d2f0dac3fd82
+++ utils/usherctl.in 925b3148ef6c70d4377638058249c703d55d84be
@@ -1,7 +1,7 @@
#! /bin/sh
# A script to control usher. It can be used to set up an initial
-# configuration, add, modify or remove servers, and reload the
+# configuration, add, modify or remove monotone servers, and reload the
# usher process.
address@hidden@/usher
@@ -19,9 +19,9 @@ address@hidden@/mtn
# (default: $USHER_CONFDIR/usher.conf)
# USHER_GLOBALCONF Global configuration template.
# (default: $USHER_CONFDIR/global.conf)
-# USHER_CONFD Directory for project specific configuration files.
+# USHER_CONFD Directory for path specific configuration files.
# (default: $USHER_CONFDIR/conf.d)
-# USHER_SKEL Directory for project skeleton files.
+# USHER_SKEL Directory for path skeleton files.
# (default: $USHER_CONFDIR/skel)
# USHER_PIDFILE Usher PID file.
# (default: @localstatedir@/run/usher.pid)
@@ -29,8 +29,8 @@ address@hidden@/mtn
# (default: @localstatedir@/log/usher.log)
# USHER_LOGDIR Usher log directory for monotone processes.
# (default: @localstatedir@/log/usher)
-# USHER_PROJECTDIR Usher projects directory.
-# (default: @localstatedir@/lib/usher/projects)
+# USHER_PATHDIR Usher paths directory.
+# (default: @localstatedir@/lib/usher/paths)
#
# The following variables are only useful for the system administrator
# that wants to set up a system wide usher.
@@ -101,7 +101,7 @@ USHER_LOGDIR=${USHER_LOGDIR:address@hidden
USHER_PIDFILE=${USHER_PIDFILE:address@hidden@/run/usher.pid}
USHER_LOGFILE=${USHER_LOGFILE:address@hidden@/log/usher.log}
USHER_LOGDIR=${USHER_LOGDIR:address@hidden@/log/usher}
-USHER_PROJECTDIR=${USHER_PROJECTDIR:address@hidden@/lib/usher/projects}
+USHER_PATHDIR=${USHER_PATHDIR:address@hidden@/lib/usher/paths}
THIS="$0"
@@ -278,25 +278,25 @@ rebuild () {
}
# $1 operation
-# $2 server name
+# $2 server path
# $3 host prefix
# $4 pattern prefix
# $5 type (remote local)
# $6- args
writesrv0 () {
op="$1"; shift
- name="$1"; shift
+ path="$1"; shift
host="$1"; shift
pattern="$1"; shift
type="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "Server must have a name."
+ if [ -z "$path" ]; then
+ echo >&2 "Server must have a path."
exit 1
fi
(
- echo "server \"$name\""
+ echo "server \"$path\""
if [ -n "$host" ]; then echo "host \"$host\""; fi
if [ -n "$pattern" ]; then
if [ "$pattern" = ";" ]; then
@@ -321,11 +321,11 @@ writesrv0 () {
exit 1
;;
esac
- ) > "$USHER_CONFD/$name.conf"
- _maybe_set_file_owner "$USHER_CONFD/$name.conf"
- chmod 640 "$USHER_CONFD/$name.conf"
+ ) > "$USHER_CONFD/$path.conf"
+ _maybe_set_file_owner "$USHER_CONFD/$path.conf"
+ chmod 640 "$USHER_CONFD/$path.conf"
rebuild
- echo >&2 "Server '$name' $op."
+ echo >&2 "Server '$path' $op."
}
writesrv () {
@@ -333,14 +333,14 @@ writesrv () {
echo >&2 "Please reload usher to activate."
}
-# $1 server name
+# $1 server path
# $2 host prefix
# $3 pattern prefix
# $4 type (remote local)
# $5- args
addsrv0 () {
if [ -f "$USHER_CONFD/$1.conf" ]; then
- echo >&2 "There is already a server named '$1', not changing."
+ echo >&2 "There is already a server with the path '$1', not changing."
exit 1
fi
@@ -352,19 +352,19 @@ addsrv () {
echo >&2 "Please reload usher to activate."
}
-# $1 server name
+# $1 server path
# $2 host prefix
# $3 pattern prefix
# $4 type (remote local)
# $5- args
modsrv0 () {
- name="$1"; shift
+ path="$1"; shift
ohost="$1"; host="$1"; shift
opattern="$1"; pattern="$1"; shift
otype="$1"
- if [ ! -f "$USHER_CONFD/$name.conf" ]; then
- echo >&2 "There is no server configuration named '$name', nothing to modify."
+ if [ ! -f "$USHER_CONFD/$path.conf" ]; then
+ echo >&2 "There is no server configuration with the path '$path', nothing to modify."
exit 1
fi
@@ -389,9 +389,9 @@ modsrv0 () {
* )
;;
esac
- done < "$USHER_CONFD/$name.conf"
- mv "$USHER_CONFD/$name.conf" "$USHER_CONFD/$name.conf~"
- writesrv0 modified "$name" "$host" "$pattern" "$@"
+ done < "$USHER_CONFD/$path.conf"
+ mv "$USHER_CONFD/$path.conf" "$USHER_CONFD/$path.conf~"
+ writesrv0 modified "$path" "$host" "$pattern" "$@"
}
modsrv () {
@@ -399,18 +399,18 @@ modsrv () {
echo >&2 "Please reload usher to activate."
}
-# $1 server name
+# $1 server path
delsrv0 () {
- name="$1"
+ path="$1"
- if [ ! -f "$USHER_CONFD/$name.conf" ]; then
- echo >&2 "There is no server configuration named '$name', nothing to delete."
+ if [ ! -f "$USHER_CONFD/$path.conf" ]; then
+ echo >&2 "There is no server configuration with the path '$path', nothing to delete."
exit 1
fi
- rm -f "$USHER_CONFD/$name.conf" "$USHER_CONFD/$name.conf~"
+ rm -f "$USHER_CONFD/$path.conf" "$USHER_CONFD/$path.conf~"
rebuild
- echo >&2 "Server '$name' deleted."
+ echo >&2 "Server '$path' deleted."
}
delsrv () {
@@ -418,9 +418,9 @@ delsrv () {
echo >&2 "Please reload usher to activate."
}
-# $1 name
+# $1 path
rebuild_permissions () {
- confdir="$USHER_PROJECTDIR/$name"
+ confdir="$USHER_PATHDIR/$path"
aconfdir="$confdir/admin"
amtn="$MTN --confdir \"$aconfdir\" --no-standard-rcfiles --no-workspace"
listenport=`cat "$USHER_CONF" | grep '^ *listenaddr' | tail -1 | \
@@ -455,21 +455,21 @@ rebuild_permissions () {
}
# $1 type
-# $2 name
-mkproject () {
+# $2 path
+mkserver () {
type="$1"; shift
- name="$1"; shift
+ path="$1"; shift
- if [ -e "$USHER_PROJECTDIR/$name" ]; then
- echo >&2 "There already is a project named '$name'."
+ if [ -e "$USHER_PATHDIR/$path" ]; then
+ echo >&2 "There already is a configured path '$path'."
exit 1
fi
- confdir="$USHER_PROJECTDIR/$name"
+ confdir="$USHER_PATHDIR/$path"
aconfdir="$confdir/admin"
- # Create protect project infrastructure
+ # Create protect path infrastructure
set -e
mkdir "$confdir"
mkdir "$confdir/hooks.d"
@@ -491,24 +491,24 @@ mkproject () {
amtn="$MTN --confdir \"$aconfdir\" --no-standard-rcfiles --no-workspace"
# Generate admin key
- (echo; echo) | eval $amtn genkey "\"$name-admin\"" > /dev/null 2> /dev/null
- akid=`eval $amtn ls keys | grep "$name-admin\$" | tail -1 | cut -f1 -d' '`
+ (echo; echo) | eval $amtn genkey "\"$path-admin\"" > /dev/null 2> /dev/null
+ akid=`eval $amtn ls keys | grep "$path-admin\$" | tail -1 | cut -f1 -d' '`
_maybe_set_directory_owner "$aconfdir/keys"
# Add admin information
- touch "$aconfdir/type.$type" # A marker for the project type
+ touch "$aconfdir/type.$type" # A marker for the path type
touch "$aconfdir/patterns" # The branch patterns handled by this
- # project. If none, "*" is assumed.
+ # path. If none, "*" is assumed.
touch "$aconfdir/rokeys" # r/o key identities, one per line.
touch "$aconfdir/rwkeys" # r/w key identities, one per line.
touch "$aconfdir/rakeys" # remote_automate permissions key
# identities, one per line.
- # --- Project ---
+ # --- Path ---
mtn="$MTN -d \"$confdir/database.mtn\" --confdir \"$confdir\" --no-standard-rcfiles --ticker=dot --no-workspace"
- # Generate name and password for the server key
- skn="$name-server"
+ # Generate path and password for the server key
+ skn="$path-server"
skp=`dd if=/dev/random ibs=8 count=1 2>/dev/null | \
perl -e 'my $string=""; while (<STDIN>) { $string .= $_; } print unpack("H*",$string),"\n";'`
echo "$skn \"$skp\"" > $confdir/passphrases
@@ -554,65 +554,65 @@ mkproject () {
# --- Finalise ---
- # bootstrap admin key into the project database
- eval $amtn pubkey "\"$name-admin\"" | eval $mtn read 2> /dev/null
+ # bootstrap admin key into the path database
+ eval $amtn pubkey "\"$path-admin\"" | eval $mtn read 2> /dev/null
echo "$akid" > "$aconfdir/rakeys"
- # add project server
- addsrv0 "$name" "" "" \
+ # add path server
+ addsrv0 "$path" "" "" \
local "--confdir" "$confdir" "-d" "$confdir/database.mtn" \
"--no-standard-rcfiles" "--rcfile" "$confdir/monotonerc" \
"--timestamps" "--ticker=dot"
restart_if_started
- rebuild_permissions "$name"
+ rebuild_permissions "$path"
- echo >&2 "$type project '$name' created."
+ echo >&2 "$type path '$path' created."
}
-# $1: name
-rmproject () {
- name="$1"; shift
+# $1: path
+rmpath () {
+ path="$1"; shift
- if [ ! -e "$USHER_PROJECTDIR/$name" ]; then
- echo >&2 "There is no project named '$name'."
+ if [ ! -e "$USHER_PATHDIR/$path" ]; then
+ echo >&2 "There is no configured path '$path'."
exit 1
fi
- delsrv0 "$name"
+ delsrv0 "$path"
restart_if_started
- rm -rf "$USHER_PROJECTDIR/$name"
- echo >&2 "Project '$name' removed."
+ rm -rf "$USHER_PATHDIR/$path"
+ echo >&2 "Path '$path' removed."
}
-# $1: name
+# $1: path
# $2: type
# stdin: public key
-addprojectkey () {
- name="$1"; shift
+addpathkey () {
+ path="$1"; shift
type="$1"; shift
key="`cat`"
- if [ ! -e "$USHER_PROJECTDIR/$name" ]; then
- echo >&2 "There is no project named '$name'."
+ if [ ! -e "$USHER_PATHDIR/$path" ]; then
+ echo >&2 "There is no configured path '$path'."
exit 1
fi
- confdir="$USHER_PROJECTDIR/$name"
+ confdir="$USHER_PATHDIR/$path"
aconfdir="$confdir/admin"
amtn="$MTN --confdir \"$aconfdir\" --no-standard-rcfiles --no-workspace"
listenaddr=mtn://`cat "$USHER_CONF" | grep '^ *listenaddr' | tail -1 | \
- cut -f2 -d'"' | sed -e 's|^0\.0\.0\.0:\(.*\)$|127.0.0.1:\1|'`/"$name"
+ cut -f2 -d'"' | sed -e 's|^0\.0\.0\.0:\(.*\)$|127.0.0.1:\1|'`/"$path"
- # Send the public key to the project server
+ # Send the public key to the path server
if ! (
if status0; then
- eval $amtn --keydir "\"$aconfdir/keys\"" --key "$name-admin" \
+ eval $amtn --keydir "\"$aconfdir/keys\"" --key "$path-admin" \
automate remote --remote-stdio-host $listenaddr \
put_public_key "\"$key\"" 2> /tmp/mtn.$$.err
else
- eval $amtn --keydir "\"$aconfdir/keys\"" --key "$name-admin" \
+ eval $amtn --keydir "\"$aconfdir/keys\"" --key "$path-admin" \
--db "\"$confdir/database.mtn\"" \
automate put_public_key "\"$key\"" 2> /tmp/mtn.$$.err
fi
@@ -652,23 +652,23 @@ addprojectkey () {
fi
done
- rebuild_permissions "$name"
+ rebuild_permissions "$path"
- echo >&2 "key '$keyid' added to project '$name'."
+ echo >&2 "key '$keyid' added to path '$path'."
}
-# $1: name
+# $1: path
# $2: branch pattern
-addprojectpattern () {
- name="$1"; shift
+addpathpattern () {
+ path="$1"; shift
pattern="$1"; shift
- if [ ! -e "$USHER_PROJECTDIR/$name" ]; then
- echo >&2 "There is no project named '$name'."
+ if [ ! -e "$USHER_PATHDIR/$path" ]; then
+ echo >&2 "There is no configured path '$path'."
exit 1
fi
- confdir="$USHER_PROJECTDIR/$name"
+ confdir="$USHER_PATHDIR/$path"
aconfdir="$confdir/admin"
found_pattern=false
@@ -681,38 +681,38 @@ addprojectpattern () {
echo "$pattern" >> "$aconfdir/patterns"
fi
- rebuild_permissions "$name"
+ rebuild_permissions "$path"
- echo >&2 "pattern '$pattern' added to project '$name'."
+ echo >&2 "pattern '$pattern' added to path '$path'."
}
-projectinfo () {
- name="$1"; shift
+pathinfo () {
+ path="$1"; shift
- if [ ! -d "$USHER_PROJECTDIR/$name" ]; then
- echo >&2 "usherctl doesn't manage the project $name"
+ if [ ! -d "$USHER_PATHDIR/$path" ]; then
+ echo >&2 "usherctl doesn't manage the path $path"
return 1
fi
while [ $# -gt 0 ]; do
case "$1" in
configdir )
- echo "configdir: $USHER_PROJECTDIR/$name"
+ echo "configdir: $USHER_PATHDIR/$path"
;;
database )
- echo "database: $USHER_PROJECTDIR/$name/database.mtn"
+ echo "database: $USHER_PATHDIR/$path/database.mtn"
;;
patterns )
- if [ -f "$USHER_PROJECTDIR/$name/admin/patterns" ]; then
- patterns="`cat "$USHER_PROJECTDIR/$name/admin/patterns" | sed -e '/^ *$/d'`"
+ if [ -f "$USHER_PATHDIR/$path/admin/patterns" ]; then
+ patterns="`cat "$USHER_PATHDIR/$path/admin/patterns" | sed -e '/^ *$/d'`"
if [ -z "$patterns" ]; then patterns="*"; fi
echo "$patterns" | sed -e 's|^|pattern: |'
fi
;;
type )
- if [ -f "$USHER_PROJECTDIR/$name/admin/type.private" ]; then
+ if [ -f "$USHER_PATHDIR/$path/admin/type.private" ]; then
echo "type: private"
- elif [ -f "$USHER_PROJECTDIR/$name/admin/type.public" ]; then
+ elif [ -f "$USHER_PATHDIR/$path/admin/type.public" ]; then
echo "type: public"
fi
;;
@@ -722,14 +722,14 @@ list () {
}
list () {
- grep '^ *server *"' "$USHER_CONF" | cut -f2 -d'"' | while read name; do
- text="$name"
+ grep '^ *server *"' "$USHER_CONF" | cut -f2 -d'"' | while read path; do
+ text="$path"
extratext=" (WARNING: seems manually added, might get overwritten)"
- if [ -f "$USHER_CONFD/$name.conf" ]; then
+ if [ -f "$USHER_CONFD/$path.conf" ]; then
extratext=" (managed with usherctl)"
fi
- if [ -d "$USHER_PROJECTDIR/$name" ]; then
- extratext=" (project managed with usherctl)"
+ if [ -d "$USHER_PATHDIR/$path" ]; then
+ extratext=" (path managed with usherctl)"
fi
echo "$text$extratext"
done
@@ -778,7 +778,7 @@ case $1 in
done
mkdir "$USHER_CONFDIR" "$USHER_CONFD" "$USHER_LOGDIR"
- mkdir -p "$USHER_PROJECTDIR"
+ mkdir -p "$USHER_PATHDIR"
sed -e '1,/^# -----BEGIN globalconf-----$/d' \
-e '/^# -----END globalconf-----$/,$d' \
-e "s|%adminuser%|$adminuser|g" \
@@ -791,7 +791,7 @@ case $1 in
-e 's/^# //' \
< "$THIS" > "$USHER_GLOBALCONF"
_maybe_set_directory_owner "$USHER_CONFDIR" "$USHER_CONFD" \
- "$USHER_LOGDIR" "$USHER_PROJECTDIR"
+ "$USHER_LOGDIR" "$USHER_PATHDIR"
rebuild
echo >&2 "Global configuration file $USHER_GLOBALCONF generated."
# echo >&2 "You should probably edit it."
@@ -803,9 +803,9 @@ case $1 in
add | mod )
op="$1"; shift
- name="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "No name given."
+ path="$1"; shift
+ if [ -z "$path" ]; then
+ echo >&2 "No path given."
exit 1
fi
@@ -837,7 +837,7 @@ case $1 in
done
case $1 in
local | remote )
- ${op}srv "$name" "$host" "$pattern" "$@"
+ ${op}srv "$path" "$host" "$pattern" "$@"
;;
* )
echo >&2 "Unknown server type $1."
@@ -847,41 +847,41 @@ case $1 in
;;
del )
shift
- name="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "No name given."
+ path="$1"; shift
+ if [ -z "$path" ]; then
+ echo >&2 "No path given."
exit 1
fi
- delsrv "$name"
+ delsrv "$path"
;;
- mkpubproject | mkprivproject )
- type=`case $1 in mkpubproject ) echo public ;; mkprivproject ) echo private ;; esac`
+ mkpubserver | mkprivserver )
+ type=`case $1 in mkpubserver ) echo public ;; mkprivserver ) echo private ;; esac`
shift
- name="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "You have to give your project a name."
+ path="$1"; shift
+ if [ -z "$path" ]; then
+ echo >&2 "You have to give your server a path."
exit 1
fi
- mkproject "$type" "$name"
+ mkserver "$type" "$path"
;;
- rmproject )
+ rmserver )
shift
- name="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "You have to give your project a name."
+ path="$1"; shift
+ if [ -z "$path" ]; then
+ echo >&2 "You have to give your server a path."
exit 1
fi
- rmproject "$1"
+ rmserver "$1"
;;
info )
shift
- name="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "No name given."
+ path="$1"; shift
+ if [ -z "$path" ]; then
+ echo >&2 "No path given."
exit 1
fi
@@ -896,19 +896,19 @@ case $1 in
eval set -- "$TEMP"
while true; do
case "$1" in
- -c ) # config/project directory
+ -c ) # config/server directory
c=configdir
shift
;;
- -d ) # project database
+ -d ) # server database
d=database
shift
;;
- -p ) # project patterns
+ -p ) # server patterns
p=patterns
shift
;;
- -t ) # project type
+ -t ) # server type
t=type
shift
;;
@@ -921,17 +921,17 @@ case $1 in
infos=`echo $c $d $p $t`
if [ -z "$infos" ]; then
- projectinfo "$name" configdir database patterns type
+ serverinfo "$path" configdir database patterns type
else
- projectinfo "$name" $infos
+ serverinfo "$path" $infos
fi
;;
addkey )
shift
- name="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "You have to give your project a name."
+ path="$1"; shift
+ if [ -z "$path" ]; then
+ echo >&2 "You have to give your server a path."
exit 1
fi
@@ -957,19 +957,19 @@ case $1 in
esac
done
- addprojectkey "$name" "$type" # The key itself is on stdin
+ addserverkey "$path" "$type" # The key itself is on stdin
;;
addpattern )
shift
- name="$1"; shift
+ path="$1"; shift
pattern="$1"; shift
- if [ -z "$name" ]; then
- echo >&2 "You have to give your project a name."
+ if [ -z "$path" ]; then
+ echo >&2 "You have to give your server a path."
exit 1
fi
- addprojectpattern "$name" "$pattern"
+ addserverpattern "$path" "$pattern"
;;
start | stop | restart | reload | status | list )
============================================================
--- doc/usher.man 26c13c38c1676d8b6d998041fdcf2f9b58a291af
+++ doc/usher.man 877bfd079b55b4b6c4a6a2683a4b129d3b1dbef1
@@ -22,8 +22,8 @@ This is an 'usher' to allow multiple mon
.I config-file
.SH "DESCRIPTION"
This is an 'usher' to allow multiple monotone servers to work from the
-same port. The monotone client specifies a host name and a branch
-pattern with which it wants to sync;
+same port. The monotone client specifies a host name, a path and a
+branch pattern with which it wants to sync.
.B usher
then looks up which server to forward the connection to. All servers
using the same hostname (so if you support pre-0.48 clients, probably
============================================================
--- doc/usher.conf.man 8a61220224fda6b45ff661f6d1f0b0565c31db17
+++ doc/usher.conf.man 9e2bfc0d71fe84aa57bc1da7a04987b42b6c9add
@@ -33,12 +33,12 @@ script "name" "exe" "arg" "arg"
logdir "/var/log/usher/"
script "name" "exe" "arg" "arg"
-server "monotone"
+path "monotone"
host "localhost"
pattern "net.venge.monotone"
remote "66.96.28.3:4691"
-server "local"
+path "local"
host "127.0.0.1"
pattern "*"
local "\-d" "/usr/local/src/managed/my.db"
@@ -53,7 +53,8 @@ administrative interface (see below). Yo
\fBuserpass\fP lines.
.TP
\fBmonotone "\fIexecutable\fP" "\fIarg1\fP" "\fIarg2\fP"\fP ...
-Gives the first part of the command line used when spawning local servers.
+Gives the first part of the command line used when spawning local
+monotone servers.
.IP
The default is
'nh
@@ -72,7 +73,7 @@ The default is
'hy 1
.TP
\fBlogdir "\fI/path/for/log/files/\fP"\fP
-A path (ending with a slash) where per-server logfiles for local
+A path (ending with a slash) where logfiles for local monotone
servers should be stored.
.IP
The default is
@@ -85,33 +86,30 @@ will be given before any arguments given
administrative interface. Any arguments specified in the config file
will be given before any arguments given to the \fBRUN\fP command.
-.SH "PER-SERVER DIRECTIVES"
+.SH "MONOTONE SERVER DIRECTIVES"
.TP
-\fBserver "\fIname\fP"\fP
-Define a new server with the given name. Clients that are version 0.48
-or later can connect to a specific server with
-\fImtn://host.com/servername\fP . If you only expect clients 0.48 or
+\fBpath "\fIname\fP"\fP
+Define a new path with the given name. Clients that are version 0.48
+or later can connect to a specific monotone server with
+\fImtn://host.com/path\fP . If you only expect clients 0.48 or
newer, this is the preferred dispatch mechanism.
.TP
\fBhost "\fIhostname-prefix\fP"\fP
-This server will match
-connections made to a hostname with the given prefix. If you expect
-clients older than 0.48 and control your DNS, this is the
-preferred dispatch mechanism.
+Usher will match connections made to a hostname with the given prefix.
+If you expect clients older than 0.48 and control your DNS, this is
+the preferred dispatch mechanism.
.TP
\fBpattern "\fIpattern-prefix\fP"\fP
-This server will match
-connections where the user's include
-pattern has the given prefix. If you don't control your DNS, this is
-the only dispatch mechanism that you can use with clients older than
-0.48.
+Usher will match connections where the user's include pattern has the
+given prefix. If you don't control your DNS, this is the only dispatch
+mechanism that you can use with clients older than 0.48.
.TP
\fBremote "\fIaddress:port\fP"\fP
-Specifies a remote server to forward connections to.
+Specifies a remote monotone server to forward connections to.
.TP
\fBlocal "\fIarg1\fP" "\fIarg2\fP"\fP ...
Specifies arguments to append to the command line in the
-\fBmonotone\fP directive, to spawn a local server to forward
+\fBmonotone\fP directive, to spawn a local monotone server to forward
connections to.
.SH "ADMINISTRATIVE INTERFACE"
If the \fBadminaddr\fP directive is given in the config file, the
@@ -139,75 +137,80 @@ closed.
closed.
.TP
\fBMATCH\fP \fIhost pattern\fP
-Looks up the name of the server that would be used for an incoming
-connection having the given host and pattern.
-Returns "\fCOK: \fIservername\fR" if a match is found,
+Looks up the name of the monotone server that would be used for an
+incoming connection having the given host and pattern.
+Returns "\fCOK: \fIpath\fR" if a match is found,
or "\fCERROR: \fImessage\fR" if no match is found.
.TP
-\fBSTATUS\fP [ \fIservername\fP ]
-Get the status of a particular server, or of the usher as a whole if
-no server is specified.
+\fBSTATUS\fP [ \fIpath\fP ]
+Get the status of a particular monotone server for the given path, or
+of the usher as a whole if no path is specified.
.RS
.PP
-If a server is specified, the result will be one of
+If the path for a server is specified, the result will be one of
.IP "\fCREMOTE\fP"
-This is a remote server without open connections.
+This is a remote monotone server without open connections.
.IP "\fCACTIVE \fP\fIn\fP"
-This server currently has n open connections
+This monotone server currently has n open connections
.IP "\fCWAITING\fP"
-This (local) server is running, but has no open connections.
+This (local) monotone server is running, but has no open connections.
.IP "\fCSLEEPING\fP"
-This (local) server is not running, but is available to connect to.
+This (local) monotone server is not running, but is available to
+connect to.
.IP "\fCSTOPPING \fP\fIn\fP"
-This (local) server has been asked to stop, but still has n open
-connections. It will not accept further connections.
+This (local) monotone server has been asked to stop, but still has n
+open connections. It will not accept further connections.
.IP "\fCSTOPPED\fP"
-This (local) server is not running, and will not accept connections.
+This (local) monotone server is not running, and will not accept
+connections.
.IP "\fCSHUTTINGDOWN\fP"
-The usher is being shut down, and will not accept further
-connections.
+Usher is being shut down, and will not accept further connections.
.IP "\fCSHUTDOWN\fP"
-The usher has been shut down, and will not accept connections. All
-local servers have been stopped.
+Usher has been shut down, and will not accept connections. All local
+monotone servers have been stopped.
.PP
-If no server is specified, the response will be \fCWAITING\fP,
+If no path is specified, the response will be \fCWAITING\fP,
\fCACTIVE\fP, \fCSHUTTINGDOWN\fP, or \fCSHUTDOWN\fP, with
.I n
-being the total number of open connections across all servers.
+being the total number of open connections across all monotone
+servers.
.RE
.TP
-\fBLISTCONNECTIONS\fP [ \fIservername\fP ]
+\fBLISTCONNECTIONS\fP [ \fIpath\fP ]
Returns a space-separated list of all open connections to the
-given server, or to any server if no server is specified. The list
-items are "(server)address:port", with the address and port being for
-the remote end of the connection. Returns "none" if there are no
-connections to list.
+monotone server for the given path, or to any monotone server if no
+path is specified. The list items are "address:port", with the address
+and port being for the remote end of the connection. Returns "none" if
+there are no connections to list.
.TP
-\fBSTOP\fP \fIservername\fP [ \fIreason\fP ]
-Prevent the given local server from receiving further
-connections, and stop it once all connections are closed. The result
-will be the new status of that server: \fCACTIVE\fP local servers will become
-\fCSTOPPING\fP, and \fCWAITING\fP and \fCSLEEPING\fP serveres become \fCSTOPPED\fP. Servers in
-other states are not affected.
+\fBSTOP\fP \fIpath\fP [ \fIreason\fP ]
+Prevent the local monotone server for the given path from receiving
+further connections, and stop it once all connections are closed. The
+result will be the new status of that server: \fCACTIVE\fP local
+monotone servers will become \fCSTOPPING\fP, and \fCWAITING\fP and
+\fCSLEEPING\fP monotone servers become \fCSTOPPED\fP. Monotone servers
+in other states are not affected.
.TP
-\fBSTART\fP \fIservername\fP
-Allow a \fCSTOPPED\fP or \fCSTOPPING\fP server to receive connections again.
-The result will be the new status of that server: \fCSTOPPING\fP servers
-become \fCACTIVE\fP, and \fCSTOPPED\fP servers become \fCSLEEPING\fP. Servers in other
-states are not affected.
+\fBSTART\fP \fIpath\fP
+Allow a \fCSTOPPED\fP or \fCSTOPPING\fP monotone server to receive
+connections again. The result will be the new status of that monotone
+server: \fCSTOPPING\fP monotone servers become \fCACTIVE\fP, and
+\fCSTOPPED\fP monotone servers become \fCSLEEPING\fP. Monotnoe servers
+in other states are not affected.
.TP
-\fBKILL_NOW\fP \fIservername\fP [ \fIreason\fP ]
-Immediately kill the given local server, dropping any open
-connections, and prevent it from receiving new connections and
-restarting. The named server will immediately change to state \fCSTOPPED\fP.
+\fBKILL_NOW\fP \fIpath\fP [ \fIreason\fP ]
+Immediately kill the local monotone server for the given path,
+dropping any open connections, and prevent it from receiving new
+connections and restarting. The state of the affected monotone server
+will immediately change to \fCSTOPPED\fP.
.TP
\fBLIST\fP [ \fIstate\fP ]
-Without an argument, returns a
-space-separated list of all servers. With an argument, returns a list
-of all servers which are in the given state.
+Without an argument, returns a space-separated list of all paths.
+With an argument, returns a list of all paths for which the monotone
+servers are in the given state.
.TP
\fBSHUTDOWN\fP [ \fIreason\fP ]
-Do not accept new connections for any servers, local or
+Do not accept new connections for any monotone server, local or
remote. Returns "\fCok\fP".
.TP
\fBSTARTUP\fP
@@ -229,14 +232,15 @@ newline.
followed by a newline, the exit status and a comment, and another
newline.
.TP
-\fBREMOVE_SERVER\fP \fIservername\fP
-Remove the named server, as if by removing it from the config
-file and giving the \fBRELOAD\fP command. Returns "\fCok\fP", or
-"\fCnot found\fP" if the named server doesn't exist.
+\fBREMOVE_SERVER\fP \fIpath\fP
+Remove the monotone server for the given path, as if by removing it
+from the config file and giving the \fBRELOAD\fP command. Returns
+"\fCok\fP", or "\fCnot found\fP" if affected monotone server server
+doesn't exist.
.TP
-\fBADD_SERVER\fP \fIname\fP { \fBremote\fP | \fBlocal\fP } \fIarg\fP ...
-Add a server with the given name and startup arguments (or name and
-address for remote servers).
+\fBADD_SERVER\fP \fIpath\fP { \fBremote\fP | \fBlocal\fP } \fIarg\fP ...
+Add a monotone server with the given path and startup arguments (or
+path and address for remote servers).
"\fIarg\fP ..." is either "\fIhostname port\fP" for remote servers, or
arguments to the underlying
.B monotone
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-commits-diffs] net.venge.monotone.contrib.usher.path-instead-of-server: 01984ec8240da5e8a0b160ff85f6ee244fe9e41d,
code <=