You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file defines the standards and requirements for the `geeksbsmrt/RaspberryPi` home lab repository.
4
+
5
+
## 1. Technical Stack
6
+
7
+
-**Primary Scripting**: Bash (.sh) is the preferred language for orchestration and local maintenance.
8
+
-**Orchestration**: Docker Compose for service management.
9
+
-**Excluded**: PowerShell 7 and .NET/C# are discouraged for this repository unless explicitly requested.
10
+
11
+
## 2. Networking & IP Management
12
+
13
+
The environment primarily uses the `192.168.254.0/24` range for Docker containers within the broader `192.168.0.0/16` home network.
14
+
15
+
### Allocation Strategy
16
+
17
+
-**Public Services**: Internet-routable through Caddy. Assigned from the **bottom** of the macvlan range (e.g., `.1`, `.2`, `.3`...).
18
+
-**Internal Services**: Databases, support services (e.g., Unbound). Assigned from the **top** of the macvlan range (e.g., `.254`, `.253`, `.252`...).
19
+
20
+
### Network Isolation
21
+
22
+
-**Rule**: Backend services (Databases, Redis, etc.) should use internal Docker bridge networks where possible. Only front-facing services (Caddy, Pi-hole) or those requiring direct subnet access should be exposed to the `macvlan` network.
-**Container**: Must be named for the service they provide.
28
+
29
+
## 3. Secret Management
30
+
31
+
-**Primary Source**: `secrets.sops.env` (Encrypted via SOPS/AGE).
32
+
-**Secondary**: `docker/.env` (Local plaintext, derived from or kept in sync with SOPS).
33
+
-**Requirement**: The following MUST be placed in both files and encrypted in the `.sops.env`:
34
+
- API keys, passwords, and tokens.
35
+
-**Internal IP addresses** (any IP within the `192.168.0.0/16` range).
36
+
-**Rule**: Never commit `docker/.env` directly to Git.
37
+
38
+
## 4. Security & Industry Standards
39
+
40
+
To ensure the home lab remains secure and stable, the following standards apply:
41
+
42
+
### Container Security
43
+
44
+
-**Image Pinning**: Avoid `:latest` or `:alpine` tags without a version number. All images must be pinned to a specific version (e.g., `image: postgres:16.1-alpine`).
45
+
-**Least-Privilege**: Containers should run as non-root users (`user: "1000:1000"`) where compatible.
46
+
-**Healthchecks**: Every service in `docker-compose.yml` must include a functional `healthcheck`.
47
+
-**Logging Configuration**: Limit log sizes to prevent disk exhaustion (e.g., `max-size: "10m"`, `max-file: "3"`).
48
+
49
+
### Data Persistence
50
+
51
+
-**Standard**: Persistent data volumes should be mapped to a standard path (e.g., `./data/service_name`) or clearly organized within the service directory to simplify backups.
52
+
53
+
### Quality Control
54
+
55
+
-**Linting**: All `docker-compose.yml` and `sh` files must pass `hadolint` and `shellcheck` via pre-commit hooks.
56
+
-**Secret Scanning**: Pre-commit hooks must be active to prevent plaintext leakages.
57
+
58
+
## 5. Operational Workflow
59
+
60
+
-**Git-First Deployment**: All changes MUST be committed to the repository. Deployment is handled by GitHub Actions (`deploy-prod.yaml`).
61
+
-**Emergency Exception (Hotfix)**:
62
+
- In a "Service Down" situation, manual fixes may be applied to the live instance **ONLY after explicit USER permission**.
63
+
- Once verified, changes **MUST** be immediately committed to Git.
64
+
-**Idempotency**: All setup scripts must be safe to run multiple times.
65
+
-**Documentation**: Maintain `ReadMe.md` parity with cluster changes.
Copy file name to clipboardExpand all lines: ReadMe.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,14 @@
5
5
This repository contains configuration files and resources for setting up and managing a Raspberry Pi-based home lab environment. It leverages tools like Docker, pre-commit hooks, and encrypted secrets management to ensure a secure and maintainable setup.
6
6
7
7
## Features
8
+
8
9
- Dockerized Services: Containerized applications for easy deployment and scalability.
sops_age__list_1__map_enc=-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3VDZzb0IvcXAvcWpRY2pK\nL0txc3ZNVFhSN0NJVCswL05LWHhudHl2eGdZCm9JLy9BNlJrdFVsNlM4WmxNNXdY\nVW1pK3AxOVJvTW1SRWNRUTVUT1BseUEKLS0tIGhXTDE3eG9ucnVuY3dsTW1tbUZq\nTWszMjNwVFA1dUxTaTNUbWRvTkJmWUEKr+qniEgTJ5mBQ0wHGxlMQnj3zNWBdkHZ\nlbpdEQbWsSKAdtPvnKvW//A4gUueemGrTHTBkpiAR8svW5JVlpEImw==\n-----END AGE ENCRYPTED FILE-----\n
0 commit comments