# F5 URLREP CM Customer Install Guide

`get_latest.sh` is now the single installer/updater script.

## What `get_latest.sh` does

- Detects OS automatically (`rocky`, `ubuntu/debian`, `macos`)
- Downloads the correct binary
- Verifies checksum and GPG signature
- Installs into the **current directory** (`$PWD`)
- Creates installer state directories as needed
- Writes installer logs (prefers `/var/log/cassandra`)
- Creates weekly cron update job (Sunday at 04:00)
- Sends success/failure feedback to Magneto API

## Current release settings

- Base URL: `https://cdn.tag-insights.com/apps/f5_urlrep_cm`
- Current version: `1.0.0`

Published files include:
- `get_latest.sh`
- `uninstall-latest.sh`
- `checksums-latest.manifest` (+ `.sha256` + `.sig`)
- `f5_urlrep_cm-rocky-latest.gz` (+ `.sha256` + `.sig`)
- `f5_urlrep_cm-ubuntu-latest.gz` (+ `.sha256` + `.sig`)
- `f5_urlrep_cm-macos-latest.gz` (+ `.sha256` + `.sig`)

## Quick start (recommended)

1. Create a folder for the app and enter it.
2. Download and run installer.
3. Verify the binary.

```bash
mkdir -p "$HOME/f5_urlrep_cm"
cd "$HOME/f5_urlrep_cm"
curl -fsSLO https://cdn.tag-insights.com/apps/f5_urlrep_cm/get_latest.sh
bash ./get_latest.sh
./f5_urlrep_cm --version
```

## One-liner curl mode

```bash
cd "$HOME/f5_urlrep_cm"
curl -fsSL https://cdn.tag-insights.com/apps/f5_urlrep_cm/get_latest.sh | bash
```

## Where files go

If run from `/path/to/myapp`:

- Binary: `/path/to/myapp/f5_urlrep_cm`
- Installer script: `/path/to/myapp/get_latest.sh`
- State dir: `/path/to/myapp/.f5_urlrep_cm_installer/`

Logs:

- Preferred: `/var/log/cassandra/f5_urlrep_cm_installer.log`
- Fallback: `/path/to/myapp/.f5_urlrep_cm_installer/installer.log`

## Cron auto-update

Installer creates/updates a cron entry:

- Sunday at 04:00

To skip cron creation:

```bash
bash ./get_latest.sh --no-cron
```

## Uninstall

From the install directory:

```bash
curl -fsSLO https://cdn.tag-insights.com/apps/f5_urlrep_cm/uninstall-latest.sh
bash ./uninstall-latest.sh
```

Uninstall removes:

- `f5_urlrep_cm`
- `get_latest.sh`
- `.f5_urlrep_cm_installer/`
- installer cron entry marker

## Feedback API (automatic)

At completion/failure, installer sends POST JSON to:

`https://api.magnetoai.com/1.0/ingestors/installer_feedback.php`

Payload fields:

- `client_id`
- `timestamp`
- `client_ip`
- `client_hostname`
- `version`
- `os`
- `arch`
- `status` (`updated_successfully` or `failed`)

## Optional flags

- `--no-cron` skip cron setup
- `--public-key-file <path>` explicit GPG public key
- `--help` show usage

## Troubleshooting

Manifest signature verification failed:

- Ensure a valid public key is available.
- Try:

```bash
bash ./get_latest.sh --public-key-file ./public.key
```

Unsupported platform:

- Supported platforms are Rocky Linux, Ubuntu/Debian, macOS.

Permission denied for `/var/log/cassandra`:

- Installer falls back to local installer log path.

`crontab` not found:

- Install cron on your OS, or run updates manually.
