Update setup.sh
This commit is contained in:
@@ -9,16 +9,14 @@ if [ "$UID" != "0" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Get settings
|
# Get settings
|
||||||
read -rsp "User Password: " pass; echo
|
|
||||||
RID=$(cat /etc/radio_id)
|
RID=$(cat /etc/radio_id)
|
||||||
read -rp "Radio ID (${RID:-1-254}): " ip
|
read -rp "Radio ID (${RID:-1-254}): " ip
|
||||||
ip=${ip:-$RID}
|
ip=${ip:-$RID}
|
||||||
echo $ip > /etc/radio_id
|
echo $ip > /etc/radio_id
|
||||||
read -rp "Radio Name ($HOSTNAME): " name
|
read -rp "Radio Name ($HOSTNAME): " name
|
||||||
name=${name:-$HOSTNAME}
|
name=${name:-$HOSTNAME}
|
||||||
read -rp "Mesh Name: " mesh_ssid
|
read -rp "HuggingFace Token: " token
|
||||||
read -rsp "Mesh Password: " mesh_pass; echo
|
export HUGGING_FACE_HUB_TOKEN=${token}
|
||||||
read -rsp "Hotspot Password: " ap_pass; echo
|
|
||||||
read -p "Enable wireguard (Y/N): " wireguard
|
read -p "Enable wireguard (Y/N): " wireguard
|
||||||
if [ "${wireguard,,}" == "y" ]; then
|
if [ "${wireguard,,}" == "y" ]; then
|
||||||
while [ ! -f "/etc/wireguard/wg0.conf" ]; do
|
while [ ! -f "/etc/wireguard/wg0.conf" ]; do
|
||||||
@@ -51,6 +49,11 @@ cat <<EOF >> /etc/motd
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Node
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.7/install.sh | bash
|
||||||
|
source ~/.bashrc
|
||||||
|
nvm install stable && nvm use stable
|
||||||
|
|
||||||
# Setup wireguard
|
# Setup wireguard
|
||||||
if [ "${wireguard,,}" == "y" ]; then
|
if [ "${wireguard,,}" == "y" ]; then
|
||||||
apt install wireguard -y
|
apt install wireguard -y
|
||||||
@@ -74,15 +77,8 @@ refclock SHM 0 offset 0.5 delay 0.2 refid NMEA
|
|||||||
EOF
|
EOF
|
||||||
systemctl enable --now gpsd chrony
|
systemctl enable --now gpsd chrony
|
||||||
|
|
||||||
# Setup DNS
|
# Setup Fallback AP
|
||||||
# TODO: Setup AP management
|
curl -sL https://git.zakscode.com/ztimson/fallback-ap/raw/branch/master/install.sh | sudo bash
|
||||||
apt install -y dnsmasq
|
|
||||||
tee -a /etc/dnsmasq.d/local.conf > /dev/null <<'EOF'
|
|
||||||
server=1.1.1.1
|
|
||||||
server=1.0.0.1
|
|
||||||
address=/$HOSTNAME/$IP
|
|
||||||
address=/.$HOSTNAME/$IP
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Install docker
|
# Install docker
|
||||||
apt install -y qemu-user-static
|
apt install -y qemu-user-static
|
||||||
@@ -90,70 +86,85 @@ curl -fsSL https://get.docker.com | sh
|
|||||||
usermod -aG docker $USER
|
usermod -aG docker $USER
|
||||||
newgrp docker
|
newgrp docker
|
||||||
|
|
||||||
# Setup Guacamole - http://localhost:8080
|
# VNC
|
||||||
sed -i 's/^#\?PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
sudo raspi-config nonint do_vnc 0
|
||||||
systemctl restart ssh
|
cat <<EOF | sudo tee /etc/wayvnc/config
|
||||||
apt-get install -y xrdp
|
use_relative_paths=true
|
||||||
tee /etc/xrdp/startwm.sh > /dev/null <<'EOF'
|
address=127.0.0.1
|
||||||
#!/bin/sh
|
enable_auth=false
|
||||||
unset DBUS_SESSION_BUS_ADDRESS
|
enable_pam=false
|
||||||
unset XDG_RUNTIME_DIR
|
relax_encryption=true
|
||||||
exec startlxde-pi
|
|
||||||
EOF
|
EOF
|
||||||
mkdir -p /etc/polkit-1/rules.d
|
|
||||||
tee /etc/polkit-1/rules.d/49-nopasswd.rules > /dev/null <<'EOF'
|
|
||||||
polkit.addRule(function(action, subject) {
|
|
||||||
return polkit.Result.YES;
|
|
||||||
});
|
|
||||||
EOF
|
|
||||||
systemctl restart polkit
|
|
||||||
systemctl enable --now xrdp
|
|
||||||
docker run -d --name guacamole --network host --restart unless-stopped -v guacamole:/config flcontainers/guacamole:latest
|
|
||||||
|
|
||||||
# Setup Automount + FileBrowser - http://localhost:1200
|
# Setup Automount + FileBrowser - http://localhost:1200
|
||||||
mkdir -p /etc/udev/rules.d/
|
# mkdir -p /etc/udev/rules.d/
|
||||||
echo 'ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1"' > /etc/udev/rules.d/99-udisks2.rules
|
# echo 'ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1"' > /etc/udev/rules.d/99-udisks2.rules
|
||||||
docker run -d --name filebrowser --restart unless-stopped -p 1200:8080 -e FB_USERNAME=$USER -v filebrowser:/config -v /media:/data hurlenko/filebrowser:latest
|
# docker run -d --name filebrowser --restart unless-stopped -p 1200:8080 -e FB_USERNAME=$USER -v filebrowser:/config -v /media:/data hurlenko/filebrowser:latest
|
||||||
sleep 3
|
# sleep 3
|
||||||
fb_pass=$(docker logs filebrowser 2>&1 | grep -oP 'randomly generated password: \K.*'); echo $fb_pass
|
# fb_pass=$(docker logs filebrowser 2>&1 | grep -oP 'randomly generated password: \K.*'); echo $fb_pass
|
||||||
|
|
||||||
# Setup Kiwix - http://localhost:1300
|
# Setup Kiwix - http://localhost:1300
|
||||||
mkdir -p /media/library/archive
|
# mkdir -p /media/library/archive
|
||||||
mkdir -p /media/library/zim
|
# mkdir -p /media/library/zim
|
||||||
docker run -d --name kiwix --restart unless-stopped -p 1300:3000 -v /media/library:/data ztimson/kiwixm:latest
|
# docker run -d --name kiwix --restart unless-stopped -p 1300:3000 -v /media/library:/data ztimson/kiwixm:latest
|
||||||
|
|
||||||
# Maps - http://localhost:1400
|
# Maps - http://localhost:1400
|
||||||
mkdir -p /media/maps/tiles
|
mkdir -p /media/maps/tiles
|
||||||
mkdir -p /media/maps/styles
|
mkdir -p /media/maps/styles
|
||||||
docker run -d --name maps --restart unless-stopped -p 1400:8080 -v /media/maps/config.json:/config.json -v /media/maps/tiles:/data -v /media/maps/styles:/styles maptiler/tileserver-gl:v4.11.0
|
docker run -d --name maps --restart unless-stopped -p 1400:8080 -v /media/maps/config.json:/config.json -v /media/maps/tiles:/data -v /media/maps/styles:/styles maptiler/tileserver-gl:v4.11.0
|
||||||
|
|
||||||
# Setup Ollama + OpenWebUI - http://localhost:1000
|
# Setup AI (LiteRT + Gemma4-E2B)
|
||||||
docker run -d --name ollama --restart unless-stopped -p 11434:11434 -v ollama:/root/.ollama ollama/ollama:latest
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
docker exec -d ollama ollama pull llama3.2:1b-instruct-q4_K_M # Works best on Pi5 (High TPS, Low memory)
|
source $HOME/.local/bin/env
|
||||||
docker run -d --name open-webui --restart unless-stopped -p 1000:8080 -e OLLAMA_BASE_URL=http://ollama:11434 --link ollama -v open-webui:/app/backend/data ghcr.io/open-webui/open-webui:main
|
INSTALL_DIR="$(pwd)"
|
||||||
|
uv venv --clear --python=3.13 --seed
|
||||||
|
source .venv/bin/activate
|
||||||
|
uv pip install litert-cli-nightly litert-lm-nightly
|
||||||
|
litert-lm import --from-huggingface-repo litert-community/gemma-4-E2B-it-litert-lm
|
||||||
|
MODEL_PATH="$INSTALL_DIR/gemma-4-E2B-it.litertlm"
|
||||||
|
LITERT_BIN="$INSTALL_DIR/.venv/bin/litert-lm"
|
||||||
|
SERVICE_USER="$(whoami)"
|
||||||
|
cat <<EOF | sudo tee /etc/systemd/system/litert.service
|
||||||
|
[Unit]
|
||||||
|
Description=LiteRT OpenAI-compatible server
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=$LITERT_BIN serve
|
||||||
|
Restart=on-failure
|
||||||
|
User=$SERVICE_USER
|
||||||
|
WorkingDirectory=$INSTALL_DIR
|
||||||
|
Environment="PATH=$INSTALL_DIR/.venv/bin:/usr/bin:/bin"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl enable --now litert.service
|
||||||
|
|
||||||
# LoRa - http://localhost:4403
|
# LoRa - http://localhost:4403
|
||||||
pip install --upgrade --break-system-packages meshtastic
|
# pip install --upgrade --break-system-packages meshtastic
|
||||||
LORA_DEVICE=$(ls /dev/serial/by-id | grep RAK)
|
# LORA_DEVICE=$(ls /dev/serial/by-id | grep RAK)
|
||||||
apt install -y ser2net
|
# apt install -y ser2net
|
||||||
rm /etc/ser2net.yaml || echo
|
# rm /etc/ser2net.yaml || echo
|
||||||
tee /etc/ser2net.conf <<EOF
|
# tee /etc/ser2net.conf <<EOF
|
||||||
4403:raw:0:/dev/serial/by-id/$LORA_DEVICE:115200 8DATABITS NONE 1STOPBIT
|
# 4403:raw:0:/dev/serial/by-id/$LORA_DEVICE:115200 8DATABITS NONE 1STOPBIT
|
||||||
EOF
|
# EOF
|
||||||
sed -i 's|\$CONFFILE|/etc/ser2net.conf|g' /lib/systemd/system/ser2net.service
|
# sed -i 's|\$CONFFILE|/etc/ser2net.conf|g' /lib/systemd/system/ser2net.service
|
||||||
systemctl daemon-reload
|
# systemctl daemon-reload
|
||||||
systemctl restart ser2net
|
# systemctl restart ser2net
|
||||||
|
|
||||||
# Federated chat - http://localhost:1500
|
# Federated chat - http://localhost:1500
|
||||||
docker run -it --rm -v synapse:/data -e SYNAPSE_SERVER_NAME=server.local -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate
|
# docker run -it --rm -v synapse:/data -e SYNAPSE_SERVER_NAME=server.local -e SYNAPSE_REPORT_STATS=no matrixdotorg/synapse:latest generate
|
||||||
tee -a /var/lib/docker/volumes/synapse/_data/homeserver.yaml <<EOF
|
# tee -a /var/lib/docker/volumes/synapse/_data/homeserver.yaml <<EOF
|
||||||
enable_registration: true
|
# enable_registration: true
|
||||||
enable_registration_without_verification: true
|
# enable_registration_without_verification: true
|
||||||
EOF
|
# EOF
|
||||||
docker run -d --name synapse --restart unless-stopped -e SYNAPSE_SERVER_NAME=server.local -e SYNAPSE_REPORT_STATS=no -v synapse:/data -p 8008:8008 matrixdotorg/synapse:latest
|
# docker run -d --name synapse --restart unless-stopped -e SYNAPSE_SERVER_NAME=server.local -e SYNAPSE_REPORT_STATS=no -v synapse:/data -p 8008:8008 matrixdotorg/synapse:latest
|
||||||
mkdir -p /etc/element
|
# mkdir -p /etc/element
|
||||||
echo "{\"default_server_config\":{\"m.homeserver\":{\"base_url\":\"http://$IP:8008\",\"server_name\":\"server.local\"}}}" > /etc/element/config.json
|
# echo "{\"default_server_config\":{\"m.homeserver\":{\"base_url\":\"http://$IP:8008\",\"server_name\":\"server.local\"}}}" > /etc/element/config.json
|
||||||
docker run -d --name element --restart unless-stopped -p 1500:80 -v /etc/element/config.json:/app/config.json vectorim/element-web:latest
|
# docker run -d --name element --restart unless-stopped -p 1500:80 -v /etc/element/config.json:/app/config.json vectorim/element-web:latest
|
||||||
|
|
||||||
# Setup pentest suite - http:localhost:1600
|
# Setup pentest suite - http:localhost:1600
|
||||||
sudo apt install -y arp-scan aircrack-ng gobuster hashcat hcxtools hydra john netcat-openbsd nikto nmap masscan reaver sqlmap tcpdump wireshark
|
sudo apt install -y arp-scan aircrack-ng gobuster hashcat hcxtools hydra john netcat-openbsd nikto nmap masscan reaver sqlmap tcpdump wireshark
|
||||||
@@ -173,6 +184,6 @@ docker run -d --name atak --restart unless-stopped --platform=linux/amd64 -p 808
|
|||||||
# Speedtest - http://localhost:1900
|
# Speedtest - http://localhost:1900
|
||||||
docker run -d --name speedtest --restart unless-stopped -p 1900:80 lscr.io/linuxserver/librespeed:latest
|
docker run -d --name speedtest --restart unless-stopped -p 1900:80 lscr.io/linuxserver/librespeed:latest
|
||||||
|
|
||||||
# TODO: Captive Portal + PWA & Caddy
|
# TODO: Captive Portal + PWA
|
||||||
# TODO: E-Ink + QR Join AP
|
# TODO: E-Ink + QR Join AP
|
||||||
# TODO: Mesh
|
# TODO: Mesh
|
||||||
|
|||||||
Reference in New Issue
Block a user