This is a starter kit for creating a Truto Daemon. It uses Bun.sh.
- Install Bun.sh
- Install dependencies using
bun install
- Copy the .env.example to .env and change the values to your own.
- Run the server using
bun dev
It uses SQLite as the database and is stored at <project_root>/sqlite.db by default. To change the location, you can change the .env file.
- Build the app using
bun run build-linux
. -
scp
the binary to the server. -
chmod +x
the binary. -
sudo setcap CAP_NET_BIND_SERVICE=+eip
the binary. - Copy over the .env file to the server.
- Copy over the
truto-daemon.service
file to/etc/systemd/system/
. - Replace the
ExecStart
andEnvironmentFile
attributes in the service file to the actual path on the server. - Run the following commands:
sudo systemctl daemon-reload
sudo systemctl enable truto-daemon
sudo systemctl start truto-daemon
-
sudo systemctl status truto-daemon
to check the status of the service. -
sudo journalctl -t truto-daemon
to check the logs of the service.