Skip to content

Commit 662af4b

Browse files
committed
refactor: Rename default configuration file from config.json to backup-config.json and update all references.
1 parent cb1fb4d commit 662af4b

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const app = new Elysia()
4141
.use(
4242
r2Backup({
4343
sourceDir: './data',
44-
configPath: './config.json',
44+
configPath: './backup-config.json',
4545
})
4646
)
4747
.listen(3000)
@@ -60,12 +60,12 @@ On first run, you'll be guided through an onboarding wizard to configure:
6060

6161
### Plugin Options
6262

63-
| Option | Type | Required | Description |
64-
| ------------ | ------ | -------- | ------------------------------------------------------ |
65-
| `sourceDir` | string || Local directory to backup |
66-
| `configPath` | string || Path to save runtime config (default: `./config.json`) |
63+
| Option | Type | Required | Description |
64+
| ------------ | ------ | -------- | ------------------------------------------------------------- |
65+
| `sourceDir` | string || Local directory to backup |
66+
| `configPath` | string || Path to save runtime config (default: `./backup-config.json`) |
6767

68-
### Runtime Configuration (via UI or config.json)
68+
### Runtime Configuration (via UI or backup-config.json)
6969

7070
| Option | Type | Description |
7171
| ----------------- | -------- | ---------------------------------------------- |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sourceDir": "./data",
3-
"configPath": "./config.json",
3+
"configPath": "./backup-config.json",
44
"endpoint": "https://fb81cb0efe496349aa882e65d6704c6f.r2.cloudflarestorage.com",
55
"bucket": "2025-12-20",
66
"prefix": "",

demo/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const app = new Elysia()
2121
.use(
2222
r2Backup({
2323
sourceDir: './data',
24-
configPath: './config.json',
24+
configPath: './backup-config.json',
2525
})
2626
)
2727
.get(

src/core/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const saveConfig = async (configPath, config) => {
4343
* @returns {Object} Configuration manager with get/set/save methods
4444
*/
4545
export const createConfigManager = initialConfig => {
46-
const configPath = initialConfig.configPath || './config.json'
46+
const configPath = initialConfig.configPath || './backup-config.json'
4747
const savedConfig = loadConfig(configPath)
4848

4949
let config = { ...initialConfig, ...savedConfig }

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ const sessionManager = createSessionManager()
3232
* @param {string} [config.prefix] - Optional prefix for S3 keys (e.g. 'backups/')
3333
* @param {string} [config.cronSchedule] - Cron schedule expression
3434
* @param {boolean} [config.cronEnabled] - Whether the cron schedule is enabled
35-
* @param {string} [config.configPath] - Path to save runtime configuration (default: './config.json')
35+
* @param {string} [config.configPath] - Path to save runtime configuration (default: './backup-config.json')
3636
*/
3737
export const r2Backup = initialConfig => app => {
3838
// State to hold runtime configuration (allows UI updates)
39-
const configPath = initialConfig.configPath || './config.json'
39+
const configPath = initialConfig.configPath || './backup-config.json'
4040

4141
// Load saved config if exists
4242
let savedConfig = {}
@@ -52,7 +52,7 @@ export const r2Backup = initialConfig => app => {
5252

5353
let config = { ...initialConfig, ...savedConfig }
5454

55-
// Helper to check if config.json exists and has required fields
55+
// Helper to check if backup-config.json exists and has required fields
5656
const hasValidConfig = () => {
5757
if (!existsSync(configPath)) return false
5858
try {

0 commit comments

Comments
 (0)