# Operations Guide

## Admin route

The admin route is **data-driven**:
- The base route segment is read from DB table `routes`, column `admin`.
- Default in the provided DB dump is `admin`.

So your admin panel URL is:
- `/{adminRoute}`
- Example: `/admin`

## Cron / scheduled jobs

These endpoints exist (see `app/Config/Routes.php` and `app/Controllers/CronController.php`):

- **Update RSS feeds**: `GET /cron/update-feeds`
- **Update sitemap**: `GET /cron/update-sitemap`
- **Publish scheduled posts**: `GET /cron/check-scheduled-posts`

### Recommended cron entries

Run each endpoint on an interval that matches your traffic/content needs. Example (every 5 minutes for feeds and scheduled posts, daily for sitemap):

- `*/5 * * * * curl -fsS https://YOUR_DOMAIN/cron/update-feeds >/dev/null`
- `*/5 * * * * curl -fsS https://YOUR_DOMAIN/cron/check-scheduled-posts >/dev/null`
- `0 3 * * * curl -fsS https://YOUR_DOMAIN/cron/update-sitemap >/dev/null`

### Protecting cron endpoints

These are plain GET routes. If your site is public, consider protecting them (WAF rule, allow-list, secret token pattern, etc.) so random visitors cannot trigger jobs.

## HTTPS + rewrite behavior

### Forced HTTPS redirect

Root `.htaccess` currently forces HTTPS:

- It redirects any request where `HTTPS != on` to the same URL on `https://...`

If your TLS is terminated at a reverse proxy / load balancer, ensure your proxy correctly sets HTTPS-related headers; otherwise you can get redirect loops.

### Pretty URLs (index.php removed)

The app is configured for `indexPage = ''` and `.htaccess` routes all unknown paths to `index.php`.

## Sessions

This deployment is configured to use DB sessions:
- `app/Config/App.php` sets:
  - `sessionDriver = CodeIgniter\\Session\\Handlers\\DatabaseHandler`
  - `sessionSavePath = 'ci_sessions'`

So the DB table **`ci_sessions`** must exist (it is included in the SQL dumps).

## Logs / caches / uploads

- Writable runtime data is stored in:
  - `writable/` (cache, logs, sessions, uploads)
- Public uploads are in:
  - `uploads/` (many subfolders; see `docs/INSTALLATION.md` for required write permissions)

