Project

General

Profile

Actions

Feature #55

open
AS

Feature #33: Canofy Control Centre Backend Development

Feature #46: Canofy Control Centre Onboarding Process

# [CANOFY-109] Bootstrap Server (apt, MariaDB, Node, Redis)

Feature #55: # [CANOFY-109] Bootstrap Server (apt, MariaDB, Node, Redis)

Added by Akshath Shettigara about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/23/2026
Due date:
% Done:

0%

Estimated time:

Description

[CANOFY-109] Bootstrap Server (apt, MariaDB, Node, Redis)

Type: Story
Epic: New Client Onboarding — Automated AWS + Frappe Provisioning
Stage key: server_bootstrap (pipeline stage 9 of 15)
Component: utils/onboarding_executor.py, utils/ssm_client.py

User Story

As an operations engineer,
I want the base OS packages and system services a Frappe bench needs
installed and configured automatically over SSM,
so that every client server has an identical, correctly-configured
foundation (MariaDB charset/collation, Node version, Redis) without manual
per-server setup.

Description

Execute, via SSM (no SSH, ever), in sequence:

  1. apt update && apt upgrade -y (non-interactive).
  2. Install: git, curl, build tools, wkhtmltopdf, nginx, supervisor,
    mariadb-server/client, and other bench prerequisites.
  3. Install Node 18 + yarn.
  4. Install Redis.
  5. Write MariaDB's utf8mb4/innodb config via tee (not an interactive
    editor).
  6. Restart MariaDB, then secure it non-interactively: set root password,
    remove anonymous users, remove the test database, flush privileges —
    equivalent to mysql_secure_installation but scriptable.

The generated MariaDB root password must be produced fresh per server
(never reused, never hardcoded) and handed to stage 10 for site creation,
then stored in the Credential vault.

Configuration / Prerequisites

  • Depends on stage 8 (SSM online).
  • Base AMI must be Ubuntu 22.04 (or whatever OS version the bootstrap
    commands target) — a mismatched OS breaks every command in this stage.

Acceptance Criteria

  • All commands run non-interactively (no step can block waiting for a
    TTY prompt — this is a hard requirement since SSM has no interactive
    terminal).
  • MariaDB's collation/charset config matches what Frappe requires
    (utf8mb4, utf8mb4_unicode_ci).
  • MariaDB root password is randomly generated, never logged in plaintext
    anywhere (SSM command output, Frappe logs, Onboarding Request.error_log).
  • test database and anonymous MySQL users are removed.
  • Node/Redis versions match what the target Frappe version requires.

Test Cases

ID Scenario Steps Expected Result
TC-1 Happy path Run stage on a fresh Ubuntu 22.04 instance All packages install; MariaDB, Redis, nginx, supervisor all running afterward
TC-2 No plaintext password leak Search stage output/logs/error_log for the generated MariaDB password after the run Not found anywhere in plaintext
TC-3 MariaDB security Attempt to connect to MariaDB as an anonymous user, or query the test database Both fail — anonymous users and test db removed
TC-4 Charset correctness Query MariaDB's default charset/collation after config Matches utf8mb4/utf8mb4_unicode_ci
TC-5 Idempotent re-run Retry this stage after a downstream failure apt commands don't fail on "already installed"; MariaDB re-securing doesn't fail on "password already changed"
TC-6 Command failure surfaces clearly Simulate an apt package install failure (e.g. mirror unreachable) Stage fails with the actual apt error text surfaced, not a generic "exit status 1"

No data to display

Actions

Also available in: PDF Atom