# CMR Scanner — RPM package (RHEL / AlmaLinux / Fedora)

> **Private registry** — a personal access token is required to install or upgrade this package via `dnf` or `yum`.

## Supported distributions

| Distribution                         | Architecture |
| ------------------------------------ | ------------ |
| RHEL 8 / AlmaLinux 8 / Rocky Linux 8 | x86_64       |
| RHEL 9 / AlmaLinux 9 / Rocky Linux 9 | x86_64       |
| Fedora 40+                           | x86_64       |

## Getting a personal access token

1. Sign in to [git.araliasoftware.com](https://git.araliasoftware.com)
2. Go to **Settings → Applications → Access tokens**
3. Create a token with **`read:package`** scope
4. Copy and save the token — it is only shown once

## Install via dnf/yum (recommended)

Configuring a `.repo` file means `dnf upgrade` handles future updates automatically.

Create `/etc/yum.repos.d/cmr-scanner.repo` with the following content, substituting your credentials and provider:

```ini
[cmr-scanner]
name=CMR Scanner (postgresql)
baseurl=https://YOUR_USERNAME:YOUR_TOKEN@git.araliasoftware.com/api/packages/athan/rpm/postgresql
enabled=1
gpgcheck=0
```

Replace `postgresql` in both `name` and `baseurl` with `mysql`, `mariadb`, or `sqlserver` if using a different database provider.

Restrict the file's permissions to protect your token:

```bash
sudo chmod 0600 /etc/yum.repos.d/cmr-scanner.repo
```

Then install:

```bash
sudo dnf install cmr-scanner-postgresql
```

### Updating

```bash
sudo dnf upgrade cmr-scanner-postgresql
```

## Install manually from a release file

Download the `.rpm` from the [releases page](https://git.araliasoftware.com/athan/cmr-scanner/releases) — a token is needed to access that page too.

```bash
sudo dnf install ./cmr-scanner-postgresql-VERSION.x86_64.rpm
```

## After installing

Edit the configuration file, run migrations, then start the service:

```bash
# /etc/cmr-scanner/env.template documents every available option —
# open it alongside env to see what else you can configure.
sudo nano /etc/cmr-scanner/env

sudo -u cmr-scanner /opt/cmr-scanner/node/bin/node \
  /opt/cmr-scanner/app/node_modules/.bin/prisma migrate deploy

sudo systemctl start cmr-scanner
sudo systemctl enable cmr-scanner
```

## Full deployment guide

See [DEPLOY.md](https://git.araliasoftware.com/athan/cmr-scanner/raw/branch/main/DEPLOY.md) for complete
configuration, database migration, NGINX reverse-proxy, SELinux, and CAC/PIV smart-card setup instructions.
