You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Staticman is architected with two configuration files:
A YAML-formatted "site/repo" file that is meant to be found in a git service (such as GitHub or GitLab).
A JSON-formatted "server" file (which may be overridden/supplemented using environmental variables).
With this architecture, multiple web sites (each with their own source git repository) may leverage a single "community" Staticman instance. Unfortunately, this architecture hinders the implementation of a more "robust" development lifecycle that features promotion through, for example, development, test, staging, and production environments.
For example, the schema for the YAML-formatted "site/repo" file currently requires that a value be set for the branch property and defaults to master. However, this precludes the ability for the YAML-formatted "site/repo" file to be promoted, without change, on the way to production. Similarly, with Staticman currently only allowing for Akismet to be enabled/disabled via the akismet.enabled property in the YAML-formatted "site/repo" file, Akismet cannot be cleanly disabled in dev or test (but remain enabled in prod) without requiring a modification to source code during code promotion.
In order to address this shortcoming, several properties should be added to the schema for the JSON-formatted "server" file, which could be shadowed by their YAML-formatted "site/repo" file counterparts:
akismet.enabled
branch
githubWebhookSecret
gitlabWebhookSecret
The goal would be to allow for any environment-specific configuration to be specified someplace other than the YAML-formatted "site/repo" file.
Once support for multiple environments is improved, a follow-on concern is cross-talk between tiers/layers of different environments. For example:
A dev site accidentally pointed at a prod Staticman instance.
A staging Staticman instance pointing at a prod Mailgun mailing list.
Webhooks triggered on a dev branch being processed by a prod Staticman instance.
In order to prevent/identify this cross-talk, logic checks should be added to the codebase. For example:
Verify that the branch specified in the webhook payload matches the value specified in the configuration(s).
Verify that the branch specified in the REST request matches the value specified in the configuration(s).
Verify that the origin request header sent to the entry endpoint matches one or more expected values.
Beyond preventative steps, the various artifacts generated by Staticman could be "tagged" with their source environment. For example:
Name and subject in notification emails.
Content and commit messages in pull/merge requests.
Address, name, and description in mailing lists.
This would make it obvious which notification emails, pull/merge requests, and mailing lists are aligned with which environments.
The text was updated successfully, but these errors were encountered:
hispanic
pushed a commit
to hispanic/staticwoman
that referenced
this issue
Mar 21, 2021
…iple environments (e.g., dev, staging, prod)"
- Add configuration properties that allow for code promotion (without modification of staticman.yml) through different environments.
- Add logic checks that help prevent cross-talk between tiers/layers of different environments. For example, Staticman dev and Mailgun prod.
- Flag config properties as sensitive, where appropriate.
- Prepend various artifacts such as commit messages, mailing list addresses, email subjects, etc. with a value to help identify the source environment.
- Allow for the "entry" endpoint to be "locked down" to specific origins.
Staticman is architected with two configuration files:
With this architecture, multiple web sites (each with their own source git repository) may leverage a single "community" Staticman instance. Unfortunately, this architecture hinders the implementation of a more "robust" development lifecycle that features promotion through, for example, development, test, staging, and production environments.
For example, the schema for the YAML-formatted "site/repo" file currently requires that a value be set for the
branch
property and defaults tomaster
. However, this precludes the ability for the YAML-formatted "site/repo" file to be promoted, without change, on the way to production. Similarly, with Staticman currently only allowing for Akismet to be enabled/disabled via theakismet.enabled
property in the YAML-formatted "site/repo" file, Akismet cannot be cleanly disabled in dev or test (but remain enabled in prod) without requiring a modification to source code during code promotion.In order to address this shortcoming, several properties should be added to the schema for the JSON-formatted "server" file, which could be shadowed by their YAML-formatted "site/repo" file counterparts:
akismet.enabled
branch
githubWebhookSecret
gitlabWebhookSecret
The goal would be to allow for any environment-specific configuration to be specified someplace other than the YAML-formatted "site/repo" file.
Once support for multiple environments is improved, a follow-on concern is cross-talk between tiers/layers of different environments. For example:
In order to prevent/identify this cross-talk, logic checks should be added to the codebase. For example:
origin
request header sent to theentry
endpoint matches one or more expected values.Beyond preventative steps, the various artifacts generated by Staticman could be "tagged" with their source environment. For example:
This would make it obvious which notification emails, pull/merge requests, and mailing lists are aligned with which environments.
The text was updated successfully, but these errors were encountered: