Casvisor
Operations

Configuration

Casvisor reads conf/app.conf from its working directory when it starts. In the Docker images that is /conf/app.conf. Restart Casvisor after changing it.

Two ways to keep your own values apart from the file in the repository:

  • conf/app.local.conf, in the same format. Every key in it overrides conf/app.conf. It is not in git, so pulling a new version never conflicts with it; it is the place for dataSourceName, clientSecret and credentialKey.
  • Environment variables of the same name as the key, which override both files, for example docker run -e driverName=mysql .... This works for every key in the tables below except httpport, runmode, redisEndpoint and the Beego settings, which are read from the files only.
appname = casvisor
httpport = 19000
runmode = dev
SessionOn = true
copyrequestbody = true
driverName = sqlite
dataSourceName = db/casvisor.db
dbName =
tableNamePrefix =
isDemoMode = false
logPostOnly = true
redisEndpoint =
casdoorEndpoint =
clientId =
clientSecret =
casdoorOrganization = "casvisor"
casdoorApplication =
adminPassword =
sshGatewayPort =
sshGatewayHost =
recordingPath =
recordingRetentionDays =
disableRecording = false

With the file as shipped, Casvisor keeps its data in SQLite under db/ and signs people in with its own accounts.

Server

KeyDefaultMeaning
httpport19000The port Casvisor listens on, for the web UI, the API and the connection WebSockets.
runmodedevBeego's run mode. prod turns off Beego's development error pages.
appname, SessionOn, copyrequestbodyBeego settings Casvisor relies on. Leave them as they are.

Database

KeyDefaultMeaning
driverNamesqlitesqlite, or mysql for MySQL and MariaDB.
dataSourceNamedb/casvisor.dbFor SQLite, the database file, relative to the working directory (/db/casvisor.db in the Docker image); its folder is created if missing. For MySQL, the DSN up to and including the /, without the database name, such as root:123456@tcp(localhost:3306)/.
dbNameemptyMySQL only: the database. Casvisor creates it at start if it does not exist.
tableNamePrefixemptyA prefix for the API rule table, for sharing a database.

Casvisor creates its tables, and any column a newer version needs, at start. SQLite runs in WAL mode and waits up to 10 seconds for a lock, which is plenty for one Casvisor; use MySQL when the database should live on another server or be backed up with your other MySQL databases.

When the environment variable RUNNING_IN_DOCKER is true, localhost in dataSourceName is replaced by the Docker host's address, so a container can reach a MySQL server running on its host.

Sign-in

KeyDefaultMeaning
casdoorEndpointemptyEmpty: Casvisor signs people in with its own accounts. Set to Casdoor's address, reachable from both the browsers and the Casvisor server and without a trailing slash, to sign in through Casdoor instead.
clientId, clientSecretemptyThe client ID and secret of the Casdoor application.
casdoorOrganizationcasvisorWith Casdoor, the organization of the application. With built-in accounts, the organization those accounts, and the assets and permissions they create, belong to.
casdoorApplicationemptyThe name of the Casdoor application.
adminPasswordemptyBuilt-in accounts only: the password of the first administrator, admin, created when there are no users yet. Empty means a random one, printed once in the log. It is not used after that.
allowedUsersemptyComma-separated organization/name of the only users who may sign in. Empty lets everyone in. See Users and administrators.

See Connect Casdoor and Users and administrators. Casvisor writes the Casdoor values into the web UI when it serves it, and an empty casdoorEndpoint makes the UI show its own sign-in form, so the same build works either way.

Connections

KeyDefaultMeaning
sshGatewayPortempty; 2222 in the Docker imagesThe port of the SSH gateway, on every interface. Empty turns the gateway off. The Docker images set it with an environment variable, so pass -e sshGatewayPort= to turn it off there. It is always off with isDemoMode = true.
sshGatewayHostemptyThe host name shown in the SSH commands users copy. Empty uses the host name of the web UI.

Recordings

KeyDefaultMeaning
recordingPathemptyWhere recordings are written. Empty means recordings/ under the working directory, which is /recordings in the Docker image.
recordingRetentionDaysemptyRecordings older than this many days are deleted, checked every hour. Empty or 0 keeps them forever.
disableRecordingfalsetrue stops recording new sessions. Recordings already made can still be played.

Patch management

KeyDefaultMeaning
patchScanInterval24Hours after which an asset that was scanned before is scanned for updates again by itself. 0 turns the scheduled scans off.

Sessions and logs

KeyDefaultMeaning
redisEndpointemptyEmpty keeps sign-in sessions as files under tmp/. Set it to a Redis address, such as 127.0.0.1:6379, to keep them in Redis instead, so people stay signed in when the container is replaced.
logPostOnlytrueLog only the calls that change something. See Operation logs.
isDemoModefalseFor a public demo: sessions end after 15 minutes, each client IP can have only a few open at a time, users can only stop their own sessions, the SSH gateway is off, and so are scheduled patch scans.

Security

KeyDefaultMeaning
credentialKeyemptyEncrypts stored passwords and private keys. See Encryption.
Edit on GitHub

On this page