# F-Droid Repository Project

## Project Overview
This project manages the official F-Droid repository for the Rekindle Android app. It serves signed APKs and repository metadata over HTTPS.

## Architecture
- **Web Server**: Nginx (serving files from `/app/repo`).
- **Deployment**: Docker container (`rekindle-fdroid`) based on a custom image (`fdroid-repo`).
- **HTTPS**: Managed via Nginx reverse proxy on the host with Let's Encrypt certificates for `fdroid.jombo.uk`.

## Key Workflows

### Updating the Repository
To update the repository with a new APK and synchronize metadata from GitHub:

1.  Place the new APK in the root directory (it should be named `rekindleAndroid-0_9.apk` or `app-release.apk`).
2.  (Optional) Update `metadata/com.rekindle.app.yml` if the version code or version name has changed.
3.  Run the automation script:
    ```bash
    ./update_repo.sh
    ```

The `update_repo.sh` script performs the following:
- Syncs the APK to the `repo/` directory.
- Runs `fdroid update` to refresh the index.
- Bumps the `lastupdated` and `added` dates to today's date in both XML and JSON formats.
- Re-signs the repository indices using the local keystore.
- Rebuilds the Docker image to make the changes persistent.
- Restarts the Docker container.

### Local Testing
To serve the repository locally for testing purposes:
```bash
./serve_local.sh
```
This serves the contents of the `repo/` directory on `http://localhost:8080`.

## Configuration
- **Metadata**: Found in the `metadata/` directory. Synchronized with the app's source code and Fastlane metadata.
- **Repository Keys**: `keystore.p12` contains the signing keys. Password: `password` (used in automation script).
- **Docker**: `Dockerfile` and `.dockerignore` manage the container environment.
