Returned to Keenetic. It allows for the use -1 server (and no permanently running servers).
For example:
- PPPoE
- WiFi mesh
- extra providers (when needed): 4g, wifi, 2nd ethernet
- DHCP & DNS
- VPN client
- VPN server
- Torrent-client
- DLNA-server
- External LB with https from Let’s Encrypt (Caddy)
- Static internal homepage (Caddy)
- Exchange folder (SFTP-server)
- Back-up server (to external hdd, sftp protocol or time machine)
A Caddy was required to host the internal start page. Let’s see how it can be installed and configured.
OPKG
2 articles:
- https://support.keenetic.ru/ultra/kn-1811/ru/18481.html
- https://support.keenetic.ru/ultra/kn-1811/ru/18482.html
In general, it results in another separate ssh connection to the system, which is access to the already running Linux.
Also, from the second article we understand that my architecture is aarch64 aka arm64 – this will be useful to know which Caddy to download.
Removing OPKG
For reinstalling everything from scratch.
Commands:
no opkg disk
no system mount storage:
erase storage:
Switch the disk to another one (you can temporarily plug in a flash drive) via http://192.168.1.1/opkg – otherwise it won’t reinstall, you’ll just get Opkg::Manager: Disk is unchanged. and that’s it.
Installing OPKG
- http://192.168.1.1/opkg – install opkg itself (Built-in storage, /opt/etc/init.d/rc.unslung)
- Basic setup:
exec sh
opkg update
opkg upgrade
passwd root
opkg install rsync curl jq
opkg list-installed
Caddy
Installing Caddy
mkdir 1
cd 1
curl -fLO https://github.com/caddyserver/caddy/releases/download/v2.11.4/caddy_2.11.4_linux_arm64.tar.gz
# or `rsync caddy_2.11.4_linux_arm64.tar.gz kopg:1/` if curl fails with 500
gunzip caddy_2.11.4_linux_arm64.tar.gz
tar -xvf caddy_2.11.4_linux_arm64.tar
mv caddy /opt/usr/bin
caddy --help
cd
rm -rf ~/1
Configuring Caddy
mkdir /opt/var/log/caddy
mkdir /opt/share/caddy
mkdir /opt/share/caddy/start
mkdir /opt/etc/caddy
cat > /opt/etc/caddy/Caddyfile << EOF
{
storage file_system /opt/share/caddy
default_bind 192.168.1.1
}
:8080 {
root * /opt/share/caddy/start
file_server
}
EOF
caddy fmt --overwrite /opt/etc/caddy/Caddyfile
cat > /opt/share/caddy/start/index.html << EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Caddy</title>
</head>
<body>
Caddy works! 🎇🎇🎇
</body>
</html>
EOF
cat > /opt/etc/init.d/S98caddy << \EOF
#!/bin/sh
ENABLED="yes"
PROCS="caddy"
ARGS="start --config /opt/etc/caddy/Caddyfile"
WORK_DIR="/opt/share/caddy"
DESC=$PROCS
PREARGS=""
PRECMD="export GOMAXPROCS=1"
POSTCMD=""
. /opt/etc/init.d/rc.func
EOF
chmod +x /opt/etc/init.d/S98caddy
/opt/etc/init.d/S98caddy start
/opt/etc/init.d/S98caddy check
Install rsync to update static website using rsync:
opkg install rsync
And a router restart for checking that everything starts up properly.