diff --git a/AGENT_Context_Project.md b/AGENT_Context_Project.md index 6c0f496..15a080f 100644 --- a/AGENT_Context_Project.md +++ b/AGENT_Context_Project.md @@ -1,4 +1,4 @@ -# AGENT Context — myLinux Project +# AGENT Context — Linux_post_install Project > **Purpose:** Single-source context document so any AI agent can understand the project, navigate the codebase, and make correct contributions. @@ -6,7 +6,7 @@ ## 1. Project Overview -**myLinux** is a personal bootstrap and homelab toolkit for Debian/Ubuntu. One command turns a bare install into a fully productive machine: +**Linux_post_install** is a personal bootstrap and homelab toolkit for Debian/Ubuntu. One command turns a bare install into a fully productive machine: - Automated system package installation (25+ packages) - A unified CLI (`pos`) for network, Docker, media, system, and SSH tasks @@ -14,7 +14,7 @@ - Docker Compose service management via ScaleTail templates (119+ self-hosted services with Tailscale sidecar) - Systemd service management for boot-time automation -**Repository:** `https://github.com/IFindMe/myLinux` +**Repository:** `https://gitea.skink-platy.ts.net/admin/Linux_post_install` **Target OS:** Debian / Ubuntu (uses `apt`) **Shell:** Bash (`#!/usr/bin/env bash`) @@ -23,7 +23,7 @@ ## 2. Directory Structure ``` -myLinux/ +Linux_post_install/ ├── install.sh # Main orchestrator — entry point ├── preinstall.sh # Phase 1: system packages via apt + yt-dlp ├── postinstall.sh # Phase 3: PATH, bash completion, systemd services @@ -112,13 +112,13 @@ User runs: ./install.sh [--apps|--full|--dry-run|--skip |--steps ] │ └─ Copies systemd/*.service → /etc/systemd/system/, enables them │ ├─ Phase 4: ScaleTail clone -│ └─ Shallow-clones ScaleTail templates to /usr/local/share/mylinux/scale-tail +│ └─ Shallow-clones ScaleTail templates to /usr/local/share/linux_post_install/scale-tail │ └─ [if --apps or --full]: apps/install.sh └─ Interactive picker (or --all for non-interactive) ``` -**After install, the repo can be deleted** — all tools live in `/usr/local/bin/` and templates in `/usr/local/share/mylinux/`. +**After install, the repo can be deleted** — all tools live in `/usr/local/bin/` and templates in `/usr/local/share/linux_post_install/`. ### install.sh Flags @@ -133,7 +133,7 @@ User runs: ./install.sh [--apps|--full|--dry-run|--skip |--steps ] ### pos Output Logging -All non-interactive `pos` commands log output to `~/.local/share/mylinux/logs/`: +All non-interactive `pos` commands log output to `~/.local/share/linux_post_install/logs/`: - Per-command files: `YYYYMMDD_HHMMSS_pos_.log` (full stdout+stderr) - Main log: `pos.log` (command + timestamp + exit code for every invocation) - Interactive commands (`system-firewall`, `media-mp4`) only log invocation, not output @@ -181,8 +181,8 @@ These forward to `pos` transparently: `wr-ip`, `wr-checkport`, `wr-scan-ping`, ` `pos-vbox` manages disposable Docker containers as lightweight VMs: -- **Container labeling:** All created containers get `mylinux.vbox=true` label -- **`ls` filtering:** `docker ps --filter label=mylinux.vbox=true` — only shows vbox-managed containers +- **Container labeling:** All created containers get `linux_post_install.vbox=true` label +- **`ls` filtering:** `docker ps --filter label=linux_post_install.vbox=true` — only shows vbox-managed containers - **Post-create prompt:** After `create`, asks "Enter now? [Y/n]" using `confirm` helper - **Working dir detection:** `enter` auto-detects bind mount path from container labels - **Custom dirs:** `--dir ` or `--dir .` for current directory @@ -224,12 +224,12 @@ source "$(dirname "$0")/../lib/common.sh" ScaleTail provides 119+ Docker Compose templates with a Tailscale sidecar pattern (`network_mode: service:tailscale`). Each service gets a `tail-xxxxx.ts.net` URL with optional automatic HTTPS. ``` -/usr/local/share/mylinux/scale-tail/ # Templates (git repo) +/usr/local/share/linux_post_install/scale-tail/ # Templates (git repo) └── services// ├── compose.yaml └── .env -~/.config/mylinux/compose.env # Global defaults (TS_AUTHKEY, TZ, DNS_SERVER, SERVICES_BASE) +~/.config/linux_post_install/compose.env # Global defaults (TS_AUTHKEY, TZ, DNS_SERVER, SERVICES_BASE) /srv// # Active deployments (default base) ├── compose.yaml # From template (refreshed on update) @@ -308,7 +308,7 @@ All `.service` files in `systemd/` are automatically copied to `/etc/systemd/sys ### Runtime Config -- `~/.config/mylinux/compose.env` — Docker Compose global defaults +- `~/.config/linux_post_install/compose.env` — Docker Compose global defaults - `~/.bashrc` — Modified by postinstall (PATH, bash completion) --- diff --git a/DEV.md b/DEV.md index 8fbf444..f1c7be7 100644 --- a/DEV.md +++ b/DEV.md @@ -34,26 +34,16 @@ Each phase is independent and is only run if the corresponding file exists. | `bin/` | Daily-use tools and wrappers | `/usr/local/bin/` | | `apps//` | Optional desktop apps (by category) | run on demand | | `lib/` | Shared library (`common.sh`) | sourced at build time | -<<<<<<< HEAD -| `config/` | Static config files + SSH authorized_keys | `~/.config//` (via postinstall) | -======= | `config/` | Static config files (gitignored — user adds their own) | `~/.config//` (via postinstall) | ->>>>>>> bba577c (Initial commit) -| `compose/` | ScaleTail templates (dev reference only) | cloned to `/usr/local/share/mylinux/scale-tail` on install | +| `compose/` | ScaleTail templates (dev reference only) | cloned to `/usr/local/share/linux_post_install/scale-tail` on install | | `systemd/` | Systemd service unit files | `/etc/systemd/system/` (via postinstall) | ### Key Files Added | File | Purpose | |------|---------| -<<<<<<< HEAD -| `.gitignore` | Prevents secrets (rclone tokens) and build artifacts from being committed | -| `config/authorized_keys` | SSH public keys read by `postinstall.sh` (replaces hardcoded key) |ls - -======= | `.gitignore` | Prevents secrets (rclone tokens, SSH keys) and build artifacts from being committed | ->>>>>>> bba577c (Initial commit) -| `~/.config/mylinux/compose.env` | Global Docker Compose defaults (`TS_AUTHKEY`, `TZ`, `DNS_SERVER`, `SERVICES_BASE`) — created by `wr-compose config` | +| `~/.config/linux_post_install/compose.env` | Global Docker Compose defaults (`TS_AUTHKEY`, `TZ`, `DNS_SERVER`, `SERVICES_BASE`) — created by `wr-compose config` | --- @@ -118,14 +108,11 @@ If the file contains secrets (tokens, keys): - Add it to `.gitignore` - Document in README how to create it manually -<<<<<<< HEAD ### 4. Add SSH keys (if needed) Place public keys in `config/authorized_keys` (one per line). `postinstall.sh` reads from this file automatically. -======= ->>>>>>> bba577c (Initial commit) ### 5. Update README.md Add a section under **Tools Reference** following the existing format. @@ -319,17 +306,17 @@ fi ## Working with Docker Compose -The installer clones [ScaleTail](https://github.com/tailscale-dev/ScaleTail) templates to `/usr/local/share/mylinux/scale-tail/` — a library of 119+ self-hosted services with a **Tailscale sidecar** pattern. Each service runs with `network_mode: service:tailscale`, gets a `tail-xxxxx.ts.net` URL, and optional automatic HTTPS via Tailscale Serve or Funnel. +The installer clones [ScaleTail](https://github.com/tailscale-dev/ScaleTail) templates to `/usr/local/share/linux_post_install/scale-tail/` — a library of 119+ self-hosted services with a **Tailscale sidecar** pattern. Each service runs with `network_mode: service:tailscale`, gets a `tail-xxxxx.ts.net` URL, and optional automatic HTTPS via Tailscale Serve or Funnel. ### Architecture (after install) ``` -/usr/local/share/mylinux/scale-tail/ # ScaleTail templates (git repo) +/usr/local/share/linux_post_install/scale-tail/ # ScaleTail templates (git repo) └── services// ├── compose.yaml # Service definition (Tailscale + app containers) └── .env # Template variables (SERVICE, IMAGE_URL, TS_AUTHKEY, TZ, ...) -~/.config/mylinux/compose.env # Global defaults — set via wr-compose config +~/.config/linux_post_install/compose.env # Global defaults — set via wr-compose config // # Active deployments (default: /srv/) ├── compose.yaml # Copied from template (refreshed on wr-compose update) @@ -345,11 +332,11 @@ The installer clones [ScaleTail](https://github.com/tailscale-dev/ScaleTail) tem | `wr-compose up ` | Deploys service to `$SERVICES_BASE//` (default: `/srv`), creates `config/` + `data/` dirs, generates `.env` from global config (prompts for `TS_AUTHKEY` if empty), runs `docker compose up -d` | | `wr-compose down ` | Runs `docker compose down` in the service directory | | `wr-compose update` | `git pull` in ScaleTail templates dir, then re-copies `compose.yaml` into all deployed directories — `.env` files are left untouched | -| `wr-compose config set K=V` | Persists a value in `~/.config/mylinux/compose.env` (e.g. `TS_AUTHKEY`, `TZ`, `DNS_SERVER`, `SERVICES_BASE`) | +| `wr-compose config set K=V` | Persists a value in `~/.config/linux_post_install/compose.env` (e.g. `TS_AUTHKEY`, `TZ`, `DNS_SERVER`, `SERVICES_BASE`) | ### Portable `.env` design -- **Global**: `~/.config/mylinux/compose.env` — one place for `TS_AUTHKEY`, `TZ`, `DNS_SERVER`, `SERVICES_BASE`. +- **Global**: `~/.config/linux_post_install/compose.env` — one place for `TS_AUTHKEY`, `TZ`, `DNS_SERVER`, `SERVICES_BASE`. - **Per-service**: `//.env` — generated from the ScaleTail template on first deploy, with empty values filled from the global config. - **On update**: `wr-compose update` refreshes only `compose.yaml` from the templates; `.env` files are preserved. - **Services path**: set `SERVICES_BASE` to any directory (e.g. `/srv`) via `wr-compose config set SERVICES_BASE=/srv`. Defaults to `/srv`. diff --git a/README.md b/README.md index 1c33dba..15228f2 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# myLinux — Personal Bootstrap & Homelab Toolkit +# Linux_post_install — Personal Bootstrap & Homelab Toolkit > One command to turn a bare Debian/Ubuntu install into a usable machine. @@ -13,8 +13,8 @@ ## Quick Start ```bash -git clone https://github.com/IFindMe/myLinux.git -cd myLinux +git clone https://gitea.skink-platy.ts.net/admin/Linux_post_install.git +cd Linux_post_install ./install.sh # core bootstrap + ScaleTail templates ./install.sh --apps # core + interactive app picker ./install.sh --full # core + all apps (non-interactive) @@ -29,7 +29,7 @@ cd myLinux ./install.sh --apps --dry-run # preview without executing ``` -The machine returns to a productive state with minimal manual work. The installer copies all tools to `/usr/local/bin/` and clones ScaleTail templates to `/usr/local/share/mylinux/` — you can delete the repo after install, everything still works. +The machine returns to a productive state with minimal manual work. The installer copies all tools to `/usr/local/bin/` and clones ScaleTail templates to `/usr/local/share/linux_post_install/` — you can delete the repo after install, everything still works. --- @@ -47,7 +47,7 @@ The machine returns to a productive state with minimal manual work. The installe ## Repository Structure ``` -myLinux/ +Linux_post_install/ ├── apps/ # Optional desktop applications (by category) │ ├── install.sh # Interactive selector (y/n per app) │ ├── browsers/ @@ -86,15 +86,9 @@ myLinux/ │ ├── vbox → pos # Backward-compat wrapper │ ├── ssh-load-all → pos# Backward-compat wrapper │ └── autostart.sh # Boot-time script (via systemd) -<<<<<<< HEAD -├── config/ -│ ├── authorized_keys # SSH public keys (read by postinstall) -│ └── rclone.conf # rclone Google Drive config (gitignored) -======= ├── config/ # User config files (gitignored) │ ├── authorized_keys # SSH public keys (gitignored — add your own) │ └── rclone.conf # rclone config (gitignored — add your own) ->>>>>>> bba577c (Initial commit) ├── lib/ │ └── common.sh # Shared library (colors, logging, spinner, timer) ├── systemd/ @@ -249,8 +243,8 @@ Applied by `postinstall.sh`: After reinstalling Debian or Ubuntu: ```bash -git clone https://github.com/IFindMe/myLinux.git -cd myLinux +git clone https://gitea.skink-platy.ts.net/admin/Linux_post_install.git +cd Linux_post_install ./install.sh ``` diff --git a/bin/pos b/bin/pos index cb65c38..78bc185 100755 --- a/bin/pos +++ b/bin/pos @@ -101,7 +101,7 @@ args=("$@") n=${#args[@]} # ── Logging setup ────────────────────────────────────────────── -LOG_DIR="$HOME/.local/share/mylinux/logs" +LOG_DIR="$HOME/.local/share/linux_post_install/logs" mkdir -p "$LOG_DIR" 2>/dev/null || true CMD_SAFE=$(echo "${args[*]}" | tr ' /' '__') LOG_FILE="$LOG_DIR/$(date +%Y%m%d_%H%M%S)_pos_${CMD_SAFE}.log" diff --git a/bin/pos-docker-compose b/bin/pos-docker-compose index 5f00859..d96b885 100755 --- a/bin/pos-docker-compose +++ b/bin/pos-docker-compose @@ -2,8 +2,8 @@ set -euo pipefail source "$(dirname "$0")/../lib/common.sh" 2>/dev/null || source "$(dirname "$0")/common.sh" -SCALE_DIR="/usr/local/share/mylinux/scale-tail/services" -CONFIG_ENV="${HOME}/.config/mylinux/compose.env" +SCALE_DIR="/usr/local/share/linux_post_install/scale-tail/services" +CONFIG_ENV="${HOME}/.config/linux_post_install/compose.env" usage() { cat </dev/null) + names=$(docker ps -a --filter label=linux_post_install.vbox=true --format '{{.Names}}' 2>/dev/null) COMPREPLY=($(compgen -W "$names" -- "$cur")) } diff --git a/install.sh b/install.sh index 4502da8..dd436ac 100755 --- a/install.sh +++ b/install.sh @@ -80,7 +80,7 @@ should_run() { return 0 } -section "myLinux Bootstrap" +section "Linux_post_install Bootstrap" timer_start # ── Phase 1: preinstall ──────────────────────────────────────── @@ -117,7 +117,7 @@ fi # ── Phase 4: ScaleTail templates ──────────────────────────────── if should_run 4 scalepoint; then step 4 4 "Cloning ScaleTail templates" - scale_dest="/usr/local/share/mylinux/scale-tail" + scale_dest="/usr/local/share/linux_post_install/scale-tail" if [ ! -d "$scale_dest" ]; then spawn "Cloning ScaleTail" sudo git clone --depth 1 \ https://github.com/tailscale-dev/ScaleTail.git "$scale_dest" diff --git a/postinstall.sh b/postinstall.sh index d9284df..3cafca0 100755 --- a/postinstall.sh +++ b/postinstall.sh @@ -45,7 +45,6 @@ else warn "completions/pos.bash not found, skipping" fi -<<<<<<< HEAD # ── SSH authorized keys ──────────────────────────────────────── SSH_DIR="$HOME/.ssh" AUTH_FILE="$SSH_DIR/authorized_keys" @@ -73,9 +72,6 @@ if [ -f "$KEY_FILE" ]; then else warn "config/authorized_keys not found, skipping SSH setup" fi - -======= ->>>>>>> bba577c (Initial commit) # ── systemd services ─────────────────────────────────────────── if [ -d systemd ] && [ -n "$(ls -A systemd/*.service 2>/dev/null)" ]; then run sudo cp systemd/*.service /etc/systemd/system/