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