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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos
Commits
4f5af09f
Commit
4f5af09f
authored
Dec 08, 2022
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Plain Diff
software/mosquitto: Implement password-based authentication ...
See merge request
nexedi/slapos!1298
parents
32447daf
af34e75b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
9 deletions
+42
-9
software/mosquitto/buildout.hash.cfg
software/mosquitto/buildout.hash.cfg
+1
-1
software/mosquitto/instance.cfg.in
software/mosquitto/instance.cfg.in
+37
-8
software/mosquitto/software.cfg
software/mosquitto/software.cfg
+4
-0
No files found.
software/mosquitto/buildout.hash.cfg
View file @
4f5af09f
[instance-profile]
filename = instance.cfg.in
md5sum =
6bfa6ce34bc99511d71ef68f677c99a9
md5sum =
4c7aa7b2132dc13ddee37fb416decf81
software/mosquitto/instance.cfg.in
View file @
4f5af09f
...
...
@@ -34,21 +34,47 @@ bin = ${:home}/bin
[mosquitto-config-file]
recipe = slapos.recipe.build
location = ${directory:etc}/${:_buildout_section_name_}.cfg
ip = ${instance-parameter:ipv4-random}
ipv4 = ${instance-parameter:ipv4-random}
ipv6 = ${instance-parameter:ipv6-random}
port = 1883
password = ${mosquitto-password-file:location}
install =
config = open(self.options["location"], "w")
ip = self.options["ip"]
config.write(f"listener 1883 {ip}\nprotocol mqtt")
port = self.options["port"]
ipv4 = self.options["ipv4"]
ipv6 = self.options["ipv6"]
password = self.options["password"]
config.write(f"listener {port} {ipv4}\nprotocol mqtt\n\n")
config.write(f"listener {port} {ipv6}\nprotocol mqtt\n\n")
config.write(f"password_file {password}\n\n")
[mosquitto-password-file]
recipe = plone.recipe.command
location = ${directory:etc}/${:_buildout_section_name_}.txt
command =
touch ${:location}
{{ mosquitto_location }}/bin/mosquitto_passwd -b ${:location} ${mosquitto-password:username} ${mosquitto-password:passwd}
stop-on-error = true
[mosquitto-password]
recipe = slapos.cookbook:generate.password
username = mosquitto
[mosquitto-listen-promise]
[mosquitto-listen-promise
-ipv4
]
<= check-port-listening-promise
hostname = ${mosquitto-config-file:ip}
port = 1883
hostname = ${mosquitto-config-file:ipv4}
port = ${mosquitto-config-file:port}
[mosquitto-listen-promise-ipv6]
<= check-port-listening-promise
hostname = ${mosquitto-config-file:ipv6}
port = ${mosquitto-config-file:port}
[promises]
recipe =
instance-promises =
${mosquitto-listen-promise:path}
${mosquitto-listen-promise-ipv4:path}
${mosquitto-listen-promise-ipv6:path}
[mosquitto-service]
recipe = slapos.cookbook:wrapper
...
...
@@ -58,4 +84,7 @@ output = $${:wrapper-path}
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url = mqtt://${mosquitto-listen-promise:hostname}:${mosquitto-listen-promise:port}
ipv4 = mqtt://${mosquitto-config-file:ipv4}:${mosquitto-config-file:port}
ipv6 = mqtt://${mosquitto-config-file:ipv6}:${mosquitto-config-file:port}
username = ${mosquitto-password:username}
password = ${mosquitto-password:passwd}
software/mosquitto/software.cfg
View file @
4f5af09f
...
...
@@ -8,6 +8,10 @@ extends =
parts =
slapos-cookbook
instance-profile
plone.recipe.command
[plone.recipe.command]
recipe = zc.recipe.egg
[instance-profile]
recipe = slapos.recipe.template:jinja2
...
...
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