diff --git a/manual/latex/devopsAIPromptLog.tex b/manual/latex/devopsAIPromptLog.tex index 1a3a6ad..4d47cd1 100644 --- a/manual/latex/devopsAIPromptLog.tex +++ b/manual/latex/devopsAIPromptLog.tex @@ -604,7 +604,7 @@ password, or the \texttt{jenkins-bot} token. Claude read the droplet state, ran Vincent's guarded test unchanged (first run aborted on upload permissions it introduced; fixed with \texttt{chmod}; second run passed), wrote the Dockerfile, plugin lockfile, -Compose, Caddy, and README changes, deployed Jenkins with a backup and +Compose, Caddy, and README changes, deployed Jenkins after backing up the Compose and Caddy files and with a monitored rollout, and pushed the feature commits after Billy asked. Billy performed every web-interface step (DNS, Jenkins setup and security, bot account and token, credential, job, webhook, branch protection, PR @@ -642,7 +642,7 @@ split-tunnel. Human decision: state the campus network plus addresses added on request as the approved path. Outputs used: corrected access-path text, an exposure-table row, the GlobalProtect figure, the Caddyfile comment, version 4.1 and its history row. Billy's residential address was kept out of -the report. Vincent then tested from campus Wi-Fi exttt{Stevens-Net} +the report. Vincent then tested from campus Wi-Fi \texttt{Stevens-Net} (public address 155.246.151.38) and the sign-in page loaded; Claude combined his screenshots into one figure, blurring the password field and profile icon. A friend reportedly on campus saw a blank page (the 403); his network diff --git a/manual/latex/devopsDocumentHistory.tex b/manual/latex/devopsDocumentHistory.tex index c805318..a04fb61 100644 --- a/manual/latex/devopsDocumentHistory.tex +++ b/manual/latex/devopsDocumentHistory.tex @@ -12,7 +12,7 @@ link each entry to the changed chapter, table, figure, or controlled artifact. \multicolumn{4}{l}{\small\itshape Document Update History (continued)}\\ \toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule \endhead \bottomrule \endlastfoot -October 23, 2026 / 4.1 & BY, CD & Corrected the Jenkins instructor access path to the Stevens campus network, with off-campus graders' addresses added on request; recorded the GlobalProtect test showing the Stevens VPN is split-tunnel and therefore not an access path, and Vincent's passing campus test on exttt{Stevens-Net}. Shortened AI initials in this table (CDX for Codex, CD for Claude). Hosts and Passwords tables are unchanged. & \ChapterRef{JenkinsCI}, \ChapterRef{AIPromptLog}\\ +October 23, 2026 / 4.1 & BY, CD & Corrected the Jenkins instructor access path to the Stevens campus network, with off-campus graders' addresses added on request; recorded the GlobalProtect test showing the Stevens VPN is split-tunnel and therefore not an access path, and Vincent's passing campus test on \texttt{Stevens-Net}; added the real webhook delivery table and diagnosis of one timed-out delivery, UML stereotypes on the deployment diagram, the stored Jenkins URL, free disk space, reconciled plugin counts, and corrected wording on push rights, resource limits, and corrective actions. Shortened AI initials in this table (CDX for Codex, CD for Claude). Hosts and Passwords tables are unchanged. & \ChapterRef{JenkinsCI}, \ChapterRef{AIPromptLog}\\ October 22--23, 2026 / 4.0 & BY, VS, CD & Assignment 6: ran the guarded Jenkins capacity test on the resized 1\,GiB droplet; deployed Jenkins 2.580.1 LTS with a hashed plugin lockfile behind Caddy at \texttt{ci.yebilly.me} (Stevens and team allowlist); integrated Gitea via a private webhook and the \texttt{jenkins-bot} identity; required check \texttt{vpn-dns-gateway/pipeline/pr-main} on \texttt{main}; recorded PR~\#15's pass, blocked failure, repair, review, and merge, the restart-persistence and IPv4/IPv6 exposure tests, and the plugin-update check. \textbf{Updated the Hosts table} (resize, Jenkins, \texttt{ci} DNS, Color Buttons retired) and \textbf{the Passwords table} (Jenkins administrators, \texttt{jenkins-bot} account and token, CI allowlist file). Added glossary terms, set the Assignment 6 title page and abstract, and noted the completed Assignment 5 merge. & Title and abstract, \ChapterRef{JenkinsCI}, \ChapterRef{HostsPasswords}, \ChapterRef{AutomatedManualBuild}, \ChapterRef{AIPromptLog}\\ October 21, 2026 / preparation & VS, CDX & Recorded core-test timing qualification and the Billy/Claude handoff; prepared the plugin/pipeline test and verified it locally after separating plugin resolution from runtime. The droplet run remains unverified. Hosts and Passwords tables are unchanged because no persistent Jenkins service or real integration credential was added. & \ChapterRef{AIPromptLog}\\ October 7, 2026 / 3.4 & VS, CDX & Added the successful run-4 repair screenshots and verified its commit, PDF version, artifact contents, and SHA-256; completed the failure/repair evidence. Replaced the abstract's template instructions with an Assignment 5 summary. Hosts and Passwords tables are unchanged from 3.3; final workflow PDF review and submission remain pending. & Title and abstract, \ChapterRef{AutomatedManualBuild}, \ChapterRef{AIPromptLog}\\ diff --git a/manual/latex/devopsHostsPasswords.tex b/manual/latex/devopsHostsPasswords.tex index d1fd64a..1e6fd68 100644 --- a/manual/latex/devopsHostsPasswords.tex +++ b/manual/latex/devopsHostsPasswords.tex @@ -90,7 +90,7 @@ Gitea \texttt{jenkins-bot} (added 22 Oct 2026) & BY & BY's password manager; use Jenkins \texttt{billy} & BY & BY's password manager & Administer (all)\\ Jenkins \texttt{vsun1} & VS & VS's password manager & Administer (all)\\ Jenkins initial admin password & --- & One-time setup secret in \texttt{/var/jenkins\_home/secrets/}; read once by BY, superseded by named accounts & Setup only\\ -CI allowlist \texttt{.env} & BY & \texttt{\textasciitilde/gitea/.env} on the droplet, root-only; holds team IP addresses (personal data, not a secret) & n/a\\ +CI allowlist \texttt{.env} & BY & \texttt{\textasciitilde/gitea/.env} on the droplet, root-only; holds team and approved grader IP addresses (personal data, not a secret); grader entries are removed after grading & n/a\\ DigitalOcean team & BY, VS & Each member's own login, in their password manager & Team member\\ Namecheap (\texttt{yebilly.me}) & BY & BY's password manager & Domain owner\\ Droplet \texttt{root} SSH & BY & Key-based only; private key \texttt{digiOcean} on BY's laptop; no password login & Root\\ diff --git a/manual/latex/devopsJenkins.tex b/manual/latex/devopsJenkins.tex index 6315869..462defe 100644 --- a/manual/latex/devopsJenkins.tex +++ b/manual/latex/devopsJenkins.tex @@ -113,8 +113,10 @@ Jenkins is a third service in the existing The first deployment kept the test's limits (256\,MiB RAM, 128\,MiB heap, 0.5 CPU). Builds worked, but the setup wizard and plugin pages hung with \texttt{OutOfMemoryError: Java heap space} once Jenkins loaded the -update-center catalog. The limits were doubled to those shown above at -03:35; Jenkins then answered in 45\,s instead of 184\,s, used about +update-center catalog. At 03:35 the limits were raised to those shown above +(RAM and heap doubled to 512\,MiB and 256\,MiB, RAM plus swap 512 to +768\,MiB, CPU 0.5 to 0.75); Jenkins then answered in 45\,s instead of +184\,s on its next start, used about 350\,MiB, and left about 180\,MiB of host RAM available with Gitea still returning 200. The service runs one executor so only one build uses memory at a time. @@ -221,7 +223,14 @@ ci.yebilly.me { \texttt{CI\_TEAM\_IPS} is read from the untracked, root-only \texttt{\textasciitilde/gitea/.env}, so home addresses are not in Git. Caddy's \texttt{reverse\_proxy} forwards the \texttt{X-Forwarded-*} headers, and the -Jenkins URL is set to \texttt{https://ci.yebilly.me/}. +Jenkins URL (\emph{Manage Jenkins $\rightarrow$ System $\rightarrow$ Jenkins +Location}) is \texttt{https://ci.yebilly.me/}, as stored in the controller's +configuration (read on the droplet, October 23): +\begin{minted}{text} +$ docker exec gitea-jenkins-1 grep jenkinsUrl \ + /var/jenkins_home/jenkins.model.JenkinsLocationConfiguration.xml + https://ci.yebilly.me/ +\end{minted} \begin{figure}[H] \centering @@ -251,7 +260,7 @@ HTTPS \texttt{ci} via droplet IPv6 & IPv6, not allowlisted; Oct 23 01:02:42 & 40 HTTP \texttt{ci} via IPv6 & same & redirect & 308 \StatusPass\\ TCP 8080, 50000, 3000 via IPv6 & same & closed & closed/filtered \StatusPass\\ HTTPS \texttt{ci\ldots/login} from campus & \texttt{Stevens-Net}, \texttt{155.246.151.38} (Vincent); Oct 23 & 200 & Sign-in page shown \StatusPass\\ -Public IPv4 while on Stevens VPN & GlobalProtect connected; Oct 23 18:56:13 & \texttt{155.246.x.x} & Unchanged residential address; VPN is split-tunnel, so not offered as an access path\\ +Public IPv4 while on Stevens VPN & GlobalProtect connected; Oct 23 18:56:13 & Stevens address & Unchanged residential address; VPN is split-tunnel, so not offered as an access path \textbf{\footnotesize INFO}\\ \bottomrule \end{tabularx}} @@ -304,29 +313,30 @@ droplet. box/.style={draw, rounded corners, align=center, font=\small, minimum height=1.0cm}, lbl/.style={font=\scriptsize, fill=white, inner sep=1pt}, arr/.style={-{Stealth}, thick}] - \node[box] (browser) at (0,0) {Team / instructor\\browser}; - \node[box, fill=devopsLightBlue] (fw) at (4.3,0) {Cloud Firewall\\\texttt{gitea-fw}\\443 / 80}; - \node[box] (caddy) at (8.6,0) {Caddy TLS proxy\\allowlist for \texttt{ci}\\alias \texttt{git.yebilly.me}}; - \node[box] (gitea) at (13.2,1.9) {Gitea \texttt{:3000}}; - \node[box] (jenkins) at (13.2,-1.9) {Jenkins controller \texttt{:8080}\\\textbf{builds run here}\\(1 executor)}; - \node[box] (gvol) at (17.4,1.9) {\texttt{gitea-data}\\SQLite + repos}; - \node[box] (jvol) at (17.4,-1.9) {\texttt{jenkins-home}\\jobs, users,\\credentials}; + \node[box] (browser) at (0,0) {\guillemotleft device\guillemotright\\Team / instructor\\browser}; + \node[box, fill=devopsLightBlue] (fw) at (4.3,0) {\guillemotleft device\guillemotright\\Cloud Firewall\\\texttt{gitea-fw}, 443 / 80}; + \node[box] (caddy) at (8.6,0) {\guillemotleft container\guillemotright\\Caddy TLS proxy\\allowlist for \texttt{ci}\\alias \texttt{git.yebilly.me}}; + \node[box] (gitea) at (13.6,2.2) {\guillemotleft container\guillemotright\\Gitea \texttt{:3000}}; + \node[box] (jenkins) at (13.6,-3.0) {\guillemotleft container\guillemotright\\Jenkins controller \texttt{:8080}\\\textbf{builds run here}\\(1 executor)}; + \node[box] (gvol) at (18.4,2.2) {\guillemotleft artifact\guillemotright\\\texttt{gitea-data}\\SQLite + repos}; + \node[box] (jvol) at (18.4,-3.0) {\guillemotleft artifact\guillemotright\\\texttt{jenkins-home}\\jobs, users,\\credentials}; \draw[arr] (browser) -- node[lbl, above=2pt]{HTTPS} (fw); \draw[arr] (fw) -- (caddy); \draw[arr] (caddy.north) |- node[lbl, pos=0.75]{HTTP} (gitea.west); \draw[arr] (caddy.south) |- node[lbl, pos=0.75]{HTTP} (jenkins.west); - \draw[arr, dashed, devopsGreen] ([xshift=-6mm]gitea.south) -- node[lbl, left=2pt]{1. webhook} ([xshift=-6mm]jenkins.north); - \draw[arr, dashed, devopsBlue] ([xshift=6mm]jenkins.north) -- node[lbl, right=2pt, align=left]{2. checkout + status\\via Caddy alias} ([xshift=6mm]gitea.south); + \draw[arr, dashed, devopsGreen] (gitea.south) -- node[lbl, right=2pt]{1. webhook (private)} (jenkins.north); + \draw[arr, dashed, devopsBlue] (jenkins.north west) -- node[lbl, pos=0.5, left=3pt]{2. checkout + status} (caddy.south east); \draw[arr] (gitea) -- (gvol); \draw[arr] (jenkins) -- (jvol); - \node[draw, dashed, rounded corners, fit=(caddy) (gitea) (jenkins) (gvol) (jvol), inner sep=8pt, - label={[font=\scriptsize]above:Droplet \texttt{The-Ocean} (1\,GiB) / Docker network \texttt{gitea\_web}}] {}; + \node[draw, dashed, rounded corners, fit=(caddy) (gitea) (jenkins) (gvol) (jvol), inner sep=10pt, + label={[font=\scriptsize]above:\guillemotleft device\guillemotright\ Droplet \texttt{The-Ocean} (1\,GiB) / \guillemotleft executionEnvironment\guillemotright\ Docker network \texttt{gitea\_web}}] {}; \end{tikzpicture}} -\caption{Actual deployment, October 2026. Only Caddy's 80/443 are public. -Gitea sends the webhook to \texttt{http://jenkins:8080} on the private -network; Jenkins checks out code and posts statuses to -\texttt{https://git.yebilly.me}, which resolves to Caddy inside the Docker -network. Builds run on the controller; there is no separate agent.} +\caption{UML deployment diagram of the actual deployment, October 2026. Only +Caddy's 80/443 are public. (1) Gitea sends the webhook to +\texttt{http://jenkins:8080} on the private network. (2) Jenkins checks out +code and posts statuses to \texttt{https://git.yebilly.me}, which resolves to +Caddy inside the Docker network; Caddy forwards to Gitea. Builds run on the +controller; there is no separate agent.} \label{Figure:JenkinsDeployment} \end{figure} @@ -378,8 +388,35 @@ in one header is blurred.} \label{Figure:JenkinsWebhook} \end{figure} +All 14 deliveries to date, read from Gitea's delivery records on October 23, +are summarized in Table~\ref{Table:JenkinsDeliveries}. + +{\small +\begin{tabularx}{\linewidth}{L{0.6cm}L{2.7cm}L{2.6cm}L{1.4cm}Y} +\caption{Gitea webhook deliveries to Jenkins (UTC)\label{Table:JenkinsDeliveries}}\\ +\toprule \textbf{\#} & \textbf{Time} & \textbf{Event} & \textbf{Commit} & \textbf{Result}\\ \midrule +1 & Oct 22 22:54:06 & test push & --- & 200 \texttt{Processed}\\ +2 & Oct 22 22:57:43 & push & \texttt{ad35197} & 200; started branch job\\ +3 & Oct 22 23:01:59 & PR \#15 opened & \texttt{ad35197} & \textbf{failed}: client timeout awaiting headers (see below)\\ +4--5 & Oct 22 23:10:32 & push, PR synchronized & \texttt{52b297c} & 200; started PR-15 run 2\\ +6--7 & Oct 22 23:15:09 & push, PR synchronized & \texttt{9381d2a} & 200; started PR-15 run 3\\ +8--9 & Oct 23 00:55:22 & PR closed, push & \texttt{9381d2a}, \texttt{420ba4c} & 200; started main run 1\\ +10--14 & Oct 23 01:21--01:24 & push, PR \#16 events & \texttt{1149e9f}, \texttt{e4f3ce5} & 200; started PR-16 run 1 and main run 2\\ +\bottomrule +\end{tabularx}} + \paragraph{Diagnosing a failed delivery.} -If a push does not start a build: (1) open \emph{Repository Settings +Delivery~3 is a real failure. Gitea recorded \texttt{Post +"http://jenkins:8080/gitea-webhook/post": context deadline exceeded +(Client.Timeout exceeded while awaiting headers)}. Diagnosis: Jenkins did +receive the event, because Gitea shows PR-15's status ``Build queued'' at +23:02:01, two seconds later, and run~1 passed at 23:02:18. Jenkins answered +after Gitea's delivery timeout because it was busy with the PR discovery on +its 0.75-CPU limit. No action was needed; had the build not started, +\emph{Redeliver} on that delivery, or \emph{Scan Multibranch Pipeline Now}, +would recover it, and raising Gitea's \texttt{webhook.DELIVER\_TIMEOUT} +would prevent repeats. General procedure if a push does not start a build: +(1) open \emph{Repository Settings $\rightarrow$ Webhooks $\rightarrow$ jenkins-ci $\rightarrow$ Recent Deliveries} and read the response; (2) ``can only call allowed HTTP servers'' means \texttt{ALLOWED\_HOST\_LIST} was lost, so recreate the Gitea @@ -527,8 +564,9 @@ Merge & \href{https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/commit/420ba4 \end{tabularx} Each Jenkins log names the commit it checked out -(\texttt{Checking out Revision 52b297c2f338\ldots} for run~2, -\texttt{9381d2aa9a11\ldots} for run~3), and each matches the PR head shown +(\texttt{Checking out Revision ad35197ee490\ldots} for run~1, +\texttt{52b297c2f338\ldots} for run~2, \texttt{9381d2aa9a11\ldots} for +run~3), and each matches the PR head shown in Gitea at that time. The branch job \texttt{feature/issue-14}~\#1 also passed on \texttt{ad35197} before the PR existed; its context \texttt{vpn-dns-gateway/pipeline/head} is not the required one. @@ -565,9 +603,10 @@ credentials and their key, so a malicious \texttt{Jenkinsfile} could steal the bot token.\footnote{\url{https://www.jenkins.io/doc/book/security/controller-isolation/}} Compensating restrictions: \begin{itemize}[nosep] -\item Only Billy and Vincent can push to the repository, so only they can -change the \texttt{Jenkinsfile}; \texttt{main} accepts changes only through -reviewed PRs. +\item Only Billy and Vincent, plus the \texttt{jenkins-bot} identity whose +token exists only inside Jenkins, have write access to the repository, so +only they can change the \texttt{Jenkinsfile}; \texttt{main} accepts changes +only through reviewed PRs, which also applies to the bot. \item PRs from forks are not discovered, so untrusted code never runs. \item No Docker socket is mounted and the container is not privileged; its memory, CPU, and process count are capped. @@ -578,7 +617,11 @@ Jenkins. \paragraph{Plugin-update check.} On October 23 at 01:03, the 63 locked plugins were compared with the Jenkins -update center for core 2.580.1. One newer version exists +update center for core 2.580.1. (Counts: the capacity bundle had 59; +\texttt{matrix-auth} and \texttt{pipeline-graph-view} with its two +dependencies make 63 locked; Jenkins reports 66 installed, the other three +being the theme plugins described in Section~\ref{Section:JenkinsQuality}, +which this check did not cover.) One newer version exists (\texttt{workflow-api} \texttt{1413.v2ff1a\_5e720fa\_} $\rightarrow$ \texttt{1429.v7a\_1b\_efb\_a\_f7c5}); no security warning matches any installed version. The update was deferred: it is not a security fix and would change @@ -602,7 +645,7 @@ Section~\ref{Section:JenkinsTrigger}. Memory trouble (slow pages, \label{Section:JenkinsQuality} \paragraph{Corrective actions.} -Four problems were found and fixed during this work, each recorded with its +Five problems were found and fixed during this work, each recorded with its evidence: (1) the official plugin installer ran out of its 128\,MiB heap while reading the update-center catalog, so the Dockerfile downloads the pinned plugins with \texttt{curl} and checks their SHA-256; (2) the first droplet @@ -610,7 +653,9 @@ capacity run failed on upload permissions, fixed by \texttt{chmod}; (3) the 128\,MiB heap hung the web interface, fixed by the larger limits in Section~\ref{Section:JenkinsDeployment}; (4) matrix authorization was missing because the capacity bundle covered only Pipeline and Gitea, so -\texttt{matrix-auth} was added and the image rebuilt. Three theme plugins +\texttt{matrix-auth} was added and the image rebuilt; (5) no stage-by-stage +run view was installed, so \texttt{pipeline-graph-view} was added the same +way. Three theme plugins (\texttt{dark-theme}, \texttt{dracula-theme}, \texttt{theme-manager}) were installed from the web interface during setup and are not in the lockfile; they survive in \texttt{jenkins-home} but would be lost if the volume were @@ -627,15 +672,18 @@ docker compose logs --tail 100 jenkins # startup errors, OutOfMemoryError docker compose build jenkins && docker compose up -d jenkins \end{minted} After a droplet reboot, Docker starts all three services because of their -restart policies; Jenkins needs about one minute before the login page -answers. Gitea does not depend on Jenkins, so a Jenkins outage only delays +restart policies. Measured container starts took 25\,s (warm +\texttt{docker compose restart}) to 45\,s (first start after the limit +change); a full droplet reboot was not tested, so allow about a minute before +the login page answers. Gitea does not depend on Jenkins, so a Jenkins outage only delays checks (PRs stay blocked until Jenkins reports). \paragraph{Cost, ownership, and cleanup.} Jenkins adds no paid resource; it uses the droplet's 1\,GiB Basic plan (listed at \$6/month on DigitalOcean's pricing page on October 21, 2026; the account's billing was not re-checked here) and about 0.9\,GB of disk for its -image. Billy administers the droplet and Jenkins; Vincent reviews. To remove +image. On October 23 the root filesystem had 18\,GB free of 24\,GB +(\texttt{df -h /}, 25\% used). Billy administers the droplet and Jenkins; Vincent reviews. To remove Jenkins: delete the \texttt{main} protection's required check, stop and remove the service (\texttt{docker compose rm -sf jenkins}), delete the volume (\texttt{docker volume rm gitea\_jenkins-home}), remove the \texttt{ci} block @@ -643,7 +691,8 @@ from the Caddyfile and the \texttt{ci} DNS record, delete the webhook, and delete the \texttt{jenkins-bot} user and token. \paragraph{Document controls.} -This version is 4.0. Document History records the change and both updated +This chapter was introduced in version 4.0 and corrected in 4.1 (access path, +delivery evidence, wording). Document History records both and the updated tables in \ChapterRef{HostsPasswords}: the Hosts table adds \texttt{ci.yebilly.me}, the Jenkins service, and the 1\,GiB resize; the Passwords table adds the Jenkins administrators, the \texttt{jenkins-bot} account, and its token.