CShark Demonstration
Menu

CShark Documentation

Administrator's Guide

Configuration and maintenance of CShark software at the customer’s site: from service and topology management to backup, diagnostics and updating.

Version 2.0.3

1. Purpose of the document and administrator roles

The document is intended for specialists who configure and maintain CShark software at the customer’s site.

Daily work with the system is described in a separate document "User Guide", deployment - in the document “Instructions for installing a copy of the software”.

RoleArea of responsibility
System administratorobject topology, devices, cameras, displays, integrations, system parameters, update
Parking administratorevent processing rules, zone modes, operators and their rights
Customer system engineerinfrastructure, backup, monitoring, network

Rights are delineated by role model (section 12); the division into roles above is organizational.

2. Software composition and placement of components

ServicePurposePort
coreapplication server: application logic, REST API, WebSocket, event consumersinternal
gatewaydevice gateway: receiving camera events and controlling the scoreboard18010/tcp
webweb interface and single point of access to API8088/tcp
postgresPostgreSQL 17 databaseinternal
natsNATS JetStream event businternal
seaweedfsobject frame storage, S3 protocol18333/tcp

The observability profile is included in the verification kit; published by Grafana on 13000/tcp, its remaining services are available only within the Compose network.

All services run in containers within a closed network perimeter of the facility. Calls to external services are not executed during operation.

3. Service management

Working directory: /opt/cshark-stand.

# service status
sudo docker compose --env-file /opt/cshark-stand/.env \
  -f /opt/cshark-stand/compose.yml --profile obs ps

# start
sudo docker compose --env-file /opt/cshark-stand/.env \
  -f /opt/cshark-stand/compose.yml --profile obs up -d

# stop
sudo docker compose --env-file /opt/cshark-stand/.env \
  -f /opt/cshark-stand/compose.yml --profile obs stop

# restart one service
sudo docker compose --env-file /opt/cshark-stand/.env \
  -f /opt/cshark-stand/compose.yml restart core

# service logs
sudo docker compose --env-file /opt/cshark-stand/.env \
  -f /opt/cshark-stand/compose.yml logs -f core

4. Settings

The parameters are set by environment variables (file .env next to the service description file). After changing the settings, the service must be restarted.

VariablePurposeDefault value
CSHARK_DATABASE_URLdatabase connection string
CSHARK_NATS_URLevent bus addressnats://nats:4222
CSHARK_S3_ENDPOINT_URLobject storage addresshttp://seaweedfs:8333
CSHARK_S3_PUBLIC_ENDPOINT_URLstorage address for generating links to the client
CSHARK_S3_ACCESS_KEY, CSHARK_S3_SECRET_KEYstorage access keys
CSHARK_S3_BUCKETobject containercshark-media
CSHARK_AUTH_ENFORCEmandatory authenticationtrue
CSHARK_AUTH_SECRETsession token signing secretset during installation
CSHARK_CORS_ORIGINSallowed web interface sources
CSHARK_WEB_PORTweb interface publishing port8088
CSHARK_OTEL_ENDPOINTtelemetry collector addressnot specified

5. Initial setup of the object

When you log in for the first time, the Initial Setup Wizard is available. Sequence:

  1. Change the password for the built-in administrator account.
  2. Create an object (parking), levels, zones, parking spaces.
  3. Load the graphic background of the level and place objects on the diagram.
  4. Register cameras and link them to parking spaces.
  5. Create templates and devices for information boards.
  6. Set up a graph of reachability zones and entry points.
  7. Create operator roles and accounts.
  8. Configure event processing rules.

6. Setting up topology and circuit

Section “Administration” → “Topology”.

Hierarchy: organization → parking → level → zone → parking space.

ActionOrder
Creating a Levelindicate the name and serial number
Create a zoneindicate the name, level reference, type
Creation of a parking spaceindicate the code (unique within the object), zone, type
Loading a Level Underlaydownload the graphic file of the level plan
Placement on the diagramset the coordinates and shape of parking spaces, zones and devices in the diagram editor

Parking space codes are displayed to users and must correspond to the markings on the site.

7. Setting up video analytics cameras

Section "Equipment".

  1. Configure the camera to send events to the device gateway address (vendor protocol over HTTP). The address and port are specified in the camera settings.
  2. The camera that accesses the system appears in the list of undetected devices.
  3. Register a camera: set the name, network address, location.
  4. Link the camera to the parking spaces it serves.
  5. Check the arrival of events: the status of the associated parking space should change when the situation changes.

Performance monitoring is performed automatically based on periodic presence signals. The device status is displayed in the “Equipment” section and on the site diagram. The history of state changes is saved.

For devices that support control, command transmission via the command channel is available.

8. Setting up information boards

Section "Scoreboard".

8.1. Templates

The template describes the layout of the frame and consists of regions:

Region typeContents
Textarbitrary text with context value substitution
Free seats counternumber of available spaces in a zone or object
direction arrowdirection of movement to the zone
Imagestatic image
QR codelink encoded into image
Level maplevel diagram for high resolution monitors
Zone tablezone summary
Indicatornumerical indicator

The font size is automatically adjusted to the size of the region; If the region's capacity is insufficient, a warning is issued when saving the template.

8.2. Display devices

  1. Create a device, select a class: text LED panel (EK07, TCP/RS-485 protocol) or web kiosk on a high-resolution monitor.
  2. Specify connection parameters.
  3. Link template, zone and entry point.
  4. Check the result by previewing the generated frame.

A public address of the form is generated for the web kiosk /kiosk/display/<identifier>?token=<token>; the monitor opens this page in kiosk mode. The token restricts access to content.

8.3. Content Priorities

Emergency → manual replacement → schedule → staffing. Emergency content (fire or shelter mode) supersedes any other content and cannot be replaced manually.

8.4. Addressee of texts

The reasons for unavailability are divided into public (displayed to the driver) and administrative (available only to staff). Administrative texts are not physically present in the public kiosk response and in the WebSocket stream. The diagnostic status of the display is available at /api/displays/{id}/state for authenticated personnel only.

10. Setting object modes and zones

Zone and object states: staff, fire, shelter, maintenance.

Mode change methodOrder
Manuallysection “Administration” → “Zones” → mode selection
Automaticallyaccording to a signal from fire automatic systems through a device gateway

Changing the mode instantly changes: the availability of parking spaces in the zone, the contents of information boards (emergency content receives the highest priority), the rules for processing events, and the composition of notifications.

The administrator returns to normal mode manually after eliminating the cause.

11. Setting up event processing rules

Section “Administration” → “Rules”.

The rule is set according to the following scheme:

trigger (event type) × region (object, zone, group of places, specific place) × condition (time, status, other signs) → actions

Available actions: notify the operator, create an incident, change the status, send a command to the device.

The rule takes effect without restarting services. The order in which rules are applied is determined by their priority.

Examples: “violation of markings in an area for people with limited mobility → create a critical level incident”; “The parking space at the entrance has been occupied for more than 10 minutes without permission → notify the shift supervisor.”

12. Managing users, roles and rights

Section “Administration” → “Users” and “Roles”.

  • Permissions are set in a single space of the form “resource:action” (for example, displays:manage, users:manage).
  • A role is a named set of permissions. The user is assigned a role; Additionally, individual permits may be issued.
  • Sections of the interface that are not accessible to the user due to rights are not displayed in the navigation.
  • User actions are recorded in the action log.

Password requirements: at least 6 characters. Passwords are stored in the form of hashes (bcrypt algorithm); they are not stored or transmitted in clear text.

Sessions are implemented by signed tokens; the signature secret is specified by the parameter CSHARK_AUTH_SECRET. Changing the secret ends all active sessions.

13. Setting up integration with external systems

Section “Administration” → “Integrations”.

OpportunityDescription
REST APIfacility directories, availability of parking spaces, receiving information about sessions of an external access control system; The OpenAPI specification is available at /openapi.json
Access keysare created with visibility scopes and request rate limits
Outgoing webhookssubscribing an external system to events; requests are signed, delivery is repeated if there is an error

Interaction with a partner automated parking system (entrance group) is performed through these mechanisms.

14. Data retention and retention policies

DataStorage locationShelf life
Directories, topology, usersdatabaseindefinitely
Visits, parking lot events, occupancy snapshotsregular PostgreSQL tables with object and time indexesdetermined by the approved operational policy
Event footageobject storagecustomizable, consistent with event storage period
User activity logdatabasecustomizable

The storage period is set by policies in the system settings section. Footage is only available via limited-time links; direct public access to storage facilities is closed.

15. Backup and restore

15.1. Backup

tools/backup/backup.sh /path/to/backups

A database dump and media manifest are generated. Storage objects are copied separately using synchronization tools - the command is issued by the script. Recommended frequency: database - daily (according to the schedule on the host), media materials - weekly. The storage depth of copies is not less than the period of data storage in the system.

15.2. Checking the copy

Restoring to a temporary database without risk to the working one:

tools/backup/restore.sh backups/cshark-XXXX.dump cshark_restore_check

The script displays control counters (car spaces, visits, incidents, users) for reconciliation.

15.3. Recovery

Stop before recovery core and gateway via Compose file /opt/cshark-stand/compose.yml, execute the standard recovery script from the delivery and then start the same services. The commands and path to the backup copy are recorded in the work log; the restoration is first tested on a separate stand.

Media materials are restored by synchronization into an object container with verification against the manifest.

16. Monitoring and diagnostics

CheckCommand or address
Application healthcurl -fsS http://127.0.0.1:8088/api/health
Service Statussudo docker compose --env-file /opt/cshark-stand/.env -f /opt/cshark-stand/compose.yml --profile obs ps
Magazinessudo docker compose --env-file /opt/cshark-stand/.env -f /opt/cshark-stand/compose.yml logs -f core

The software generates metrics, logs and traces according to the OpenTelemetry standard. When the observability profile is enabled, Grafana panels are available.

Key indicators:

IndicatorWhat does it mean
number of published eventsreceipt of data from equipment
number of events processedoperation of application server consumers
volume of unprocessed messagesgrowth means the server can't keep up or the consumer is stopped
number of connected WebSocket clientsactive operator workplaces

Personal and sensitive data are automatically excluded from the logs.

17. Software update

The update is initiated by the customer administrator. There are no mechanisms for forced updating and remote control from outside the perimeter of the facility.

The current release does not include automatic remote update. Before the implementation of a promising managed mechanism, the update is performed as a separate regulatory delivery: accept the signed offline kit, verify the SHA-256 and foreign key signature, create and verify a backup copy, execute the release-specific instructions and a full smoke-test. The operation is carried out by the administrator during the agreed maintenance window.

Migrations follow the expansion-compression principle: breaking schema changes are released in a release following the release of the code that runs without them. Therefore, reverting to a previous version of the code is safe and does not require a schema rollback.

Returns are only allowed on a previously saved and tested set of the previous version after assessing the compatibility of the data scheme. Arbitrarily changing the container tag in an installed instance is not a standard update.

18. Typical faults and solutions

SignProbable CauseActions
Statuses of parking spaces are not updatedevent delivery is brokencheck camera availability; check device gateway logs; check the rate of unprocessed messages - if it increases, restart the application server
Events arrive without framesobject storage unavailablecheck storage service; events are not lost, frames will be missing only during the period of unavailability
The scoreboard is not updatingdisplay device unavailablecheck the connection in the “Equipment” section; preview the frame - if the frame is formed, the problem is in the communication channel with the device
Web interface is not availableThe service is not running or the port is busycheck the condition of containers; if there is a port conflict, set CSHARK_WEB_PORT and restart
The web interface restarts cyclicallylost container networkrecreate the service with the key --force-recreate
All users are not logged inchanged the token signing secretcheck CSHARK_AUTH_SECRET; after changing the secret, re-login is required
Error loading frames into storage indicating time discrepancyhost and container clock divergencesynchronize host time via NTP
Database volume is growingretention policies are not configuredset the storage period for events and frames in system settings

19. Location of files and components

ComponentLocation
Service Description File/opt/cshark-stand/compose.yml
Environment Settings/opt/cshark-stand/.env
Primary details/opt/cshark-stand/INITIAL-CREDENTIALS.txt
Installation log/opt/cshark-stand/install.log
Database dataDocker volume pg_data
Object storage dataDocker volume seaweed_data
Event Bus DataDocker volume nats_data
Application server source code (inside the image)/app/apps/core/app/
Device gateway source text (inside the image)/app/apps/gateway/gateway/
Database schema migrations/app/apps/core/alembic/versions/
Static web interface files/usr/share/nginx/html/ in the web interface container
Software Interface Specificationhttp://<address>:8088/openapi.json
Interactive API documentationhttp://<address>:8088/docs

Access inside the container:

sudo docker compose --env-file /opt/cshark-stand/.env \
  -f /opt/cshark-stand/compose.yml exec core sh
docker run --rm cshark-core:<version> cat /etc/os-release    # base OS of the image

20. Technical support

ChannelMeaning
OrganizationLLC "KOMPETENTSIA"
Phone+7 495 532-61-18
Operating modeMonday–Friday, 09:00–18:00 Moscow time
Support address115280, Moscow, st. Leninskaya Sloboda, 21, building 1

The procedure for processing requests, priorities and response times are given in the document “Description of processes ensuring maintenance of the software life cycle”.