Tested on Orange pi zero + Armbian image, Orange pi one + Armbian image and Raspberry pi B+ with Raspbian image.
sudo apt-get update
Then
sudo apt-get upgrade
sudo dpkg-reconfigure tzdata
sudo apt-get install -y tmux
tmux new -s casanet -d
tmux a -t casanet
- Download the Linux binary execution (
casanet_linux_x64
orcasanet_linux_arm
for ARM processor based (such as raspberry pi)casanet_linux_arm
file) from here - Download the
casanet.json
configuration file from here - Download the environments example file from here
- Give to the
casanet_linux_arm
file an execute permission (usingchmod -R 0777 ./casanet_linux_arm
command)
It is recommended to check the default environments of the server and change it by demand.
for it copy the .env.example file and edit the real env:
cp .env.example .env
Then edit real environments by nano .env
or any other text editor.
The Orange pi Armbian image, changes his mac address each boot, so I recommend to get the mac address and set it to the
PHYSICAL_ADDRESS
environment variable, else the default username and the identity against a remote server will change each boot.
press ctrl
+ b
+ d
to exit from the tmux window.
Go to the init.d
directory
cd /etc/init.d/
Then create and edit the script named casanet
sudo nano casanet
In the editor paste the following content:
#!/bin/bash
# autostart casanet server
echo "Starting casanet server in casanet tmux window"
case "$1" in
'start')
tmux kill-session -t "casanet"
tmux new -s "casanet" -d
tmux send-keys -t "casanet" "cd /casanet-dir" C-m # Go the the directory where the Casanet executable placed
tmux send-keys -t "casanet" "sudo ./casanet_linux_arm" C-m # Or casanet_linux_x64, the sudo used to allows Casanet to scan the network
;;
'stop')
tmux kill-session -t "casanet"
esac
Give file an exe permission
sudo chmod +x casanet
Now the script is ready.
Go to the rc3.d
directory to link the script there.
cd /etc/rc3.d/
Create the link
sudo ln -s /etc/init.d/casanet
And change the link name to a boot pattern.
sudo mv casanet S01casanet
Now reboot the device and check that all work properly.
Good Luck!
- Run
git clone https://github.com/casanet/casanet-server.git
- Go to the backend directory ```cd ../backend/``
- Install casanet server dependencies
yarn --frozen-lockfile
- Build the backend by
npm run build
- Run
npm run fetch:dashboard
if you wants the server to serve frontend dashboard