Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
512eb061
Commit
512eb061
authored
Feb 21, 2023
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: lua
parent
abf49ff3
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
74 additions
and
7 deletions
+74
-7
component/dovecot/buildout.cfg
component/dovecot/buildout.cfg
+10
-0
component/lua/buildout.cfg
component/lua/buildout.cfg
+24
-0
software/dovecot/buildout.hash.cfg
software/dovecot/buildout.hash.cfg
+8
-5
software/dovecot/dovecot-passdb.jinja2.lua
software/dovecot/dovecot-passdb.jinja2.lua
+17
-0
software/dovecot/dovecot-passwd.jinja2
software/dovecot/dovecot-passwd.jinja2
+1
-0
software/dovecot/dovecot.jinja2.conf
software/dovecot/dovecot.jinja2.conf
+6
-2
software/dovecot/instance-default.cfg.in
software/dovecot/instance-default.cfg.in
+5
-0
software/dovecot/instance.cfg.in
software/dovecot/instance.cfg.in
+1
-0
software/dovecot/software.cfg
software/dovecot/software.cfg
+2
-0
No files found.
component/dovecot/buildout.cfg
View file @
512eb061
# Dovecot
# https://doc.dovecot.org/
[buildout]
extends =
../lua/buildout.cfg
[dovecot]
recipe = slapos.recipe.cmmi
url = https://dovecot.org/releases/2.3/dovecot-2.3.20.tar.gz
...
...
@@ -10,5 +14,11 @@ configure-options =
--prefix=${:location}
--exec-prefix=${:location}
--with-systemd=no
--with-lua=yes
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${lua:location}/lib/pkgconfig
LUA_LIBS="-L${lua:location}/lib -Wl,-rpath=${lua:location}/lib -llua -lm"
LUA_CFLAGS="-I${lua:location}/include"
make-targets = install
post-install = cp -r ${:location}/share/doc/dovecot/example-config/* ${:location}/etc/dovecot/
component/lua/buildout.cfg
View file @
512eb061
...
...
@@ -28,3 +28,27 @@ pc =
Version: $${version}
Libs: -L$${libdir} -llua
Cflags: -I$${includedir}
[lua5.2]
recipe = slapos.recipe.cmmi
shared = true
url = http://www.lua.org/ftp/lua-5.2.3.tar.gz
md5sum = dc7f94ec6ff15c985d2d6ad0f1b35654
configure-command = true
make-options =
"$(uname -sr 2>/dev/null|grep -Eq '^Linux' && echo linux || echo posix)"
MYCFLAGS="-I${readline:location}/include -fPIC"
MYLDFLAGS="-L${readline:location}/lib -Wl,-rpath=${readline:location}/lib"
INSTALL_TOP=@@LOCATION@@
post-install =
mkdir -p %(location)s/lib/pkgconfig
{
make pc INSTALL_TOP=%(location)s
echo '%(pc)s'
} > %(location)s/lib/pkgconfig/lua.pc
pc =
Name: Lua
Description: Lua language engine
Version: $${version}
Libs: -L$${libdir} -llua
Cflags: -I$${includedir}
software/dovecot/buildout.hash.cfg
View file @
512eb061
...
...
@@ -15,22 +15,25 @@
[template]
filename = instance.cfg.in
md5sum =
5ded78c210ad723606f808165fe10be6
md5sum =
06e676a14d64c2aa394bab2849aff687
[template-default]
_update_hash_filename_ = instance-default.cfg.in
md5sum =
5c478f96bfb447059f8599bca65745e3
md5sum =
8b5f29e2ae0b6ae846530e6f170d8868
[dovecot.jinja2.conf]
_update_hash_filename_ = dovecot.jinja2.conf
md5sum =
abfb5606d5af39b1a6682919129708d0
md5sum =
9bf03ace9c104b8d566e782a6578561e
[dovecot-passwd.jinja2]
_update_hash_filename_ = dovecot-passwd.jinja2
md5sum = b4f2be65faad8194fd0a1e5ccb157c8e
md5sum = 9e895c044984534a330328329b8b8462
[dovecot-passdb.jinja2.lua]
_update_hash_filename_ = dovecot-passdb.jinja2.lua
md5sum = 72dbac7b1c282c83ab761efd0770082e
[postfix_main.jinja2.cf]
_update_hash_filename_ = postfix_main.jinja2.cf
md5sum =
6f13224d48a8d7a3e865142ec99bd2ea
md5sum =
ab88b1d1661d9ae9f7a2032101bdef75
[postfix_master.jinja2.cf]
_update_hash_filename_ = postfix_master.jinja2.cf
md5sum = 7752a8b4af5c18dc404e0a862af89272
...
...
software/dovecot/dovecot-passdb.jinja2.lua
0 → 100644
View file @
512eb061
function
auth_passdb_lookup
(
req
)
if
req
.
user
==
"alpha"
then
return
dovecot
.
auth
.
PASSDB_RESULT_OK
,
"password=pass"
end
return
dovecot
.
auth
.
PASSDB_RESULT_USER_UNKNOWN
,
"no such user"
end
function
script_init
()
return
0
end
function
script_deinit
()
end
function
auth_userdb_iterate
()
return
{
"alpha"
}
end
software/dovecot/dovecot-passwd.jinja2
View file @
512eb061
alpha:{PLAIN}ors123
bravo:{PLAIN}ors123
charlie:{PLAIN}ors123
delta:{PLAIN}ors123
software/dovecot/dovecot.jinja2.conf
View file @
512eb061
...
...
@@ -78,9 +78,13 @@ namespace inbox {
ssl
=
no
# passdb {
# args = {{ dovecot_passwd }}
# driver = passwd-file
# }
passdb
{
args
= {{
dovecot_passwd
}}
driver
=
passwd
-
file
driver
=
lua
args
=
file
={{
dovecot_passdb_lua
}}
blocking
=
yes
}
userdb
{
driver
=
static
...
...
software/dovecot/instance-default.cfg.in
View file @
512eb061
...
...
@@ -68,6 +68,7 @@ url = {{ dovecot_conf_template }}
output = ${directory:etc}/dovecot.conf
extra-context =
key dovecot_passwd dovecot-passwd:output
key dovecot_passdb_lua dovecot-passdb-lua:output
raw postfix_auth ${directory:var-spool-postfix-private}/auth
raw postfix_dovecot_lmtp ${directory:var-spool-postfix-private}/dovecot-lmtp
...
...
@@ -75,6 +76,10 @@ extra-context =
<= config-base
url = {{ dovecot_passwd_template }}
output = ${directory:etc}/dovecot-passwd
[dovecot-passdb-lua]
<= config-base
url = {{ dovecot_passdb_lua_template }}
output = ${directory:etc}/dovecot-passdb.lua
[userinfo]
recipe = slapos.cookbook:userinfo
...
...
software/dovecot/instance.cfg.in
View file @
512eb061
...
...
@@ -23,6 +23,7 @@ context =
raw template_monitor ${monitor2-template:output}
raw dovecot_conf_template ${dovecot.jinja2.conf:target}
raw dovecot_passwd_template ${dovecot-passwd.jinja2:target}
raw dovecot_passdb_lua_template ${dovecot-passdb.jinja2.lua:target}
raw dovecot_binary ${dovecot:location}/sbin/dovecot
raw postfix_main_template ${postfix_main.jinja2.cf:target}
raw postfix_master_template ${postfix_master.jinja2.cf:target}
...
...
software/dovecot/software.cfg
View file @
512eb061
...
...
@@ -34,6 +34,8 @@ filename = ${:_buildout_section_name_}
< = copy-to-instance
[dovecot-passwd.jinja2]
< = copy-to-instance
[dovecot-passdb.jinja2.lua]
< = copy-to-instance
[postfix_main.jinja2.cf]
< = copy-to-instance
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment