Skip to content

stat.flexfs

stat.flexfs collects usage statistics from admin servers, stores them in its database, and sends periodic usage reports via SMTP. It also manages license grants that are returned to admin servers as part of the stats relay flow.

| Subcommand | Description | |---|---| | deinit creds | Remove the credentials file | | deinit systemd | Remove the systemd service unit | | init creds | Initialize the credentials file | | init systemd | Create and enable a systemd service unit | | license | Print license information | | start | Start the statistics server | | version | Print the build version |

Terminal window
stat.flexfs start [flags]

| Flag | Type | Default | Description | |---|---|---|---| | --credsFile | string | ~/.flexfs/stat/creds | Credentials file path |

All flags on this page are internal.

| Flag | Type | Default | Description | |---|---|---|---| | --bindAddr | string | 0.0.0.0:443 | Address and port to bind | | --dbFolder | string | ~/.flexfs/stat | Database folder path | | --keyFolder | string | ~/.flexfs/license | Signing key folder path | | --mockTime | bool | false | Simulate time as 5 minutes after last reported_at | | --noSSL | bool | false | Disable SSL for the REST API | | --pprof | bool | false | Enable pprof profiler | | --pprofPort | int | 6065 | Pprof server port | | --smtpAddr | string | | SMTP server address (overrides creds file) | | --smtpFrom | string | | SMTP from email address (overrides creds file) | | --smtpPass | string | | SMTP server password (overrides creds file) | | --smtpTo | string | | SMTP to email addresses (overrides creds file) | | --smtpUser | string | | SMTP server username (overrides creds file) | | --sqliteOpts | string | _journal=WAL&_cache_size=10240&_fk=true&_timeout=5000 | SQLite database connection options | | --sslCert | string | ~/.flexfs/ssl/cert | SSL certificate file path | | --sslKey | string | ~/.flexfs/ssl/key | SSL private key file path | | --verbose, -v | bool | false | Enable verbose logging |

Terminal window
stat.flexfs init creds [flags]

Initializes a credentials file for the stat server with SMTP settings for usage reports.

| Flag | Type | Default | Description | |---|---|---|---| | --force | bool | false | Overwrite existing creds file | | --smtpAddr | string | email-smtp.us-east-1.amazonaws.com:587 | SMTP server address | | --smtpFrom | string | flexFS Service <no-reply@ses.flexfs.io> | SMTP from email address | | --smtpPass | string | "" | SMTP server password (will prompt if omitted) | | --smtpTo | string | (internal default) | SMTP to email addresses (comma-separated) | | --smtpUser | string | (internal default) | SMTP server username |

Terminal window
sudo stat.flexfs init systemd [flags]

Creates and enables a systemd service unit (flexfs-stat.service) for the stat server. Requires root.

| Flag | Type | Default | Description | |---|---|---|---| | --force | bool | false | Overwrite existing systemd unit file | | --now | bool | false | Start the service immediately after enabling | | --startFlags | string | "" | Additional flags to pass to the start command |

Terminal window
stat.flexfs deinit creds [flags]

Removes the credentials file for the stat server. If the credentials file is referenced by a systemd unit, the command refuses unless --force is passed, in which case it removes the references too.

| Flag | Type | Default | Description | |---|---|---|---| | --force | bool | false | Remove creds even if referenced by systemd (removes references too) |

Terminal window
sudo stat.flexfs deinit systemd

Removes the systemd service unit (flexfs-stat.service) for the stat server. Requires root.