chore: auto-bootstrap cli config

This commit is contained in:
Andreas Dueren
2025-11-05 05:58:50 -06:00
parent fc9abad56b
commit 8f3a34a277
2 changed files with 37 additions and 35 deletions

View File

@@ -60,39 +60,25 @@ The installer now asks for dedicated hostnames for the Auth/Accounts/Cast/Albums
## Administration ## Administration
- Use the bundled CLI from the Cloudron web terminal (CLI state lives in `/app/data/cli-data`). On a new deployment initialise it once (this seeds the CLI config, whitelists an admin email, and resets the CLI DB): - **Grant yourself admin privileges**
```bash 1. Open the Cloudron dashboard → your Ente app → **File Manager**.
# from the Cloudron terminal, logged in as root 2. Navigate to `/app/data/config/` and open (or create) `museum.override.yaml`.
cat <<'EOF' >/cli-data/config.yaml 3. Add your email to the super-admin list:
endpoint: ```yaml
api: https://<your-app-domain>/api internal:
log:
http: false
EOF
mkdir -p /cli-data/export
chown cloudron:cloudron /cli-data /cli-data/config.yaml /cli-data/export
cat <<'EOF' >/app/data/config/museum.override.yaml
internal:
super-admins: super-admins:
- admin@example.com - you@example.com
EOF ```
rm -f /cli-data/ente-cli.db 4. Save the file and restart the app. The override is appended to Museums configuration on every start.
chown cloudron:cloudron /app/data/config/museum.override.yaml
cloudron restart --app <your-app-domain> - **Sign in to the bundled CLI**
*The package now preconfigures the CLI (config: `/app/data/cli-data/config.yaml`, exports: `/app/data/cli-data/export`).*
# store your account (enter the OTP emailed to you) From the Cloudron **Terminal** run:
```bash
# authenticate once (enter the OTP you receive by email)
sudo -u cloudron ente account add sudo -u cloudron ente account add
# inspect available commands # inspect available commands
sudo -u cloudron ente --help sudo -u cloudron ente --help
``` ```
Once the account is added you can follow the upstream admin docs for tasks like whitelisting and quota adjustments. After youre signed in you can follow the upstream docs for tasks like increasing storage: see [user administration](https://ente.io/help/self-hosting/administration/users) and the [CLI reference](https://ente.io/help/self-hosting/administration/cli).
See the upstream admin guides for further context: [user administration](https://ente.io/help/self-hosting/administration/users) and [CLI reference](https://ente.io/help/self-hosting/administration/cli).
- To persist custom Museum settings (for example, seeding super-admin email addresses), create `/app/data/config/museum.override.yaml`. The file is appended to `museum/configurations/local.yaml` on each startup.
```yaml
internal:
super-admins:
- admin@example.com
```

View File

@@ -602,16 +602,32 @@ CLI_DATA_DIR="$DATA_DIR/cli-data"
mkdir -p "$CLI_DATA_DIR" mkdir -p "$CLI_DATA_DIR"
chown cloudron:cloudron "$CLI_DATA_DIR" chown cloudron:cloudron "$CLI_DATA_DIR"
chmod 700 "$CLI_DATA_DIR" chmod 700 "$CLI_DATA_DIR"
CLI_EXPORT_DIR="$CLI_DATA_DIR/export"
if [ ! -d "$CLI_EXPORT_DIR" ]; then
mkdir -p "$CLI_EXPORT_DIR"
chown cloudron:cloudron "$CLI_EXPORT_DIR"
chmod 700 "$CLI_EXPORT_DIR"
fi
CLI_HOME="$DATA_DIR/home/.ente" CLI_DATA_CONFIG="$CLI_DATA_DIR/config.yaml"
mkdir -p "$CLI_HOME" if [ ! -f "$CLI_DATA_CONFIG" ]; then
cat > "$CLI_HOME/config.yaml" <<EOF_CLI cat > "$CLI_DATA_CONFIG" <<EOF_CLI_DATA
endpoint: endpoint:
api: ${API_ORIGIN} api: ${API_ORIGIN}
log: log:
http: false http: false
EOF_CLI EOF_CLI_DATA
chown -R cloudron:cloudron "$DATA_DIR/home" chown cloudron:cloudron "$CLI_DATA_CONFIG"
chmod 600 "$CLI_DATA_CONFIG"
log INFO "Initialised CLI data configuration at $CLI_DATA_CONFIG"
fi
CLI_HOME="$DATA_DIR/home/.ente"
mkdir -p "$CLI_HOME"
if [ ! -f "$CLI_HOME/config.yaml" ]; then
ln -sf "$CLI_DATA_CONFIG" "$CLI_HOME/config.yaml"
fi
chown -R cloudron:cloudron "$DATA_DIR/home" "$CLI_HOME"
chmod 700 "$DATA_DIR/home" chmod 700 "$DATA_DIR/home"
log INFO "Rendering Caddy configuration" log INFO "Rendering Caddy configuration"