summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:32:41 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 15:32:41 +0000
commit68baec9d6dc1b5636bda02e6e75a2fabb0ba2da0 (patch)
treeb5d04e6f9d5001f18cc3f2ef5121d5470a2d28ea
parent4baf90acc593a8145440c3277957657d6725af2a (diff)
downloadgitano-68baec9d6dc1b5636bda02e6e75a2fabb0ba2da0.tar.bz2
Support dots in users and groups
-rw-r--r--lib/gitano/config.lua6
-rw-r--r--lib/gitano/lace.lua2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitano/config.lua b/lib/gitano/config.lua
index 7374d27..d253f86 100644
--- a/lib/gitano/config.lua
+++ b/lib/gitano/config.lua
@@ -81,7 +81,7 @@ local function parse_admin_config(commit)
-- Gather the users
local users = {}
for filename, obj in pairs(flat_tree) do
- local prefix, username = filename:match("^(users/.-)([a-z][a-z0-9_-]+)/user%.conf$")
+ local prefix, username = filename:match("^(users/.-)([a-z][a-z0-9_.-]+)/user%.conf$")
if prefix and username then
if not is_blob(obj) then
return nil, prefix .. username .. "/user.conf is not a blob?"
@@ -114,7 +114,7 @@ local function parse_admin_config(commit)
-- Now gather the users' keys
local all_keys = {}
for filename, obj in pairs(flat_tree) do
- local prefix, username, keyname = filename:match("^(users/.-)([a-z][a-z0-9_-]+)/([a-z][a-z0-9_-]+)%.key$")
+ local prefix, username, keyname = filename:match("^(users/.-)([a-z][a-z0-9_.-]+)/([a-z][a-z0-9_-.]+)%.key$")
if prefix and username and keyname then
if not users[username] then
return nil, "Found a key (" .. keyname .. ") for " .. username .. " which lacks a user.conf"
@@ -157,7 +157,7 @@ local function parse_admin_config(commit)
-- Now gather the groups
local groups = {}
for filename, obj in pairs(flat_tree) do
- local prefix, groupname = filename:match("^(groups/.-)([a-z][a-z0-9_-]+)%.conf$")
+ local prefix, groupname = filename:match("^(groups/.-)([a-z][a-z0-9_.-]+)%.conf$")
if prefix and groupname then
if groups[groupname] then
return nil, "Duplicate group name: " .. groupname
diff --git a/lib/gitano/lace.lua b/lib/gitano/lace.lua
index 2376cc8..953327e 100644
--- a/lib/gitano/lace.lua
+++ b/lib/gitano/lace.lua
@@ -12,7 +12,7 @@ local log = require 'gitano.log'
local pcre = require "rex_pcre"
local function flatten_name(n)
- return n:gsub("[^A-Za-z0-9]", "_")
+ return n:gsub("[^A-Za-z0-9.-]", "_")
end
local function generate_automatics(ctx)
local config = ctx.repo.config