forked from finn/tinyboard
Compare commits
11 Commits
88fabcf25f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ee67739f7 | ||
|
|
39f8f64351 | ||
|
|
e924579b2e | ||
|
|
912e553e06 | ||
|
|
98986e615b | ||
|
|
0e792be751 | ||
|
|
835793d396 | ||
|
|
11f9586c5e | ||
|
|
3e351f925d | ||
|
|
a197b7881b | ||
|
|
60feeca65e |
31
README.md
31
README.md
@@ -16,14 +16,14 @@ On a fresh Debian/Ubuntu VPS or server:
|
|||||||
apt install git
|
apt install git
|
||||||
git clone https://gut.oily.dad/justin/tinyboard
|
git clone https://gut.oily.dad/justin/tinyboard
|
||||||
cd tinyboard
|
cd tinyboard
|
||||||
./setup.sh # choose option 4
|
./setup.sh # option 4 (setup new hub)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setting up a new Spoke
|
### Setting up a new Spoke
|
||||||
|
|
||||||
On a fresh Armbian device:
|
On a fresh Armbian device:
|
||||||
|
|
||||||
1. Modify `spoke/armbian.not_logged_in_yet` accordingly, then drop it onto the SD card as `/root/.not_logged_in_yet` before first boot (WiFi credentials)
|
1. Modify `spoke/armbian.not_logged_in_yet` accordingly, then drop it onto the SD card as `/root/.not_logged_in_yet` before first boot (WiFi credentials) — see [Armbian Autoconfig docs](https://docs.armbian.com/User-Guide_Autoconfig/)
|
||||||
2. Boot, SSH in as root
|
2. Boot, SSH in as root
|
||||||
3. Run:
|
3. Run:
|
||||||
|
|
||||||
@@ -31,8 +31,8 @@ On a fresh Armbian device:
|
|||||||
apt install git
|
apt install git
|
||||||
git clone https://gut.oily.dad/justin/tinyboard
|
git clone https://gut.oily.dad/justin/tinyboard
|
||||||
cd tinyboard
|
cd tinyboard
|
||||||
./setup-network.sh # configure static IP — SSH session will drop, reconnect
|
./setup.sh # option 0 (configure network)
|
||||||
./setup.sh # choose option 1
|
./setup.sh # option 1 (configure new spoke)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Onboarding a Spoke from the Hub
|
### Onboarding a Spoke from the Hub
|
||||||
@@ -41,14 +41,14 @@ Once the spoke tunnel is up, run on the hub:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd tinyboard
|
cd tinyboard
|
||||||
./setup.sh # choose option 2
|
./setup.sh # option 2 (onboard spoke)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Offboarding a Spoke from the Hub
|
### Offboarding a Spoke from the Hub
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd tinyboard
|
cd tinyboard
|
||||||
./setup.sh # choose option 3
|
./setup.sh # option 3 (offboard spoke)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -76,8 +76,8 @@ Spokes initiate outbound SSH connections to the hub, creating reverse tunnels. T
|
|||||||
```
|
```
|
||||||
tinyboard/
|
tinyboard/
|
||||||
├── setup.sh ← entry point
|
├── setup.sh ← entry point
|
||||||
├── setup-network.sh ← configure static IP on spoke before setup
|
|
||||||
├── spoke/
|
├── spoke/
|
||||||
|
│ ├── setup-network.sh ← configure static IP before setup
|
||||||
│ ├── setup-spoke.sh ← automated spoke setup
|
│ ├── setup-spoke.sh ← automated spoke setup
|
||||||
│ ├── compose.yaml ← Docker Compose for autossh + syncthing
|
│ ├── compose.yaml ← Docker Compose for autossh + syncthing
|
||||||
│ ├── Dockerfile ← autossh container
|
│ ├── Dockerfile ← autossh container
|
||||||
@@ -94,12 +94,13 @@ tinyboard/
|
|||||||
|
|
||||||
### `setup.sh`
|
### `setup.sh`
|
||||||
Entry point. Presents a menu:
|
Entry point. Presents a menu:
|
||||||
|
0. Reconfigure network (static IP via netplan — SSH session will drop, reconnect)
|
||||||
1. Set up this device as a new spoke
|
1. Set up this device as a new spoke
|
||||||
2. Onboard a new spoke from the hub
|
2. Onboard a new spoke from the hub
|
||||||
3. Offboard a spoke from the hub
|
3. Offboard a spoke from the hub
|
||||||
4. Set up this device as a new hub
|
4. Set up this device as a new hub
|
||||||
|
|
||||||
### `setup-network.sh`
|
### `spoke/setup-network.sh`
|
||||||
Run as root on a new spoke before `setup.sh`. Configures a static IP via netplan. Supports both WiFi and wired interfaces. Automatically reverts if network connectivity is lost after applying the new config.
|
Run as root on a new spoke before `setup.sh`. Configures a static IP via netplan. Supports both WiFi and wired interfaces. Automatically reverts if network connectivity is lost after applying the new config.
|
||||||
|
|
||||||
### `spoke/setup-spoke.sh`
|
### `spoke/setup-spoke.sh`
|
||||||
@@ -172,6 +173,20 @@ Before committing, ensure the following do not contain real credentials:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### `apt update` fails with beta.armbian.com error
|
||||||
|
|
||||||
|
On some Armbian images, a beta apt repository is enabled by default and may cause `apt update` to fail. Comment it out:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
grep -r "beta.armbian" /etc/apt/sources.list /etc/apt/sources.list.d/
|
||||||
|
```
|
||||||
|
|
||||||
|
Open the file that contains it (usually `/etc/apt/sources.list.d/armbian.sources`) and comment out or remove the line referencing `beta.armbian.com`, then run `apt update` again.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
**Spoke:** Armbian (Debian-based), ARM device, Docker, autossh, git
|
**Spoke:** Armbian (Debian-based), ARM device, Docker, autossh, git
|
||||||
|
|||||||
8
setup.sh
8
setup.sh
@@ -15,14 +15,20 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
|
|
||||||
header "TinyBoard Setup"
|
header "TinyBoard Setup"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo " 0) Reconfigure network"
|
||||||
echo " 1) Set up this device as a new spoke"
|
echo " 1) Set up this device as a new spoke"
|
||||||
echo " 2) Onboard a new spoke from the hub"
|
echo " 2) Onboard a new spoke from the hub"
|
||||||
echo " 3) Offboard a spoke from the hub"
|
echo " 3) Offboard a spoke from the hub"
|
||||||
echo " 4) Set up this device as a new hub"
|
echo " 4) Set up this device as a new hub"
|
||||||
echo ""
|
echo ""
|
||||||
read -rp "Choose [1/2/3/4]: " CHOICE
|
read -rp "Choose [0/1/2/3/4]: " CHOICE
|
||||||
|
|
||||||
case "$CHOICE" in
|
case "$CHOICE" in
|
||||||
|
0)
|
||||||
|
[ "$(id -u)" -eq 0 ] || die "Network reconfiguration must be run as root"
|
||||||
|
info "Starting network reconfiguration..."
|
||||||
|
exec "$SCRIPT_DIR/spoke/setup-network.sh"
|
||||||
|
;;
|
||||||
1)
|
1)
|
||||||
[ "$(id -u)" -eq 0 ] || die "Spoke setup must be run as root"
|
[ "$(id -u)" -eq 0 ] || die "Spoke setup must be run as root"
|
||||||
info "Starting spoke setup..."
|
info "Starting spoke setup..."
|
||||||
|
|||||||
@@ -197,6 +197,6 @@ echo -e "${YELLOW}════════════════════
|
|||||||
echo -e "${YELLOW} Network reconfigured.${NC}"
|
echo -e "${YELLOW} Network reconfigured.${NC}"
|
||||||
echo -e "${YELLOW} If you are connected via SSH, your session${NC}"
|
echo -e "${YELLOW} If you are connected via SSH, your session${NC}"
|
||||||
echo -e "${YELLOW} may drop. Reconnect to: ${STATIC_ADDR}${NC}"
|
echo -e "${YELLOW} may drop. Reconnect to: ${STATIC_ADDR}${NC}"
|
||||||
echo -e "${YELLOW} Then run: ./setup.sh${NC}"
|
echo -e "${YELLOW} Then run: cd .. && ./setup.sh${NC}"
|
||||||
echo -e "${YELLOW}══════════════════════════════════════════${NC}"
|
echo -e "${YELLOW}══════════════════════════════════════════${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
Reference in New Issue
Block a user