summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-12-03 14:36:49 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2016-12-03 16:06:49 +0000
commite8164607276cc0b4cf3d92df12034222a70beed0 (patch)
treefa23611297de126b298fa88aa3b65d58d81fc667 /bin
parent217401944117a6411628d454e8e3632da6a65d54 (diff)
downloadgitano-e8164607276cc0b4cf3d92df12034222a70beed0.tar.gz
Support a gitano-bypass user in gitano-setup
Diffstat (limited to 'bin')
-rw-r--r--bin/gitano-setup.in31
1 files changed, 23 insertions, 8 deletions
diff --git a/bin/gitano-setup.in b/bin/gitano-setup.in
index 0b5b854..df904fa 100644
--- a/bin/gitano-setup.in
+++ b/bin/gitano-setup.in
@@ -166,6 +166,9 @@ end
assert(file_exists(ask_for("paths.pubkey", gitano.i18n.expand("SETUP_PATHS_PUBKEY_INFO"),
pubkey_path)),
gitano.i18n.expand("SETUP_PATHS_PUBKEY_NOT_FOUND"))
+assert(file_exists(ask_for("paths.bypasskey", gitano.i18n.expand("SETUP_PATHS_BYPASSKEY_INFO"),
+ pubkey_path)),
+ gitano.i18n.expand("SETUP_PATHS_BYPASSKEY_NOT_FOUND"))
ask_for("paths.repos", gitano.i18n.expand("SETUP_PATHS_REPOS_INFO"),
get("paths.home") .. "/repos")
@@ -224,14 +227,26 @@ acquire(skel, "", skel_path)
skel:close()
-- Now build the user files
-gitano.log.info(gitano.i18n.expand("SETUP_PREP_ADMIN_USER", {user=get("admin.username")}))
-local userpath = "users/" .. get("admin.username") .. "/user.conf"
-local keypath = "users/" .. get("admin.username") .. "/" .. get("admin.keyname") .. ".key"
-local userconf = clod.parse("")
-userconf.settings.real_name = get("admin.realname")
-userconf.settings.email_address = get("admin.email")
-completely_flat[userpath] = userconf:serialise()
-completely_flat[keypath] = assert(sio.open(get("paths.pubkey"), "r")):read "*a"
+do
+ gitano.log.info(gitano.i18n.expand("SETUP_PREP_BYPASS_USER", {user="gitano-bypass"}))
+ local userpath = "users/gitano-bypass/user.conf"
+ local keypath = "users/gitano-bypass/initial.key"
+ local userconf = clod.parse("")
+ userconf.settings.real_name = gitano.i18n.expand("SETUP_BYPASS_USER_REAL_NAME")
+ userconf.settings.email_address = get("admin.email")
+ completely_flat[userpath] = userconf:serialise()
+ completely_flat[keypath] = assert(sio.open(get("paths.bypasskey"), "r")):read "*a"
+end
+do
+ gitano.log.info(gitano.i18n.expand("SETUP_PREP_ADMIN_USER", {user=get("admin.username")}))
+ local userpath = "users/" .. get("admin.username") .. "/user.conf"
+ local keypath = "users/" .. get("admin.username") .. "/" .. get("admin.keyname") .. ".key"
+ local userconf = clod.parse("")
+ userconf.settings.real_name = get("admin.realname")
+ userconf.settings.email_address = get("admin.email")
+ completely_flat[userpath] = userconf:serialise()
+ completely_flat[keypath] = assert(sio.open(get("paths.pubkey"), "r")):read "*a"
+end
-- And now the gitano-admin group
gitano.log.info(gitano.i18n.expand("SETUP_PREP_GITANO_ADMIN"))