File tree Expand file tree Collapse file tree 3 files changed +709
-376
lines changed
Expand file tree Collapse file tree 3 files changed +709
-376
lines changed Original file line number Diff line number Diff line change 1- # R2/S3 Configuration
1+ # R2/S3 Credentials
22R2_BUCKET = your-bucket-name
3- R2_ACCESS_KEY_ID = your-access-key
4- R2_SECRET_ACCESS_KEY = your-secret-key
3+ R2_ACCESS_KEY_ID = your-access-key-id
4+ R2_SECRET_ACCESS_KEY = your-secret-access- key
55R2_ENDPOINT = https://your-account.r2.cloudflarestorage.com
66
7+ # Authentication (required when configured)
8+ # If you configure username and password, authentication will be required
9+ BACKUP_USERNAME = admin
10+ BACKUP_PASSWORD = changeme
11+
712# Backup Source Directory
813BACKUP_SOURCE_DIR = ./data
Original file line number Diff line number Diff line change 55 */
66
77import { Elysia } from 'elysia'
8- import { r2Backup } from '@riligar/elysia-backup '
8+ import { r2Backup } from '../src/index.js '
99import { readFileSync , writeFileSync } from 'fs'
1010
1111// JSON file paths
@@ -29,6 +29,11 @@ const app = new Elysia()
2929 extensions : [ '.json' ] ,
3030 cronSchedule : '0 * * * *' ,
3131 cronEnabled : false ,
32+ // Authentication - provide username and password to enable auth
33+ auth : {
34+ username : process . env . BACKUP_USERNAME ,
35+ password : process . env . BACKUP_PASSWORD ,
36+ } ,
3237 } )
3338 )
3439 . get (
You can’t perform that action at this time.
0 commit comments