Running SIHub with MariaDB
The ERP overview (/app/erp), the public page /platform/erp, the
ERP documentation and SIHubHelper's ERP answers are provided via the normal AppHub deploy action or Sync & deploy activated. The upgrade path reloads application code, templates, style sheet, documentation, and verified restarts services; there are no new tables, provider values, or Python dependencies. Accounts, modules, subscriptions and data remain unchanged; repeated deployments do not change anything. TattooHub takes over the pages with the core snapshot of the same deployment. Pure sync and prepare --no-start stage the change for the next deploy.
Business cards and the referral program use the normal AppHub deploy action or Sync & deploy for activation. The upgrade path adds the new tables and, at service start (init-db) the column business_cards.design for the business card designer; existing cards keep their details and receive the brand design. It restarts the services, moves daily billing into the existing maintenance task and keeps card and referral addresses out of the access log. Missing or faulty optional wallet credentials block neither the deploy nor the service start; check-config reports a faulty file as a warning. Accounts, subscriptions and credentials remain unchanged. Pure sync and prepare --no-start stage the change for the next deploy.
The Instagram preparation, with public data deletion instructions at
/legal/data-deletion, an expanded privacy notice and more secure access logging, uses the normal AppHub deploy action or Sync & deploy for activation. The existing full upgrade path handles the schema sync and restarts; credentials, data and subscriptions are kept. check-config also checks the local legal texts when Meta keys are configured and reports any remaining operator details before the Meta submission. Missing optional Meta credentials do not block other operations. Pure sync and prepare --no-start stage the change for the next deploy.
During Apache activation, prepare-access-logging.py updates only VirtualHosts with ServerName sihub.at, including in individually named files. Targets and filters of existing access logs are kept; IP address, time, HTTP method, URL path, protocol, status and response size are stored, but no query parameters or referrers. Private receipt paths and signed
/social-media/-fetch paths are omitted. Where a dedicated access log is missing, one with a data-minimizing format is added so that it does not inherit a global combined log. The changes are backed up, checked for Apache syntax and reloaded; on errors, the old configuration is restored and the deploy fails visibly. Repeated runs do not change the finished state again. Historical logs are not deleted. Custom upstream proxies/CDNs need a log configuration suited to their operation.
The Meta app review guide contains the exact URLs, permission justifications and the test flow. A successful deploy replaces neither Meta's business/provider verification nor App Review and publication.
The same normal deploy installs and enables sihub-backup.timer for managed database backups. Retention under
/var/lib/sihub/backups/managed/{daily,quarterly} is two calendar months for daily backups and seven years for one backup per quarter. The backup run and the deployment share the same setup lock; the timer and any running job are stopped before schema changes, and the timer is enabled after the local health check. If the first upgrade fails, a newly installed timer stays stopped. prepare --no-start installs the units but only enables them on the next normal deploy. Repeated deploys keep existing credentials, backups and subscriptions. Older rollback backups directly under
/var/lib/sihub/backups are not part of this deletion run and are kept. Details on scope, restore and limits are described in
Managed database backups.
The normal AppHub deploy and sync with deploy compare changes with the last successfully activated commit. Static files need no restart, web templates a verified Gunicorn reload. Changes to the schema, Python dependencies, shared application code and workers keep the full upgrade path with backup and migrations. AppHub installs the shared helper during its own normal update; older installations first go through a full upgrade. prepare --no-start remains a preparation and does not move the last successful activation state. Even without a new Git commit, sync with deploy sends SIHub through the normal activation check: changed values in /etc/sihub/sihub.env trigger the full upgrade path with a restart; unchanged values only trigger the health check.
The Inbox agent replaces the separate inbox helper section, directly in the inbox. The normal deploy action or Sync & deploy activates the Python modules and the changed inbox worker through the full upgrade path, including backup, schema sync and verified restarts. Ratings and personal corrections are stored encrypted in the existing entities table; additional tables, provider values or Stripe prices are not required. The product identifier postfach, existing licenses and subscriptions, agent instructions, messages and inbox credentials are kept even with repeated upgrades. The old daily helper run does not start any new sorting; queued work orders that were already approved continue to be processed. Pure sync without deployment and prepare --no-start
stage this change for the next regular deploy.
git-sync-all.py --deploy --build-only also uses the regular deploy path for the already published version, without a preceding Git sync. Usage details are described in Inbox agent.
The tab Inbox → Agent with rules, priority list, handoffs and the linking of emails and orders uses the same normal deploy action or Sync & deploy for activation. The full upgrade path restarts the web service and workers; rules and assignments are stored encrypted in the existing table entities, additional migrations or provider values are not needed. Ratings, corrections, orders and subscriptions are kept across repeated deploys. Pure sync, build-only and prepare --no-start stage the change for the next regular deploy.
The fixes to the Automaton template mapping for the agent catalog and setup, and to the database lock before AI calls, use the normal deploy action or Sync & deploy for activation. The changed Python modules go through the existing full upgrade path with a restart of the web service and agent workers. No additional migrations or provider values are required; existing agent instructions, prices, credentials and subscriptions are kept. Pure sync and build-only stage the fix for the next deploy.
The provider and model selection under SIHub Admin → AI operations uses the same normal deploy action or Sync & deploy for activation. The full upgrade path adds the table platform_ai_settings and restarts the web service and workers after the configuration check, schema sync and model check. As long as no selection has been saved in the admin area, the existing operator configuration still applies. The admin selection stores OpenAI or Anthropic plus the models for standard, fast and complex tasks in the database; API keys stay in the protected operator environment. Changes apply to new model requests without another deploy. The configuration check and the real model check use the same stored selection as the web service and workers. Already selected providers and models, keys, stored activities and subscriptions are kept even with repeated deploys. A table missing on the first upgrade is added by the regular schema sync; any other error reading the stored selection stops the activation with an error message that contains no credentials. Pure sync, build-only and prepare --no-start prepare the change for the next regular deployment.
The login option Keep me signed in uses the same normal deploy action or Sync & deploy for activation. The existing upgrade path applies the Python change including restart, form and translations; additional migrations or operator values are not required. AIHUB_SECRET_KEY is kept even with repeated deploys so that valid sign-ins survive restarts. Existing sessions keep their previous lifetime; only a new sign-in with the option enabled uses the extended lifetime of 30 days of inactivity. Pure sync, build-only and prepare --no-start prepare the change for the next regular deployment.
Forgot password also uses the normal deploy action or
Sync & deploy for activation. The schema sync adds the reset tokens; existing accounts, password hashes, SMTP credentials and subscriptions are kept, even with repeated deploys. Sending directly uses the existing
AIHUB_SMTP_HOST, AIHUB_SMTP_FROM, AIHUB_SMTP_PORT and TLS settings (AIHUB_SMTP_STARTTLS=1 or AIHUB_SMTP_SSL=1). With SMTP authentication,
AIHUB_SMTP_USER and AIHUB_SMTP_PASSWORD are reused. The links use
AIHUB_PUBLIC_URL as an HTTPS address without credentials, additional path, query or fragment. There is no additional worker or activation switch; the contact form's AppHub connection does not replace this direct mail access.
The normal deploy checks the configuration without sending email. Missing mail access is explicitly reported as unavailable email password reset; initial setup remains possible, and until then the public form shows the same unavailability for all accounts. Invalid complete SMTP settings stop the configuration check. The diagnostic command check-config --mail also requires the direct reset mail access. Missing operator credentials are added to the existing private operator file and applied via the usual deploy. The configuration check does not confirm actual delivery. Pure sync, build-only and --no-start do not activate a new runtime; the next full deployment applies the prepared changes.
The Sales workspace is also activated via the normal deploy action. The schema sync adds sales_channels and
sales_records for connections and encrypted sales data, as well as
bot_routines.run_at for one-time scheduled agent runs. Repeated upgrades keep existing credentials, records, schedules and subscriptions. The existing worker restarts activate the new scheduling; sync with deploy follows the same flow. Staging only and build-only do not fetch any data.
The direct helloCash connection under Channels uses the same normal deploy action or Sync & deploy for activation. The changed Python modules, help texts, translation catalogs and static files go through the existing upgrade path; there is no new table, no new encryption purpose and no new operator values. Already verified helloCash credentials, imported receipts, agent templates and subscriptions are kept even with repeated deploys. Pure sync, build-only and prepare --no-start prepare the change for the next regular deployment.
The shared table Invoices → All invoices is activated with the same normal deploy action or sync with deploy. It merges your own and imported invoices when reading; neither a data copy nor an additional migration is needed. The changed Python module runs through the existing full upgrade path with restart and health checks. Existing invoices, number ranges, channel credentials, keys and subscriptions are kept even with repeated deploys. An explicitly selected mode without deployment or prepare --no-start stages the change for the next deploy.
The Automaton uses the same normal deploy action or
Sync & deploy for activation. The schema sync adds automaton_agents,
automaton_ledger and automaton_proposals; price management creates the offer
automaton once with a starting price and monthly allowance; existing prices remain unchanged. The regular agent workers run the heartbeats and book the model costs exactly once after each work order; there is no additional service or timer. The optional operator values SIHUB_AUTOMATON_MONTHLY_CREDIT_EUR,
SIHUB_AUTOMATON_USD_EUR and SIHUB_AUTOMATON_MODEL_RATES are checked by check-config for their format; without entries, the default values apply. Repeated deploys do not create a second monthly credit and keep balances, proposals, strategy and subscriptions. Pure sync, build-only and prepare --no-start prepare the change for the next regular deployment.
The automatic SendDrop handoff also uses this upgrade path. The schema sync adds shipping rules and persistent shipping jobs; existing connections, encrypted credentials, orders and subscriptions are kept. Repeated deploys do not reset stored shipping jobs. The regular agent workers fetch the sales channels selected for automatic shipping and process the shipping jobs even without an open browser. The normal deploy enables both standard workers; in Compose mode, this task is handled by the existing bot-worker service. No additional maintenance commands or timers are needed. Setup then takes place in the sales workspace; the schema upgrade alone does not hand any orders over to SendDrop. The automation is off by default; neither a deploy nor connecting an account turns it on. Only explicit activation and saving by an owner or administrator allows the automatic handoff. An automation that was already deliberately enabled keeps its setting across further deploys. Pure sync, build-only and prepare --no-start prepare the change for the next deploy without starting a shipping worker.
The extension to Channels with sales channels, shipping channels and social media keeps using the same tables and encrypted credentials. The category is derived from the provider; no additional data conversion is required. Existing connections, started fetches, orders and subscriptions are kept across repeated deploys. The normal deploy actions also deliver the SendDrop connection, profile links and /app/channels as well; previous links and
/api/sales-channels remain compatible. Failed provider calls of the channel and connection APIs respond with HTTP 424 instead of 502 so that Cloudflare in front of
sihub.at and tattoohub.at does not replace the JSON error message with its own 502 page; TattooHub receives this with the next normal deploy via the core snapshot. The changed Python modules go through the full upgrade path including runtime check and restart, even if a sync without deploy was run before. For profile-only links, the upgrade needs no additional social OAuth operator values and does not connect to SendDrop or the social platforms. For API publishing, the same deploy adds the tables social_media_assets
and social_publications as well as empty operator fields for the provider apps; existing values are kept. The required OAuth identifiers, redirect URIs and provider approvals are listed in Social media marketing. Accounts are then connected under Channels in the workspace. The separate Compose setup uses its usual docker compose ... up -d --build-deploy with deploy/.env.production; AppHub does not update its containers.
The normal configuration check reports for Facebook/Instagram, YouTube and LinkedIn whether the operator app is missing or configured for account authorization. Missing optional apps do not prevent the deploy; Channels → Connect account then shows the required setup steps. A partially entered or invalid key pair and an unsuitable HTTPS redirect address stop the activation with field names, without outputting credentials. The check does not contact any provider and does not yet confirm any permissions. The app ID and app secret are created at the respective provider and cannot be generated by the deploy. Values already entered remain unchanged across repeated deploys.
During the regular schema/data upgrade, existing social media marketing agents receive the tools for listing approved accounts and for commissioning posts and stories. The mapping bot_social_publications prevents duplicate jobs on repeated tool calls. The upgrade keeps individual instructions, existing tools, account connections and subscriptions and does not publish any post itself. The normal app and worker restart activates the changes; sync with deploy uses the same path. Pure sync and build-only stage them for the next full deploy.
SIHub uses MariaDB for all persistently stored platform data: users, workspaces, agents, settings, knowledge, conversation histories, voice and usage data, and the notification outbox. The default database is named SIHub. DATABASE_URL is mandatory; a missing or invalid value does not fall back to SQLite. Apache serves the app at https://sihub.at and passes requests to /run/sihub-live/gunicorn.sock for processing.
Data storage and automatic schema updates
All portal and API write paths use the same configured MariaDB. User registration, team management, agent creation, publishing and settings changes therefore persist after a restart. The data is mapped as follows:
| MariaDB table | Content |
|---|---|
workspaces |
Workspaces and workspace settings as JSON in settings |
users |
Users, workspace assignment, email, password hash, role and active status |
password_reset_tokens |
Hashed one-time reset tokens, expiration time and binding to the current password |
workspace_invitations |
Open invitations with email, role, hashed link and expiration time; accepted invitations are deleted, unused ones 30 days after expiration |
workspace_members, workspace_area_roles |
Additional memberships of existing accounts in other workspaces, and roles limited to individual areas |
entities |
Agents, knowledge, tools, channels, contacts, campaigns, tasks and reviews; type-specific configuration as JSON in data |
versions |
Published agent versions with full configuration snapshot |
conversations, messages |
Conversations, statuses, summaries, goals and messages/transcripts |
api_keys, audit, limits |
Hashed platform API keys, permission scopes, change log and request counters |
outbox |
Notification jobs and their delivery status |
voice_pending, voice_sessions, voice_events, voice_tool_calls |
Voice lifecycle, snapshots, heartbeats and retry-safe events/tool calls |
usage_ledger, voice_metrics |
Usage counters, fixed price versions, EUR estimates and metrics |
bot_jobs, bot_routines, bot_job_usage |
Customer association of work orders and routines, as well as token usage and allowance deductions per model call |
social_media_assets, social_publications |
Media and retry-safe publishing jobs of the social media marketing agent |
sales_shipping_settings, sales_shipments |
Encrypted shipping rules and retry-safe SendDrop jobs with label and shipment references |
sales_sync_settings |
Polling schedules, next run, errors and resume state for automatic channel imports |
_sihub_schema_migrations |
Versioned schema and check state of the automatic sync |
JSON fields are also stored in MariaDB; they are not files or browser storage. Operator credentials for AI, telephony and SMTP providers as well as session keys remain in the private operator file. Redis coordinates short-lived call capacity; persistent conversations and usage data are stored in MariaDB.
SIHub checks the entire bundled schema at every application start. Before starting Gunicorn, the systemd service runs manage.py init-db as well. The sync uses a database-specific MariaDB lock so that several starting processes do not run the same migration at the same time. It adds missing tables, columns and indexes and performs supported, data-preserving type enlargements. The schema and check state is logged in MariaDB; existing users and agents are kept; versioned data migrations apply required configuration changes.
In AppHub, the normal deploy action runs prepare as part of the complete update flow. In Docker mode, the new app version is built and started; its startup runs the same schema sync. There are no manual CREATE TABLE-commands for new features needed. The installer creates the MariaDB database and the DB account once; at startup, the existing connection is used. For a self-managed DB, the SIHub user needs schema change privileges on its own database in addition to the data privileges, in particular CREATE, ALTER and INDEX; the transition of old contact columns described below additionally requires LOCK TABLES.
The usual deploy flow also handles the switch to central operator AI and live mode. Existing credentials, subscriptions and conversation histories are kept. The operator file receives the mandatory live settings with a private backup; the data migration is transactional and repeatable. Previously simulated open work orders are ended, and corresponding routines and campaigns are paused so that old trial actions do not trigger real external effects after the fact. Before activation, the deployment checks a real short model response without customer data; missing or unreachable operator access stops the activation with an error. Sync with deployment uses the same flow. --no-start, build-only runs and sync without deployment do not activate any services or send model requests.
The open inbox fetches new emails when opened and then every 20 seconds. “Refresh” also starts the IMAP fetch for members with editing rights. During automatic refresh, new entries are added while keeping filters, selection, loaded pages and the visible list position. The regular inbox timer remains responsible for fetching when no browser window is open. The normal deploy updates the application and timer and adds the table
inbox_self_receipt_checks. The next regular fetch then catches up, in limited batches, on previously skipped received copies of messages sent to your own address. Sent messages, credentials and existing emails are kept; repeated deploys and fetches do not create duplicates.
Duplicate entries for AIHUB_LIVE_ENABLED and AIHUB_DEMO_ENABLED
in /etc/sihub/sihub.env are automatically merged by the normal deploy into a single entry each, with 1 or 0 respectively, even with contradictory old values. This fixes the earlier abort “Duplicate operating mode in the operator file”. Before the change, the original is kept with mode 0600 as a
sihub.env.before-operator-live-* backup. Other entries and existing credentials are kept; a repeated run does not change the already cleaned file again. Wavelink access keys entered multiple times remain an error so that no existing key is replaced arbitrarily.
Social OAuth credentials (SIHUB_META_*, SIHUB_TIKTOK_*, SIHUB_YOUTUBE_*,
SIHUB_LINKEDIN_*) that were entered in addition to the empty placeholder, for example appended at the end of the file, are merged by the normal deploy into one entry with the entered value. Empty placeholders and identical repetitions are dropped; the original is also kept as a
sihub.env.before-operator-live-* backup. If the file contains two different values for the same key, the deploy still aborts with “Duplicate social OAuth operator value” without changing the file. In that case, remove the wrong entry with sudoedit /etc/sihub/sihub.env and deploy again.
For an existing Compose telephony stack, the normal full deploy updates the app and voice worker together: sudo docker compose --env-file deploy/.env.production -f deploy/compose.yml --profile voice up -d --build. The existing private operator file and data volumes are kept. The direct Apache installation does not manage this separate stack or external workers. Outdated worker protocols get no access to the centrally billed AI; separately operated workers must receive the same approved version through their own deploy process.
The reconciliation does not delete tables or columns and keeps larger existing VARCHAR-lengths. A targeted exception applies to the four fields originally created as LONGTEXT in contact_delivery: route, apphub_status, apphub_thread_id and confirmation_status are switched to VARCHAR(32/40/128/40) types. Before that, it checks all values, including trailing spaces, under a write lock. Values that are too long or a different collation stop the transition without converting these columns. If needed, the matching non-unique confirmation index is switched from a prefix index to full columns; other index definitions are not replaced.
An older LONGTEXT-column platform_gift_mails.recipient_id is converted in the same protected way into a VARCHAR(128) column. As a result, this older queue no longer blocks the application start and the inbox worker. Existing recipients and delivery states are kept; invalid values stop the conversion with a diagnosis. This adjustment is part of the normal deploy and does not require an additional maintenance command.
An incompatible change, a required field that cannot be added safely or an index collision stops the start with a diagnosis. In that case, fix the described schema/data conflict after a backup; the service does not continue with an unverified schema. MariaDB may already have committed DDL permanently before an error. After the fix, the next sync runs the remaining steps idempotently.
You can check or update the state directly:
# Letzten Prüfbericht lesen, ohne Migration:
sudo bash apache2/install.sh manage schema-status
# Den vollständigen Schemaabgleich gezielt ausführen:
sudo bash apache2/install.sh manage init-db
schema-status changes neither the schema nor user data and outputs the last completed check report and the expected code version as JSON. A new full structure check is run by init-db or the application start. init-db reports the schema sync and the changes made. Both commands use the same DB credentials as the service.
Apache quick start as with TattooHub
The complete procedure is described in the repository at apache2/README.md. Put the checkout in /var/www/SIHub; point the DNS A record to your server and make sure that ports 80/443 are reachable.
cd /var/www/SIHub
sudo apt update
sudo apt install -y apache2 certbot python3 python3-venv curl dnsutils mariadb-server mariadb-client
sudo systemctl enable --now mariadb
sudo mariadb -N -e 'SELECT VERSION();'
sudo bash apache2/install.sh prepare
sudo bash apache2/install.sh manage create-admin --email DEINE_ADMIN_EMAIL --workspace-name SIHub
sudo /opt/sihub-venv/bin/python apache2/health.py
Python 3.10+ and MariaDB 10.6+ are required; the template for new database servers selects MariaDB 10.11. The setup installs the Python dependencies under /opt/sihub-venv, creates the service user sihub and the private operator file /etc/sihub/sihub.env. It generates secure session/DB passwords directly in this file (mode 0600). Via the local MariaDB admin socket, it creates the database SIHub and a dedicated sihub-DB account if neither exists yet. A working existing MariaDB connection is reused; an existing account or database with incorrect credentials is not overwritten.
The application uses InnoDB with UTF-8. /var/lib/sihub contains private working files and backups; no SQLite database is created there. The setup installs and starts sihub.service, the trading worker and a daily timer that only deletes expired rate limit counters. The separate command manage.py purge for conversations and demo workspaces remains a deliberate operator action. You set up Apache and certificates according to Server guide, section 5 .
An old .env, a source database in the checkout or a Docker/legacy process still running on port 5090 aborts the initial installation. For existing accounts, follow the MariaDB migration. prepare --no-start prepares the service for a data import without starting it.
Configuration and management commands
The direct service and apache2/install.sh manage read the same file /etc/sihub/sihub.env. Docker, in contrast, uses deploy/.env.production; local development uses .env. The technical AIHUB_*-variable names remain unchanged.
DATABASE_URL=mariadb+pymysql://sihub:[email protected]:3306/SIHub
AIHUB_ENV=production
AIHUB_LOAD_DOTENV=0
AIHUB_PUBLIC_URL=https://sihub.at
AIHUB_SECURE_COOKIES=1
AIHUB_TRUST_PROXY=1
Enter credentials in the private editor; passwords and DSNs do not belong in the shell history as arguments. Special characters in the DSN password must be URL-encoded. The generator uses safe hex values. Add API/SMTP/telephony keys to the operator file as well.
sudoedit /etc/sihub/sihub.env
sudo bash apache2/install.sh manage check-config
sudo systemctl restart sihub
sudo bash apache2/install.sh manage schema-status
sudo bash apache2/install.sh manage list-workspaces
sudo bash apache2/install.sh manage purge --dry-run
The direct website setup does not start any real-time voice workers yet. For the complete telephony stack, Server setup describes the Docker path with MariaDB 10.11, Redis and separate LiveKit workers. The DB and Redis get no public ports. Old PostgreSQL/SQLite operation is not part of the new production configuration.
Backup and updates
The backup uses mariadb-dump with a private temporary client file. The password and DSN do not appear as process arguments. The output is a consistent SQL dump with schema and data; existing backup files are not overwritten. By default, the direct helper writes to /var/lib/sihub/backups, the Docker helper to /var/backups/sihub.
The normal backup also copies the active web push identity into the associated file DEIN_BACKUP.sql.web-push-keys.json with mode 0600. This also applies to a key pair configured in the operator environment. Store the SQL dump and key file together in a protected location. If a dump fails, both newly created files are removed; existing backups remain untouched. After a data restore, restore the associated key file as
AIHUB_INSTANCE_PATH/web-push-keys.json with the service user as owner and mode 0600, unless the same pair is already present in the operator environment. A foreign or newly generated pair does not replace a key backup.
# Direkter Apachebetrieb:
sudo bash apache2/backup-mariadb.sh
# Dockerbetrieb:
sudo bash deploy/backup-mariadb.sh
Also back up the operator file and the approved software/image version separately and encrypted. The dump contains personal data and authentication hashes, but no operator file or session keys. Redis AOF does not replace a MariaDB dump. MariaDB dump documentation
The encrypted inbox data and credentials require the same persistent master key when restored. Back up the private credentials.key in the instance directory, or the configured data/provider key, separately from the dump. Protected data
For normal updates, use the Deploy action for SIHub in AppHub or sync with deployment enabled. The shared flow stops the web service, workers and timers, backs up MariaDB and applies the new version. Immediately before the runtime and schema update, it stops and checks the affected units again so that services restarted in the meantime do not block the sync. If a unit remains active, the deployment ends in the phase Dienststopp-vor-Schema with the unit's name before the runtime or schema is changed. After a successful stop check, the flow updates the operator environment and data, checks the real AI connection and starts the services with local and public health checks. The corresponding installed entry point is:
sudo /usr/local/bin/deploy-var-www-repository.sh /var/www/SIHub
With every deployment, the preparation also restores the read permissions of the public files under static/ and checks them as the service user sihub, before the runtime, schema or services are updated. This also corrects existing CSS and JavaScript files with overly restrictive permissions. Private operator files and working data remain unchanged by this permission fix. prepare --no-start
runs the same check without starting the service.
The normal AppHub deploy installs changes to this helper automatically. After a successful local check, all standard workers and timers are re-enabled and checked individually, even if they were inactive after an earlier error. A failed worker start does not block the other starts. The invoice timer sihub-invoices.timer checks daily for due monthly invoices. It is set up together with the schema during the normal deploy, stopped before the backup and schema sync, and re-enabled after a check. The invoice run may be repeated; monthly invoices already generated are kept and do not receive a second invoice number. A running invoice run that cannot be stopped aborts the deployment before the backup. In Compose mode, the same full up -d --build-call starts the
invoice-scheduler together with the app. It checks after startup and then hourly. A failed run ends the process with an error status; Compose logs the error and restarts the scheduler.
The email appointment assistant uses the existing inbox worker; device notifications are additionally processed by the normal
aihub-notifications.timer every minute. In Compose mode, the normal deployment call also starts inbox-worker and notifications, after the app is healthy; the services check every 60 and ten seconds respectively. No additional maintenance command is needed for activation. The new Python dependency
pywebpush, tables for settings, appointment requests, notifications and device subscriptions are set up in the shared upgrade path. Pure sync, a build without activation and --no-start start no additional services.
During the regular schema sync, a persistent web push identity in
AIHUB_INSTANCE_PATH/web-push-keys.json is created once: directly under /var/lib/sihub, in the container in the existing private volume /app/instance. Die Datei gehört
dem Dienstbenutzer und benötigt Modus 0600. Der normale Datenbanksicherungspfad
sichert dieses Paar automatisch mit; bei einer Wiederherstellung zusammen mit
der Datenbank übernehmen.
Vorhandene Schlüssel und Geräteabonnements werden bei wiederholten Deploys
beibehalten. Fehlt der Schlüssel trotz vorhandener Geräteabonnements, stoppt das
Upgrade mit einer Wiederherstellungsdiagnose, statt einen neuen Schlüssel zu
erzeugen. Optional konfigurierte SIHUB_WEB_PUSH_PRIVATE_KEY and
SIHUB_WEB_PUSH_PUBLIC_KEY are checked and reused as a matching Base64url P-256 pair. SIHUB_WEB_PUSH_SUBJECT is optional; by default, the public HTTPS address is used. Mailbox/calendar credentials and subscriptions are not changed. Each person approves device notifications themselves, per device, after signing in; the deployment does not replace any browser or operating system permission.
Deleting and restoring in the inbox use the existing persistent inbox action queue. The normal schema sync adds
postfach_actions.origin with the default value helper; existing approvals thus keep their previous requirements. New actions explicitly clicked in the inbox carry inbox and are processed by the existing inbox worker even when pre-sorting is turned off. The normal deploy action or Sync & deploy applies this worker together with the new interface. Credentials, subscriptions, messages and pending actions are kept. Messages already deleted locally are not automatically interpreted as new server deletion jobs. Repeated upgrades do not create additional jobs. Pure sync, build-only and --no-start keep their previous meaning; activation follows with the next full deploy.
The automatic channel fetches for orders, customers and channel receipts run via the existing sihub-bot-worker@…-services or the Compose service
bot-worker. These check due schedules in their normal run (every five seconds by default). The central schema sync adds the fetch settings and persistent run states; the normal deploy action and
Sync & deploy then restart the same workers. As before, they are stopped before the backup and schema change. Existing channel credentials, subscriptions, schedules and started fetches are kept. Parallel workers claim a run with a database lock and resume limited fetch steps after a restart. Without a saved schedule, no automatic fetch takes place. The setting offers minute/hour intervals, daily times and a one-time point in time with time zone. Pure sync, build-only and explicitly selected --no-start start no services for this; activation happens with the next full deploy. The normal Python dependencies also include
tzdata, so that IANA time zones are available in the service and in slim container images. A public HTTPS error does not shut down the locally healthy application; the deploy still counts as failed. Before changes to Git and the runtime, the error path restores previously active persistent services and timers. After a preparation error, the current runtime is only started after another configuration, schema and live AI check plus a local health check; the existing backup and the deploy lock protect this flow. Error messages name the phase reached; the database and Git are not reset automatically.
To retry a failed deploy, use the same AppHub tile or project action Sync & deploy. The global Git sync skips repositories without new pushes. A Wavelink update that was deferred because of SIHub is then run through Wavelink's normal deploy action.
The following manage-commands are for diagnosis and recovery. For a first-time direct setup, apache2/install.sh prepare remains the entry point. Existing operator keys and database credentials are kept. In Docker mode, after a backup, build new images and start them with up -d; the container start runs the required checks and migrations. docker compose down --volumes is not an update command, because it deletes data volumes.
Test the restore in a separate database first
A restore test does not overwrite a running database. Replace DEIN_BACKUP.sql with the actual backup. The redirection takes place in a root shell because dumps have mode 0600. An existing test DB makes CREATE DATABASE fail; do not delete it automatically.
For a local MariaDB with admin access via the Unix socket:
sudo -i
mariadb -e 'CREATE DATABASE `SIHub_restore_check` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;'
mariadb SIHub_restore_check < /var/lib/sihub/backups/DEIN_BACKUP.sql
mariadb SIHub_restore_check -e 'SELECT COUNT(*) FROM workspaces; SELECT COUNT(*) FROM users; SELECT COUNT(*) FROM conversations;'
exit
For the Compose container, the root password is only used in the child process's environment:
sudo -i
cd /var/www/SIHub
docker compose --env-file deploy/.env.production -f deploy/compose.yml exec -T mariadb sh -c 'MYSQL_PWD="$MARIADB_ROOT_PASSWORD" exec mariadb --user=root -e "CREATE DATABASE SIHub_restore_check CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"'
docker compose --env-file deploy/.env.production -f deploy/compose.yml exec -T mariadb sh -c 'MYSQL_PWD="$MARIADB_ROOT_PASSWORD" exec mariadb --user=root SIHub_restore_check' < /var/backups/sihub/DEIN_BACKUP.sql
docker compose --env-file deploy/.env.production -f deploy/compose.yml exec -T mariadb sh -c 'MYSQL_PWD="$MARIADB_ROOT_PASSWORD" exec mariadb --user=root SIHub_restore_check -e "SELECT COUNT(*) FROM workspaces; SELECT COUNT(*) FROM users; SELECT COUNT(*) FROM conversations;"'
exit
Compare row counts with those at the time of the backup. Then check sign-in, knowledge, versions, conversation histories and exports in an isolated SIHub instance without production provider credentials and without an outbound network connection. Its DB user needs appropriate privileges on the test DB. A row comparison alone does not prove a successful sign-in.
In a real restore, first stop SIHub, your own voice workers and maintenance timers, back up the current state and import into a new DB. Grant the existing SIHub DB user privileges on this DB and change only the database name in DATABASE_URL. Check the configuration, schema and the central operator AI before restarting workers and public routing. The old database and the backup are kept; running phone rooms are not restored by a restore.
Maintenance and diagnostics
Retention deletes data only when running manage.py purge; check beforehand with purge --dry-run. The Compose maintenance services and timers in deploy/systemd/ use the same operator environment as the app. Notifications run via the regularly started service and check the respective delivery approval; the voice reaper is set up when telephony is enabled. Details are in Server setup. The direct installation sets up its matching workers and timers itself.
sudo journalctl -u sihub -n 100 --no-pager
sudo apache2ctl -S
sudo tail -n 50 /var/log/apache2/sihub-error.log
curl --fail https://sihub.at/health
/health confirms application/database liveness. The live test of telephony, providers and 20 parallel calls is performed separately according to Capacity acceptance.
Maintenance page during updates
For updates, the normal deployment automatically switches on a maintenance page delivered by Apache before the service stop: "SIHub is currently being updated." or “Wavelink is currently being updated.” It does not require a running web service, returns HTTP 503 with retry-after and is not cached. Health checks and ACME certificate exams remain accessible. After successful deployment checks, the website will be released again. In the event of an error, the maintenance page remains active; the next successful normal deploy removes them. The switch is repeatable and does not change any data, access data or subscriptions. AppHub activates the maintenance page before backup and service stop, even when first upgrading to this function. prepare --no-start does not switch any maintenance page itself; with the AppHub deploy, the page stays active until its final checks. Pure sync/build modes remain unchanged.