345 lines
19 KiB
TeX
345 lines
19 KiB
TeX
\chapter{Startup Foundation with Gitea}
|
|
\ChapterLabel{Gitea}
|
|
\index{Gitea}
|
|
|
|
\section{Student Pack Domain and DNS}
|
|
This chapter records the Chapter 2 startup infrastructure completed for Group 10. The implementation was restarted on Sergio Espinal's own DigitalOcean Droplet so the group documentation reflects an environment that Sergio can administer directly rather than a teammate-owned host. The setup follows the vendor documentation for DigitalOcean Droplets and firewalls, Gitea's Docker installation model, and Caddy's automatic HTTPS reverse proxy pattern \cite{DigitalOceanDroplets,DigitalOceanFirewalls,GiteaDocker,CaddyAutomaticHTTPS,CaddyReverseProxy}.
|
|
|
|
\begin{devopsNote}[Scope]
|
|
The public startup Git service for this assignment is \href{https://git.sespinal590.dev/}{\texttt{https://git.sespinal590.dev/}}. The earlier teammate Droplet path is no longer the controlled implementation for this document because Sergio did not have administrator access to that Droplet.
|
|
\end{devopsNote}
|
|
|
|
The GitHub Student Developer Pack was used to register \texttt{sespinal590.dev} through Name.com. The Name.com order showed the domain registration discounted to \texttt{\$0.00} for the first year with Domain Safe included. The domain purchase flow showed the normal renewal price as \texttt{\$22.99/year}; this was recorded as the renewal-cost check so the startup understands the future cost after the student-pack discount ends. Personal address, phone, and payment information are intentionally excluded from this manual.
|
|
|
|
\begin{longtable}{L{3.5cm}L{4.4cm}L{5.0cm}}
|
|
\caption{Startup Domain Records\label{Table:GiteaDomain}}\\
|
|
\toprule
|
|
\textbf{Item} & \textbf{Value} & \textbf{Evidence or Purpose}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Item} & \textbf{Value} & \textbf{Evidence or Purpose}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
Domain & \texttt{sespinal590.dev} & Registered with the GitHub Student Developer Pack through Name.com.\\
|
|
First-year cost and renewal check & \texttt{\$0.00} first year; \texttt{\$22.99/year} renewal shown in Name.com flow & Confirms both the student-pack discount and the future renewal cost.\\
|
|
Service host & \texttt{git.sespinal590.dev} & Dedicated subdomain for the startup Git server.\\
|
|
DNS type & \texttt{A} record & Maps the Git service name to the Droplet public IPv4 address.\\
|
|
DNS target & \texttt{165.227.90.215} & Public IPv4 address assigned to the DigitalOcean Droplet.\\
|
|
DNS verification & Google DNS, Cloudflare DNS, and Windows resolver & \texttt{nslookup} and \texttt{Resolve-DnsName} returned the same public address.\\
|
|
\end{longtable}
|
|
|
|
\section{Pinned Gitea Deployment}
|
|
The startup Git service runs on a DigitalOcean Basic Droplet using Docker Compose. The Droplet selection intentionally followed the low-cost class direction: Ubuntu 24.04 LTS, regular shared CPU, 1 vCPU, 512 MB RAM, and 10 GB SSD storage at \texttt{\$4/month}.
|
|
|
|
\begin{longtable}{L{3.5cm}L{5.4cm}L{4.0cm}}
|
|
\caption{Startup Hosts and Services\label{Table:GiteaHosts}}\\
|
|
\toprule
|
|
\textbf{Resource} & \textbf{Selected Value} & \textbf{Reason}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Resource} & \textbf{Selected Value} & \textbf{Reason}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
Droplet name & \texttt{sergio-ssw590-gitea} & Human-readable name tying the host to this course and service.\\
|
|
Region & \texttt{NYC1} & Nearby DigitalOcean region for the Stevens team.\\
|
|
Image & \texttt{Ubuntu 24.04 LTS x64} & Current long-term support Linux image.\\
|
|
Plan & \texttt{s-1vcpu-512mb-10gb} & Lowest-cost plan available in the create Droplet flow.\\
|
|
Public IPv4 & \texttt{165.227.90.215} & External address used by DNS and browser testing.\\
|
|
Private IPv4 & \texttt{10.116.0.3} & Internal VPC address, not exposed directly to users.\\
|
|
SSH key & \texttt{espinKey1DigitalOceanDroplet} & Key-based access for administration.\\
|
|
\end{longtable}
|
|
|
|
The service stack uses pinned container image versions so future rebuilds are predictable.
|
|
|
|
\begin{longtable}{L{3.0cm}L{4.7cm}L{5.2cm}}
|
|
\caption{Pinned Container Versions\label{Table:GiteaContainers}}\\
|
|
\toprule
|
|
\textbf{Container} & \textbf{Image} & \textbf{Role}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Container} & \textbf{Image} & \textbf{Role}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
\texttt{gitea} & \texttt{gitea/gitea:1.27.3} & Hosts the startup source-code repositories, issues, and pull requests.\\
|
|
\texttt{caddy} & \texttt{caddy:2.10.2} & Terminates HTTPS and reverse proxies requests to Gitea.\\
|
|
\end{longtable}
|
|
|
|
Docker was installed from Docker's official Ubuntu repository. The installation was verified with \texttt{docker run --rm hello-world}. The final Docker Compose deployment publishes only Caddy's web ports to the public internet; Gitea is reachable only on the private Docker network.
|
|
|
|
\begin{lstlisting}[caption={Final service shape from Docker},label={Listing:GiteaDockerPs}]
|
|
NAMES IMAGE PORTS
|
|
caddy caddy:2.10.2 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp
|
|
gitea gitea/gitea:1.27.3 22/tcp, 3000/tcp
|
|
\end{lstlisting}
|
|
|
|
\section{Database and Persistence}
|
|
Gitea was configured with SQLite for this small course startup deployment. SQLite is acceptable here because the assignment needs a working Git service with issues, pull requests, and documentation evidence rather than a high-traffic production installation. The database file is stored in the Docker-mounted Gitea data directory:
|
|
|
|
\begin{lstlisting}[caption={Persistent Gitea storage layout},label={Listing:GiteaStorage}]
|
|
/opt/gitea/data
|
|
/opt/gitea/data/gitea/gitea.db
|
|
\end{lstlisting}
|
|
|
|
Persistence was verified by creating real startup artifacts, replacing the Gitea container, and confirming that the artifacts still existed after the service returned.
|
|
|
|
\begin{longtable}{L{3.4cm}L{9.8cm}}
|
|
\caption{Persistence Verification\label{Table:GiteaPersistence}}\\
|
|
\toprule
|
|
\textbf{Check} & \textbf{Observed Result}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Check} & \textbf{Observed Result}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
Before replacement & Repository \texttt{group10-startup/startup-product} existed with five issues.\\
|
|
Replacement action & \texttt{docker compose rm -sf gitea} followed by \texttt{docker compose up -d}.\\
|
|
After replacement & The same repository and issue records were still present in SQLite.\\
|
|
Conclusion & Gitea application state is stored outside the disposable container layer.\\
|
|
\end{longtable}
|
|
|
|
\section{HTTPS and Certificate Renewal}
|
|
Caddy was added as the internet-facing reverse proxy so users visit Gitea with HTTPS instead of the temporary setup URL on port 3000. The Caddy configuration is intentionally small:
|
|
|
|
\begin{lstlisting}[caption={Caddy reverse proxy configuration},label={Listing:Caddyfile}]
|
|
git.sespinal590.dev {
|
|
encode zstd gzip
|
|
reverse_proxy gitea:3000
|
|
}
|
|
\end{lstlisting}
|
|
|
|
Gitea was then configured with the final root URL \texttt{https://git.sespinal590.dev/}. Caddy obtained a Let's Encrypt certificate automatically. The verified certificate subject was \texttt{CN = git.sespinal590.dev}, issued by Let's Encrypt \texttt{YE1}, valid from September 28, 2026 to December 27, 2026.
|
|
|
|
\begin{longtable}{L{4.0cm}L{9.2cm}}
|
|
\caption{HTTPS Verification\label{Table:GiteaHttps}}\\
|
|
\toprule
|
|
\textbf{Test} & \textbf{Result}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Test} & \textbf{Result}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
HTTP request & \texttt{http://git.sespinal590.dev/} returned \texttt{308 Permanent Redirect}.\\
|
|
HTTPS request & \texttt{https://git.sespinal590.dev/} returned \texttt{HTTP/2 200}.\\
|
|
Browser check & The Gitea home page loaded with title \texttt{SSW 590 Startup Gitea}.\\
|
|
Certificate automation & Caddy logs showed successful ACME challenge completion and certificate storage.\\
|
|
Renewal readiness & Caddy stores certificate state in its persistent data volume and reported automatic HTTPS management in the logs. A real renewal cannot be observed until the certificate approaches expiration, but the renewal path is enabled by Caddy's managed certificate storage.\\
|
|
\end{longtable}
|
|
|
|
\section{Firewall and External Exposure}
|
|
A DigitalOcean Cloud Firewall was attached to the Droplet. The firewall keeps administrative access narrow while allowing normal web users to reach the startup Git service.
|
|
|
|
\begin{longtable}{L{2.0cm}L{2.0cm}L{2.2cm}L{6.8cm}}
|
|
\caption{Inbound Firewall Rules\label{Table:GiteaFirewall}}\\
|
|
\toprule
|
|
\textbf{Type} & \textbf{Protocol} & \textbf{Port} & \textbf{Source}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Type} & \textbf{Protocol} & \textbf{Port} & \textbf{Source}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
SSH & TCP & 22 & Sergio's current public IP only: \texttt{108.35.145.74/32}.\\
|
|
HTTP & TCP & 80 & All IPv4 and All IPv6, needed for redirects and certificate validation.\\
|
|
HTTPS & TCP & 443 & All IPv4 and All IPv6, needed for normal browser access.\\
|
|
\end{longtable}
|
|
|
|
External exposure was tested from the workstation after the firewall was created. Ports 80 and 443 were reachable. Port 3000 was not reachable externally, which is the desired result because Gitea should sit behind Caddy.
|
|
|
|
\begin{longtable}{L{3.0cm}L{2.0cm}L{8.2cm}}
|
|
\caption{External Port Verification\label{Table:GiteaPorts}}\\
|
|
\toprule
|
|
\textbf{Target} & \textbf{Result} & \textbf{Meaning}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Target} & \textbf{Result} & \textbf{Meaning}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
\texttt{git.sespinal590.dev:80} & Pass & HTTP redirect endpoint is available.\\
|
|
\texttt{git.sespinal590.dev:443} & Pass & HTTPS service is available.\\
|
|
\texttt{git.sespinal590.dev:3000} & Blocked & Direct Gitea port is not exposed publicly.\\
|
|
\texttt{git.sespinal590.dev:5432} & Blocked & No database port is exposed publicly.\\
|
|
\end{longtable}
|
|
|
|
\section{Startup Team Workflow}
|
|
The Gitea instance was not left as an empty installation. A startup organization, repository, issues, branches, pull requests, review account, and merges were created to show the group can use the service as a small startup source-control platform.
|
|
|
|
\begin{longtable}{L{4.0cm}L{9.2cm}}
|
|
\caption{Startup Workspace Records\label{Table:GiteaWorkflow}}\\
|
|
\toprule
|
|
\textbf{Artifact} & \textbf{Evidence}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Artifact} & \textbf{Evidence}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
Organization & \texttt{group10-startup}.\\
|
|
Repository & \texttt{group10-startup/startup-product}.\\
|
|
Administrator & Sergio's \texttt{sespinal} account.\\
|
|
Review account & A separate non-admin reviewer account was created for pull-request testing.\\
|
|
Open issues & Runbook, persistent-storage verification, and HTTPS/firewall evidence issues remained open for continued operations.\\
|
|
\end{longtable}
|
|
|
|
The startup backlog was created as Gitea issues so planned work is visible and reviewable.
|
|
|
|
\begin{longtable}{L{1.5cm}L{5.3cm}L{2.0cm}L{4.0cm}}
|
|
\caption{Startup Backlog Evidence\label{Table:GiteaBacklog}}\\
|
|
\toprule
|
|
\textbf{Issue} & \textbf{Title} & \textbf{Status} & \textbf{Evidence}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Issue} & \textbf{Title} & \textbf{Status} & \textbf{Evidence}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
\texttt{\#1} & Draft startup product vision & Closed & Closed by reviewed and merged pull request \texttt{\#6}.\\
|
|
\texttt{\#2} & Add initial feature backlog & Closed & Closed by reviewed and merged pull request \texttt{\#7}.\\
|
|
\texttt{\#3} & Document Gitea operating runbook & Open & Retained as follow-up operations work.\\
|
|
\texttt{\#4} & Verify persistent storage after container replacement & Open & Used to track persistence evidence and future repeat checks.\\
|
|
\texttt{\#5} & Prepare HTTPS and firewall evidence & Open & Used to track security and exposure evidence.\\
|
|
\end{longtable}
|
|
|
|
Two issue-driven pull requests were completed:
|
|
|
|
\begin{enumerate}[leftmargin=*]
|
|
\item Issue \texttt{\#1}, ``Draft startup product vision,'' was closed by pull request \texttt{\#6}, ``Document product vision.'' The feature branch commit was \texttt{904d468}. The reviewer account reviewed the pull request before it was merged.
|
|
\item Issue \texttt{\#2}, ``Add initial feature backlog,'' was closed by pull request \texttt{\#7}. The branch was updated after a merge conflict and merged after review. The final branch-update commit was \texttt{95573e8}.
|
|
\end{enumerate}
|
|
|
|
This verifies that the startup can use Gitea for the basic DevOps collaboration loop: create an issue, create a branch, make a change, open a pull request, review it with another account, merge it, and close the issue.
|
|
|
|
\section{Architecture and Operation}
|
|
Figure~\ref{Figure:GiteaArchitecture} summarizes the deployed architecture.
|
|
|
|
\begin{figure}[htbp]
|
|
\centering
|
|
\fbox{\begin{minipage}{0.88\linewidth}
|
|
\centering
|
|
\textbf{User Browser}\\
|
|
\texttt{https://git.sespinal590.dev}\\[4pt]
|
|
$\Downarrow$\\[4pt]
|
|
\textbf{Name.com DNS}\\
|
|
\texttt{git.sespinal590.dev -> 165.227.90.215}\\[4pt]
|
|
$\Downarrow$\\[4pt]
|
|
\textbf{DigitalOcean Cloud Firewall}\\
|
|
Allow 80/443 publicly; allow 22 only from Sergio's current IP\\[4pt]
|
|
$\Downarrow$\\[4pt]
|
|
\textbf{Caddy Container}\\
|
|
Automatic HTTPS and reverse proxy\\[4pt]
|
|
$\Downarrow$\\[4pt]
|
|
\textbf{Gitea Container}\\
|
|
Repository, issues, pull requests, and users\\[4pt]
|
|
$\Downarrow$\\[4pt]
|
|
\textbf{Persistent Volume}\\
|
|
\texttt{/opt/gitea/data/gitea/gitea.db}
|
|
\end{minipage}}
|
|
\caption{Startup Gitea deployment architecture}
|
|
\label{Figure:GiteaArchitecture}
|
|
\end{figure}
|
|
|
|
\begin{longtable}{L{4.2cm}L{9.0cm}}
|
|
\caption{Operational Controls\label{Table:GiteaControls}}\\
|
|
\toprule
|
|
\textbf{Control} & \textbf{Implementation}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Control} & \textbf{Implementation}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
Least privilege network access & Only ports 80 and 443 are public. SSH is restricted to a single public IP source.\\
|
|
No direct application port & Port 3000 is internal to Docker after Caddy was installed.\\
|
|
Pinned runtime versions & Gitea and Caddy container image tags are fixed instead of floating latest tags.\\
|
|
Persistent data & Gitea state is stored on the host-mounted data directory, not only inside the container filesystem.\\
|
|
Temporary credential cleanup & Temporary \texttt{codex-*} API tokens were deleted after setup.\\
|
|
Sensitive information handling & Passwords, payment details, personal address, and phone information are not stored in this manual.\\
|
|
\end{longtable}
|
|
|
|
\section{Rubric Evidence Checklist}
|
|
Table~\ref{Table:GiteaRubricEvidence} maps the Chapter 2 rubric to the evidence in this manual.
|
|
|
|
\begin{longtable}{L{4.8cm}L{2.0cm}L{6.4cm}}
|
|
\caption{Rubric Evidence Checklist\label{Table:GiteaRubricEvidence}}\\
|
|
\toprule
|
|
\textbf{Rubric Criterion} & \textbf{Status} & \textbf{Evidence in This Chapter}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Rubric Criterion} & \textbf{Status} & \textbf{Evidence in This Chapter}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
Student Pack domain, cost/renewal check, DNS evidence & Complete & Table~\ref{Table:GiteaDomain} records the domain, first-year cost, renewal cost, DNS target, and resolver checks.\\
|
|
Pinned Gitea deployment and reproducible configuration & Complete & Tables~\ref{Table:GiteaHosts} and~\ref{Table:GiteaContainers} plus Listing~\ref{Listing:GiteaDockerPs} record the host, image versions, and container exposure.\\
|
|
Database configuration and persistence verification & Complete & Listing~\ref{Listing:GiteaStorage} and Table~\ref{Table:GiteaPersistence} record SQLite storage and container replacement verification.\\
|
|
Valid HTTPS, redirect, certificate details, renewal test & Complete & Table~\ref{Table:GiteaHttps} records HTTP redirect, HTTPS success, certificate details, and Caddy renewal readiness.\\
|
|
Firewall, limited exposure, external verification & Complete & Tables~\ref{Table:GiteaFirewall} and~\ref{Table:GiteaPorts} record allowed ports and blocked direct service/database ports.\\
|
|
Startup organization, backlog, issue-to-review-merge workflow & Complete & Tables~\ref{Table:GiteaWorkflow} and~\ref{Table:GiteaBacklog} plus the pull-request notes record organization, backlog, reviews, and merges.\\
|
|
Architecture and operational explanation & Complete & Figure~\ref{Figure:GiteaArchitecture} and Table~\ref{Table:GiteaControls} explain the operational structure and controls.\\
|
|
Versioned IT manual, history, Hosts/Passwords hints, citations and evidence & Complete & Document History records version 1.5; Tables~\ref{Table:GiteaHosts} and~\ref{Table:GiteaPasswordHints} record hosts and password-handling hints; citations appear in the chapter introduction and bibliography.\\
|
|
\end{longtable}
|
|
|
|
\section{Manual Quality and Controls}
|
|
\begin{longtable}{L{4.1cm}L{9.1cm}}
|
|
\caption{Password Hint and Secret Handling Controls\label{Table:GiteaPasswordHints}}\\
|
|
\toprule
|
|
\textbf{Item} & \textbf{Manual Rule}\\
|
|
\midrule
|
|
\endfirsthead
|
|
\toprule
|
|
\textbf{Item} & \textbf{Manual Rule}\\
|
|
\midrule
|
|
\endhead
|
|
\bottomrule
|
|
\endlastfoot
|
|
DigitalOcean account & Payment details are entered manually by the account owner and are not recorded.\\
|
|
Name.com account & Contact, address, phone, and payment details are excluded from screenshots or text.\\
|
|
Gitea administrator password & Password is known only to the account owner and is not placed in Git, Overleaf, screenshots, or prompts.\\
|
|
Review account password & Used only for testing the review flow and should be rotated or replaced before real group use.\\
|
|
API tokens & Temporary setup tokens are deleted when no longer needed.\\
|
|
\end{longtable}
|
|
|
|
The main documentation risk is that screenshots may accidentally include personal information. Any screenshot from the Name.com order page must be cropped or redacted before inclusion because the original confirmation page displayed contact details. Any screenshot from Gitea should avoid showing passwords, session tokens, or private browser profile details.
|
|
|
|
\section{Optional Extra Credit: Backup and Restore}
|
|
An additional backup and restore test was performed to demonstrate recoverability. The backup procedure produced an application data archive, a SQLite database backup, and a checksum file:
|
|
|
|
\begin{lstlisting}[caption={Backup files retained on the Droplet},label={Listing:GiteaBackups}]
|
|
/opt/gitea-backup-test/backups/gitea-data-20260929T063202Z.tar.gz
|
|
/opt/gitea-backup-test/backups/gitea-db-20260929T063202Z.sqlite
|
|
/opt/gitea-backup-test/backups/gitea-backup-20260929T063202Z.sha256
|
|
\end{lstlisting}
|
|
|
|
The restore test was intentionally isolated from production. A separate restore directory and container were used on \texttt{127.0.0.1:3001}. The restored service returned \texttt{HTTP/1.1 200 OK} for the startup repository page. A database query against the restored copy showed the expected repository and issue records, including the merged pull requests and remaining open operations issues.
|
|
|
|
\begin{devopsNote}[Extra Credit Result]
|
|
The restore container was shut down after verification. The backup files remain on the Droplet for evidence, while the production Gitea and Caddy containers continue to serve \texttt{https://git.sespinal590.dev/}.
|
|
\end{devopsNote}
|