Outpost
Run Gitea, Docker, Swarm or k3s on servers that never touch the internet.
Outpost is a small Python tool you run on your laptop. It reads your projects' lockfiles, downloads everything they need while you have internet, pushes it into one Gitea server, and configures your other servers to use only that Gitea. Builds and deployments then work with the internet switched off, and every server rejects any attempt to reach outside, with a firewall rule you can read and a verification table you can show.
flowchart LR
I(("internet")) -- "outpost fetch" --> L["laptop<br/>needs/*.yml → box/"]
L -- "outpost upload (ssh)" --> G["Gitea server · sealed<br/>PyPI · npm · apt · apk · rpm · images · git · CI"]
L -- "outpost infra setup (ssh)" --> N["nodes · sealed<br/>Compose · Swarm · k3s"]
N -- "https: everything they need" --> G
The demo app, built and deployed by Gitea Actions on a sealed node. It probes the internet at build time and on every page load.
Contents
- Why
- Highlights
- Try it in twenty minutes
- What you write
- How it works
- The dashboard
- What it proves
- Commands
- Compared with
- FAQ
- Documentation
- Project layout and tests
- Status and limits
Why
Public registries are a hidden dependency of every build. pip install talks to pypi.org,
npm install to npmjs.org, apt-get to deb.debian.org, FROM python:3.12 to Docker Hub,
and nothing writes any of it down. When they are unreachable, blocked or compromised,
nothing ships, and nobody can say what the system actually needed.
An air-gapped setup is the strict answer, and the usual way there is heavy: a PyPI mirror, an npm mirror, an apt mirror, a container registry, a git server and a CI system, each with its own install, storage and upgrade path. Outpost's claim is that one small tool and one server are enough, and that the result should be simple enough to understand in an afternoon:
- Gitea is one static binary with built-in registries for PyPI, npm, Debian, Alpine, RPM, container images and plain files, plus git hosting and CI. It replaces five services.
- The laptop needs Python and
ssh. The servers needsshand nothing else. - The list of what a system needs becomes a file you can read, diff and review.
- The firewall turns "we think it is offline" into "here is the table that says so".
Highlights
- One command per step, in the order you use them:
init,fetch,gitea setup,upload,infra setup,check,demo push. Every step is idempotent and logged. - Lockfiles as input.
uv.lock,poetry.lock,Pipfile.lock,requirements*.txt,package-lock.json,pnpm-lock.yaml,yarn.lock, plus images, OS packages and files with a URL. - Three OS package families. apt for Debian and Ubuntu, apk for Alpine, rpm for Rocky, Alma, Fedora and CentOS Stream, each resolved with the real package manager inside a container of the real distro, so the full dependency tree lands in Gitea's Debian, Alpine or RPM registry.
- Three runtimes from one Gitea. Docker Compose nodes, a Docker Swarm, or a k3s cluster,
declared in a 15-line
servers.yml. One node can serve several infrastructures. - A real seal. iptables rejects outbound internet for the host and for its containers and
pods, with a kernel-level backstop in the
securitytable that stays effective whatever Docker or k3s add to the firewall. Open it on purpose with a logged reason. - Named exceptions, by name. When an app must call
api.twilio.comor an e-mail API behind a CDN, list the names underegress_proxyinservers.yml: one tinyproxy from Gitea, sealed with a single exception for its own user, lets through only those names (TLS stays end to end), logs every request, and workloads opt in withHTTPS_PROXY. A program that does not opt in is still sealed. See named exceptions. - Dockerfiles change by two lines.
FROMnames the Gitea copy of the base image (${GITEA}/pkgs/library/python:3.12-slim), andCOPY --from=config / /brings pip, npm, apt, apk, dnf and CA configuration into the build. Nothing on a node rewrites image names: a bare Docker Hub name fails at once, like every other reach for the internet. - CI that cannot cheat. Gitea Actions runners on the nodes, in host mode: a job is a shell script on a sealed node, under the same rules as everything else.
- A demo you can audit. A Flask site whose Dockerfile refuses to build if the internet answers, deployed to Compose, Swarm and k3s by one workflow.
- A dashboard for people who do not type commands. Home answers three questions (downloaded? on the server? sealed and working?), Machines shows every server and what it runs, each step says what the button will do before you press it, progress is narrated, failures are translated into a sentence and a fix, and the history reads like a diary.
- Day two is covered.
gitea backupandrestore(and an automatic backup before a Gitea upgrade),hostsfor versions and drift,infra upgradefor OS security updates served by Gitea,pki rotatefor the CA,reportfor one HTML page of evidence. - A lab.
outpost lab upmakes throwaway servers in Docker (systemd, sshd, real iptables), so the whole flow runs on one machine. The integration tests use the same lab. - No framework. About 13,000 lines of Python (with docstrings), standard library plus PyYAML.
Servers get shell scripts and static binaries you can read in
outpost/infra/.
Try it in twenty minutes
Needs Python 3.11+, ssh, openssl and Docker on your machine.
pipx install outpost-airgap # the command is outpost
outpost init my-workspace && cd my-workspace
outpost lab up # four "servers" in Docker; servers.yml written for them
outpost fetch # the demo's needs + Gitea, Docker, k3s, CoreDNS, the runner → box/
outpost gitea setup # Gitea on https://172.31.252.10, with a private CA, sealed
outpost upload # the box → Gitea's registries, plus the config image
outpost infra setup dev # a Compose node: configured, sealed, Docker installed from Gitea, verified
outpost infra setup prod # a two-node Swarm
outpost infra setup k8s # a k3s server
outpost check --infra dev # build and run on the sealed node; a container cannot reach pypi.org
outpost demo push # Gitea Actions builds the demo and deploys it to all three
Setup ends with a verification table for every node:
==> verifying dev
lab-node-1: all good
ok gitea in /etc/hosts
ok gitea name restored at boot
ok gitea reachable with trusted TLS
ok system trust store has the CA
ok pip points at gitea
ok npm points at gitea
ok package sources are gitea only
ok node dns for containers running
ok package index updates offline
ok egress sealed
ok public internet rejected
ok egress seal survives reboot
ok routed traffic sealed too (containers, pods)
ok egress script is the current one
ok egress seal starts before the network
ok ipv6 sealed too
ok coredns at pinned version 1.15.0
ok pip.conf unchanged
ok docker running
ok docker at pinned version 29.9.2
ok compose at pinned version 5.6.1
ok compose plugin
ok buildx plugin
ok docker trusts and reaches gitea registry
ok container egress hooked
ok actions runner active
ok runner at pinned version 5.2.2
With an egress_proxy in servers.yml, every node's table has three more lines (after the
node's own, before Docker's), and outpost proxy setup prints the proxy host's own table:
ok proxy settings for programs that opt in
ok proxy reachable (example.org through the proxy -> 200)
ok proxy refuses unknown names (CONNECT example.com -> 403)
Then open http://172.31.252.21:8000 (Compose), :8080 (Swarm) or http://172.31.252.30:30080
(k3s). The page says No internet at build time, no internet now and lists what it probed.
The pipeline is at https://172.31.252.10/pkgs/demo/actions.
With real servers, replace lab up by SSH aliases in servers.yml; nothing else changes.
The guide walks through every step and what it does on
the servers.
What you write
servers.yml, using aliases from ~/.ssh/config (root, or a user with passwordless sudo):
gitea:
host: gitea-1
name: gitea.internal # any name; nodes learn it from /etc/hosts, no DNS needed
infrastructures:
dev: {type: compose, nodes: [dev-1]}
prod: {type: swarm, nodes: [prod-1, prod-2, prod-3]}
k8s: {type: k3s, nodes: [k8s-1, k8s-2]}
needs/my-api.yml, pointing at lockfiles you already have:
python: "3.12"
images: [python:3.12-slim, postgres:16]
pypi: [{file: ../../my-api/uv.lock}]
npm: [{file: ../../my-web/package-lock.json}]
apt: {distro: bookworm, packages: [libpq-dev]}
apk: {branch: v3.20, packages: [curl]} # for an alpine:3.20 base
rpm: {distro: rocky9, packages: [git]} # for a rockylinux:9 base
files: [{url: https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64, name: jq, version: "1.7.1"}]
And two lines in each Dockerfile: the base image by its Gitea name, and the config image copied in:
ARG GITEA
FROM ${GITEA}/pkgs/config:latest AS config
FROM ${GITEA}/pkgs/library/python:3.12-slim # the Gitea copy of python:3.12-slim
COPY --from=config / /
# apt-get, pip and npm now use Gitea (apk add on an Alpine base, dnf install on a RHEL one). Nothing else changes.
How it works
| step | on the laptop | on the servers |
|---|---|---|
fetch |
reads needs and lockfiles; pulls images with a small OCI client, wheels with pip download for the server's platform, OS packages with apt, apk or dnf inside a container of the right distro; writes box/manifest.json |
nothing |
gitea setup |
creates a private CA and a server certificate with openssl |
copies the Gitea binary from the box over scp; writes app.ini (HTTPS 443, SQLite, registries and Actions on); creates the admin user, token and organisation; seals the host |
upload |
verifies the box against its manifest; opens an SSH tunnel to port 443 | receives every file into the matching registry (409 for files it has); the config image is built on the laptop and pushed |
infra setup |
writes /etc/hosts, the CA, pip.conf, npmrc, an apt, apk or dnf source (by the node's family); seals; then downloads CoreDNS, Docker (with daemon.json) or k3s (with registries.yaml) and the Actions runner from Gitea, restarting a runtime only when its config changed; verifies |
|
check, demo push |
runs smoke checks over SSH; commits the demo through Gitea's API | the runner builds the image on the node; the deploy jobs run compose up, stack deploy or kubectl apply and wait until the node serves the new commit |
Five ideas carry the design:
- Gitea is the local internet. Every client speaks its native protocol to Gitea, and
everything lives under one organisation: wheels, tarballs, packages, files, and images as
pkgs/<owner>/<image>(library/python,bitnami/redis,org/appforghcr.io/org/app). Dockerfiles and manifests name that copy explicitly; nothing on a node rewrites names. - The box is a folder. A manifest with a SHA-256 per file, optionally packed into signed
tar.xzfiles for USB sticks or GitHub releases. - Seal first, install after. Docker, k3s, CoreDNS and the runner are fetched from Gitea with the internet already blocked. Setup finishing is itself the proof the box was complete.
- Reject, and reject below the clients. One iptables chain in the
filtertable (REJECT, so failures are instant and name the host) and again in thesecuritytable (DROP, evaluated last, so no runtime's rules can get ahead of it). - A config image and a node DNS. The same generated files go to every host and into
pkgs/config:latest; CoreDNS on each node answers the Gitea name for containers, because pip refuses HTTPS to a bare IP and containers cannot see/etc/hosts.
The architecture pages have the long version, and decisions records what we tried on the way, including the hole where k3s pods could reach the internet while the host could not, and how it was closed.
The dashboard
outpost ui opens a local page over the same workspace. It only edits files and runs
CLI commands, and prints the command behind every button, so it doubles as a tutorial. It is
written for someone who has never opened a terminal: pages are named for what they are about,
every action says what it will do, which machines it touches and how long it takes, a running
command shows its steps, and a failed one is explained in a sentence with what to do.
Home: is everything downloaded, does the local server have it, are the servers sealed and working.
Machines: every server, its internet switched off, what runs on it, when it was last looked at.
Deploy: one workflow, three infrastructures, every node serving the pushed commit, sealed at build time and now.
What it proves
| claim | enforced by | checked by |
|---|---|---|
| a node builds and runs with the internet off | every client points at Gitea; the box held what the build needed | outpost check; the demo's build-time probe |
| a node cannot reach the public internet | iptables REJECT on OUTPUT and FORWARD, DROP backstop in security |
verify; the demo page's live probe |
| containers and pods are sealed too | the same chains on routed traffic | hello-python and hello-k3s checks |
| the seal survives a reboot | a oneshot unit before Docker and k3s | verify |
| every exception is written down and every opening is logged | allow: in servers.yml; /var/log/outpost-egress.log |
iptables -S OUTPOST; the node page |
| a named exception reaches only its names, and only for programs that ask | the egress proxy's allow list; one owner match for its user on TCP 443 and 80, on its host only | outpost proxy verify; proxy refuses unknown names on every node; hello-proxy checks; /var/log/tinyproxy/tinyproxy.log |
Not covered: root on a node can remove the rule (and it will be logged); Gitea is a single server with no HA; content is mirrored as the lockfiles say, not vetted; inbound ports are your provider's firewall; with an egress proxy, an allowed name is allowed for any workload that opts in, and DNS (port 53) stays open to any resolver. The full list.
Commands
| command | does |
|---|---|
outpost init [folder] |
create a workspace: servers.yml, needs/, checks/, demo/ |
outpost needs |
print the merged needs, with the pinned downloads |
outpost fetch [--only kinds] |
download into box/; incremental |
outpost pack [--out dist] |
signed tar.xz per kind, for releases or USB |
outpost gitea setup / info |
install or upgrade Gitea (backup first); show its address and seal |
outpost gitea backup / restore <archive> |
archive Gitea's data to backups/; put it back |
outpost upload [source ...] |
box folder or archives → Gitea |
outpost infra setup <name> / verify <name> / upgrade <name> / list |
configure, seal, install, verify; OS updates from Gitea |
outpost check [name] --infra <name> |
smoke checks on the sealed node |
outpost demo push / status |
deploy the demo through Gitea Actions; see the runs and what nodes serve |
outpost egress <target> seal|open|status [--reason] |
seal, open or show the seal on Gitea, an infrastructure or one server |
outpost proxy setup / verify |
the egress proxy for egress_proxy in servers.yml: install, seal, update the nodes, verify |
outpost ui [--port 8484] |
the dashboard |
outpost lab up [--small] / down |
throwaway servers in Docker |
outpost hosts [--refresh] |
what every server runs: versions, seal, workloads, drift |
outpost pki rotate |
new CA and certificate, pushed to Gitea, the config image, the egress proxy host and every node |
outpost report [--out file] |
the proof report as one HTML page |
--dir <folder> selects another workspace. Full reference,
day-two commands.
Compared with
| Outpost | a stack of mirrors (devpi, Verdaccio, aptly, registry, git, CI) | Nexus / Artifactory | |
|---|---|---|---|
| services to run | one (Gitea) | five or six | one, large |
| install | a Python tool over SSH; servers need nothing | each by hand or with configuration management | a JVM application, a database, storage planning |
| what is mirrored | exactly what the lockfiles list, written down in needs/ |
usually proxy caches: whatever was requested once | proxy or hosted repositories |
| proof of isolation | iptables seal on every server, verify table, probes inside builds |
not included | not included |
| CI inside the gap | Gitea Actions runners on the nodes | separate | separate |
| scope | small teams and labs that want to understand every piece | flexible | enterprise |
Outpost is not a replacement for a large artifact server with fine-grained access control, replication and retention policies. It is for the case where you want the whole thing to fit in your head.
FAQ
Does the laptop need to be inside the sealed network? No. It needs SSH to the servers.
Gitea's API is reached through an SSH tunnel, so wherever ssh gitea-1 works, everything works.
Can I use my own Gitea? Not yet. Outpost installs and configures Gitea with its own
app.ini and certificate so that every later step can assume the layout.
What about images from ghcr.io or quay.io? Fetched, uploaded and referenced like any
other: ghcr.io/org/app:1.4 becomes gitea.internal/pkgs/org/app:1.4, exactly as
python:3.12-slim becomes gitea.internal/pkgs/library/python:3.12-slim. Docker Hub is not a
special case; a bare FROM python:3.12-slim on a sealed node fails at once, on purpose.
Security updates for the OS? Mirrored only for the packages you list, in
needs/os-updates.yml. Fetch, upload, then outpost infra upgrade <name> installs them from
Gitea with the nodes still sealed. See day two.
ARM servers? Wired through but not yet run on ARM servers: arch: arm64 in servers.yml
fetches wheels, images and binaries for aarch64. The default is amd64.
Why not DROP everything instead of REJECT? Because a rejected connection fails in
milliseconds with the name of the host, which turns the firewall into a to-do list. The
security table backstop does drop, as the kernel allows nothing else there.
Is the box reproducible? The box is what the lockfiles resolve to at fetch time. Pin versions in lockfiles and the box is the same each time; the manifest lets you compare two.
Documentation
Start at docs/index.md. The docs come in two tracks.
Use and understand Outpost. The quickstart; the guide, ten chapters from the idea to a deployed app; the architecture, with a walkthrough of three commands through the code and a code map; the reference; the glossary.
Learn. The course teaches systems engineering from zero, with Outpost's own code as the example: ssh, systemd, routes and DNS, the kernel firewall, TLS and a private CA, package managers, container images, orchestrators, CI and security, with exercises on the lab and the real mistakes made along the way. It makes this repository a place to learn how such systems work, not only a tool to use.
To change Outpost: development, CONTRIBUTING.md, and design/ for why it looks like this.
The docs are Markdown with Mermaid diagrams and render on GitHub as they are. mkdocs.yml
publishes them as a site: uvx --with mkdocs-material mkdocs serve.
Project layout and tests
outpost/
cli/ the commands, one file each
workspace.py the workspace folder: paths, state, secrets
config/ servers.yml and mirrors.yml, read and checked
system.py AirGappedSystem: one workspace's config, state, secrets and servers, passed to every command
endpoints.py where Gitea and the egress proxy are, as clients see them
needs/ fetch/ needs files and lockfiles; one fetcher per kind (images, pypi, npm, apt, apk, rpm, files)
box.py oci/ manifest, pack, sign; pull and push images over HTTP
ssh/ http.py Host.run / write / put / get, the Tunnel; urllib with a private CA
pki.py CA, server certificate, box signing, with the openssl CLI
gitea/ setup over ssh, upload, backup, connect (tunnel), client (API), packages (registries)
egress.py the seal: the outpost-egress script, its boot unit, seal and open
hostsfile.py the Gitea name in /etc/hosts, kept across reboots
client_config/ the pip, npm, apt, apk, dnf and Docker files that point at Gitea
infra/ node/ (the steps every node shares), compose, swarm, k3s, runner, verify, upgrade, proxy/
checks/ demo/ smoke checks; the demo project's workflow, push and status
hosts/ one SSH round trip per server: versions, seal, workloads, cached in state/hosts/
report/ the proof report, one HTML page from state/
ui/ the dashboard: server.py (routes), overview.py, status/, projects/, explain.py, index.html
lab.py throwaway servers in Docker
templates/ what `outpost init` copies, and the lab server's Dockerfile
tests/ unit tests with a fake SSH host and a fake Gitea speaking real HTTP
tests/integration real Gitea container and Docker Hub; the full flow on the lab (fetch, a Gitea upgrade,
backup and restore, compose, swarm, k3s, the demo, a reboot, the dashboard's server side)
docs/ the quickstart, the guide, the architecture, the reference, the course (docs/learn/), development
design/ why it looks like this: decisions, change records, history
scripts/ check.sh (every gate), format.sh
scripts/check.sh # format check, lint, types, unit tests and docs links; no network
OUTPOST_INTEGRATION=1 python -m pytest -q tests/integration # 30+ minutes; Docker and the internet
Status and limits
Version 0.1.0. Tested end to end: the integration suite installs the previous Gitea on a throwaway systemd container over SSH, upgrades it to the pinned one with a backup first, backs up and restores, uploads a real box, sets up and seals a Compose node, a two-node Swarm and a k3s server, builds images on them with apt and pip served by Gitea and the internet rejected, deploys the demo to all three through Gitea Actions, restarts the servers and checks that the seal and the applications come back.
Pinned: Gitea 28.2.0, Docker 29.9.2, Compose 5.6.1, buildx 0.38.1, CoreDNS 1.15.0, k3s v1.37.1+k3s1, Gitea runner 5.2.2. The lab's servers run Ubuntu 24.04; nodes on Alpine and the RHEL family are configured with apk and dnf but are not run end to end yet. amd64 tested, arm64 wired through but not yet run on ARM servers. One Gitea, no HA; backups are a command. Containers stand in for servers in the tests, so a run on real virtual machines is the remaining step before a 1.0. Limits lists what Outpost does not do, on purpose or not yet.
Contributions welcome: CONTRIBUTING.md says how, and the development page explains the layout and the principles (files are the state; one idea per file; no new dependency without a reason). MIT licensed.
Metadata
Release files for outpost-airgap 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| outpost_airgap-0.1.0.tar.gz | 340.1 kB | With provenance | Details for outpost_airgap-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| outpost_airgap-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for outpost_airgap-0.1.0-py3-none-any.whl |
Total release size: 663.7 kB
Release files / outpost_airgap-0.1.0.tar.gz
| Download URL | outpost_airgap-0.1.0.tar.gz |
|---|---|
| Size | 340.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
647b1b1b83ab28b0dfb1e59f34c84bd6091893b8042b59701552e8a658d11f7d
|
|
BLAKE2b-256 checksum How to use checksums |
e0843ebfb99a8617e317a1ed5c20cc951714e61587df085515984b36b36ff2ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logRelease files / outpost_airgap-0.1.0-py3-none-any.whl
| Download URL | outpost_airgap-0.1.0-py3-none-any.whl |
|---|---|
| Size | 323.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
364b619841a18b31e5cafca5eef6199720d27dd7e0a53c830bc0876579caedf4
|
|
BLAKE2b-256 checksum How to use checksums |
694c8be8f49a92b41b3f33bd45f39724fad0e8b6c94fffef948a3a368ce8ac5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logSecurity for outpost-airgap 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for outpost_airgap-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.