Skip to content

Commit a4d0f97

Browse files
committed
fix: update configuration file path references from ~/.dbu.yaml to ~/dbu.yaml
- Modified example configuration file and documentation to reflect the new default path for the configuration file. - Adjusted Docker Compose file to align with the updated configuration path. - Ensured consistency across various documentation files regarding the configuration file location.
1 parent 39c9ffa commit a4d0f97

File tree

20 files changed

+63
-61
lines changed

20 files changed

+63
-61
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
uses: golangci/golangci-lint-action@v3
6262
with:
6363
version: latest
64+
args: --out-format=colored-line-number
6465

6566
- name: Format check
6667
run: |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ go install github.com/ibrahimraimi/database-backup-utility@latest
127127

128128
## Configuration
129129

130-
Create a configuration file at `~/.dbu.yaml`:
130+
Create a configuration file at `~/dbu.yaml`:
131131

132132
```yaml
133133
# Logging configuration
@@ -174,7 +174,7 @@ export AZURE_STORAGE_KEY=your_storage_key
174174

175175
### Global Flags
176176

177-
- `--config`: Path to configuration file (default: ~/.dbu.yaml)
177+
- `--config`: Path to configuration file (default: ~/dbu.yaml)
178178
- `--log-level`: Log level (debug, info, warn, error)
179179
- `--log-format`: Log format (json, text)
180180

cmd/backup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ func init() {
5555
backupCmd.Flags().StringVar(&cloudRegion, "region", "", "Cloud storage region")
5656

5757
// Mark required flags
58-
backupCmd.MarkFlagRequired("db-type")
59-
backupCmd.MarkFlagRequired("database")
58+
_ = backupCmd.MarkFlagRequired("db-type")
59+
_ = backupCmd.MarkFlagRequired("database")
6060
}
6161

6262
func runBackup(cmd *cobra.Command, args []string) error {

cmd/restore.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ func init() {
4343
restoreCmd.Flags().BoolVar(&dropExisting, "drop-existing", false, "Drop existing tables before restore")
4444

4545
// Mark required flags
46-
restoreCmd.MarkFlagRequired("db-type")
47-
restoreCmd.MarkFlagRequired("database")
48-
restoreCmd.MarkFlagRequired("file")
46+
_ = restoreCmd.MarkFlagRequired("db-type")
47+
_ = restoreCmd.MarkFlagRequired("database")
48+
_ = restoreCmd.MarkFlagRequired("file")
4949
}
5050

5151
func runRestore(cmd *cobra.Command, args []string) error {

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ func init() {
3030
cobra.OnInitialize(initConfig)
3131

3232
// Global flags
33-
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.dbu.yaml)")
33+
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/dbu.yaml)")
3434
rootCmd.PersistentFlags().String("log-level", "info", "log level (debug, info, warn, error)")
3535
rootCmd.PersistentFlags().String("log-format", "json", "log format (json, text)")
3636

3737
// Bind flags to viper
38-
viper.BindPFlag("log.level", rootCmd.PersistentFlags().Lookup("log-level"))
39-
viper.BindPFlag("log.format", rootCmd.PersistentFlags().Lookup("log-format"))
38+
_ = viper.BindPFlag("log.level", rootCmd.PersistentFlags().Lookup("log-level"))
39+
_ = viper.BindPFlag("log.format", rootCmd.PersistentFlags().Lookup("log-format"))
4040
}
4141

4242
// initConfig reads in config file and ENV variables if set.

cmd/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func init() {
3131
testCmd.Flags().String("connection-string", "", "Full database connection string")
3232

3333
// Mark required flags
34-
testCmd.MarkFlagRequired("db-type")
34+
_ = testCmd.MarkFlagRequired("db-type")
3535
}
3636

3737
func runTest(cmd *cobra.Command, args []string) error {

config.example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Database Backup Utility Configuration Example
2-
# Copy this file to ~/.dbu.yaml and modify as needed
2+
# Copy this file to ~/dbu.yaml and modify as needed
33

44
# Logging configuration
55
log:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ services:
6868
condition: service_healthy
6969
volumes:
7070
- ./backups:/backups
71-
- ./config.example.yaml:/home/dbbackup/.dbu.yaml
71+
- ./config.example.yaml:/home/dbbackup/dbu.yaml
7272
environment:
7373
- BACKUP_DIR=/backups
7474
- LOG_LEVEL=info

docs/cloud-storage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Create an IAM policy with the following permissions:
4444
### Configuration
4545

4646
```yaml
47-
# ~/.dbu.yaml
47+
# ~/dbu.yaml
4848
storage:
4949
type: "cloud"
5050
path: "./temp"
@@ -162,7 +162,7 @@ aws configure set default.s3.use_accelerate_endpoint true
162162
### Configuration
163163

164164
```yaml
165-
# ~/.dbu.yaml
165+
# ~/dbu.yaml
166166
storage:
167167
type: "cloud"
168168
path: "./temp"
@@ -278,7 +278,7 @@ export GCP_BUCKET=your-backup-bucket
278278
### Configuration
279279

280280
```yaml
281-
# ~/.dbu.yaml
281+
# ~/dbu.yaml
282282
storage:
283283
type: "cloud"
284284
path: "./temp"

docs/configuration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This guide covers all configuration options available in the Database Backup Uti
44

55
## Configuration File
66

7-
The utility uses YAML configuration files. The default location is `~/.dbu.yaml`.
7+
The utility uses YAML configuration files. The default location is `~/dbu.yaml`.
88

99
### Basic Configuration Structure
1010

@@ -420,8 +420,8 @@ database:
420420

421421
```bash
422422
# Secure configuration file
423-
chmod 600 ~/.dbu.yaml
424-
chown $USER:$USER ~/.dbu.yaml
423+
chmod 600 ~/dbu.yaml
424+
chown $USER:$USER ~/dbu.yaml
425425
426426
# Secure backup directory
427427
chmod 700 /var/backups/database-backup-utility
@@ -448,17 +448,17 @@ database:
448448

449449
```bash
450450
# Check if configuration file exists
451-
ls -la ~/.dbu.yaml
451+
ls -la ~/dbu.yaml
452452
453453
# Create default configuration
454-
cp config.example.yaml ~/.dbu.yaml
454+
cp config.example.yaml ~/dbu.yaml
455455
```
456456

457457
#### Invalid YAML Syntax
458458

459459
```bash
460460
# Validate YAML syntax
461-
python -c "import yaml; yaml.safe_load(open('~/.dbu.yaml'))"
461+
python -c "import yaml; yaml.safe_load(open('~/dbu.yaml'))"
462462
463463
# Or use online YAML validator
464464
```

0 commit comments

Comments
 (0)