comparison src/lib/Shared.luan @ 4:028e74c8889d

add all_users
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 12 May 2022 16:54:11 -0600
parents dfc36e7ed22c
children
comparison
equal deleted inserted replaced
3:e3448053230a 4:028e74c8889d
139 repo.admins = list_to_set(repo.admins) 139 repo.admins = list_to_set(repo.admins)
140 end 140 end
141 config.private = config.private and list_to_set(config.private) 141 config.private = config.private and list_to_set(config.private)
142 Shared.config = config 142 Shared.config = config
143 143
144 local user_repos = {}
145 for _, repo in pairs(config.repos) do
146 for user in pairs(repo.users) do
147 local repos = user_repos[user]
148 if repos == nil then
149 repos = {}
150 user_repos[user] = repos
151 end
152 repos[#repos+1] = repo
153 end
154 end
155 Shared.user_repos = user_repos
156
144 function Shared.get_raw_config() 157 function Shared.get_raw_config()
145 return deep_copy(raw_config) 158 return deep_copy(raw_config)
146 end 159 end
147 160
148 local function reload_nginx() 161 local function reload_nginx()