-
Notifications
You must be signed in to change notification settings - Fork 22
Home
English | 简体中文
In order to make full use of the functions of this project, you need to take the following steps:
About app config, please refer to App Wiki.
version: "3.0"
services:
srvbox:
image: lollipopkit/srvbox_monitor:latest
container_name: srvbox
ports:
- 3770:3770
volumes:
- ./config:/root/.config/server_box
environment:
- TZ=Asia/Shanghai
# Custom listen address
# - SBM_ADDR=0.0.0.0:3770
# TLS Cert
# - SBM_TLS_CRT=/root/.config/server_box/cert.pem
# TLS Key
# - SBM_TLS_KEY=/root/.config/server_box/key.pem
Attention:
- To ensure that the server can read the network interface normally, you need to ensure that
network_mode
ishost
. - Please edit this file according to your needs, and pay attention to the comments.
- If port 3770 is occupied, you can change it to another port by modifying
SBM_ADDR
.
Choose a directory you like, write the above content into docker-compose.yml
and run docker compose up -d
.
-
docker rm srvbox -f && docker rmi lollipopkit/srvbox_monitor:latest
to delete old image. -
docker compose up -d
to run with new image.
- The following command will install newest version for
root
and configsystemd
. - If you want to install as
rootless
ordocker
, please refer to other instructions.
curl -fsSL https://raw.githubusercontent.com/lollipopkit/server_box_monitor/main/install.sh | sh -s -x -- install
curl -fsSL https://raw.githubusercontent.com/lollipopkit/server_box_monitor/main/install.sh | sh -x -s -- install
curl -fsSL https://raw.githubusercontent.com/lollipopkit/server_box_monitor/main/install.sh | sh -x -s -- upgrade
- If you have
go
installed, you can rungo install github.com/lollipopkit/server_box_monitor@latest
- If you don't have
go
installed, you can download the binary from release page
If you are using the executable file, you probably want it to run continuously. It is recommended to use systemd
:
- Example (Read comment!):
[Unit] Description=ServerBox Monitor Service After=network.target [Service] Type=simple # Uncomment the following line to run as a specific user # User=root Restart=on-failure RestartSec=5s # Make sure the path is correct ExecStart=/usr/bin/server_box_monitor # /home/xxx is your home directory WorkingDirectory=/home/xxx/.config/server_box [Install] WantedBy=default.target
- Rootless
- Copy file to
~/.config/systemd/user/srvbox.service
- Run
systemctl --user enable --now srvbox
- You can run
sudo loginctl enable-linger $USER
to make the service run after logout
- Copy file to
- Rootful
- Copy file to
/etc/systemd/system/srvbox.service
- Uncomment
User
in the file - Run
systemctl enable --now srvbox
- Copy file to
You need manually update the executable file.
Before the next section, you need to confirm that the service is running, you can confirm it in the following ways:
- If you are using
Docker
:docker logs srvbox
- If you are using
systemd
: such assystemctl status srvbox
- Web access
http://DEVICE_IP:3770/status
(If you have modified the listening address, please replace it yourself)
If there is a display similar to the below, it means that the service has been successfully started and you can continue to the next step.
Different installation methods, the configuration file is in different paths:
- Executable:
~/.config/server_box/config.json
-
Docker
:./config/config.json
Here is a complete example of the server configuration, you need to modify it according to your needs: