**Prerequisites (Sudo Access):**
-Since the script runs non-interactively, your SSH user must be able to run `gitea` commands as the Gitea user without a password.
+The script attempts to use `sudo`. Because it uses `ssh -t`, you can enter your sudo password interactively.
-On the **Gitea Server**, add this to `/etc/sudoers` (using `sudo visudo`):
-
-```text
-# Allow shane to run commands as gg without a password
-shane ALL=(gg) NOPASSWD: /usr/local/bin/gitea
-```
**What it does:**
```bash
# On the server
-sudo -u gg rm -rf /var/lib/gitea/data/repo-archive/*
+sudo -u git rm -rf /var/lib/gitea/data/repo-archive/*
```
## Update Procedure
# Safe Directory
# We need to run this globally or on the system level, but running it locally for the user often works
# if the user accessing it is the one running this.
- # However, 'git config --global' on remote affects the remote user (gg).
+ # However, 'git config --global' on remote affects the remote user (git).
remote_run(
remote, ["git", "config", "--global", "--add", "safe.directory", full_path]
)