GithubHelp home page GithubHelp logo

atessmer / ibbqweb Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 2.49 MB

Webserver for interacting with Inkbird iBBQ bluetooth grill thermometers

License: GNU General Public License v3.0

Python 39.36% CSS 2.29% JavaScript 44.92% HTML 12.52% Shell 0.91%

ibbqweb's Introduction

iBBQ Web

An alternat client for Inkbird iBBQ bluetooth grill thermometers, providing a terminal display as well as a web front-end for monitoring and adjusting the thermomitor over the network.

Requirements

Python Dependencies

Install the following python dependencies:

sudo pip install aiohttp
sudo pip install "bleak>=0.20"

System User/Group

Create an 'ibbqweb' user/group and configure user/group permissions to ensure ibbqweb has the needed access to system resources without needing to run as root:

sudo useradd --no-create-home --home-dir /nonexistent --shell /usr/sbin/nologin ibbqweb
sudo usermod -a -G bluetooth ibbqweb
sudo vim /etc/dbus-1/system.d/bluetooth.conf

After creating the user, add permissions listed here for : https://unix.stackexchange.com/questions/348441/how-to-allow-non-root-systemd-service-to-use-dbus-for-ble-operation

iptables

Add iptables rules to NAT from port 80 to 8080, so ibbqweb can run on non-privileged port:

sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
sudo apt install iptables-persistent
sudo sh -c 'iptables-save > /etc/iptables/rules.v4'

Run as 'ibbqweb' user

Start the ibbq client as the ibbqweb user:

sudo -u ibbqweb ./ibbqweb.py

Recommended

git-hooks

git config --local core.hooksPath .githooks/

TLS via Let's Encrypt:

The following steps can be used to generate and use a free TLS certificate for the web front-end from Let's Encrypt.

Install certbot

sudo apt install certbot

DNS Challenge (internal domains)

For internal domain, where certbot cannot verify your ownership of the domain by adding a file to the webroot directory, configure certbot for DNS challenge:

See https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-dns-validation-with-acme-dns-certbot-on-ubuntu-18-04

System Group

Create an 'ssl-certs' group, make it the owner of the certs, and add the ibbqweb

sudo groupadd ssl-certs
sudo usermod -a -G ssl-certs ibbqweb
sudo chgrp -R ssl-certs /etc/letsencrypt
sudo chmod -R g=rX /etc/letsencrypt

iBBQ Web Config

Update http_port, tls.cert, and tls.key in /etc/ibbqweb/ibbqweb.json. Ex:

{
   "http_port": 4433,
   "tls": {
      "cert": "/etc/letsencrypt/live/example.com/fullchain.pem",
      "key": "/etc/letsencrypt/live/example.com/privkey.pem"
   }
}

iptables

Replace the above iptables rules for port 80 with the same rules for port 443

sudo iptables -t nat -D OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 4433
sudo iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 4433
sudo sh -c 'iptables-save > /etc/iptables/rules.v4'

ibbqweb's People

Stargazers

Konstantin L. Golovko avatar

Watchers

Alex Tessmer avatar

Forkers

faisalhusain007

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.