From 1b01a5e6536b50cd3ed4dcf764d34f109c47bf32 Mon Sep 17 00:00:00 2001 From: Arunavo Ray Date: Thu, 28 Aug 2025 20:11:16 +0530 Subject: [PATCH] updated docs --- README.md | 20 ++++++++++++++++++++ docs/ENVIRONMENT_VARIABLES.md | 11 ++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6768322..ea7db22 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,26 @@ Enable in Settings → Mirror Options → Mirror metadata - **Automatic Cleanup** - Configure retention period for activity logs - **Scheduled Sync** - Set custom intervals for automatic mirroring +### Automatic Mirroring + +Gitea Mirror can automatically sync your repositories at regular intervals. There are two ways to configure this: + +#### Via Web Interface (Recommended) +Navigate to the Configuration page and enable "Automatic Mirroring" with your preferred interval (e.g., every 6 hours, daily, etc.). + +#### Via Environment Variables +Set `GITEA_MIRROR_INTERVAL` to automatically enable scheduled mirroring: + +```bash +# Examples of supported formats: +GITEA_MIRROR_INTERVAL=8h # Every 8 hours +GITEA_MIRROR_INTERVAL=30m # Every 30 minutes +GITEA_MIRROR_INTERVAL=1d # Daily +GITEA_MIRROR_INTERVAL=86400 # Every 86400 seconds (24 hours) +``` + +When this variable is set, the scheduler automatically enables and runs at the specified interval. The timer starts from the last successful sync, not from container startup. + ## Troubleshooting ### Reverse Proxy Configuration diff --git a/docs/ENVIRONMENT_VARIABLES.md b/docs/ENVIRONMENT_VARIABLES.md index 3bf803e..3b4af06 100644 --- a/docs/ENVIRONMENT_VARIABLES.md +++ b/docs/ENVIRONMENT_VARIABLES.md @@ -95,7 +95,7 @@ Settings for the destination Gitea instance. | Variable | Description | Default | Options | |----------|-------------|---------|---------| | `GITEA_ORG_VISIBILITY` | Default organization visibility | `public` | `public`, `private`, `limited`, `default` | -| `GITEA_MIRROR_INTERVAL` | Mirror sync interval (automatically enables scheduler) | `8h` | Duration string (e.g., `30m`, `1h`, `8h`, `24h`) | +| `GITEA_MIRROR_INTERVAL` | Mirror sync interval - **automatically enables scheduled mirroring when set** | `8h` | Duration string (e.g., `30m`, `1h`, `8h`, `24h`, `1d`) or seconds | | `GITEA_LFS` | Enable LFS support (requires LFS on Gitea server) - Shows in UI | `false` | `true`, `false` | | `GITEA_CREATE_ORG` | Auto-create organizations | `true` | `true`, `false` | | `GITEA_PRESERVE_VISIBILITY` | Preserve GitHub repo visibility in Gitea | `false` | `true`, `false` | @@ -351,9 +351,14 @@ BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:3000,http://192.168.1.100:3000 3. **Token Security**: All tokens are encrypted before being stored in the database. -4. **Backward Compatibility**: The `DELAY` variable is maintained for backward compatibility but `SCHEDULE_INTERVAL` is preferred. +4. **Auto-Enabling Features**: Certain environment variables automatically enable features when set: + - `GITEA_MIRROR_INTERVAL` - Automatically enables scheduled mirroring + - `CLEANUP_DELETE_IF_NOT_IN_GITHUB=true` - Automatically enables repository cleanup + - `SCHEDULE_INTERVAL` or `DELAY` - Automatically enables the scheduler -5. **Required Scopes**: The GitHub token requires the following scopes: +5. **Backward Compatibility**: The `DELAY` variable is maintained for backward compatibility but `SCHEDULE_INTERVAL` is preferred. + +6. **Required Scopes**: The GitHub token requires the following scopes: - `repo` (full control of private repositories) - `admin:org` (read organization data) - Additional scopes may be required for specific features