The earlier
chapters.
Original lab notes, questions and checkpoints. Their status reflects what was known at the time. The milestone journey shows the latest verified progress.
Return to the milestone journey ↗Day 1 — Linux, Ubuntu and SSH
Verified lab: Provisioned Ubuntu 24.04 VPS; configured a non-root YOUR_USER user, SSH Ed25519 key authentication, PuTTY and VS Code Remote SSH. Practiced shell navigation, file permissions, system services and connection troubleshooting.
Commands & meanings
whoami # current account
pwd # working directory
ls -la # files including hidden entries
cd ~/projects # move to projects
sudo systemctl status nginx --no-pager
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
Lessons learned: Root has broad privileges; day-to-day operation under a non-root account limits accidental impact. Public keys reside in authorized_keys, while private SSH keys stay on the client. The server verifies signatures without receiving the private key.
Mistakes and recovery: A stray backtick in cd /projectleft the shell at a>continuation prompt; **Ctrl+C** cancelled the unfinished command. The(END)screen came from a pager, exited with **q**; these are different situations.clsis not the standard Ubuntu clear command; useclear. SSH closing does not normally stop long-running Docker containers; tmux` can preserve an interactive shell session.
Permission arithmetic: read r=4, write w=2, execute x=1. rw-r--r-- is 644, rw------- is 600. File deletion is chiefly controlled by parent-directory permissions, not merely the file's write bit.
Revisit: process supervision, journalctl, network diagnosis, least privilege, and safe VPS reboot.
Day 2 — Docker, DNS, Nginx and HTTPS
Verified lab: Deployed static portfolio in a Docker image using Nginx. Host Nginx proxies public HTTPS requests to the container through 127.0.0.1:8080:80. DNS for harishjeeka.com points to VPS public IP via Cloudflare DNS. Certbot obtained Let's Encrypt certificates; a renewal dry-run succeeded.
Request path: Browser → DNS lookup → VPS TCP 443 → host Nginx TLS termination → HTTP to 127.0.0.1:8080 → Docker's container port 80 → website files.
ports:
- "127.0.0.1:8080:80" # host loopback : host port : container port
sudo docker ps -a
sudo docker compose ps
sudo docker logs --tail=50 harish-portfolio
curl -I http://127.0.0.1:8080
curl -I https://harishjeeka.com
sudo nginx -t
sudo systemctl reload nginx
sudo certbot certificates
sudo certbot renew --dry-run
systemctl list-timers --all | grep certbot
Incident: A 502 Bad Gateway typically points to a proxy/upstream failure; inspect container state, Docker logs, host Nginx error logs, and the upstream endpoint before restarting. sudo docker start harish-portfolio needs a container name. curl -I http://127.0.0.1:8080 requires both -I and //.
Certificate notes: The public website certificate is CA-issued, not self-signed. Let's Encrypt is the CA; Certbot is the ACME management client. Expiration causes browser TLS warnings/failures and does not automatically downgrade HTTPS to HTTP. The server safeguards its private TLS key; the certificate contains its public key.
Pending checks: confirm automated renewal timer, backup strategy, off-server recovery, safe OS reboot, proactive monitoring.
Day 3 — Git and Forgejo
Hands-on reported: Forgejo installed in Docker; reached privately via ssh -N -L 3000:127.0.0.1:3000 YOUR_USER@<VPS_IP>. Admin account, repository creation, and first Git push were reported complete. Nginx reverse proxy and public git.harishjeeka.com were configured in steps, but final public URL/security checks were not independently confirmed.
Git versus hosting: git add selects changes; git commit records history locally; git push uploads commits to Forgejo. Publishing a Git commit does not redeploy the website by itself.
cd ~/projects/harish-portfolio
git status
git diff --stat
git add site/
git commit -m "Document engineering journey"
git remote -v
git push origin main
Key lesson: A URL typed alone into Bash is not a command: https://...git yields No such file or directory. It must be part of git remote add origin URL or another Git operation. A Forgejo warning about ROOT_URL=http://localhost:3000/ occurs when visited via a different domain; align ROOT_URL with https://git.harishjeeka.com/ after obtaining HTTPS.
Operational security: Forgejo remains distinct from the portfolio container. Keep container port 3000 bound to loopback, disable unauthenticated registration, enable admin MFA, maintain off-VPS backups, and place CI runners on isolated infrastructure.
Practice still planned: feature branch → commit → pull request → review → merge, automated CI, rollback exercises.
Day 4 — GPT Code Review prototype and agent architecture
Completed as reported: Created Python virtual environment, installed OpenAI SDK and called the OpenAI API with synthetic Git diff data. Resolved OpenAIError: Missing credentials by exporting OPENAI_API_KEY in the same shell; the API key must never enter Git or public site content.
Prototype architecture: Synthetic Git diff → Python validation / OpenAI() client → GPT API → natural-language findings. This is an LLM application, not yet a tool-calling autonomous agent.
Testing approach: pytest validates empty-diff rejection and mocked model responses, without using a live paid API for each test. Tests and an isolated Forgejo Actions runner were taught but their successful execution has not been confirmed.
Coding with AI: GPT, Cursor or Claude can generate Python code. An architect still must own requirements, authorization, test cases, review, failure handling and deployment decisions. The organization does not need to train its own LLM to build agents; an approved inference gateway can provide model access.
Target evolution: synthetic diff → read-only Git tools → model tool-calling request → app-side allowlist and argument validation → structured findings → human approval → evaluations → CI/CD and observability.
Enterprise design questions: Does the self-hosted gateway support OpenAI-compatible chat or Responses APIs? Tool calling and JSON schema? Authentication, rate limits, context size, concurrent requests, latency budgets, data retention, audit logging, failure modes and model-version rollbacks? Never send organizational code to a personal API or VPS without explicit approval.
Next step: generate tests with an AI coding assistant, inspect and run them locally, push a feature branch, and configure a runner isolated from public hosting.
Live AI chatbot, Forgejo CI/CD and the 403 incident
Built and verified: a portfolio chatbot with server-side model calls, approved public facts, a protected runtime key, a Docker backend and a visible website widget. A real request returned HTTP 200 with an answer. This is an LLM application; autonomous tool execution is still future work.
Request controls: 10 calls per visitor per minute, 30 globally per minute, 200 globally per 24-hour window, a three-second visitor cooldown and two concurrent upstream calls per process. SQLite preserves budgets in a volume. Eight backend tests passed without paid model calls.
Delivery work: a repository-scoped Mac runner connected to Forgejo. The Mac is ARM64 and the VPS is AMD64, so the workflow explicitly builds linux/amd64 images. PR validation passed; the main workflow built and published both images, authenticated over restricted SSH and pulled them onto the VPS. Five isolated deployment-controller tests passed.
What failed
The candidate Nginx returned 403 Forbidden for release.txt. The workflow used umask 077 to protect temporary credentials. That also made the new public marker file 0600; Docker preserved the permission and the Nginx worker could not read it.
umask 077
printf '%s\n' "$REVISION" > site/release.txt
# New file: owner read/write only (0600)
What we fixed, and why
The targeted fix grants read access to the public marker only. Secret files retain restrictive permissions. The workflow error was introduced in the assistant-prepared setup, not by a user entering the wrong command.
printf '%s\n' "$REVISION" > site/release.txt
chmod 0644 site/release.txt
# Public marker: owner read/write; group and others read
Verification: a real local Nginx container returned 403 for a 0600 file and 200 with the expected revision for a 0644 file. The fix is committed on fix/ci-release-file-permissions; it still needs publication, CI and successful promotion.
Why the other layers exist
- Server-side API: keeps the model key away from browser code.
- Persistent quotas: restrict admitted requests even after an app restart.
- Mac runner: performs build work away from the production VPS.
- Image digests: identify exact artifacts rather than mutable tags.
- Candidate checks: detect a bad release before changing live traffic.
- Restricted deployment account: permits the expected deploy/rollback operation without granting the CI key an ordinary server shell.
Next checkpoint: merge the permission fix, verify the public release SHA and chatbot, exercise rollback to the retained previous pair, then restore the successful new release. Record those results before marking CD complete.
Architecture and security concepts studied
These topics have been discussed conceptually; they are not claimed as completed implementations.
| Topic | Working understanding |
|---|---|
| Root/intermediate CA | Browser chains a site certificate to a trusted root. |
| Self-signed certificates | Signed by their own private keys; no automatic browser trust, though root CAs can be self-signed trust anchors. |
| SSH vs TLS | SSH authenticates remote login with SSH keys; HTTPS uses TLS/X.509 certificates. |
| SAML SSO | Browser, Service Provider (SP), Identity Provider (IdP), signed assertions, ACS, issuer/audience/time checks. Signing cert rotation is separate from TLS renewal. |
| AuthN vs AuthZ | Authentication is identity; authorization determines permitted account access and tool execution. |
| Proxmox / Podman | Proxmox virtualizes hosts/VMs; Podman runs OCI containers, managed e.g. with systemd Quadlet. |
| Kubernetes / Ingress | Optional orchestration; Ingress routing depends on a controller. Host Nginx works without Kubernetes. |
| AI gateway | Provides routing, credentials, limits, privacy controls, model selection, observability and resilience. |
Interview principle: Distinguish what works in a lab, what runs in production, and what has only been considered in an architecture discussion.
Knowledge checks and feedback
These are the exact topics assessed; scores are a self-study checkpoint.
- 5/10 — Why non-root
YOUR_USERand SSH public/private authentication? Correct: root has unrestricted access; non-root reduces accidental damage and supports accountability. Missed: least privilege,sudo, public key inauthorized_keys, private key stays client-side, signature proof. - 5/10 — Interpret
-rw-r--r--and tighten SSH file permission. Correct: owner read/write, group and others read. Fix: numeric 644 rather than guessed sum;chmod 600 ~/.ssh/authorized_keys. File deletion depends on parent directory. - 7/10 — Trace DNS → Nginx → Docker. Correct: DNS to IP, reverse proxy, localhost, port mapping. Missing: browser HTTPS port 443, TLS termination, host 8080 mapped to container 80; one backend is reverse proxying, not actual load balancing.
- 7/10 — Diagnose a 502. Correct:
docker ps, attempt container restart,curl. Missing:docker ps -a, examine Docker and Nginx logs, command syntax, verify upstream then public path, root-cause analysis. - 5/10 — Certificate expiry and CA/self-signed trust. Correct: browser warns and CA signs certificate. Missing: HTTPS does not silently switch to HTTP; Certbot vs Let's Encrypt; self-signed TLS versus SSH keys;
certbot certificates, renewal dry-run and OpenSSL checks.
Average: 5.8/10. Git/Forgejo Question 6 was presented but not answered; assessment switched to accelerated AI agent implementation.
Further architect exercise (unanswered): Design an internal code review service for 200 developers, 50 concurrent reviews, no confidential code leaving the organization, recoverable LLM outages, audit logs, traces, and access control.
Suggested recall drill: Explain each deployed service request path without notes; rebuild curl and Git commands from memory; diagnose a broken certificate and a stopped upstream container.