Add comprehensive data persistence verification
- Added test-persistence.sh script to verify Docker volume mounting - Enhanced DEPLOYMENT.md with detailed data persistence documentation - Updated deploy.sh to verify data directory mount on deployment - Added data/README.md explaining data storage and backup - Updated data/.gitignore to include README.md - Documented what data persists and what doesn't - Added backup strategies and troubleshooting tips
This commit is contained in:
1 parent
ad37bb57ae
commit
97c47cde1c
5 files changed
+235
-1
No files matched your search
+2
-1
@@ -1,5 +1,6 @@
|
||||
# Exclude all user data files
|
||||
*.json
|
||||
|
||||
# Keep this .gitignore file
|
||||
# Keep these files
|
||||
!.gitignore
|
||||
!README.md
|
||||
@@ -0,0 +1,68 @@
|
||||
# Capsule User Data Directory
|
||||
|
||||
This directory contains all your encrypted budget data.
|
||||
|
||||
## What's Stored Here
|
||||
|
||||
- **users.json** - User credentials (SHA-256 hashed passwords)
|
||||
- **{userId}.json** - Individual user budget data (AES-GCM encrypted)
|
||||
- **locks/** - File locks for concurrent access protection
|
||||
|
||||
## Data Persistence
|
||||
|
||||
✅ This directory is **mounted as a Docker volume**
|
||||
✅ Data persists across container restarts
|
||||
✅ Data persists across container rebuilds
|
||||
✅ Data survives system reboots
|
||||
|
||||
## Backup
|
||||
|
||||
**Recommended:** Back up this entire directory regularly
|
||||
|
||||
```bash
|
||||
# From parent directory
|
||||
tar -czf capsule-backup-$(date +%Y%m%d).tar.gz data/
|
||||
```
|
||||
|
||||
## Security
|
||||
|
||||
- All budget data is encrypted with AES-GCM
|
||||
- Passwords are hashed with SHA-256
|
||||
- NEVER share your ENCRYPTION_KEY
|
||||
- Keep this directory secure
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
data/
|
||||
├── users.json # User accounts
|
||||
├── user-abc123.json # User 1 data (encrypted)
|
||||
├── user-def456.json # User 2 data (encrypted)
|
||||
└── locks/ # File locks
|
||||
├── users.json.lock
|
||||
└── ...
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Data not persisting?**
|
||||
|
||||
Check Docker volume mount:
|
||||
```bash
|
||||
docker inspect capsule-budget | grep -A 10 "Mounts"
|
||||
```
|
||||
|
||||
Should show:
|
||||
```json
|
||||
"Mounts": [{
|
||||
"Source": "/path/to/capsule/data",
|
||||
"Destination": "/app/data"
|
||||
}]
|
||||
```
|
||||
|
||||
**Permission issues?**
|
||||
|
||||
Ensure directory has correct permissions:
|
||||
```bash
|
||||
chmod 755 data
|
||||
```
|
||||
Reference in new issue
Block a user