Skip to content

Commit 59bec6f

Browse files
committed
docs: update database setup instructions and clarify persistent data directory usage
1 parent 35e30a6 commit 59bec6f

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

services/backend/DB.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@ To perform the initial setup of the database, use the following endpoint:
2626

2727
**For SQLite:**
2828
The server will automatically manage the database file location. The request body should be:
29+
2930
```json
3031
{
3132
"type": "sqlite"
3233
}
3334
```
35+
3436
The SQLite database file will be created and stored at: `services/backend/persistent_data/database/deploystack.db`.
3537

3638
**For PostgreSQL:**
3739
The request body should be:
40+
3841
```json
3942
{
4043
"type": "postgres",
4144
"connectionString": "postgresql://username:password@host:port/mydatabase"
4245
}
4346
```
47+
4448
Replace the `connectionString` with your actual PostgreSQL connection URI.
4549

4650
**Important:** After the initial database setup via this API, you **must restart the backend server** for the changes to take full effect and for the application to connect to the newly configured database.
@@ -168,6 +172,7 @@ You can inspect the SQLite database directly using various tools:
168172
```bash
169173
sqlite3 services/backend/persistent_data/database/deploystack.db
170174
```
175+
171176
(Assuming the command is run from the project root directory)
172177
173178
- **Visual Tools**: [DB Browser for SQLite](https://sqlitebrowser.org/) or VSCode extensions like SQLite Viewer

services/backend/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ services/backend/
8484
The `services/backend/persistent_data/` directory is designated for storing all data that needs to persist across application restarts or deployments.
8585

8686
**Purpose:**
87+
8788
- To provide a single, consistent location for all persistent backend data.
8889
- When developing backend features that require data persistence (e.g., database files, configuration files that should not be in version control but are generated/modified at runtime), use this directory exclusively.
8990

9091
**Examples of data stored here:**
92+
9193
- SQLite database file (e.g., `persistent_data/database/deploystack.db`)
9294
- Database selection configuration (e.g., `persistent_data/db.selection.json`)
9395

services/backend/SECURITY.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ We will acknowledge receipt of your vulnerability report promptly and work with
1212

1313
User passwords are never stored in plaintext. We employ a strong, adaptive hashing algorithm to protect user credentials.
1414

15-
- **Algorithm:** We will use `argon2id`, which is a part of the Argon2 family of algorithms (Argon2id is generally recommended as it provides resistance against both side-channel attacks and GPU cracking attacks).
16-
- **Salt Generation:** A unique, cryptographically secure salt is automatically generated for each user's password by the `argon2` library at the time of account creation or password change. This salt is then stored as part of the resulting hash string.
17-
- **Parameters:** We use appropriate parameters for `argon2` (e.g., memory cost, time cost, and parallelism) to ensure that the hashing process is computationally intensive, making brute-force attacks significantly more difficult. These parameters are chosen to balance security with acceptable performance on our servers and may be adjusted based on hardware improvements over time.
18-
- **Verification:** During login, the provided password and the stored salt (extracted from the hash string) are used to re-compute the hash. This newly computed hash is then compared against the stored hash in a constant-time manner (handled by the `argon2` library's verify function) to help prevent timing attacks.
15+
- **Algorithm:** We will use `argon2id`, which is a part of the Argon2 family of algorithms (Argon2id is generally recommended as it provides resistance against both side-channel attacks and GPU cracking attacks).
16+
- **Salt Generation:** A unique, cryptographically secure salt is automatically generated for each user's password by the `argon2` library at the time of account creation or password change. This salt is then stored as part of the resulting hash string.
17+
- **Parameters:** We use appropriate parameters for `argon2` (e.g., memory cost, time cost, and parallelism) to ensure that the hashing process is computationally intensive, making brute-force attacks significantly more difficult. These parameters are chosen to balance security with acceptable performance on our servers and may be adjusted based on hardware improvements over time.
18+
- **Verification:** During login, the provided password and the stored salt (extracted from the hash string) are used to re-compute the hash. This newly computed hash is then compared against the stored hash in a constant-time manner (handled by the `argon2` library's verify function) to help prevent timing attacks.
1919

2020
This approach ensures that even if the database were compromised, recovering the original passwords would be computationally infeasible.
2121

2222
## Session Management
2323

2424
User sessions are managed using `lucia-auth`.
2525

26-
- Session identifiers are cryptographically random and stored in secure, HTTP-only cookies to prevent XSS attacks from accessing them.
27-
- Sessions have defined expiration times (both active and idle timeouts) to limit the window of opportunity for session hijacking.
26+
- Session identifiers are cryptographically random and stored in secure, HTTP-only cookies to prevent XSS attacks from accessing them.
27+
- Sessions have defined expiration times (both active and idle timeouts) to limit the window of opportunity for session hijacking.
2828

2929
## Data Validation
3030

0 commit comments

Comments
 (0)