feat: publish Gamertan Tend preview source
Sanitized root snapshot from private source commit a72903c63e1753f9e6ffbf40453c0830bdfc05c5 and tree 295641e67eef5979da76746d8ae271249568263e. Private development history and workflows are excluded by the exact allowlist. AI-assisted: OpenAI Codex helped implement, test, and audit this preview. Signed-off-by: Cole Speelman <crspeelman@gmail.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
Zero-Clause BSD
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,19 @@
|
||||
# Reusable Tend examples
|
||||
|
||||
This subtree is licensed 0BSD so an operator can copy and adapt it without
|
||||
bringing the Tend program's AGPL license into an application configuration.
|
||||
|
||||
The blue/green example expects separately reviewed environment files:
|
||||
|
||||
```text
|
||||
# /etc/example-site/blue.env
|
||||
EXAMPLE_LISTEN=127.0.0.1:8090
|
||||
|
||||
# /etc/example-site/green.env
|
||||
EXAMPLE_LISTEN=127.0.0.1:8091
|
||||
```
|
||||
|
||||
Production configuration belongs outside the source checkout, owned by root,
|
||||
and not group- or world-writable. The Caddy handler template is an entire
|
||||
imported handler fragment; the enclosing site, matchers, and routing precedence
|
||||
remain operator-owned.
|
||||
@@ -0,0 +1,2 @@
|
||||
# Managed by Tend. The enclosing site and route matchers remain operator-owned.
|
||||
reverse_proxy {{UPSTREAM}}
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Example site (%i)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
DynamicUser=yes
|
||||
ExecStart=/opt/example-site/slots/%i/example-site
|
||||
EnvironmentFile=/etc/example-site/%i.env
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
ProtectSystem=strict
|
||||
ProtectHome=yes
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"service": { "name": "example-site", "allowed_host": "example.test" },
|
||||
"build": { "package": "./cmd/site", "binary": "example-site", "branch": "main" },
|
||||
"deployment": {
|
||||
"strategy": "blue_green",
|
||||
"root": "/opt/example-site",
|
||||
"lock_file": "/run/lock/gamertan-deploy.lock",
|
||||
"state_file": "/opt/example-site/tend-state.json",
|
||||
"health_path": "/healthz",
|
||||
"readiness_path": "/readyz",
|
||||
"candidate_timeout_seconds": 30,
|
||||
"smoke": [{ "path": "/", "contains": "Example site" }],
|
||||
"blue_green": {
|
||||
"caddy_config": "/etc/caddy/Caddyfile",
|
||||
"caddy_handler": "/etc/caddy/example-site-handler.caddy",
|
||||
"caddy_handler_template": "/etc/example-site/caddy-handler.template",
|
||||
"bootstrap_active": "blue",
|
||||
"blue": { "unit": "example-site-blue.service", "address": "127.0.0.1:8090", "link": "/opt/example-site/slots/blue" },
|
||||
"green": { "unit": "example-site-green.service", "address": "127.0.0.1:8091", "link": "/opt/example-site/slots/green" }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"service": { "name": "example-site", "allowed_host": "example.test" },
|
||||
"build": { "package": "./cmd/site", "binary": "example-site", "branch": "main" },
|
||||
"deployment": {
|
||||
"strategy": "singleton_candidate",
|
||||
"root": "/opt/example-site",
|
||||
"lock_file": "/run/lock/gamertan-deploy.lock",
|
||||
"state_file": "/opt/example-site/tend-state.json",
|
||||
"health_path": "/healthz",
|
||||
"readiness_path": "/readyz",
|
||||
"candidate_timeout_seconds": 30,
|
||||
"smoke": [{ "path": "/", "contains": "Example site" }],
|
||||
"singleton": {
|
||||
"unit": "example-site.service",
|
||||
"address": "127.0.0.1:8092",
|
||||
"candidate_address": "127.0.0.1:18092",
|
||||
"listen_env": "EXAMPLE_LISTEN",
|
||||
"environment": {},
|
||||
"current_link": "/opt/example-site/current",
|
||||
"previous_link": "/opt/example-site/previous"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user