commit - 0926e3456c5719c231467a4c7e4481f9e355d968094709ac24e515c928e579e5
commit + 9527045ad78ba956142e13a60fdf5dbdb803203d6c922fdbb40b45b272974f6b
blob - c9ff7977d366ee884d0c05b11d3b4dada58a41fc0a03645e25148045f83a6443
blob + 14e54601fef7683d97ad6aecba4f4682a9a53842fa22a448b3890dd848380803
--- gotsys/gotsys.conf.5
+++ gotsys/gotsys.conf.5
or in UTF-8 encoding if
.Ar string
is wrapped in quotes.
+.It Ic hash algorithm Ar hashing-algorithm
+Configure the repository's
+.Ar hashing-algorithm
+used for the computation of Git object IDs.
+Possible values are
+.Dq sha1
+.Pq the default
+or
+.Dq sha256 .
+.Pp
+This configuration directive only affects newly created repositories.
+The hashing algorithm of existing repositories cannot be changed.
.It Ic head Ar branch
Point the repository's symbolic
.Pa HEAD
blob - 3358507cfcd8b986b18dc1cde941db274388257fa71093ecd8a18bdfc3d4af67
blob + 2b568ab8ec90874385848adc84b5694efea6e0800a86c013a6027a93857b3473
--- gotsys/gotsys.h
+++ gotsys/gotsys.h
char name[NAME_MAX];
char *headref;
char description[GOTWEBD_MAXDESCRSZ];
+ enum got_hash_algorithm algo;
struct gotsys_access_rule_list access_rules;
char **, const char *);
const struct got_error *gotsys_conf_validate_mediatype(const char *);
const struct got_error *gotsys_conf_validate_string(const char *);
+const struct got_error *gotsys_conf_validate_hash_algo(
+ enum got_hash_algorithm *, const char *);
const struct got_error *gotsys_conf_new_access_rule(
struct gotsys_access_rule **, enum gotsys_access, int, const char *,
struct gotsys_userlist *, struct gotsys_grouplist *);
blob - 19e734522e24fb9706609b7392514d0bb2e36788183834ba98cb3cfb3b02ecf9
blob + 5c40e8e5af2f41cd914dd6ff4a1e49c31f1e0d6292f3e45f3207d372ec54b90b
--- gotsys/parse.y
+++ gotsys/parse.y
%token NOTIFY EMAIL FROM REPLY TO URL INSECURE HMAC HEAD WEB SERVER
%token HIDE REPOSITORIES STYLESHEET LOGO SITE OWNER WEBSITE PATH
%token DISABLE ENABLE AUTHENTICATION MEDIA TYPES DESCRIPTION
+%token HASH ALGORITHM
%token <v.string> STRING
%token <v.number> NUMBER
}
free($2);
}
+ | HASH ALGORITHM STRING {
+ const struct got_error *err;
+
+ err = gotsys_conf_validate_hash_algo(&new_repo->algo,
+ $3);
+ if (err) {
+ yyerror("%s", err->msg);
+ free($3);
+ YYERROR;
+ }
+ free($3);
+ }
;
webrepo : REPOSITORY STRING {
{
/* This has to be sorted always. */
static const struct keywords keywords[] = {
+ { "algorithm", ALGORITHM },
{ "authentication", AUTHENTICATION },
{ "authorized", AUTHORIZED },
{ "branch", BRANCH },
{ "enable", ENABLE },
{ "from", FROM },
{ "group", GROUP },
+ { "hash", HASH },
{ "head", HEAD },
{ "hide", HIDE },
{ "hmac", HMAC },
blob - 5cc79791938726d4a4744617b44443ae1f117e6fd472e133fc95539764871ee9
blob + 2bd0ac207a8a992374227e20e0bc16214f7b4d622c0cfc20be46e9d25ddd36ab
--- gotsysd/gotsysd.h
+++ gotsysd/gotsysd.h
/* Structture for GOTSYSD_IMSG_SYSCONF_REPO_CREATE. */
struct gotsysd_imsg_sysconf_repo_create {
+ int algo;
size_t name_len;
size_t headref_len;
/* Structure for GOTSYSD_IMSG_SYSCONF_REPO, */
struct gotsysd_imsg_sysconf_repo {
+ int algo;
size_t name_len;
size_t headref_len;
size_t description_len;
blob - a0fb9594eb1e360c5bb70229bf9ea3275d0f9936fa8b70cec0def8572754a3f2
blob + 676e58a60c88b9443fb7398e03ea50e470addb8917834717bada46d865b16116
--- gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c
+++ gotsysd/libexec/gotsys-repo-create/gotsys-repo-create.c
param.name_len == 0)
return got_error(GOT_ERR_PRIVSEP_LEN);
+ err = got_hash_algo_validate(param.algo);
+ if (err)
+ goto done;
+
repo_name = strndup(imsg->data + sizeof(param), param.name_len);
if (repo_name == NULL)
return got_error_from_errno("strndup");
} else
err = got_error_from_errno2("mkdir", abspath);
} else
- err = got_repo_init(abspath, head_name, GOT_HASH_SHA1);
+ err = got_repo_init(abspath, head_name, param.algo);
done:
free(repo_name);
free(fullname);
blob - b4521fbb075ae4947c20623684947cc5e48bffd1f9a3b0d1a7d23a4dc6114718
blob + 15251606c56643656f0757030e1a99700c93131e1e5144796f26068751aeb03b
--- gotsysd/sysconf.c
+++ gotsysd/sysconf.c
memset(&ireq, 0, sizeof(ireq));
+ ireq.algo = repo->algo;
+
ireq.name_len = strlen(repo->name);
if (repo->headref)
ireq.headref_len = strlen(repo->headref);
blob - fe646dc5260b25fd92307a8d994ce11030eaba4cfc3687a7b57805cbf550dd07
blob + bb85b7cf6e5e3355fb249bd89b035bcfae16e63bd4a9875038fb5193702bdce5
--- include/got_object.h
+++ include/got_object.h
GOT_NUM_HASH_ALGOS,
};
+/* Return a human-readable name of the hash algorithm. */
+const char *got_hash_algo_name(enum got_hash_algorithm);
+
+/* Return an error if the specified algorithm is out of range. */
+const struct got_error *got_hash_algo_validate(enum got_hash_algorithm);
+
struct got_object_id {
uint8_t hash[GOT_OBJECT_ID_MAXLEN];
enum got_hash_algorithm algo;
blob - 9034eebaf7171669ea3c0c0541e2d3b44ad19877d8bd96ab05212ab53bd6a525
blob + 5b24106921d1a132bab4f5643f099673bbe3967dedf3e48bc38493d86dfabb73
--- lib/got_lib_hash.h
+++ lib/got_lib_hash.h
* Compare two hash digest; similar to memcmp().
*/
int got_hash_cmp(enum got_hash_algorithm, uint8_t *, uint8_t *);
-
-/* Return a human-readable name of the hash algorithm. */
-const char *got_hash_algo_name(enum got_hash_algorithm);
blob - d75967e32aa3420e270c1c069bf43ed4e334e1b0243106a8f5ac05c9a29da554
blob + 7ceb0a59bddfe52ae4864af5b75a73a2ae01e41727605da621f7c13d91cf90cd
--- lib/gotsys_conf.c
+++ lib/gotsys_conf.c
#include "gotsys.h"
#include "utf8d.h"
+#include "got_lib_hash.h"
+
#ifndef nitems
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
#endif
"repository name too long: %s", name);
}
+ repo->algo = GOT_HASH_SHA1;
+
*new_repo = repo;
return NULL;
}
return NULL;
}
+const struct got_error *
+gotsys_conf_validate_hash_algo(enum got_hash_algorithm *algo, const char *name)
+{
+ int i = 0;
+
+ for (i = 0; i < GOT_NUM_HASH_ALGOS; i++) {
+ if (strcasecmp(name, got_hash_algo_name(i)) == 0) {
+ *algo = i;
+ return NULL;
+ }
+ }
+
+ return got_error_fmt(GOT_ERR_OBJECT_FORMAT, "%s", name);
+}
+
struct gotsys_repo *
gotsys_find_repo_by_name(const char *repo_name, struct gotsys_repolist *repos)
{
blob - 00824b174c59b4eb0cbb7c0af3268eede16687bfe1a0bd51f9133f8e342bb40b
blob + 8d8f055b45c24676bc6c9224184d4421684e6cc39f970b23335a613d8d362647
--- lib/gotsys_imsg.c
+++ lib/gotsys_imsg.c
memset(&irepo, 0, sizeof(irepo));
+ irepo.algo = repo->algo;
irepo.name_len = strlen(repo->name);
if (repo->headref)
irepo.headref_len = strlen(repo->headref);
irepo.name_len == 0)
return got_error(GOT_ERR_PRIVSEP_LEN);
+ err = got_hash_algo_validate(irepo.algo);
+ if (err)
+ goto done;
+
name = strndup(imsg->data + sizeof(irepo), irepo.name_len);
if (name == NULL)
return got_error_from_errno("strndup");
if (err)
goto done;
+ (*repo)->algo = irepo.algo;
(*repo)->headref = headref;
if (description != NULL) {
if (strlcpy((*repo)->description, description,
blob - 47a0706f58d6dbae63d0c112c235e145bbae8429c27c3d3d41b85dd5fd90658f
blob + a8f33fb02291dee6a53f9a4a9a13ae05dc777d57797593c7dbbb200d08ad51c7
--- lib/hash.c
+++ lib/hash.c
return "unknown";
}
}
+
+const struct got_error *
+got_hash_algo_validate(enum got_hash_algorithm algo)
+{
+ switch (algo) {
+ case GOT_HASH_SHA1:
+ return NULL;
+ case GOT_HASH_SHA256:
+ return NULL;
+ default:
+ return got_error(GOT_ERR_OBJECT_FORMAT);
+ }
+}
blob - 0aa2fe071737a49dbfe329c62750867b57620d176fd66e0ca17cce641f97ae25
blob + d2bde910a9ab6c7054a1b40db804ed149a92501da62204665de52615a41f8a23
--- regress/gotsysd/Makefile
+++ regress/gotsysd/Makefile
GOTSYSD_TEST_HMAC_SECRET!=openssl rand -base64 32
HTTPD_CONF=httpd.conf
SSHD_CONF=sshd_config
+GOT_TEST_ALGO=sha1
GOTSYSD_TEST_USER?=${DOAS_USER}
.if empty(GOTSYSD_TEST_USER)
GOTD_USER=${GOTD_USER} \
GOTSYSD_TEST_SMTP_PORT=${GOTSYSD_TEST_SMTP_PORT} \
GOTSYSD_TEST_HTTP_PORT=${GOTSYSD_TEST_HTTP_PORT} \
- GOTSYSD_TEST_HMAC_SECRET=${GOTSYSD_TEST_HMAC_SECRET}
+ GOTSYSD_TEST_HMAC_SECRET=${GOTSYSD_TEST_HMAC_SECRET} \
+ GOT_TEST_ALGO=${GOT_TEST_ALGO}
UNPRIV=su -m ${GOTSYSD_TEST_USER} -c
@${UNPRIV} "echo \\\" >> $@"
@${UNPRIV} "echo } >> $@"
@${UNPRIV} "echo repository gotsys { >> $@"
+ @${UNPRIV} "echo \ \ \ \ hash algorithm ${GOT_TEST_ALGO} >> $@"
@${UNPRIV} "echo \ \ \ \ permit rw ${GOTSYSD_TEST_USER} >> $@"
@${UNPRIV} "echo } >> $@"
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} rcctl restart syslogd"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} mkdir -m 750 /git "; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
- got init /git/${GOTSYS_REPO}"; \
+ got init -A ${GOT_TEST_ALGO} /git/${GOTSYS_REPO}"; \
${UNPRIV} "${GOTSYSD_SCP_CMD} \
${GOT_CONF} root@$${VMIP}:/git/${GOTSYS_REPO}/got.conf"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} mkdir /tmp/gotsys "; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
'rm -rf /git/${GOTSYS_REPO} /git/{foo,hidden}.git /tmp/gotsys'"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
- got init /git/${GOTSYS_REPO}"; \
+ got init -A ${GOT_TEST_ALGO} /git/${GOTSYS_REPO}"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
- got init /git/hidden.git"; \
+ got init -A ${GOT_TEST_ALGO} /git/hidden.git"; \
${UNPRIV} "${GOTSYSD_SCP_CMD} \
${GOT_CONF} root@$${VMIP}:/git/${GOTSYS_REPO}/got.conf"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} mkdir /tmp/gotsys "; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
'rm -rf /git/*.git /tmp/gotsys'"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
- got init /git/${GOTSYS_REPO}"; \
+ got init -A ${GOT_TEST_ALGO} /git/${GOTSYS_REPO}"; \
${UNPRIV} "${GOTSYSD_SCP_CMD} \
${GOT_CONF} root@$${VMIP}:/git/${GOTSYS_REPO}/got.conf"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} mkdir /tmp/gotsys "; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
'rm -rf /git/*.git /tmp/gotsys'"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} \
- got init /git/${GOTSYS_REPO}"; \
+ got init -A ${GOT_TEST_ALGO} /git/${GOTSYS_REPO}"; \
${UNPRIV} "${GOTSYSD_SCP_CMD} \
${GOT_CONF} root@$${VMIP}:/git/${GOTSYS_REPO}/got.conf"; \
${UNPRIV} "${GOTSYSD_SSH_CMD} root@$${VMIP} mkdir /tmp/gotsys "; \
blob - a5bf50ec1fb6490b6124db124e7dffa89ee0d025be02fb3649b9ebdb32ddb60a
blob + 82ffff997c4adc36877b804c4f07dc79a325ee93bc7c17641070314c7e05409c
--- regress/gotsysd/README
+++ regress/gotsysd/README
# make
+To run the test suite with SHA256 repositories, use:
+
+ # make GOT_TEST_ALGO=sha256
+
A test VM will be started automatically and stopped again once the tests
have finished running.
blob - 2954ae3d2686f64264ae771c3611a1bf8f3fd3f38cefe69239f9e8e1e36332d9
blob + 0ac6f44a8030382775f15decacec74cc2bad79cd5d6a7062350f76ed328de08c
--- regress/gotsysd/test_gotsysd.sh
+++ regress/gotsysd/test_gotsysd.sh
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
group developers
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
EOF
fi
# We should be able to import data into the newly created repository.
- got init $testroot/foo.git
+ got init -A ${GOT_TEST_ALGO} $testroot/foo.git
mkdir $testroot/foo
echo alpha > $testroot/foo/alpha
got import -m init -r $testroot/foo.git $testroot/foo >/dev/null
# An attempt to grant write permissions to anonymous is an error.
cat > ${testroot}/bad-gotsys.conf <<EOF
repository "gotsys" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw anonymous
}
EOF
return 1
fi
- echo -n "gotsys: ${testroot}/bad-gotsys.conf: line 2: " \
+ echo -n "gotsys: ${testroot}/bad-gotsys.conf: line 3: " \
> $testroot/stderr.expected
echo "the \"anonymous\" user must not have write permission" \
>> $testroot/stderr.expected
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
permit ro anonymous
}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
EOF
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
permit ro anonymous
}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
permit ro anonymous
protect branch 'mai"n'
return 1
fi
- echo "gotsys: ${testroot}/wt/gotsys.conf: line 18: invalid reference name: refs/heads/mai\"n" \
+ echo "gotsys: ${testroot}/wt/gotsys.conf: line 20: invalid reference name: refs/heads/mai\"n" \
> $testroot/stderr.expected
cmp -s $testroot/stderr.expected $testroot/stderr
ret=$?
fi
cat > ${testroot}/stderr.expected <<EOF
-git-receive-pack: gotsys.conf: line 18: invalid reference name: refs/heads/mai"n
-got-send-pack: gotsys.conf: line 18: invalid reference name: refs/heads/mai"n
+git-receive-pack: gotsys.conf: line 20: invalid reference name: refs/heads/mai"n
+got-send-pack: gotsys.conf: line 20: invalid reference name: refs/heads/mai"n
got: could not send pack file
EOF
cmp -s $testroot/stderr.expected $testroot/stderr
}
repository "gotsys" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
head "refs/heads/foo"
}
fi
cat > $testroot/stderr.expected <<EOF
-gotsys: ${testroot}/bad-gotsys.conf: line 8: HEAD of the "gotsys" repository cannot be overridden
+gotsys: ${testroot}/bad-gotsys.conf: line 9: HEAD of the "gotsys" repository cannot be overridden
EOF
cmp -s $testroot/stderr.expected $testroot/stderr
ret=$?
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
permit ro anonymous
head foo
}
repository "customhead" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
permit ro anonymous
head foo
fi
# Create branch "foo" in customhead.git.
- got init -b foo $testroot/customhead.git
+ got init -A ${GOT_TEST_ALGO} -b foo $testroot/customhead.git
mkdir $testroot/foo
echo alpha > $testroot/foo/alpha
got import -m init -b foo -r $testroot/customhead.git \
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
permit ro anonymous
head foo
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
deny ${GOTSYSD_DEV_USER}
permit ro anonymous
head foo
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository "foo" {
+ hash algorithm "${GOT_TEST_ALGO}"
deny ${GOTSYSD_DEV_USER}
permit ro anonymous
head foo
}
}
repository "bar" {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
EOF
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
notify url "http://${GWIP}:${GOTSYSD_TEST_HTTP_PORT}/" user flan password "password" insecure hmac "${GOTSYSD_TEST_HMAC_SECRET}"
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
notify email to "${GOTSYSD_TEST_USER}@example.com"
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
blob - 5269911176f549d7dace31847685d10735427f9286fac6df40b1889d6f71d5ef
blob + b270fb5f9c49d59348aacd8eec5cad60048429c41334cab07887268941ee7c84
--- regress/gotsysd/test_gotwebd.sh
+++ regress/gotsysd/test_gotwebd.sh
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository testrepo.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
repository gottestdev.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
repository hidden.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
web server "${VMIP}" {
return 1
fi
- got init $testroot/testrepo.git
+ got init -A ${GOT_TEST_ALGO} $testroot/testrepo.git
ret=$?
if [ $ret -ne 0 ]; then
"got init failed unexpectedly"
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository public.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository gottestdev.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
repository gottest {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
repository hidden.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
web server "${VMIP}" {
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository public.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository gottestdev.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
repository gottest.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
repository hidden.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
web server "${VMIP}" {
group devs
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw :writers
}
repository public.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw :writers
}
repository gottestdev.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw :devs
}
repository gottest.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw :testers
}
repository hidden.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw :testers
}
web server "${VMIP}" {
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository public.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository gottestdev.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
repository gottest.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
repository hidden.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
web server "${VMIP}" {
return 1
fi
- got init $testroot/public.git > /dev/null
+ got init -A ${GOT_TEST_ALGO} $testroot/public.git > /dev/null
mkdir -p $testroot/public
cat > $testroot/public/readme.txt <<EOF
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository public.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository gottestdev.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
repository gottest.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
repository hidden.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
web server "${VMIP}" {
authorized key ${sshkey}
}
repository gotsys.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository public.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository gottestdev.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_DEV_USER}
}
repository gottest.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
repository hidden.git {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
}
web server "${VMIP}" {
return 1
fi
cat > $testroot/stderr.expected <<EOF
-gotsys: ${testroot}/wt/gotsys.conf.bad: line 42: invalid UTF-8 string
+gotsys: ${testroot}/wt/gotsys.conf.bad: line 47: invalid UTF-8 string
EOF
cmp -s $testroot/stderr.expected $testroot/stderr
ret=$?
return 1
fi
- got init $testroot/public.git > /dev/null
+ got init -A ${GOT_TEST_ALGO} $testroot/public.git > /dev/null
mkdir -p $testroot/public
cat > $testroot/public/readme.txt <<EOF
blob - fc0028671da5dc79ca52a8b0290a47745c5dfbe95c62c0446a179652d8e89b9b
blob + 9e69a84a3bc4ffaca1bc814935881782861a38f72e509948e87fd6014c413723
--- regress/gotsysd/test_gotwebd_repos_www.sh
+++ regress/gotsysd/test_gotwebd_repos_www.sh
authorized key ${sshkey}
}
repository gotsys {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository www {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
return 1
fi
- got init $testroot/www.git > /dev/null
+ got init -A ${GOT_TEST_ALGO} $testroot/www.git > /dev/null
mkdir -p $testroot/www
cat > $testroot/www/index.html <<EOF
blob - 63adf8d558081735aa12a9459864c179f6bd40b90bff1d872033f9f0251ee21a
blob + edd4e8587b1c123f9a3693612e515b0ea786268443c811083bb1e647ca78c261
--- regress/gotsysd/test_gotwebd_www.sh
+++ regress/gotsysd/test_gotwebd_www.sh
authorized key ${sshkey}
}
repository gotsys {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository www {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
return 1
fi
- got init $testroot/www.git > /dev/null
+ got init -A ${GOT_TEST_ALGO} $testroot/www.git > /dev/null
mkdir -p $testroot/www
cat > $testroot/www/index.html <<EOF
authorized key ${sshkey}
}
repository gotsys {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
repository www {
+ hash algorithm "${GOT_TEST_ALGO}"
permit rw ${GOTSYSD_TEST_USER}
permit rw ${GOTSYSD_DEV_USER}
}
return 1
fi
- got init -b website $testroot/www.git > /dev/null
+ got init -A ${GOT_TEST_ALGO} -b website $testroot/www.git > /dev/null
mkdir -p $testroot/www
cat > $testroot/www/index.html <<EOF