Skip to content

Commit 3edcfd2

Browse files
author
Philipp Lamp
committed
test for dev
1 parent 4e99169 commit 3edcfd2

File tree

12 files changed

+86
-3
lines changed

12 files changed

+86
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ COPY install_hivemq.sh docker-entrypoint.sh /
1010
RUN chmod +x /docker-entrypoint.sh \
1111
&& source /install_hivemq.sh \
1212
&& rm /install_hivemq.sh
13-
COPY hivemq/ /opt/hivemq/
13+
COPY opt/ /opt/
1414
RUN chown -R hivemq:hivemq /opt/hivemq/*
1515

1616

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ Plugins
4141
-------
4242
To add plugins you could mount them to the plugin directory as described. For ease of use I recommend instead extending the Dockerfile.
4343

44+
Authentication
45+
--------------
46+
By default the file authentication plugin (see http://www.hivemq.com/plugin/file-authentication/) is installed in production-ready configuration and exactly one user.
47+
48+
| User | Password |
49+
| ---- | -------- |
50+
| hivemq | test |
51+
52+
To disable the authentication completely (e.g. for testing purposes), start the docker image with `-e HIVEMQ_DISABLE_AUTH_PLUGIN=true`
53+
54+
4455

4556
Start on docker native cluster
4657
------------------------------

Vagrantfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Vagrant.configure(2) do |config|
77
(1..number_of_instances).each do |instance_number|
88
config.vm.define "node#{instance_number}" do |host|
99
host.vm.box = "ubuntu/trusty64"
10-
host.vm.network "private_network", ip: "192.168.33.11#{instance_number}"
10+
#host.vm.network "private_network", ip: "192.168.33.11#{instance_number}"
1111
host.vm.hostname = "node#{instance_number}"
1212

1313
host.vm.provider "virtualbox" do |v|
1414
v.memory = 1024
15-
v.cpus = 1
15+
v.cpus = 2
1616
end
1717

1818

docker-entrypoint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,16 @@ if [ ! -z "$SWARM_NETWORK_BASE" ]; then
2929
fi
3030

3131

32+
# Enable Auth Plugin if necessary
33+
if [ "$HIVEMQ_DISABLE_AUTH_PLUGIN"=="true" ]; then
34+
echo "Not Activating Auth plugin due to HIVEMQ_DISABLE_AUTH_PLUGIN"
35+
# This way is not yet compatible with docker stop and start. only with rm and run.
36+
else
37+
echo "Enabling Auth plugin"
38+
ln -s /opt/hivemq-modules/fileauth/bin/file-authentication-plugin-3.0.2.jar /opt/hivemq/plugins/file-authentication-plugin-3.0.2.jar
39+
ln -s /opt/hivemq-modules/fileauth/bin/credentials.properties /opt/hivemq/plugins/credentials.properties
40+
ln -s /opt/hivemq-modules/fileauth/bin/fileAuthConfiguration.properties /opt/hivemq/plugins/fileAuthConfiguration.properties
41+
fi
42+
43+
3244
/opt/hivemq/bin/run.sh

install_hivemq.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
mkdir -p /opt
44
cd /opt
55

6+
#Install HiveMQ
67
wget -O hivemq.zip http://www.hivemq.com/download.php?token=a2903f0457bc42959785c34fa1532dca
78
unzip hivemq.zip
89
rm hivemq.zip
@@ -16,3 +17,18 @@ chown -R hivemq:hivemq /opt/hivemq
1617

1718
chmod +x /opt/hivemq/bin/run.sh
1819

20+
#Install file authentication plugin
21+
mkdir -p /opt/file-auth-plugin
22+
mkdir -p /opt/tools
23+
24+
cd /opt/file-auth-plugin
25+
wget -O file-auth.zip http://www.hivemq.com/wp-content/uploads/file-authentication-3.0.2-distribution.zip
26+
unzip file-auth.zip
27+
rm file-auth.zip
28+
29+
mv file-authentication-plugin-3.0.2.jar LICENSE.txt /opt/hivemq-modules/fileauth/bin
30+
mv tools/file-authentication-plugin-utility-1.1.jar /opt/tools
31+
32+
33+
34+
cd ..
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Files in this folder will be linked to the suitable position inside /opt/hivemq if file auth is enabled.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# To replace with your own credentials either mount an own file exactly to this place or use /opt/tools/file-authentication-plugin-utility-1.1.jar to create credentials
2+
# Since it is more reproducible, mounting is the preferred way.
3+
4+
TODO: create initial credentials
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -------------------------------------------------------------------------
2+
#
3+
# _ _ _ __ __ ____
4+
# | | | |(_) | \/ | / __ \
5+
# | |__| | _ __ __ ___ | \ / || | | |
6+
# | __ || |\ \ / // _ \| |\/| || | | |
7+
# | | | || | \ V /| __/| | | || |__| |
8+
# |_| |_||_| \_/ \___||_| |_| \___\_\
9+
#
10+
# -------------------------------------------------------------------------
11+
#
12+
# File Authentication Plugin Configuration
13+
#
14+
# -------------------------------------------------------------------------
15+
16+
# This property specifies the name of the file, which contains the
17+
# credentials of the users. Please notice that the file has to be in the
18+
# plugins folder.
19+
filename=credentials.properties
20+
21+
# Specifies if the password is stored as plaintext or as a hashed string.
22+
passwordHashing.enabled=true
23+
24+
# Here the hashing algorithm used during creation of the credentials file
25+
# can be declared. HiveMQ is supporting all hashing algorithms provided
26+
# by the Java VM.
27+
passwordHashing.shiroAlgo=SHA-512
28+
29+
# Customizes the number of hashing iterations used.
30+
passwordHashing.iterations=1000000
31+
32+
# Configures if the hashed password has used a salt during the hash generation.
33+
passwordHashingSalt.enabled=true
34+
35+
# Specifies the order of hash and salt.
36+
passwordHashingSalt.isFirst=true
37+
passwordHashingSalt.separationChar=$
38+
39+
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)