Make /opt/moonarch root-owned for multi-user support
Remove chown from archinstall custom-commands so the repo stays root:root. Use sudo for git operations in update.sh. Any user with sudo can now run moonarch-update without owning the repo.
This commit is contained in:
parent
6ca8931f04
commit
1679fcfb30
@ -4,7 +4,7 @@ Reproduzierbares Arch-Linux-Setup basierend auf archinstall + Post-Install-Autom
|
|||||||
|
|
||||||
## Projektstruktur
|
## Projektstruktur
|
||||||
|
|
||||||
- `config/` — archinstall-Konfiguration (inkl. custom-commands die das Repo nach /opt/moonarch klonen)
|
- `config/` — archinstall-Konfiguration (inkl. custom-commands die das Repo nach /opt/moonarch klonen, root-owned)
|
||||||
- `scripts/` — Post-Install- und Helper-Scripts
|
- `scripts/` — Post-Install- und Helper-Scripts
|
||||||
- `packages/` — Paketlisten (offiziell + AUR), getrennt gepflegt
|
- `packages/` — Paketlisten (offiziell + AUR), getrennt gepflegt
|
||||||
- `defaults/` — XDG-Configs, Shell-Config, Helper-Binaries, greetd/moongreet-Config, Wallpaper
|
- `defaults/` — XDG-Configs, Shell-Config, Helper-Binaries, greetd/moongreet-Config, Wallpaper
|
||||||
|
|||||||
13
DECISIONS.md
Normal file
13
DECISIONS.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Decisions
|
||||||
|
|
||||||
|
## 2026-03-29 – /opt/moonarch stays root-owned, no chown to user
|
||||||
|
- **Who**: Dominik, Ragnar
|
||||||
|
- **Why**: Multi-user system — chown to UID 1000 locks out other users from moonarch-update
|
||||||
|
- **Tradeoffs**: sudo required for git operations in update.sh vs. simpler user-owned repo
|
||||||
|
- **How**: Repo stays at /opt/moonarch owned by root:root. update.sh uses `sudo git` for fetch/pull. All scripts already use sudo for system-level operations, so this is consistent.
|
||||||
|
|
||||||
|
## 2026-03-29 – Add transform.sh for existing Arch+Wayland systems
|
||||||
|
- **Who**: Dominik, Ragnar
|
||||||
|
- **Why**: Users with existing Arch+Wayland setups should be able to adopt Moonarch without reinstalling
|
||||||
|
- **Tradeoffs**: Hard overwrite of all configs (user + system) vs. selective/merge approach — chose hard overwrite for simplicity and consistency
|
||||||
|
- **How**: New transform.sh with pre-flight summary, backup, DM conflict resolution, and --dry-run flag. Shared helpers extracted to lib.sh.
|
||||||
@ -63,7 +63,6 @@ Transform converts your system to Moonarch without reinstalling.
|
|||||||
```bash
|
```bash
|
||||||
# Clone the repo
|
# Clone the repo
|
||||||
sudo git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch
|
sudo git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch
|
||||||
sudo chown -R $(whoami):$(whoami) /opt/moonarch
|
|
||||||
|
|
||||||
# Preview what will happen (no changes made)
|
# Preview what will happen (no changes made)
|
||||||
/opt/moonarch/scripts/transform.sh --dry-run
|
/opt/moonarch/scripts/transform.sh --dry-run
|
||||||
|
|||||||
@ -70,7 +70,6 @@
|
|||||||
"timezone": "Europe/Berlin",
|
"timezone": "Europe/Berlin",
|
||||||
|
|
||||||
"custom-commands": [
|
"custom-commands": [
|
||||||
"git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch",
|
"git clone https://gitea.moonarch.de/nevaforget/moonarch.git /opt/moonarch"
|
||||||
"chown -R 1000:1000 /opt/moonarch"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,17 +15,17 @@ check_not_root
|
|||||||
log "=== Update Moonarch repo ==="
|
log "=== Update Moonarch repo ==="
|
||||||
|
|
||||||
cd "$PROJECT_DIR"
|
cd "$PROJECT_DIR"
|
||||||
if git rev-parse --is-inside-work-tree &>/dev/null; then
|
if sudo git rev-parse --is-inside-work-tree &>/dev/null; then
|
||||||
LOCAL=$(git rev-parse HEAD)
|
LOCAL=$(sudo git rev-parse HEAD)
|
||||||
git fetch origin
|
sudo git fetch origin
|
||||||
REMOTE=$(git rev-parse @{u} 2>/dev/null || echo "$LOCAL")
|
REMOTE=$(sudo git rev-parse @{u} 2>/dev/null || echo "$LOCAL")
|
||||||
|
|
||||||
if [[ "$LOCAL" != "$REMOTE" ]]; then
|
if [[ "$LOCAL" != "$REMOTE" ]]; then
|
||||||
log "Updates available."
|
log "Updates available."
|
||||||
git --no-pager log --oneline "$LOCAL".."$REMOTE"
|
sudo git --no-pager log --oneline "$LOCAL".."$REMOTE"
|
||||||
echo ""
|
echo ""
|
||||||
if confirm "Update repo?"; then
|
if confirm "Update repo?"; then
|
||||||
git pull --ff-only
|
sudo git pull --ff-only
|
||||||
log "Repo updated."
|
log "Repo updated."
|
||||||
else
|
else
|
||||||
log "Repo update skipped."
|
log "Repo update skipped."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user