Merge branch 'main' of https://github.com/balzack/databag into main

This commit is contained in:
Roland Osborne 2022-09-02 22:18:41 -07:00
commit 9d36538e95
2 changed files with 69 additions and 69 deletions

View File

@ -6,6 +6,7 @@
Databag is a self-hosted messaging service for the DWeb community. Notable features include:
- Public-private key based identity (not bound to any blockchain or hosting domain)
- Federated (accounts on different nodes can communicate)
- Lightweight (runs on a raspberry pi zero v1.3)
- No server-side replication (direct communication between app and contact's node)
- Low latency (use of websockets for push events to avoid polling)
- Responsive (renders well in browsers for phone, tablet and pc)
@ -15,9 +16,9 @@ You can test out the project [here](https://databag.coredb.org/#/create), but do
## Installation
To use databag, you will need a DNS name pointing to your node with a certificate. You can deloy a node manually, but you will have a much easier time using a container service. Containers for arm64 and amd64 are available [here](https://hub.docker.com/r/balzack/databag/tags)
To use databag, you will need a DNS name pointing to your node with a certificate. You can deloy a node manually, but you will have a much easier time using a container service. Containers for arm64 and amd64 are available [here](https://hub.docker.com/r/balzack/databag/tags).
If you choose to setup your server manually, you can follow the steps in the Dockerfile [here](/net/container/Dockerfile).
Instruction for installing without a container on a Raspberry Pi Zero are [here](/doc/pizero.md).
### Example with Portainer and Nginx Proxy Manager

View File

@ -1,98 +1,97 @@
# Install Databag on Raspberry Pi Zero (1)
# Install Databag on Raspberry Pi Zero V1.3
## These instructions assume you have the following setup:
These instructions assume you have the following setup:
- reverse proxy with an assigned hostname and certificate forwarding to your Raspberry Pi
- micro usb to ethernet adapter
- address reservation on your router
- reasonably large micro sd card (~64 GB)
## Step 1: setup the hardware
Download the DietPi OS and select the ARMv6 32-bit image:
https://dietpi.com/downloads/images/DietPi_RPi-ARMv6-Bullseye.7z
Extract the img file with 7-zip
Write the img file to the sd card with Rufus
Insert the sd card in the pi and turn it on
Download the DietPi OS and select the ARMv6 32-bit image:<br/>
https://dietpi.com/downloads/images/DietPi_RPi-ARMv6-Bullseye.7z<br/>
Extract the img file with 7-zip<br/>
Write the img file to the sd card with Rufus<br/>
Insert the sd card in the pi and turn it on<br/>
## Step 2: install the OS
SSH into the pi with root:dietpi
Watch it update and reboot
Install the minimal image
SSH into the pi with root:dietpi<br/>
Watch it update and reboot<br/>
Select the minimal image<br/>
## Step 3: install databag dependencies
apt-get -y install curl
apt-get -y install net-tools
apt-get -y install jq
apt-get -y install netcat
apt-get -y install unzip
apt-get -y install wget
apt-get -y install git
apt-get -y install vim
apt-get -y install fail2ban
apt-get -y install imagemagick-6.q16
apt-get -y install ffmpeg
apt-get -y install build-essential
apt-get -y install sqlite3
apt-get -y install openssh-client
apt-get -y install curl<br/>
apt-get -y install net-tools<br/>
apt-get -y install jq<br/>
apt-get -y install netcat<br/>
apt-get -y install unzip<br/>
apt-get -y install wget<br/>
apt-get -y install git<br/>
apt-get -y install vim<br/>
apt-get -y install fail2ban<br/>
apt-get -y install imagemagick-6.q16<br/>
apt-get -y install build-essential<br/>
apt-get -y install sqlite3<br/>
apt-get -y install openssh-client<br/>
## Step 4: install golang
Download the armv6l version:
https://go.dev/dl/go1.19.linux-armv6l.tar.gz
Extract it to /usr/local
tar -C /usr/local -xzf go1.19.linux-armv6l.tar.gz
Download the armv6l version:<br/>
https://go.dev/dl/go1.19.linux-armv6l.tar.gz<br/>
Extract it to /usr/local:<br/>
tar -C /usr/local -xzf go1.19.linux-armv6l.tar.gz<br/>
## Step 5: setup databag paths
mkdir -p /var/lib/databag
mkdir -p /opt/databag/transform
cp /app/databag/net/container/transform/* /opt/databag/transform/
mkdir -p /var/lib/databag<br/>
mkdir -p /opt/databag/transform<br/>
cp /app/databag/net/container/transform/* /opt/databag/transform/<br/>
## Step 6: initialize the internal datbase
sqlite3 /var/lib/databag/databag.db "VACUUM;"
sqlite3 /var/lib/databag/databag.db "CREATE TABLE IF NOT EXISTS 'configs' ('id' integer NOT NULL UNIQUE,'config_id' text NOT NULL,'str_value' text,'num_value' integer,'bool_value' numeric,'bin_value' blob,PRIMARY KEY ('id'));"
sqlite3 /var/lib/databag/databag.db "CREATE UNIQUE INDEX IF NOT EXISTS 'idx_configs_config_id' ON 'configs'('config_id');"
sqlite3 /var/lib/databag/databag.db "insert into configs (config_id, str_value) values ('asset_path', '/var/lib/databag/');"
sqlite3 /var/lib/databag/databag.db "insert into configs (config_id, str_value) values ('script_path', '/opt/databag/transform/');"
sqlite3 /var/lib/databag/databag.db "VACUUM;"<br/>
sqlite3 /var/lib/databag/databag.db "CREATE TABLE IF NOT EXISTS 'configs' ('id' integer NOT NULL UNIQUE,'config_id' text NOT NULL,'str_value' text,'num_value' integer,'bool_value' numeric,'bin_value' blob,PRIMARY KEY ('id'));"<br/>
sqlite3 /var/lib/databag/databag.db "CREATE UNIQUE INDEX IF NOT EXISTS 'idx_configs_config_id' ON 'configs'('config_id');"<br/>
sqlite3 /var/lib/databag/databag.db "insert into configs (config_id, str_value) values ('asset_path', '/var/lib/databag/');"<br/>
sqlite3 /var/lib/databag/databag.db "insert into configs (config_id, str_value) values ('script_path', '/opt/databag/transform/');"<br/>
## Step 7: clone and build the server
mkdir /app
cd /app
git clone https://github.com/balzack/databag.git
cd /app/databag/net/server
/usr/local/go/bin/go build databag
mkdir /app<br/>
cd /app<br/>
git clone https://github.com/balzack/databag.git<br/>
cd /app/databag/net/server<br/>
/usr/local/go/bin/go build databag<br/>
## Step 8: download the webapp
// because the react toolchain isn't available for the pi zero, the webapp is build in a github action
Download webapp.zip from the most recent build:
https://github.com/balzack/databag/actions/runs/2981276524
SCP webapp.zip into the pi
Extract it into the web/build directory
mkdir /app/databag/net/web/build
unzip webapp.zip -d /app/databag/net/web/build/
// because the react toolchain isn't available for the pi zero, the webapp is build in a github action<br/>
Download webapp.zip from the most recent build:<br/>
https://github.com/balzack/databag/actions/runs/2981276524<br/>
SCP webapp.zip into the pi<br/>
Extract it into the web/build directory<br/>
mkdir /app/databag/net/web/build<br/>
unzip webapp.zip -d /app/databag/net/web/build/<br/>
## Step 9: launch the server
cd /app/databag/net/server
nohup /usr/local/go/bin/go run databag
cd /app/databag/net/server<br/>
nohup /usr/local/go/bin/go run databag<br/>
## Step 10: configure the server
Open your brower to the pi hostname
Click the 'cog' in the upper right
Set an admin password
Select the 'cog' to bring up the settings modal
- set your hostname
- set the key to RSA 2048
- enable images
- disable audio
- disable video
Open your brower to the pi hostname<br/>
Click the 'cog' in the upper right<br/>
Set an admin password<br/>
Select the 'cog' to bring up the settings modal<br/>
- set your hostname<br/>
- set the key to RSA 2048<br/>
- enable images<br/>
- disable audio<br/>
- disable video<br/>
## Step 11: create accounts
Still in the admin dashboard
Click the 'add-user' button
Open the link in a new tab
Set a username and password
Setup your profile
Connect with contacts on federated instances
Still in the admin dashboard<br/>
Click the 'add-user' button<br/>
Open the link in a new tab<br/>
Set a username and password<br/>
Setup your profile<br/>
Connect with contacts on other federated instances<br/>
## Step 12: host for your friends and family
Back in the admin dashboard
Click the 'add-user' and send the link to anyone you want to host
Back in the admin dashboard<br/>
Click the 'add-user' and send the link to anyone you want to host<br/>