Casvisor
Getting started

Run from source

Running from source is how you develop Casvisor, and for now also how you use it with a Casdoor that signs with its own certificate (see Connect Casdoor).

What you need

VersionWhat for
Go1.26 or laterThe backend
Node.js and YarnNode 20 or later, Yarn 1The web UI
MySQL or MariaDB5.7 / 10.3 or laterAssets, permissions, sessions, operation log
guacd1.5 or laterTelnet only; SSH, RDP and VNC do not need it
CasdoorSign-in, see Connect Casdoor

Build and run

git clone https://github.com/casvisor/casvisor
cd casvisor/web
yarn install
yarn build
cd ..
go run .

yarn build writes the web UI to web/build, which the backend serves. Casvisor listens on port 19000 (httpport in conf/app.conf). On first start it creates the database named by dbName and its tables, so the MySQL account in dataSourceName needs the right to create a database.

Start guacd if you need Telnet:

docker run -d --name guacd -p 4822:4822 guacamole/guacd

Configure

Edit conf/app.conf before the first start:

dataSourceName = root:123456@tcp(localhost:3306)/
dbName = casvisor
guacamoleEndpoint = 127.0.0.1:4822
casdoorEndpoint = https://door.example.com
clientId = <client ID>
clientSecret = <client secret>
casdoorOrganization = "<organization>"
casdoorApplication = "<application>"

Configuration explains each key.

Working on the web UI

The web UI is React with Vite and shadcn/ui. For development, run Vite on its own and let it send API calls to the backend:

cd web
yarn dev

It serves on port 18001 and forwards /api, WebSockets included, to http://localhost:19000. Set CASVISOR_BACKEND to point it at another backend.

Building for other systems

The backend is pure Go with CGO_ENABLED=0, so one machine can build for the others:

CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o casvisor .
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o casvisor.exe .

Copy the binary together with conf/, data/, swagger/ and web/build/, which it reads at run time from its working directory.

Edit on GitHub

On this page