VideoGrace Server
=================

VideoGrace Server provides the web client, Admin API, WebSocket control,
WebRTC media, diagnostic telemetry and the CAN service bus.

Primary modern path: HTTPS/WSS + WebRTC.
WSM remains a fallback path for compatibility and emergency cases.

Installation
------------

1. Run:

   sudo ./install.sh

2. Open the admin panel:

   https://localhost/
   https://server.example.com/

   On the first local visit the browser will warn about the automatically
   generated certificate. Open Advanced and choose
   "Proceed to localhost (unsafe)". Do not replace HTTPS with HTTP.

3. First login:

   The first registered user becomes the owner.
   After that, the owner manages users and grants from the admin panel.

4. Main Linux paths:

   /opt/VideoGrace/Server                  - installation
   /opt/VideoGrace/Server/vgserver.conf    - config
   /opt/VideoGrace/Server/db               - databases
   /opt/VideoGrace/Server/storage          - object storage
   /var/lib/videograce/recordings          - recorder files pending upload
   /var/log/vgserver/VGServer.log          - log file

Network
-------

Open/forward ports:

   443/tcp          HTTPS, Admin API, web client, WebSocket control, PWA
   5060/udp         legacy RTP/translator compatibility
   43000-43999/udp  WebRTC ICE/DTLS/SRTP unless changed in config

Browsers, PWA and Web Push require a trusted HTTPS certificate for the
server domain. Self-signed/PKI mode is available at https://server/pki/,
but client devices must trust the root certificate.

WebRTC and media
----------------

The browser client connects to an RTC endpoint selected by the server.
WebRTC is the primary audio/video transport. WSM is used only as fallback.

Current diagnostics are available in the admin UI: WebRTC counters,
media health, client probes, remote audio/video state and stalled/ok
indicators.

CAN, services and storage
-------------------------

CAN is the internal service bus for jobs, diagnostic events and
recorder/rtc-edge/AI integrations. Recorder/Consolidator can still run as
legacy processes, while new scenarios are built around CAN services.

The standby recorder is installed as the separate vg-recorder service. It is
started, stopped and restarted together with vgserver. The installer enables
CAN and generates a random ServiceToken when one isn't configured yet.
During installation or update, its isolated Python runtime is created under
/opt/VideoGrace/Server/recorder/.venv and dependencies are downloaded from the
Python package index. Outbound HTTPS access is therefore required at this step.

   systemctl status vg-recorder
   journalctl -u vg-recorder -f

Optional recorder environment overrides belong in
/etc/videograce/recorder.env. A recorder service account must be configured on
the server before it can receive a short-lived conference access token.

The distribution also includes vg-transcriber, a standby CAN transcription
worker. Settings: /etc/videograce/transcriber.env; logs: journalctl -u vg-transcriber.
The server provisions recorder/transcriber service accounts after an owner
exists (on startup or the first job), preserving existing account settings.
Starting the worker does not enable transcription for every conference.

Old system Python installations are not replaced. If Python 3.10-3.13 with
venv is unavailable, a private SHA-256-verified Python 3.12 is downloaded to
/opt/VideoGrace/Server/python. curl/wget and HTTPS to GitHub Releases and PyPI
are required. Offline installations can set VG_PYTHON_ARCHIVE plus
VG_PYTHON_SHA256, or VG_PYTHON_BIN, and PIP_INDEX_URL or PIP_NO_INDEX/PIP_FIND_LINKS.
The default small CPU/int8 model downloads from Hugging Face on the first job.
Set VG_TRANSCRIBER_MODEL to a local model and HF_HUB_OFFLINE=1 for offline use.
Python, dependencies and models are not bundled in the server archive.

Object storage stores attachments and blobs through the filesystem backend
and storage.db. Large objects should be streamed.

The installer generates VAPID keys and enables Web Push when no keys exist.
Updates preserve existing keys and manually disabled Push settings.
Trusted HTTPS, user permission and Internet access to browser push services
(FCM, Apple Web Push and others) are required.

Update
------

1. Run:

   sudo ./update.sh

2. Check the admin dashboard: uptime, WebRTC, CAN, storage and update
   availability.

Uninstall
---------

1. Run:

   sudo ./uninstall.sh

The script stops and removes server binaries. Databases and configuration
are kept separately unless /opt/VideoGrace/Server is removed manually.

Support
-------

Documentation: https://videograce.ru/doc/admin/
Downloads:     https://videograce.ru/download
Website:       https://videograce.ru
E-mail:        contact@videograce.ru
