Skip to content

Commit 55c41d7

Browse files
committed
feat: Add authentication and session management with login/logout UI to the backup plugin, including new environment variables for credentials.
1 parent f40cc40 commit 55c41d7

File tree

3 files changed

+709
-376
lines changed

3 files changed

+709
-376
lines changed

demo/.env.example

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
# R2/S3 Configuration
1+
# R2/S3 Credentials
22
R2_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
55
R2_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
813
BACKUP_SOURCE_DIR=./data

demo/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { Elysia } from 'elysia'
8-
import { r2Backup } from '@riligar/elysia-backup'
8+
import { r2Backup } from '../src/index.js'
99
import { 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(

0 commit comments

Comments
 (0)