Skip to content

Commit bd89a43

Browse files
committed
Update to Blynk local server including config files - 877dev
The original version did not create any config files and did not support email. This commit fixes that, by making use of `directoryfix.sh` to create the config folder, which contains two config files, `server.properties` and `mail.properties`. Note that if they already exits they are not overwritten. The Dockerfile has been updated to use the latest version 0.41.14, and a parameter to use a custom mail.properties. Server.properties should work "as is" for most people, but can be changed as required. Mail.properties requires editing to add gmail credentials. Service.yml updated to map the configs to the volumes folder. A new readmeguide has been produced which needs adding to the main webpage, this can be found at https://gist.github.com/877dev/cfa52044336e1e44d74156ce8b1458aa#file-blynk-setup-guide-md
1 parent 040ffb3 commit bd89a43

File tree

3 files changed

+89
-6
lines changed

3 files changed

+89
-6
lines changed

.templates/blynk_server/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
FROM adoptopenjdk/openjdk11
2-
MAINTAINER Graham Garner <garner.gc@gmail.com>
2+
MAINTAINER 877dev <877dev@gmail.com>
33

44
#RUN apt-get update
55
#RUN apt-get install -y apt-utils
66
#RUN apt-get install -y default-jdk curl
77

8-
ENV BLYNK_SERVER_VERSION 0.41.10
8+
ENV BLYNK_SERVER_VERSION 0.41.14
99
RUN mkdir /blynk
1010
RUN curl -L https://github.com/blynkkk/blynk-server/releases/download/v${BLYNK_SERVER_VERSION}/server-${BLYNK_SERVER_VERSION}.jar > /blynk/server.jar
1111

@@ -22,4 +22,5 @@ VOLUME ["/config", "/data/backup"]
2222
EXPOSE 8080 9443
2323

2424
WORKDIR /data
25-
ENTRYPOINT ["java", "-jar", "/blynk/server.jar", "-dataFolder", "/data", "-serverConfig", "/config/server.properties"]
25+
ENTRYPOINT ["java", "-jar", "/blynk/server.jar", "-dataFolder", "/data", "-serverConfig", "/config/server.properties", "-mailConfig", "/config/mail.properties"]
26+
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
3+
# Create config files for Blynk custom server
4+
# 877dev
5+
6+
#current user
7+
u=$(whoami)
8+
9+
#Check if the config directory already exists:
10+
if [ ! -d ./volumes/blynk_server/data/config ]; then
11+
#Create the config directory
12+
sudo mkdir -p ./volumes/blynk_server/data/config
13+
14+
#Create the properties files:
15+
#cd ~/IOTstack/volumes/blynk_server/data/config
16+
sudo touch ./volumes/blynk_server/data/config/server.properties
17+
sudo touch ./volumes/blynk_server/data/config/mail.properties
18+
19+
#Give permissions:
20+
sudo chown -R $u:$u ./volumes/blynk_server/data/config
21+
22+
#Populate the server.properties file:
23+
sudo echo "hardware.mqtt.port=8440
24+
http.port=8080
25+
force.port.80.for.csv=false
26+
force.port.80.for.redirect=true
27+
https.port=9443
28+
data.folder=./data
29+
logs.folder=./logs
30+
log.level=info
31+
user.devices.limit=10
32+
user.tags.limit=100
33+
user.dashboard.max.limit=100
34+
user.widget.max.size.limit=20
35+
user.message.quota.limit=100
36+
notifications.queue.limit=2000
37+
blocking.processor.thread.pool.limit=6
38+
notifications.frequency.user.quota.limit=5
39+
webhooks.frequency.user.quota.limit=1000
40+
webhooks.response.size.limit=96
41+
user.profile.max.size=128
42+
terminal.strings.pool.size=25
43+
map.strings.pool.size=25
44+
lcd.strings.pool.size=6
45+
table.rows.pool.size=100
46+
profile.save.worker.period=60000
47+
stats.print.worker.period=60000
48+
web.request.max.size=524288
49+
csv.export.data.points.max=43200
50+
hard.socket.idle.timeout=10
51+
enable.db=false
52+
enable.raw.db.data.store=false
53+
async.logger.ring.buffer.size=2048
54+
allow.reading.widget.without.active.app=false
55+
allow.store.ip=true
56+
initial.energy=1000000
57+
admin.rootPath=/admin
58+
restore.host=blynk-cloud.com
59+
product.name=Blynk
60+
61+
admin.pass=admin
62+
" > ./volumes/blynk_server/data/config/server.properties
63+
64+
#Populate the mail.properties file:
65+
sudo echo "mail.smtp.auth=true
66+
mail.smtp.starttls.enable=true
67+
mail.smtp.host=smtp.gmail.com
68+
mail.smtp.port=587
69+
70+
mail.smtp.password=YOUR_GMAIL_APP_PASSWORD
71+
mail.smtp.connectiontimeout=30000
72+
mail.smtp.timeout=120000
73+
" > ./volumes/blynk_server/data/config/mail.properties
74+
75+
#Information messages:
76+
echo "Sample properties files created in ~/IOTstack/volumes/blynk_server/data/config"
77+
echo "Make sure you edit the files with your details, and restart the container to take effect."
78+
79+
80+
81+
fi

.templates/blynk_server/service.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
container_name: blynk_server
44
restart: unless-stopped
55
ports:
6-
- "8180:8080"
7-
- "8441:8441"
8-
- "9443:9443"
6+
- 8180:8080
7+
- 8441:8441
8+
- 9443:9443
99
volumes:
1010
- ./volumes/blynk_server/data:/data
11+
- ./volumes/blynk_server/data/config:/config

0 commit comments

Comments
 (0)