Compare commits
2
Commits
dd7c12c519
...
80c7fe2bdc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80c7fe2bdc | ||
|
|
55abfbc951 |
@@ -44,3 +44,11 @@
|
||||
- At inspection, staging.myfileagent.tech and app.myfileagent.tech did not resolve via the Droplet resolver. Existing Caddy routes serve Gitea, Jenkins and Grafana; no pricing routes added yet.
|
||||
|
||||
- Expanded secret scan to the checked-out repository (excluding Git metadata, disposable test environment and generated reports); direct agent test returned zero findings and exit 0. This change still requires a Jenkins run after publication.
|
||||
|
||||
## Jenkins validation #3 and deployment preparation
|
||||
- Jenkins assignment8-validation #3 succeeded for commit dd7c12c519b14f59d9842ebd6d417e7117d92e94, including tests, dependency audit, expanded repository secret scan, Ansible syntax, image build and HIGH/CRITICAL image scan; report archived. Evidence: https://ci.myfileagent.tech/job/assignment8-validation/3/console . Build context was 7.68 kB after excluding test venv.
|
||||
- Verified agent-to-host private SSH gateway 172.20.0.1 matches the host ED25519 fingerprint SHA256:CXrEv4+pv1jTwBtwxdTGlouS6I4H1Q6TkKbvQrbacu0. Prepared inventory and verified public known_hosts entry; dedicated account and Jenkins SSH credential are not yet configured. Prepared private deployment key and a reviewable administrator setup script, not yet executed. Gitea registry endpoint returns 401 as expected for authentication; registry push/pull has not been verified.
|
||||
|
||||
## Deployment access and DNS verification
|
||||
- On 2026-11-04, a8deploy account existed. Both staging.myfileagent.tech and app.myfileagent.tech resolved to 142.93.193.110 via Droplet resolver. From assignment8-trusted, SSH using the dedicated private key and pinned host key returned uid 1001; sudo -n id returned root. The test key was removed from the agent after verification. Passwordless sudo grants host-administrator access. No Jenkins SSH credential configured yet.
|
||||
- Prepared Caddy route and v1 release-record templates; neither route nor application deployment has been applied. Registry endpoint requires authentication; no registry package-write or package-read credential has been verified.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# Add to the existing Caddy configuration; preserve all existing routes.
|
||||
staging.myfileagent.tech {
|
||||
reverse_proxy pricing-staging:8000
|
||||
}
|
||||
app.myfileagent.tech {
|
||||
reverse_proxy pricing-production:8000
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# Run as root after reviewing the deployment privilege scope.
|
||||
set -eu
|
||||
[ "$(id -u)" -eq 0 ] || { echo "Run as root" >&2; exit 1; }
|
||||
key=/home/codex/myfileagent-gitea/secrets/assignment8-deploy.pub
|
||||
[ -s "$key" ] || { echo "Deployment public key missing" >&2; exit 1; }
|
||||
if ! id a8deploy >/dev/null 2>&1; then useradd -m -s /bin/bash a8deploy; fi
|
||||
home=$(getent passwd a8deploy | cut -d: -f6)
|
||||
[ "$home" = /home/a8deploy ] || { echo "Unexpected account home" >&2; exit 1; }
|
||||
install -d -o a8deploy -g a8deploy -m 700 "$home/.ssh"
|
||||
touch "$home/.ssh/authorized_keys"
|
||||
chown a8deploy:a8deploy "$home/.ssh/authorized_keys"
|
||||
chmod 600 "$home/.ssh/authorized_keys"
|
||||
grep -qxF "$(cat "$key")" "$home/.ssh/authorized_keys" || cat "$key" >> "$home/.ssh/authorized_keys"
|
||||
tmp=$(mktemp)
|
||||
trap 'rm -f "$tmp"' EXIT
|
||||
printf '%s\n' 'a8deploy ALL=(root) NOPASSWD: ALL' > "$tmp"
|
||||
visudo -cf "$tmp" >/dev/null
|
||||
install -o root -g root -m 440 "$tmp" /etc/sudoers.d/90-assignment8-deploy
|
||||
echo 'Assignment 8 deploy account prepared.'
|
||||
@@ -1,3 +1,2 @@
|
||||
[delivery]
|
||||
# Replace address and user; verify the SSH host key before first use.
|
||||
startup ansible_host=REPLACE_DROPLET_ADDRESS ansible_user=deploy
|
||||
startup ansible_host=172.20.0.1 ansible_user=a8deploy
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# 172.20.0.1:22 SSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.20
|
||||
172.20.0.1 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMLfpbUktZ4Q6KaAKA5quOhM/rc9asSxloPJFOsIv2/B
|
||||
@@ -0,0 +1,8 @@
|
||||
# Replace digest and commit with the approved build values. No secrets belong here.
|
||||
target_env: production
|
||||
release_image: myfileagent.tech/myfileagent/pricing@sha256:REPLACE_DIGEST
|
||||
expected_version: v1
|
||||
expected_commit: REPLACE_FULL_GIT_COMMIT
|
||||
expected_total: 30
|
||||
public_url: https://app.myfileagent.tech
|
||||
proxy_network: myfileagent-gitea_gitea-private
|
||||
@@ -0,0 +1,8 @@
|
||||
# Replace digest and commit with the approved build values. No secrets belong here.
|
||||
target_env: staging
|
||||
release_image: myfileagent.tech/myfileagent/pricing@sha256:REPLACE_DIGEST
|
||||
expected_version: v1
|
||||
expected_commit: REPLACE_FULL_GIT_COMMIT
|
||||
expected_total: 30
|
||||
public_url: https://staging.myfileagent.tech
|
||||
proxy_network: myfileagent-gitea_gitea-private
|
||||
Reference in New Issue
Block a user