Actions
Feature #58
open
AS
Feature #33: Canofy Control Centre Backend Development
Feature #46: Canofy Control Centre Onboarding Process
# [CANOFY-112] Production Config (nginx, supervisor, SSL)
Feature #58:
# [CANOFY-112] Production Config (nginx, supervisor, SSL)
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/23/2026
Due date:
% Done:
0%
Estimated time:
Description
[CANOFY-112] Production Config (nginx, supervisor, SSL)¶
Type: Story
Epic: New Client Onboarding — Automated AWS + Frappe Provisioning
Stage key: production_setup (pipeline stage 12 of 15)
Component: utils/onboarding_executor.py
User Story¶
As an operations engineer,
I want the site switched into production mode with a valid SSL
certificate automatically,
so that the client's site is served over HTTPS by nginx/supervisor
without a manual bench setup production + Certbot session per client.
Description¶
Via SSM:
- Fix the nginx log path issue (
sed-based fix noted in prior operational
experience — nginx's default log directory permissions/paths need
adjusting beforebench setup productionsucceeds cleanly). -
bench setup production(non-interactively — pipeyto any prompts),
bench setup supervisor, enable the scheduler. - Run Certbot non-interactively for the site's domain, only if real DNS
is in place (i.e. only when thedns_recordstage actually resolves
the domain to this instance's IP — Certbot's HTTP-01 challenge fails
without it). - If Certbot fails or DNS isn't ready (e.g. an IP-only test provision),
record that SSL wasn't configured (ssl_configured=Falsein pipeline
context) so later stages (frappe_config,smoke_test) fall back to
reaching the site viahttp://<elastic_ip>with an explicitHost
header instead ofhttps://<site_name>.
Configuration / Prerequisites¶
- Depends on stage 4 (DNS record, if SSL is expected to succeed) and stage
11 (apps installed — production config should happen after the app set is
final, not before). - Let's Encrypt/Certbot is rate-limited per domain — repeated failed retries
against the same domain in a short window can exhaust the rate limit.
Acceptance Criteria¶
-
nginx serves the site (HTTP at minimum, HTTPS when DNS/Certbot
succeeded). -
Supervisor manages all Frappe processes (web, worker, scheduler) and
they're running after this stage. -
Certbot failure does not fail the whole onboarding — falls back
gracefully to the IP-override path for subsequent stages. -
Retrying this stage does not re-trigger Certbot unnecessarily if a
valid cert already exists (avoid burning Let's Encrypt rate limit on
retries).
Test Cases¶
| ID | Scenario | Steps | Expected Result |
|---|---|---|---|
| TC-1 | Happy path with real DNS | Run stage after a real DNS record resolves to the instance | Site reachable over HTTPS with a valid Let's Encrypt cert |
| TC-2 | IP-only test provisioning | Run stage with no real DNS in place | SSL step fails gracefully, ssl_configured=False recorded, site still reachable over plain HTTP |
| TC-3 | Supervisor process check | After stage completes |
supervisorctl status shows all Frappe processes running |
| TC-4 | Certbot rate-limit avoidance | Retry the stage after a prior successful cert issuance | Certbot is not re-invoked for an already-valid cert |
| TC-5 | Non-interactive prompts | Inspect the bench setup production command |
No step blocks waiting for interactive confirmation |
No data to display
Actions