summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD32
-rw-r--r--blynk-server-bin.install32
-rw-r--r--blynk.service13
-rw-r--r--server.properties150
5 files changed, 249 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0a50de993557
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = blynk-server-bin
+ pkgdesc = Blynk server for the Blynk IoT platform
+ pkgver = 0.40.2
+ pkgrel = 1
+ url = https://www.blynk.cc/
+ install = blynk-server-bin.install
+ arch = any
+ license = GPL3
+ depends = java-runtime-headless>=10
+ noextract = server-0.40.2.jar
+ backup = etc/blynk/server.properties
+ source = server-0.40.2.jar::https://github.com/blynkkk/blynk-server/releases/download/v0.40.2/server-0.40.2.jar
+ source = blynk.service
+ source = blynk-server-bin.install
+ source = server.properties
+ sha256sums = 2b67a9864d48d5bbab78aa188adfb9f994b1135b6be246d97f550536a303bc14
+ sha256sums = 9d3c4395d3a76fd26ae9c453ab89a54ea91f42fd06b9c7217c5b6f6f56f9530e
+ sha256sums = 91f73c55d7f0f9dd8b429019b20dd1ed8da96ede3d56a27b1098246f3735853c
+ sha256sums = fc825817a90f2d4ec5bef5d10733957289ce478e67c9f5fff09682e1bff4c655
+
+pkgname = blynk-server-bin
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..4a6115e82e56
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: Bertrand Ciroux <bertrand.ciroux@gmail.com>
+# Contributor: Bertrand Ciroux <bertrand.ciroux@gmail.com>
+pkgname=blynk-server-bin
+pkgver=0.40.2
+pkgrel=1
+pkgdesc="Blynk server for the Blynk IoT platform"
+arch=('any')
+url="https://www.blynk.cc/"
+license=('GPL3')
+depends=('java-runtime-headless>=10')
+
+backup=('etc/blynk/server.properties')
+install="${pkgname}.install"
+
+source=("server-${pkgver}.jar::https://github.com/blynkkk/blynk-server/releases/download/v${pkgver}/server-${pkgver}.jar"
+ "blynk.service"
+ "blynk-server-bin.install"
+ "server.properties")
+
+noextract=("server-${pkgver}.jar")
+
+sha256sums=("2b67a9864d48d5bbab78aa188adfb9f994b1135b6be246d97f550536a303bc14"
+ "9d3c4395d3a76fd26ae9c453ab89a54ea91f42fd06b9c7217c5b6f6f56f9530e"
+ "91f73c55d7f0f9dd8b429019b20dd1ed8da96ede3d56a27b1098246f3735853c"
+ "fc825817a90f2d4ec5bef5d10733957289ce478e67c9f5fff09682e1bff4c655")
+
+package() {
+ install -d ${pkgdir}/{etc,usr/share,var/lib,var/log}/blynk
+ install -Dm644 blynk.service "${pkgdir}/usr/lib/systemd/system/blynk.service"
+ install -Dm644 server-${pkgver}.jar ${pkgdir}/usr/share/blynk/blynk-server.jar
+ install -Dm644 server.properties ${pkgdir}/etc/blynk/
+}
diff --git a/blynk-server-bin.install b/blynk-server-bin.install
new file mode 100644
index 000000000000..e3c89e21b95e
--- /dev/null
+++ b/blynk-server-bin.install
@@ -0,0 +1,32 @@
+_user="blynk"
+
+post_install() {
+ getent group "${_user}" &>/dev/null
+ if [ $? -ne 0 ]; then
+ echo -e "\e[34;1m==>\e[39;1m Adding ${_user} system group... \e[0m"
+ groupadd -r ${_user} 1>/dev/null
+ fi
+ getent passwd "${_user}" &>/dev/null
+ if [ $? -ne 0 ]; then
+ echo -e "\e[34;1m==>\e[39;1m Adding ${_user} system user... \e[0m"
+ useradd -r -g ${_user} -d /usr/share/blynk ${_user} 1>/dev/null
+ fi
+ post_upgrade
+}
+
+post_upgrade() {
+ chown -R ${_user}:${_user} /var/lib/blynk
+ chown -R ${_user}:${_user} /var/log/blynk
+ chown -R ${_user}:${_user} /usr/share/blynk
+}
+
+pre_remove() {
+ systemctl stop blynk.service
+ rm -rf /usr/share/blynk/static
+}
+
+post_remove() {
+ echo -e "\e[34;1m==>\e[39;1m Removing ${_user} user and group... \e[0m"
+ userdel ${_user}
+ echo -e "\e[34;1m==>\e[39;1m NOTE: Data folder /var/lib/blynk has been preserved. \e[0m"
+}
diff --git a/blynk.service b/blynk.service
new file mode 100644
index 000000000000..e08fab78b3c6
--- /dev/null
+++ b/blynk.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Starts and stops the Blynk server daemon
+
+[Service]
+User=blynk
+Group=blynk
+Restart=on-failure
+RestartSec=10
+
+ExecStart=/usr/bin/java -jar /usr/share/blynk/blynk-server.jar -serverConfig /etc/blynk/server.properties
+
+[Install]
+WantedBy=multi-user.target
diff --git a/server.properties b/server.properties
new file mode 100644
index 000000000000..72c15b406a97
--- /dev/null
+++ b/server.properties
@@ -0,0 +1,150 @@
+#hardware mqtt port
+hardware.mqtt.port=8440
+
+#http, plain web sockets and plain hardware port
+http.port=8080
+
+#if this property is true csv download url will use port 80 and will ignore http.port
+force.port.80.for.csv=false
+
+#if this property is true redirect_command will use 80 port and will ignore http.port
+force.port.80.for.redirect=true
+
+#secured https, web sockets and app port
+https.port=9443
+
+#address to bind to. by default bounded to all interfaces
+listen.address=
+
+#by default server uses embedded in jar cert to simplify local server installation.
+#WARNNING DO NOT USE THIS CERTIFICATES ON PRODUCTION OR IN WHERE ENVIRNOMENTS REAL SECURITY REQUIRED.
+#provide either full path to files either use '.' for specifying current directory. For instance "./myfile.crt"
+server.ssl.cert=
+server.ssl.key=
+server.ssl.key.pass=
+
+#by default System.getProperty("java.io.tmpdir")/blynk used
+data.folder=/var/lib/blynk
+
+#folder for logs.
+logs.folder=/var/log/blynk
+
+#log debug level. trace|debug|info|error. Defines how precise logging will be.
+log.level=info
+
+#maximum number of devices allowed per account
+user.devices.limit=50
+
+#maximum number of tags allowed per account
+user.tags.limit=100
+
+#defines maximum allowed number of user dashboards. Needed to limit possible number of tokens.
+user.dashboard.max.limit=100
+
+#defines maximum allowed widget size in KBs as json string.
+user.widget.max.size.limit=20
+
+#user is limited with 100 messages per second.
+user.message.quota.limit=100
+
+#maximum allowed number of notification queue. Queue responsible for processing email, pushes, twits sending.
+#Because of performance issue - those queue is processed in separate thread, this is required due
+#to blocking nature of all above operations. Usually limit shouldn't be reached.
+notifications.queue.limit=2000
+
+#Number of threads for performing blocking operations - push, twits, emails, db queries.
+#Recommended to hold this value low unless you have to perform a lot of blocking operations.
+blocking.processor.thread.pool.limit=6
+
+#this setting defines how often we can send mail/tweet/push or any other notification. Specified in seconds
+notifications.frequency.user.quota.limit=5
+
+#this setting defines how often we can send webhooks. Specified in miliseconds
+webhooks.frequency.user.quota.limit=1000
+
+#this setting defines how big could be response for webhook GET request. Specified in kbs
+webhooks.response.size.limit=96
+
+#maximum size of user profile in kb's
+user.profile.max.size=128
+
+#number of strings to store in terminal widget
+terminal.strings.pool.size=25
+
+#number of strings to store in map widget
+map.strings.pool.size=25
+
+#number of strings to store in lcd widget
+lcd.strings.pool.size=6
+
+#maximum number of rows allowed
+table.rows.pool.size=100
+
+#period in millis for saving all user DB to disk.
+profile.save.worker.period=60000
+
+#period in millis for saving stats to disk.
+stats.print.worker.period=60000
+
+#max size of web request in bytes, 256 kb (256x1024) is default
+web.request.max.size=524288
+
+#maximum number of points that are fetched during CSV export
+#43200 == 60 * 24 * 30 - minutes points for 1 month
+csv.export.data.points.max=43200
+
+#specifies maximum period of time when hardware socket could be idle. After which
+#socket will be closed due to non activity. In seconds. Default value 10 if not provided.
+#leave it empty for infinity timeout
+hard.socket.idle.timeout=10
+
+#enable DB
+enable.db=false
+
+#enable raw data storage to DB
+enable.raw.db.data.store=false
+
+#size of async logger ring buffer. should be increased for loads >2-3k req/sec
+async.logger.ring.buffer.size=2048
+
+#when true - allows reading worker to trigger hardware even app is offline
+allow.reading.widget.without.active.app=false
+
+#when enabled server will also store hardware and app IP
+allow.store.ip=true
+
+#initial amount of energy
+initial.energy=100000
+
+#ADMINISTRATION SECTION
+
+admin.rootPath=/admin
+
+#used for reset password page and certificate generation.
+#by default current server IP is taken. could be replaced with more friendly hostname.
+#it is recommended to override this property with your server IP to avoid possible problems of host resolving
+#server.host=test.blynk.cc
+
+#used for fallback page for reset user password, in most cases it should be the same as server.host
+#IP is not allowed here, it should be blynk-cloud.com for Blynk app
+#or *.blynk.cc for private servers with own apps
+restore.host=blynk-cloud.com
+
+product.name=Blynk
+
+#email used for certificate registration, could be omitted in case you already specified it in mail.properties
+#contact.email=
+
+#network interface to determine server's current IP.
+#only the first characters of the interface's name are needed.
+#the default setting eth will use the first ethX interface found (i.e. eth0)
+net.interface=eth
+
+#comma separated list of administrator IPs. allow access to admin UI only for those IPs.
+#you may set it for 0.0.0.0/0 to allow access for all.
+#you may use CIDR notation. For instance, 192.168.0.53/24
+allowed.administrator.ips=0.0.0.0/0,::/0
+
+# default admin name and password. that will be created on initial server start
+admin.email=admin@blynk.cc
+admin.pass=admin