home.openhab: install and configure openhab
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
aa8f19d948
commit
f482874310
8 changed files with 213 additions and 3 deletions
|
@ -44,6 +44,7 @@ Rule of thumb: keep ports below 10000 free for stuff that reserves ports.
|
|||
| 22060 | pretalx | gunicorn |
|
||||
| 22070 | paperless-ng | gunicorn |
|
||||
| 22080 | netbox | gunicorn |
|
||||
| 22090 | openhab | http |
|
||||
| 22999 | nginx | stub_status |
|
||||
|
||||
## UDP
|
||||
|
|
62
bundles/openhab/files/openhab
Normal file
62
bundles/openhab/files/openhab
Normal file
|
@ -0,0 +1,62 @@
|
|||
# openHAB service options
|
||||
|
||||
#########################
|
||||
## PORTS
|
||||
## The ports openHAB will bind its HTTP/HTTPS web server to.
|
||||
|
||||
OPENHAB_HTTP_PORT=22090
|
||||
#OPENHAB_HTTPS_PORT=8443
|
||||
|
||||
#########################
|
||||
## HTTP(S) LISTEN ADDRESS
|
||||
## The listen address used by the HTTP(S) server.
|
||||
## 0.0.0.0 (default) allows a connection from any location
|
||||
## 127.0.0.1 only allows the local machine to connect
|
||||
|
||||
OPENHAB_HTTP_ADDRESS=127.0.0.1
|
||||
|
||||
#########################
|
||||
## BACKUP DIRECTORY
|
||||
## Set the following variable to specify the backup location.
|
||||
## runtime/bin/backup and runtime/bin/restore will use this path for the zip files.
|
||||
|
||||
#OPENHAB_BACKUPS=/var/lib/openhab/backups
|
||||
|
||||
#########################
|
||||
## JAVA OPTIONS
|
||||
## Additional options for the JAVA_OPTS environment variable.
|
||||
## These will be appended to the execution of the openHAB Java runtime in front of all other options.
|
||||
##
|
||||
## A couple of independent examples:
|
||||
## EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyZWAVE:/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"
|
||||
## EXTRA_JAVA_OPTS="-Djna.library.path=/lib/arm-linux-gnueabihf/ -Duser.timezone=Europe/Berlin -Dgnu.io.rxtx.SerialPorts=/dev/ttyZWave"
|
||||
|
||||
EXTRA_JAVA_OPTS="${extra_java_opts}"
|
||||
|
||||
#########################
|
||||
## OPENHAB DEFAULTS PATHS
|
||||
## The following settings override the default apt/rpm locations and should be used with caution.
|
||||
## openHAB will fail to update itself if you're using different paths.
|
||||
## Only set these if you are testing and are confident in debugging.
|
||||
|
||||
#OPENHAB_HOME=/usr/share/openhab
|
||||
#OPENHAB_CONF=/etc/openhab
|
||||
#OPENHAB_RUNTIME=/usr/share/openhab/runtime
|
||||
#OPENHAB_USERDATA=/var/lib/openhab
|
||||
#OPENHAB_LOGDIR=/var/log/openhab
|
||||
|
||||
#########################
|
||||
## OPENHAB USER AND GROUP
|
||||
## The user and group that takes ownership of openHAB. Only available for init.d systems.
|
||||
## To edit user and group for systemd, see the service file at /usr/lib/systemd/system/openhab.service.
|
||||
|
||||
#OPENHAB_USER=openhab
|
||||
#OPENHAB_GROUP=openhab
|
||||
|
||||
#########################
|
||||
## SYSTEMD START MODE
|
||||
## The Karaf startmode for the openHAB runtime. Only available for systemctl/systemd systems.
|
||||
## Defaults to daemon when unset here. Multiple options can be used without quotes.
|
||||
## debug increases log output. daemon launches the Karaf/openHAB processes.
|
||||
|
||||
#OPENHAB_STARTMODE=debug
|
28
bundles/openhab/items.py
Normal file
28
bundles/openhab/items.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
extra_java_opts = []
|
||||
|
||||
for opt, value in sorted(node.metadata.get('openhab/java_opts', {}).items()):
|
||||
if value is None:
|
||||
extra_java_opts.append(f'-D{opt}')
|
||||
else:
|
||||
extra_java_opts.append(f'-D{opt}={value}')
|
||||
|
||||
files = {
|
||||
'/etc/default/openhab': {
|
||||
'content_type': 'mako',
|
||||
'context': {
|
||||
'extra_java_opts': ' '.join(extra_java_opts),
|
||||
},
|
||||
'triggers': {
|
||||
'svc_systemd:openhab:restart',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
svc_systemd = {
|
||||
'openhab': {
|
||||
'needs': {
|
||||
'pkg_apt:openhab',
|
||||
'pkg_apt:openhab-addons',
|
||||
},
|
||||
},
|
||||
}
|
54
bundles/openhab/metadata.py
Normal file
54
bundles/openhab/metadata.py
Normal file
|
@ -0,0 +1,54 @@
|
|||
defaults = {
|
||||
'apt': {
|
||||
'packages': {
|
||||
'openjdk-11-jre': {},
|
||||
'openhab': {
|
||||
'needs': {
|
||||
'pkg_apt:openjdk-11-jre',
|
||||
},
|
||||
},
|
||||
'openhab-addons': {
|
||||
'needs': {
|
||||
'pkg_apt:openhab',
|
||||
},
|
||||
},
|
||||
},
|
||||
'repos': {
|
||||
'openhab': {
|
||||
'items': {
|
||||
'deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'backups': {
|
||||
'paths': {
|
||||
'/var/lib/openhab',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@metadata_reactor.provides(
|
||||
'nginx/vhosts/openhab',
|
||||
)
|
||||
def nginx(metadata):
|
||||
if not node.has_bundle('nginx'):
|
||||
raise DoNotRunAgain
|
||||
|
||||
return {
|
||||
'nginx': {
|
||||
'vhosts': {
|
||||
'openhab': {
|
||||
'domain': metadata.get('openhab/domain'),
|
||||
'locations': {
|
||||
'/': {
|
||||
'target': 'http://localhost:22090/',
|
||||
},
|
||||
},
|
||||
'website_check_path': '/',
|
||||
'website_check_string': 'opnHAB',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
52
data/apt/files/gpg-keys/openhab.asc
Normal file
52
data/apt/files/gpg-keys/openhab.asc
Normal file
|
@ -0,0 +1,52 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBFWz+OYBEACXcmKiL6ix1e4gJIWVoGMF7Hv0VOVKJgIUF/zJYBqk3sXQp/pi
|
||||
JbIoODhrrIbEK33mqg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Zs7LmgSAiEITxRFTR4qg7k
|
||||
=r37a
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
1
data/backup/keys/home.openhab.key.vault
Normal file
1
data/backup/keys/home.openhab.key.vault
Normal file
|
@ -0,0 +1 @@
|
|||
encrypt$gAAAAABhflKcIRszHtJHuBcgaWh7divgjgw72cKDiP7PPk7CQ9xpdSDw3phE7tpVBnaYSjYFcn0lxH5IN7YfgsgQnRFrH4N25-awLwxp6kVsL00Si9F4o8GUBvzobQGJtzEh0nuQ3zmGGfQSLZGKiXkFHLPmnc67Mqtz7zK7Qc5Lp0qqhMJ-2PLEwl5F6WxQU8TcNTlHDgIb23yS2GWfT3DrUvZjgOKkDvS--Huphyklksn3SR3cxHy1wSmlzJxV31t4Rh7YQyj1DcuBy2TIzLAhebtPJbiUZTFsFXDJULiHl1zi5X2jVIc17rpKW_9JMTeBEDZbebyqpOp3bo9zNv4RcC_XEIW7i2hCXNT8RksW5x45-E01jKQpiKgIcJoImcDQAanNh6_xEWEPWiJFVDulkMiJob5EvZjl1j79jOciahq8ycuePWyFAAtDZgpLm9u0JlzOLFL4NbvL8-MypBLpysXTohqDa3SYKlc2-UvsUJD8bagEYsy0Ay_nGQo961AqlWF7vPk2SdYXUjN657PxSbnczOuKv63BmFWEF9Bu8OFOzxIRs1ds7jvK3KChikO91VJMQxsZrSynFBwDm5zpYRsk-k1D2blf2g1yaThd2fijYCe1Lico_nTlyf-dpSrN5szlKW5V
|
1
data/backup/keys/home.openhab.pub
Normal file
1
data/backup/keys/home.openhab.pub
Normal file
|
@ -0,0 +1 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKYyrgpO2tCRTP+eEFD127OlRIATw7BxaSgYMnyYAbMS kunsi@kunsi-t470.kunbox.net
|
|
@ -1,6 +1,9 @@
|
|||
nodes['home.openhab'] = {
|
||||
'hostname': '172.19.138.21',
|
||||
'bundles': set(),
|
||||
'bundles': {
|
||||
'nginx',
|
||||
'openhab',
|
||||
},
|
||||
'groups': {
|
||||
'debian-bullseye',
|
||||
},
|
||||
|
@ -13,8 +16,16 @@ nodes['home.openhab'] = {
|
|||
'gateway4': '172.19.138.1',
|
||||
},
|
||||
},
|
||||
'backups': { # TODO remove this when running openhab
|
||||
'exclude_from_backups': True,
|
||||
'nginx': {
|
||||
'vhosts': {
|
||||
'openhab': {'ssl': '_.home.kunbox.net'},
|
||||
},
|
||||
},
|
||||
'openhab': {
|
||||
'domain': 'openhab.home.kunbox.net',
|
||||
'java_opts': {
|
||||
'user.timezone': 'Europe/Berlin',
|
||||
},
|
||||
},
|
||||
'vm': {
|
||||
'cpu': 2,
|
||||
|
|
Loading…
Reference in a new issue