This project was developed as part of a bachelor thesis at the University of Zurich in Spring 2023.
shipp is an extensible open-source privacy enhancing technology designed for smart home environments. By integrating existing tools into a unified framework, it aims to monitor and control smart home devices' communication behavior through user-defined policies. The goal is to increase transparency and limit data collection.
On Raspberry Pi OS:
-
Install Docker.
sudo apt-get update sudo apt-get install docker
-
Set up your project directory and set up the configuration for the reverse proxy (Nginx). Copy the nginx folder from the repository to your project directory.
mkdir shipp cd shipp # Copy the nginx folder from the repository to your shipp directory.
Replace the
${LOCAL_NETWORK_IP_RANGE}placeholder in thedefault.conf.templatefile with your local network IP range in CIDR notation (e.g. 193.xxx.1.0/24) -
Create a resolv.conf file in the project directory:
touch resolv.conf
Add the following lines to the file:
nameserver 127.0.0.1 options ndots:0 -
Set up your docker-compose.yml for this project. Use the template provided in the repository. Consult the respective documentation for Pi-hole, InfluxDB and Home Assistant for further information on the setup of these services. Listed below is a table containing the environment variables that require configuration to install the shipp service.
ENV Variable Example Description SECRET_KEY32-bit hex key Used by the flask application for authentication. API_SECRET_KEYFernet generated key Used to encrypt API keys on the Database. INFLUXDB_AUTH_TOKEN32-bit hex key Needs to be the same as DOCKER_INFLUXDB_INIT_ADMIN_TOKEN.PIHOLE_DOMAINpi.hole Used to address Pi-hole in the local network. PIHOLE_AUTH_TOKENCan be looked up in the Pi-hole web interface. MAIL_SERVERmail.gmx.net The SMTP server used to deliver user notifications. MAIL_PORT587 The corresponding port for the SMTP server. MAIL_USERNAMEshipp.info@gmx.ch Sender address (login) for email notifications. MAIL_PASSWORDCorresponding password for MAIL_USERNAMEaccountTZEurope/Zurich Your local timezone. To generate a secret key for the
SECRET_KEYandINFLUXDB_AUTH_TOKEN(=DOCKER_INFLUXDB_INIT_ADMIN_TOKEN) variable, you can use the following command:openssl rand -hex 32
To generate the
API_SECRET_KEY, it is recommended to use cryptography.fernet:from cryptography.fernet import Fernet Fernet.generate_key()
-
Start the docker containers.
docker compose up -d
-
Configure devices to use Pi-hole as their DNS server: Instructions
shipp_dashboard_2.mp4
shipp_add_device.mp4
shipp_modify_policies.mp4
- Python >= 3.11
- Node.js >= 18.16.0
- Ideally a running Pi-hole instance that is configured as the primary DNS server for your network.
-
Clone the shipp repository.
git clone https://github.com/elduwa/shipp.git cd shipp -
Add a .env file to the root directory of the project with the following contents:
FLASK_APP=wsgi.py FLASK_ENV=development SECRET_KEY=<your-secret-key> API_SECRET_KEY=<your-api-secret-key> SQLITE_URL=sqlite:///data/sqlite.db PIHOLE_DB_URL=sqlite:///data/gravity.db INFLUXDB_ACTIVE=false INFLUXDB_URL=http://localhost:8086/ INFLUXDB_AUTH_TOKEN=<your-influxdb-auth-token> INFLUXDB_ORG=home INFLUXDB_BUCKET=communications PIHOLE_DOMAIN=pi.hole PIHOLE_AUTH_TOKEN=<your-pihole-auth-token> MAIL_SERVER=<notification-smtp-server> MAIL_PORT=<notification-smtp-server-port> MAIL_USERNAME=<sender-email-address/username> MAIL_PASSWORD=<your-password> SCHEDULER_TIMEINTERVAL=3600 TZ=Europe/Zurich
-
Create a python virtual environment and install the dependencies for the project.
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt -
Install the Node.js dependencies and build the frontend sources.
npm install npm run build
-
Start the Flask development server.
flask run --debug
Elliott Wallace – elliott.wallace@uzh.ch
Distributed under the MIT license. See LICENSE for more information.
- Fork it (https://github.com/elduwa/shipp/fork)
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request
This project is not affiliated with or officially endorsed by Pi-hole, InfluxDB or Home Assistant.
