Document verified Chapter 4 Jenkins checks and remaining human evidence

This commit is contained in:
2026-10-21 19:34:16 -04:00
parent 1df4798a31
commit da0577e435
34 changed files with 1556 additions and 168 deletions
+8 -1
View File
@@ -1,4 +1,11 @@
# Current team source explicitly approved on 2026-10-21; review when networks change.
ci.165.227.90.215.sslip.io {
encode zstd gzip
reverse_proxy jenkins:8080
@approved remote_ip 155.246.151.38/32 172.18.0.1/32
handle @approved {
reverse_proxy jenkins:8080
}
handle {
respond "Jenkins access requires an approved team source or administrator tunnel." 403
}
}
+12 -16
View File
@@ -1,30 +1,26 @@
pipeline {
agent any
agent { label 'controller-small-trusted' }
options {
skipDefaultCheckout()
disableConcurrentBuilds()
timeout(time: 5, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '20'))
}
stages {
stage('Checkout') {
steps {
checkout scm
sh 'git rev-parse HEAD && python3 --version'
}
}
stage('Lint') {
stage('Syntax check') {
steps {
sh '''
set -eu
test -f README.md
grep -qi "startup" README.md
'''
sh 'python3 -m py_compile pricing.py tests/test_pricing.py'
}
}
stage('Automated Test') {
stage('Unit tests') {
steps {
sh '''
set -eu
printf "CI smoke test for startup-product\\n"
find . -maxdepth 2 -type f | sort | head -20
'''
sh 'python3 -m unittest discover -s tests -v'
}
}
}
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -eu
# Run on the Droplet after creating/recreating the official Jenkins container.
docker exec --user root jenkins sh -c 'apt-get update -qq && apt-get install -y --no-install-recommends python3 && rm -rf /var/lib/apt/lists/*'
docker exec jenkins python3 --version
docker exec jenkins git --version
+20
View File
@@ -0,0 +1,20 @@
\resizebox{\linewidth}{!}{%
\begin{tikzpicture}[font=\small,box/.style={draw,rounded corners,align=center,text width=2.8cm,minimum height=1.3cm},arr/.style={-{Latex[length=2mm]},thick}]
\node[box,text width=2.3cm] (browser) at (0,0) {\guillemotleft device\guillemotright\\Team browser};
\node[box,text width=2.6cm] (fw) at (3.8,0) {Cloud Firewall\\TCP 443\\HTTP 80 for redirect};
\node[box] (proxy) at (10.8,0) {\guillemotleft container\guillemotright\\Caddy TLS proxy};
\node[box,text width=3.0cm] (jenkins) at (8.0,-3.8) {\guillemotleft container\guillemotright\\Jenkins controller\\checkout and tests};
\node[box] (gitea) at (13.5,-3.8) {\guillemotleft container\guillemotright\\Gitea :3000};
\node[box] (jh) at (8.0,-6.5) {Jenkins home\\host bind mount};
\node[box] (gd) at (13.5,-6.5) {Gitea data\\SQLite + repositories};
\draw[dashed] (6.0,1.2) rectangle (15.5,-7.5);
\node[align=center] at (10.75,1.6) {\guillemotleft device\guillemotright\ DigitalOcean Droplet 165.227.90.215};
\draw[arr] (browser)--(fw);
\draw[arr] (fw)--node[above]{HTTPS}(proxy);
\draw[arr] (proxy)--node[left=2mm,align=right]{private\\:8080}(jenkins);
\draw[arr] (proxy)--node[right=2mm,align=left]{private\\:3000}(gitea);
\draw[arr] ([yshift=3mm]jenkins.east)--node[above,align=center,font=\footnotesize]{poll / checkout\\commit status}([yshift=3mm]gitea.west);
\draw[arr] ([yshift=-3mm]gitea.west)--node[below,align=center,font=\footnotesize]{API / Git\\responses}([yshift=-3mm]jenkins.east);
\draw[arr] (jenkins)--(jh);
\draw[arr] (gitea)--(gd);
\end{tikzpicture}}
+71
View File
@@ -0,0 +1,71 @@
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
asm-api:9.10.1-216.va_9256d3b_844b_
authentication-tokens:1.144.v5ff4a_5ec5c33
bouncycastle-api:2.30.1.82-277.v70ca_0b_877184
branch-api:2.1303.v9f3b_95dc329d
caffeine-api:3.2.3-194.v31a_b_f7a_b_5a_81
checks-api:422.vc7e8b_51488c6
cloudbees-folder:6.1106.v3a_d9a_6d2465e
command-launcher:123.v37cfdc92ef67
commons-lang3-api:3.21.0-122.v6a_ea_4fd34049
commons-text-api:1.15.0-218.va_61573470393
credentials:1487.va_d001ede2c31
credentials-binding:728.v902a_273b_8947
display-url-api:2.217.va_6b_de84cc74b_
durable-task:686.v80ff80875b_82
eddsa-api:0.3.0.1-19.vc432d923e5ee
git:5.10.1
git-client:6.6.1
gitea:273.vb_78d13f6d9a_d
gitea-checks:604.638.ve9e5472551b_3
gson-api:2.13.2-173.va_a_092315913c
handy-uri-templates-2-api:2.1.8-38.vcea_5d521d5f3
instance-identity:203.v15e81a_1b_7a_38
ionicons-api:94.vcc3065403257
jackson-annotations2-api:2.22-19.v10a_a_582ea_26e
jackson2-api:2.21.2-436.v29efdb_7418ff
jakarta-activation-api:2.1.4-1
jakarta-mail-api:2.1.5-1
jakarta-xml-bind-api:4.0.9-19.v2b_a_5b_44d9a_1c
javax-activation-api:1.2.0-8
javax-mail-api:1.6.2-11
jaxb:2.3.9-133.vb_ec76a_73f706
jdk-tool:83.v417146707a_3d
joda-time-api:2.15.0-208.v6b_084e7a_d9f0
json-api:20260814-226.v20f9685d642c
mailer:534.v1b_36f5864073
mina-sshd-api-common:2.16.0-167.va_269f38cc024
mina-sshd-api-core:2.16.0-167.va_269f38cc024
pipeline-build-step:601.v6d4c6d1a_9dc7
pipeline-graph-analysis:254.v0f63a_a_447dca_
pipeline-groovy-lib:798.v5cc688825312
pipeline-input-step:560.v56198a_642157
pipeline-milestone-step:152.v6e22b_8cfc66c
pipeline-model-api:2.2293.v6e7193cec599
pipeline-model-definition:2.2293.v6e7193cec599
pipeline-model-extensions:2.2293.v6e7193cec599
pipeline-rest-api:2.41
pipeline-stage-step:345.va_96187909426
pipeline-stage-tags-metadata:2.2293.v6e7193cec599
pipeline-stage-view:2.41
plain-credentials:199.v9f8e1f741799
plugin-util-api:6.1192.v30fe6e2837ff
scm-api:728.vc30dcf7a_0df5
script-security:1399.ve6a_66547f6e1
snakeyaml-api:2.7-152.vc672728cf536
ssh-credentials:372.va_250881b_08cd
sshd:3.374.v19b_d59ce6610
structs:362.va_b_695ef4fdf9
trilead-api:2.209.v0e69b_c43c245
variant:70.va_d9f17f859e0
woodstox-core-api:7.3.0-16.v017f30ed004c
workflow-aggregator:608.v67378e9d3db_1
workflow-api:1384.vdc05a_48f535f
workflow-basic-steps:1098.v808b_fd7f8cf4
workflow-cps:4350.vcc65d4958821
workflow-durable-task-step:1479.v56e587f413a_7
workflow-job:1571.1580.v18e46842c125
workflow-multibranch:841.vec5b_9e1806ec
workflow-scm-step:487.v41313a_96b_65d
workflow-step-api:724.v538c2362b_dfb_
workflow-support:1015.v785e5a_b_b_8b_22
+21
View File
@@ -0,0 +1,21 @@
# Chapter 4 Jenkins configuration
Use official `jenkins/jenkins:2.528.1-lts-jdk21`, the existing private `gitea_default` Docker network, persistent `/opt/jenkins/home`, and no published Jenkins/agent ports. Apply compose.yml from `/opt/jenkins`. Run bootstrap-executor.sh after container creation/recreation; installing Python inside a container survives restart but does not survive recreation. Python observed: 3.13.5; Git: 2.47.3. No pip dependencies or Docker socket are needed.
Retain the home directory and a rollback copy before plugin changes. plugins.txt records every loaded plugin/version after repair; it is a version inventory, not a claim that all are the newest available. Four previously incompatible dependencies were aligned: bouncycastle-api 2.30.1.82-277.v70ca_0b_877184, caffeine-api 3.2.3-194.v31a_b_f7a_b_5a_81, gson-api 2.13.2-173.va_a_092315913c, script-security 1399.ve6a_66547f6e1. Verify zero failed plugins after restart. Refresh the update center, review advisories/core compatibility, and schedule newer versions as a separate tested upgrade; never blindly replace the working plugin set.
In Manage Jenkins > System > Gitea Servers, register `http://gitea:3000`, with automatic webhook management off. Create a Multibranch Pipeline named `startup-product-ci`, Gitea source owner `group10-startup`, repository `startup-product`, and credential ID `gitea-startup-ci` (Gitea personal access token). The restricted, non-admin `jenkins-ci` bot has collaborator access only to startup-product and token scopes write:repository/read:user. Gitea requires repository write access for status publication. Keep the token in Jenkins credentials; do not put its value in a pipeline or this repository.
Discover branches excluding those with open PRs (strategy 1). Discover origin PR heads (strategy 2); do not discover fork PRs. Jenkinsfile path: Jenkinsfile. Configure Scan Multibranch Pipeline Triggers > Periodically if not otherwise run for 1 minute. This is the rubric-permitted polling fallback. No webhook delivery is claimed. An initial indexing failure `Unknown server: http://gitea:3000` was fixed by registering the endpoint globally. A subsequent corrective push was discovered automatically: PR-9 run 2, commit ed8684a2897c407946320183e572f6412dbb7703.
Set Jenkins URL to `https://ci.165.227.90.215.sslip.io/`, one controller executor, label `controller-small-trusted`; the small course-only trusted build runs here. Disable self-registration and anonymous read. Restrict pipeline changes to trusted team writers; do not add untrusted forks, privileged mounts, or build-secret bindings. Settings/jobs/build history persist under Jenkins home. A controller build remains a security tradeoff; use an isolated agent and zero controller executors before accepting untrusted contributions.
Protect `main`: required context `startup-product-ci/pipeline/pr-main`, one approval, dismiss stale approvals, block rejected reviews, direct pushes disabled, force pushes disabled, admin merge override disabled. The check must match the latest PR head. Issue 8 and PR 9 contain the controlled failure and repair. Peer approval and eventual merge must be performed and recorded honestly.
For a failed check, open the exact linked run, compare its checked-out SHA with the PR head, then inspect the first failed stage. For missing checks, verify periodic scan timestamp/result, registered Gitea URL, token permission, network connectivity, plugin activation, and context spelling. If switching to webhooks later, scope events/destination, inspect delivery status, and keep the Jenkins interface private. Never disable CSRF to repair scripted requests; retain the session cookie with its crumb or use an approved Jenkins API token.
Restart: `cd /opt/jenkins && docker compose restart jenkins`. Verify the login, job, run history, configured polling, and absence of failed plugins. For cleanup stop the Jenkins container and disable its scan; revoke the CI bot token when integration is retired. Do not delete persistent home or shared Gitea/Caddy data. No new paid cloud resource was provisioned for Chapter 4.
## Browser access, 2026-10-21
Sergio explicitly approved CI access only from 155.246.151.38/32 and Docker host gateway 172.18.0.1/32. The updated Caddyfile-snippet reflects the deployed matcher. Approved source GET returned 200; an excluded container using a validated TLS connection to private Caddy returned 403. Gitea is unaffected. Verify administrator access before every source restriction change. Instructor viewing can occur on an approved network with the operator, or through the documented administrator-assisted SSH tunnel; no instructor Jenkins sign-in is required. Current account-side Cloud Firewall rule inspection remains pending.