Skip to content

Commit

Permalink
Add IPFS gateway and add HTTP service listing to README
Browse files Browse the repository at this point in the history
  • Loading branch information
benhylau committed Jul 5, 2017
1 parent 131a6f4 commit 809c253
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ The following instructions will help you set up an encrypted mesh network on Ras

## Optional Features

| Feature Flag | Description |
| :------------------------------ | :---------- |
| `WITH_MESH_POINT` | Set to `true` if you have a suitable USB WiFi adapter and want to configure it as a 802.11s Mesh Point interface. |
| `WITH_WIFI_AP` | Set to `true` if you have a Raspberry Pi 3 and want to configure the on-board WiFi as an Access Point. The default configuration routes all traffic to the Ethernet port `eth0`. |
| `WITH_IPFS` | Set to `true` if you want to install [IPFS](https://ipfs.io). |
| `WITH_PROMETHEUS_NODE_EXPORTER` | Set to `true` if you want to install [Prometheus Node Exporter](https://github.com/prometheus/node_exporter) to report network metrics. |
| `WITH_PROMETHEUS_SERVER` | Set to `true` if you want to install [Prometheus Server](https://github.com/prometheus/prometheus) to collect network metrics. *Requires Prometheus Node Exporter.* |
| `WITH_GRAFANA` | Set to `true` if you want to install [Grafana](https://grafana.com) to display network metrics. *Requires Prometheus Server.* |
| `WITH_EXTRA_TOOLS` | Set to `true` if you want to install non-essential tools useful for network analysis. |
| Feature Flag | HTTP Service Port | Description |
| :------------------------------ | :--------------------------------------------- | :---------- |
| `WITH_MESH_POINT` | None | Set to `true` if you have a suitable USB WiFi adapter and want to configure it as a 802.11s Mesh Point interface. |
| `WITH_WIFI_AP` | None | Set to `true` if you have a Raspberry Pi 3 and want to configure the on-board WiFi as an Access Point. The default configuration routes all traffic to the Ethernet port `eth0`. |
| `WITH_IPFS` | ** 80**: HTTP-to-IPFS gateway at `/ipfs/HASH` | Set to `true` if you want to install [IPFS](https://ipfs.io). |
| `WITH_PROMETHEUS_NODE_EXPORTER` | **9100**: Node Exporter UI | Set to `true` if you want to install [Prometheus Node Exporter](https://github.com/prometheus/node_exporter) to report network metrics. |
| `WITH_PROMETHEUS_SERVER` | **9090**: Prometheus Server UI | Set to `true` if you want to install [Prometheus Server](https://github.com/prometheus/prometheus) to collect network metrics. *Requires Prometheus Node Exporter.* |
| `WITH_GRAFANA` | **3000**: Grafana UI (login: admin/admin) | Set to `true` if you want to install [Grafana](https://grafana.com) to display network metrics. *Requires Prometheus Server.* |
| `WITH_EXTRA_TOOLS` | None | Set to `true` if you want to install non-essential tools useful for network analysis. |

If you are connected to the WiFi AP, all HTTP services are available via **http://10.0.0.1:PORT** as well as the cjdns IPv6. To connect with the cjdns address, first note your node's fc00::/8 address from `status`, then navigate to `http://[fcaa:bbbb:cccc:dddd:eeee:0000:1111:2222]:PORT` from your browser.

## Check Status

Expand Down
2 changes: 1 addition & 1 deletion scripts/grafana/install
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Install Grafana dependencies
sudo apt-get -y install libfontconfig1 fontconfig-config fonts-dejavu-core ttf-bitstream-vera fonts-liberation sqlite3
sudo apt-get install libfontconfig1 fontconfig-config fonts-dejavu-core ttf-bitstream-vera fonts-liberation sqlite3 -y

# Download and install unofficial build of Grafana for ARM
URL="https://bintray.com/fg2it/deb/download_file?file_path=main%2Fg%2Fgrafana_4.3.2_armhf.deb"
Expand Down
11 changes: 10 additions & 1 deletion scripts/ipfs/install
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ sudo cp "$BASE_DIR/ipfs.service" /lib/systemd/system/ipfs.service
sudo sed -i "s|USER_HOME|${HOME}|" /lib/systemd/system/ipfs.service
sudo systemctl daemon-reload
sudo systemctl enable ipfs.service
sudo systemctl start ipfs.service
sudo systemctl start ipfs.service

# Install nginx
sudo apt-get install nginx -y

# Configure HTTP to IPFS gateway
sudo cp "$BASE_DIR/ipfs-http-gateway.nginx" /etc/nginx/sites-available/ipfs-http-gateway
sudo ln -s /etc/nginx/sites-available/ipfs-http-gateway /etc/nginx/sites-enabled/ipfs-http-gateway
sudo rm /etc/nginx/sites-enabled/default
sudo systemctl restart nginx.service
12 changes: 12 additions & 0 deletions scripts/ipfs/ipfs-http-gateway.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server {
listen 80;
listen [::]:80;

location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
5 changes: 5 additions & 0 deletions scripts/ipfs/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ if [ -d "~/.ipfs" ]; then
echo -e "\e[1;32mKeeping ~/.ipfs\e[0m"
fi
fi

# Remove HTTP to IPFS gateway
sudo rm /etc/nginx/sites-enabled/ipfs-http-gateway
sudo rm /etc/nginx/sites-available/ipfs-http-gateway
sudo systemctl restart nginx.service

0 comments on commit 809c253

Please sign in to comment.