Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2344 commits
Select commit Hold shift + click to select a range
9ee3987
f
rmusser01 Jun 27, 2025
a4074f9
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Jun 27, 2025
fbb2097
docs
rmusser01 Jun 27, 2025
ad560f0
Delete .DS_Store
rmusser01 Jun 28, 2025
a6f9666
F for rag
rmusser01 Jul 16, 2025
ac5a600
?
rmusser01 Jul 16, 2025
66f2c79
docs
rmusser01 Jul 24, 2025
fe1f7c3
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Jul 24, 2025
f895e97
checkin
rmusser01 Aug 1, 2025
96216d8
Merge branch 'dev' of https://github.com/rmusser00/tldw_server into dev
rmusser01 Aug 1, 2025
17572cb
Phase 3 Complete: Character Chat Improvements + Bug Fixes
rmusser01 Aug 3, 2025
e72520f
letting cc run for days...
rmusser01 Aug 3, 2025
db7f72b
Phase 4 Complete: Comprehensive Evaluation System
rmusser01 Aug 3, 2025
f0fae97
Potential fix for code scanning alert no. 423: Use of a broken or wea…
rmusser01 Aug 3, 2025
14e8f92
mcp
rmusser01 Aug 3, 2025
369f80a
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 3, 2025
824c78f
README update
rmusser01 Aug 7, 2025
a34679a
README Updated
rmusser01 Aug 7, 2025
7a2d38a
Docs
rmusser01 Aug 7, 2025
4323b4d
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 7, 2025
cb40b80
tests
rmusser01 Aug 7, 2025
d3bba57
tests
rmusser01 Aug 7, 2025
b7aa90a
fix
rmusser01 Aug 7, 2025
a93af45
Test fixes
rmusser01 Aug 8, 2025
f5436c6
test fixes
rmusser01 Aug 9, 2025
b75a730
tests work
rmusser01 Aug 9, 2025
2b0afc0
Potential fix for code scanning alert no. 428: Use of a broken or wea…
rmusser01 Aug 9, 2025
034ed76
docs
rmusser01 Aug 9, 2025
27d4758
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 9, 2025
3b6b57a
add DS_Store to .gitignore
rmusser01 Aug 9, 2025
9db412a
remove .DS_Store files
rmusser01 Aug 9, 2025
9e01d1b
evals redo
rmusser01 Aug 9, 2025
7cb39f9
evals refactor
rmusser01 Aug 9, 2025
2b78a74
progress
rmusser01 Aug 9, 2025
e939aee
test work
rmusser01 Aug 9, 2025
aa2d64c
docs
rmusser01 Aug 9, 2025
c4cacae
and RAG should be working
rmusser01 Aug 10, 2025
dc4412c
rag and embeddings endpoints
rmusser01 Aug 10, 2025
3b2b1f8
embeddings documentation
rmusser01 Aug 10, 2025
ef7b2d2
idk
rmusser01 Aug 10, 2025
0da2ad5
comment out black lint
rmusser01 Aug 10, 2025
2631629
disable lint checks
rmusser01 Aug 10, 2025
aeaad34
tomli
rmusser01 Aug 10, 2025
89e7158
??? Github runners are so fun
rmusser01 Aug 10, 2025
85466fe
I am retarded
rmusser01 Aug 10, 2025
ead613d
reqs
rmusser01 Aug 10, 2025
b15891b
2
rmusser01 Aug 10, 2025
fcec6fc
f
rmusser01 Aug 10, 2025
9fd4d14
checkin before user reg
rmusser01 Aug 12, 2025
68e3653
docs
rmusser01 Aug 12, 2025
4e4bb76
user auth module plan
rmusser01 Aug 12, 2025
b684a70
user reg, front end
rmusser01 Aug 13, 2025
3aee193
auth implementation progress - blind
rmusser01 Aug 13, 2025
508e9a8
test fixes
rmusser01 Aug 14, 2025
594ab7d
auth and tests
rmusser01 Aug 14, 2025
87c2cc3
gitignore
rmusser01 Aug 14, 2025
6c8c0ae
gitignore
rmusser01 Aug 14, 2025
11d6460
test passing
rmusser01 Aug 14, 2025
a27868e
test passing
rmusser01 Aug 14, 2025
ce39712
update pyproject
rmusser01 Aug 14, 2025
a27091a
cleanup
rmusser01 Aug 14, 2025
4d002c7
github test runner fix?
rmusser01 Aug 14, 2025
7717250
f
rmusser01 Aug 14, 2025
438b5ef
deps
rmusser01 Aug 14, 2025
9e1fa15
deps
rmusser01 Aug 14, 2025
7adc954
deps
rmusser01 Aug 14, 2025
3534622
deps fix
rmusser01 Aug 14, 2025
32cd7ff
deps fix
rmusser01 Aug 14, 2025
7a662e6
deps
rmusser01 Aug 14, 2025
8f1a9a2
deps
rmusser01 Aug 14, 2025
96bd3a3
deps3
rmusser01 Aug 14, 2025
748bc68
deps99;
rmusser01 Aug 14, 2025
77b160c
works on my machine
rmusser01 Aug 14, 2025
3d2aad3
eh
rmusser01 Aug 14, 2025
43a93ff
ff
rmusser01 Aug 14, 2025
979ece5
deps98
rmusser01 Aug 14, 2025
ff9ca8a
deps97
rmusser01 Aug 14, 2025
f7941a3
gh runners fix
rmusser01 Aug 14, 2025
1b9950b
gh runners fix
rmusser01 Aug 14, 2025
4d9d4e9
and this should wokr
rmusser01 Aug 14, 2025
67d57b0
another
rmusser01 Aug 14, 2025
c8c3683
another
rmusser01 Aug 14, 2025
a482eeb
test fix
rmusser01 Aug 14, 2025
509ca43
test fixes
rmusser01 Aug 14, 2025
02ee7e3
checkin
rmusser01 Aug 14, 2025
92a7ddf
progress
rmusser01 Aug 15, 2025
5e44831
progress
rmusser01 Aug 15, 2025
f82538c
user reg + admin
rmusser01 Aug 15, 2025
f3f6c27
test fix
rmusser01 Aug 15, 2025
20e55a1
test fix
rmusser01 Aug 15, 2025
d6116da
progress
rmusser01 Aug 15, 2025
c7f9480
rag tests passing
rmusser01 Aug 15, 2025
35bf6ba
progress
rmusser01 Aug 15, 2025
8b6dc8b
evals working
rmusser01 Aug 15, 2025
f063d87
all tests pass
rmusser01 Aug 16, 2025
069dcb1
progress
rmusser01 Aug 16, 2025
0176f3f
progress
rmusser01 Aug 16, 2025
11e7df3
progress
rmusser01 Aug 16, 2025
20be397
progress
rmusser01 Aug 16, 2025
32b3bbc
fixups
rmusser01 Aug 16, 2025
66e6329
gitignore embedding_models_data
rmusser01 Aug 16, 2025
a038877
progress
rmusser01 Aug 16, 2025
4bafb4b
progress
rmusser01 Aug 16, 2025
105d2a0
more progress
rmusser01 Aug 17, 2025
b7477c0
progress
rmusser01 Aug 17, 2025
fe562a4
progress
rmusser01 Aug 17, 2025
b7bc6f6
progress
rmusser01 Aug 17, 2025
c676695
reqs
rmusser01 Aug 17, 2025
fbfe9ba
progress
rmusser01 Aug 17, 2025
0c18c68
progress
rmusser01 Aug 17, 2025
b34052b
tests
rmusser01 Aug 17, 2025
3e3747a
progress
rmusser01 Aug 17, 2025
2f39241
progress
rmusser01 Aug 17, 2025
859dd7e
docs
rmusser01 Aug 17, 2025
5cb6f05
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 17, 2025
94a9fb2
f
rmusser01 Aug 17, 2025
f5ada4b
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 17, 2025
27311cc
embeddings tests pass
rmusser01 Aug 17, 2025
09e58e0
tests
rmusser01 Aug 17, 2025
2cac0c5
embeddings tests pass
rmusser01 Aug 17, 2025
5d9f8f9
rag tests passing
rmusser01 Aug 18, 2025
a363691
wew
rmusser01 Aug 18, 2025
00dc097
progress
rmusser01 Aug 19, 2025
3f7e199
progress, before autorun
rmusser01 Aug 19, 2025
b3b61ce
rag work
rmusser01 Aug 19, 2025
f2b8a4f
we cleanup the slop a little
rmusser01 Aug 19, 2025
092b356
cleaning up RAG
rmusser01 Aug 19, 2025
9a744fd
progress
rmusser01 Aug 20, 2025
1dc46d8
progress
rmusser01 Aug 21, 2025
0e1a310
progress
rmusser01 Aug 21, 2025
ae9e6c0
progress
rmusser01 Aug 21, 2025
2fd3811
Chunking module, chatbook, Evals, Task Scheduling (programmatic), Aut…
rmusser01 Aug 21, 2025
e6d528a
progress
rmusser01 Aug 21, 2025
8399de7
progress
rmusser01 Aug 22, 2025
e1d9798
progress, getting nearer
rmusser01 Aug 22, 2025
a9e7edd
tests
rmusser01 Aug 22, 2025
4d93c64
Docs
rmusser01 Aug 22, 2025
96dae67
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 22, 2025
dccee32
chat tests passing
rmusser01 Aug 22, 2025
fd7c52a
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 22, 2025
380aed0
chat tests
rmusser01 Aug 23, 2025
a6fdf70
tests
rmusser01 Aug 23, 2025
1557b18
progress
rmusser01 Aug 23, 2025
9243e07
progress
rmusser01 Aug 23, 2025
2024e7a
progress
rmusser01 Aug 23, 2025
1124993
f
rmusser01 Aug 23, 2025
75788b2
progress
rmusser01 Aug 23, 2025
0be84b9
progress
rmusser01 Aug 23, 2025
a38d31b
checkpoint
rmusser01 Aug 23, 2025
2b459b9
more progress
rmusser01 Aug 24, 2025
a109dbd
more progress
rmusser01 Aug 24, 2025
344546b
progress
rmusser01 Aug 24, 2025
ea5246a
fix/
rmusser01 Aug 24, 2025
e9fb98a
wew core functionality fuckign works
rmusser01 Aug 24, 2025
f001efa
eh
rmusser01 Aug 24, 2025
902ce57
progress
rmusser01 Aug 25, 2025
8404fc7
e2e tests
rmusser01 Aug 25, 2025
8162a63
sweet
rmusser01 Aug 25, 2025
6bdf093
cleanup
rmusser01 Aug 25, 2025
722da88
new diarization lib
rmusser01 Aug 25, 2025
2434fd3
eh
rmusser01 Aug 26, 2025
019ce37
tests
rmusser01 Aug 27, 2025
891eac0
well it runs and works and theres a shitty webui. Need to refine/impr…
rmusser01 Aug 27, 2025
3b2f0bf
click for evals module
rmusser01 Aug 27, 2025
3613bdb
webui showing character + conversations tab
rmusser01 Aug 27, 2025
37fae3f
cc
rmusser01 Aug 28, 2025
888dbee
update .gitignore
rmusser01 Aug 28, 2025
36cbc27
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 28, 2025
52ead4f
Create uv.lock
rmusser01 Aug 28, 2025
2491c2e
pyproject + remove cc
rmusser01 Aug 28, 2025
4712baa
html
rmusser01 Aug 28, 2025
cf9f61a
Potential fix for code scanning alert no. 392: Uncontrolled data used…
rmusser01 Aug 29, 2025
d51928e
db-consolidation + lfi fixes
rmusser01 Aug 29, 2025
21a8708
conflict fix
rmusser01 Aug 29, 2025
0965b14
f
rmusser01 Aug 29, 2025
df2e20f
Potential fix for code scanning alert no. 515: Uncontrolled data used…
rmusser01 Aug 30, 2025
e33c187
Potential fix for code scanning alert no. 530: Uncontrolled data used…
rmusser01 Aug 30, 2025
d6d03f2
f
rmusser01 Aug 30, 2025
61cf8b4
fixes
rmusser01 Aug 30, 2025
0938e3e
Potential fix for code scanning alert no. 536: Uncontrolled data used…
rmusser01 Aug 30, 2025
0c5014e
fixes
rmusser01 Aug 30, 2025
851c672
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 30, 2025
8ccc5cc
fixes
rmusser01 Aug 30, 2025
44fba25
fixes
rmusser01 Aug 30, 2025
98bcf94
Potential fix for code scanning alert no. 519: Use of a broken or wea…
rmusser01 Aug 30, 2025
9cdd144
Update prompt_studio_websocket.py
rmusser01 Aug 30, 2025
7beda96
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 30, 2025
d10f208
Update Media_Wiki.py
rmusser01 Aug 30, 2025
04dfd36
fixes
rmusser01 Aug 30, 2025
eb4229b
fixes
rmusser01 Aug 30, 2025
cdb2978
Potential fix for code scanning alert no. 544: Information exposure t…
rmusser01 Aug 30, 2025
10f8697
Potential fix for code scanning alert no. 548: Bad HTML filtering regexp
rmusser01 Aug 30, 2025
d7ef739
fixes
rmusser01 Aug 30, 2025
04f852b
fixes
rmusser01 Aug 30, 2025
9447f72
Update chatbook_service.py
rmusser01 Aug 30, 2025
522342c
rag work
rmusser01 Aug 30, 2025
9c66e6d
fixes
rmusser01 Aug 30, 2025
57d281e
fixes
rmusser01 Aug 30, 2025
cd7d333
fixes
rmusser01 Aug 30, 2025
9cceaf5
fixes
rmusser01 Aug 30, 2025
5754cd5
Update test_chatbook_integration.py
rmusser01 Aug 30, 2025
d089c89
fixes
rmusser01 Aug 30, 2025
958ae3e
fixes
rmusser01 Aug 30, 2025
1b561d5
fixes
rmusser01 Aug 30, 2025
b03d3e6
docs
rmusser01 Aug 31, 2025
6064b62
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 31, 2025
9436999
fixes
rmusser01 Aug 31, 2025
5b6ba68
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Aug 31, 2025
d8c626e
fixes
rmusser01 Aug 31, 2025
0770e71
Update test_security.py
rmusser01 Aug 31, 2025
8084cb6
fixes
rmusser01 Aug 31, 2025
fff5540
Update rag_unified.py
rmusser01 Aug 31, 2025
482a143
Update rag_unified.py
rmusser01 Aug 31, 2025
d536193
Update pyproject.toml
rmusser01 Aug 31, 2025
5d9917e
fixes
rmusser01 Aug 31, 2025
4153d79
fixes
rmusser01 Aug 31, 2025
2074d53
checkpoint
rmusser01 Aug 31, 2025
adb23fc
fixes+tts/stt
rmusser01 Aug 31, 2025
e813fcb
Update Audio_Transcription_Parakeet_MLX.py
rmusser01 Aug 31, 2025
4a680ad
tts
rmusser01 Aug 31, 2025
b719fc1
tts
rmusser01 Aug 31, 2025
078e66e
tts
rmusser01 Aug 31, 2025
6a507de
tts
rmusser01 Aug 31, 2025
44e7ed3
tts
rmusser01 Aug 31, 2025
7a38406
tts/stt
rmusser01 Aug 31, 2025
b738fcf
tts
rmusser01 Aug 31, 2025
f58b463
stt/tts
rmusser01 Aug 31, 2025
a8338cb
tts
rmusser01 Sep 1, 2025
0ab5403
tts
rmusser01 Sep 1, 2025
a179fbf
basic webui fixes
rmusser01 Sep 1, 2025
3760a36
fixes
rmusser01 Sep 1, 2025
0aeee79
Update chat_content.html
rmusser01 Sep 1, 2025
9878fd2
docs
rmusser01 Sep 1, 2025
e9e6011
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Sep 1, 2025
538f244
docs
rmusser01 Sep 3, 2025
be398a3
fix
rmusser01 Sep 3, 2025
5722b23
tests
rmusser01 Sep 4, 2025
1f9fc9d
tests
rmusser01 Sep 4, 2025
8e6271d
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Sep 4, 2025
1c6ce97
Update test_chat_completions_api.py
rmusser01 Sep 4, 2025
73643ab
fixes
rmusser01 Sep 4, 2025
8e8ea4f
fixes
rmusser01 Sep 4, 2025
3da87fa
tests
rmusser01 Sep 4, 2025
14e9f01
Update TTS.md
rmusser01 Sep 4, 2025
572fd65
Merge branch 'dev' of https://github.com/rmusser01/tldw_server into dev
rmusser01 Sep 4, 2025
7539f88
tests
rmusser01 Sep 4, 2025
838b607
cleanup
rmusser01 Sep 4, 2025
0343319
tests
rmusser01 Sep 4, 2025
b92a7ab
fix
rmusser01 Sep 5, 2025
ed46693
Create test_webui_functions.py
rmusser01 Sep 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
141 changes: 141 additions & 0 deletions .claude/README_AUDIT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Claude Code Audit System

## Overview
This audit system automatically monitors and logs all file modifications made by Claude Code, providing security scanning, code quality checks, and compliance tracking.

## Components

### 1. Global Audit Script
**Location**: `~/.claude/audit_agent.sh`

This script runs after every file modification and:
- Logs all file changes with timestamps
- Scans for sensitive data (API keys, passwords, tokens)
- Checks code quality issues (debug statements, TODOs)
- Runs project-specific linting when available
- Creates both text and JSON audit logs

### 2. Global Settings
**Location**: `~/.claude/settings.json`

Configures hooks that trigger the audit system:
- `PostToolUse` hooks run after Write/Edit operations
- `PreToolUse` hooks log the start of modifications
- Audit logs stored in `~/.claude/audit_logs/`

### 3. Project Settings
**Location**: `.claude/settings.json`

Project-specific configuration for:
- Python linting with ruff
- Test file tracking
- Pre-commit test execution
- Custom notifications for sensitive data

### 4. Audit Configuration
**Location**: `.claude/audit_config.json`

Defines audit rules and patterns:
- Security patterns (API keys, passwords, SQL injection)
- Code quality checks (debug statements, TODOs)
- File rules (size limits, forbidden files)
- Project-specific requirements

## Audit Log Locations

- **Main log**: `~/.claude/audit_logs/audit_YYYYMMDD.log`
- **JSON log**: `~/.claude/audit_logs/audit_YYYYMMDD.json`
- **Activity log**: `~/.claude/audit_logs/activity.log`
- **Test changes**: `~/.claude/audit_logs/test_changes.log`

## Features

### Security Scanning
- Detects hardcoded credentials
- Identifies potential SQL injection vulnerabilities
- Warns about dangerous functions (eval, exec)
- Blocks commits with critical security issues

### Code Quality
- Identifies debug print statements
- Finds TODO/FIXME comments
- Detects console.log statements in JavaScript
- Runs project linters automatically

### Compliance Tracking
- Maintains audit trail of all modifications
- Tracks who modified what and when
- Generates daily summary reports
- Preserves git diff information

## Testing the System

To test if the audit system is working:

```bash
# Test the audit script directly
~/.claude/audit_agent.sh "Test" "/path/to/file.py"

# Check recent audit logs
cat ~/.claude/audit_logs/audit_$(date +%Y%m%d).log

# View JSON audit entries
cat ~/.claude/audit_logs/audit_$(date +%Y%m%d).json | jq '.'
```

## Notifications

The system can send notifications for:
- Critical security issues (macOS notifications)
- Test failures (console warnings)
- Linting errors (based on configuration)

## Customization

### Adding New Security Patterns
Edit `.claude/audit_config.json` and add patterns to the `security.patterns` array.

### Modifying Code Quality Checks
Update the `codeQuality.checks` section in the audit configuration.

### Project-Specific Rules
Add project-specific rules in the `projectSpecific` section of the audit config.

## Troubleshooting

### Audit Not Running
1. Check if the script is executable: `chmod +x ~/.claude/audit_agent.sh`
2. Verify hooks in settings.json are properly configured
3. Check for syntax errors in JSON configuration files

### Missing Logs
1. Ensure audit_logs directory exists: `mkdir -p ~/.claude/audit_logs`
2. Check file permissions on the audit script
3. Review Claude Code's hook execution logs

### False Positives
1. Adjust patterns in audit_config.json
2. Use `continueOnError: true` for non-critical checks
3. Customize severity levels for different rule types

## Maintenance

### Log Rotation
Logs are automatically organized by date. To clean old logs:
```bash
find ~/.claude/audit_logs -name "*.log" -mtime +30 -delete
```

### Updating Rules
When updating audit rules:
1. Test new patterns with sample files first
2. Monitor for false positives
3. Adjust severity levels as needed

## Integration with CI/CD

The audit system can be integrated with CI/CD pipelines:
1. Export audit logs to a central location
2. Parse JSON logs for automated reporting
3. Fail builds on critical security issues
4. Generate compliance reports from audit data
160 changes: 160 additions & 0 deletions .env.authnz.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# ================================================
# AuthNZ Module Environment Configuration Template
# ================================================
# Copy this file to .env and configure for your deployment
# SECURITY WARNING: Never commit the actual .env file to version control!

# ================================================
# AUTHENTICATION MODE
# ================================================
# Options: single_user, multi_user
AUTH_MODE=multi_user

# ================================================
# DATABASE CONFIGURATION
# ================================================
# For PostgreSQL (recommended for multi-user production):
# DATABASE_URL=postgresql://username:password@localhost:5432/tldw_db

# For SQLite (development or single-user):
DATABASE_URL=sqlite:///./Databases/users.db

# Database connection pool settings
DATABASE_POOL_MIN_SIZE=5
DATABASE_POOL_MAX_SIZE=20
DATABASE_MAX_QUERIES=50000
DATABASE_MAX_INACTIVE_CONNECTION_LIFETIME=300

# ================================================
# JWT CONFIGURATION (Multi-User Mode)
# ================================================
# REQUIRED: Generate a secure random key (minimum 32 characters)
# Generate with: python -c "import secrets; print(secrets.token_urlsafe(32))"
JWT_SECRET_KEY=CHANGE_ME_TO_SECURE_RANDOM_KEY_MIN_32_CHARS

# Token expiration times
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_DAYS=7
JWT_ALGORITHM=HS256

# ================================================
# SINGLE-USER MODE CONFIGURATION
# ================================================
# API key for single-user mode (auto-generated if not set)
# Generate with: python -c "import secrets; print(secrets.token_urlsafe(32))"
SINGLE_USER_API_KEY=CHANGE_ME_TO_SECURE_API_KEY

# ================================================
# ENCRYPTION KEYS
# ================================================
# Session token encryption key (auto-generated from JWT secret if not set)
# Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
SESSION_ENCRYPTION_KEY=

# API key pepper for additional hashing security (optional but recommended)
# Generate with: python -c "import secrets; print(secrets.token_hex(32))"
API_KEY_PEPPER=

# ================================================
# REDIS CONFIGURATION (Optional)
# ================================================
# Redis for session caching and rate limiting (improves performance)
# REDIS_URL=redis://localhost:6379/0
# REDIS_MAX_CONNECTIONS=50

# ================================================
# SECURITY SETTINGS
# ================================================
# Registration settings
ENABLE_REGISTRATION=false
REQUIRE_REGISTRATION_CODE=true
REGISTRATION_CODE_DEFAULT_EXPIRY_DAYS=7
REGISTRATION_CODE_DEFAULT_MAX_USES=1

# Password requirements
PASSWORD_MIN_LENGTH=10
ARGON2_MEMORY_COST=32768
ARGON2_TIME_COST=2
ARGON2_PARALLELISM=1

# Login security
MAX_LOGIN_ATTEMPTS=5
LOCKOUT_DURATION_MINUTES=15

# Rate limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_PER_MINUTE=60
RATE_LIMIT_BURST=10
SERVICE_ACCOUNT_RATE_LIMIT=1000

# Session security
SESSION_COOKIE_SECURE=true
SESSION_COOKIE_HTTPONLY=true
SESSION_COOKIE_SAMESITE=lax
SESSION_CLEANUP_INTERVAL_HOURS=1

# ================================================
# STORAGE SETTINGS
# ================================================
# User data paths
USER_DATA_BASE_PATH=./user_databases
CHROMADB_BASE_PATH=./chromadb_data

# Default user quotas
DEFAULT_STORAGE_QUOTA_MB=5120
DEFAULT_USER_ROLE=user

# ================================================
# MONITORING & LOGGING
# ================================================
# Health checks and metrics
ENABLE_HEALTH_CHECK=true
ENABLE_METRICS=true
METRICS_PORT=9090

# Data retention policies
AUDIT_LOG_RETENTION_DAYS=180
PASSWORD_HISTORY_RETENTION_COUNT=5
SESSION_LOG_RETENTION_DAYS=90

# ================================================
# DEVELOPMENT SETTINGS
# ================================================
# WARNING: Only enable these in development!
# ALLOW_JWT_SECRET_FILE=false # Never enable in production
# DEBUG_MODE=false # Verbose logging

# ================================================
# PRODUCTION CHECKLIST
# ================================================
# Before deploying to production, ensure:
# [ ] All CHANGE_ME values have been replaced with secure values
# [ ] JWT_SECRET_KEY is at least 32 characters of random data
# [ ] SINGLE_USER_API_KEY is set (for single-user mode)
# [ ] DATABASE_URL points to production database
# [ ] SESSION_COOKIE_SECURE=true (requires HTTPS)
# [ ] ENABLE_REGISTRATION is set appropriately
# [ ] Redis is configured for better performance (optional)
# [ ] This file is NOT committed to version control
# [ ] Backup strategy is in place for databases
# [ ] Monitoring and alerting are configured

# ================================================
# QUICK START COMMANDS
# ================================================
# 1. Copy this template:
# cp .env.authnz.template .env
#
# 2. Generate secure keys:
# python -c "import secrets; print('JWT_SECRET_KEY=' + secrets.token_urlsafe(32))"
# python -c "import secrets; print('SINGLE_USER_API_KEY=' + secrets.token_urlsafe(32))"
# python -c "from cryptography.fernet import Fernet; print('SESSION_ENCRYPTION_KEY=' + Fernet.generate_key().decode())"
#
# 3. Run database migrations:
# python -m tldw_Server_API.app.core.AuthNZ.run_migrations
#
# 4. Initialize AuthNZ:
# python -m tldw_Server_API.app.core.AuthNZ.initialize
#
# 5. Start the application:
# python -m uvicorn tldw_Server_API.app.main:app --reload
24 changes: 24 additions & 0 deletions .env.backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Database Configuration
AUTH_MODE=multi_user
DATABASE_URL=postgresql://tldw_user:TestPassword123!@localhost/tldw_multiuser

# JWT Configuration
JWT_SECRET_KEY=test-secret-key-for-testing-only-change-in-production
JWT_ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60
REFRESH_TOKEN_EXPIRE_DAYS=30

# Registration Settings
ENABLE_REGISTRATION=true
REQUIRE_REGISTRATION_CODE=false
DEFAULT_USER_ROLE=user
DEFAULT_STORAGE_QUOTA_MB=5120

# Rate Limiting (disabled for testing)
RATE_LIMIT_ENABLED=false
AUTH_RATE_LIMIT=5/minute
API_RATE_LIMIT=100/minute

# CORS
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8000
CORS_ALLOW_CREDENTIALS=true
3 changes: 3 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test environment configuration
AUTH_MODE=single_user
SINGLE_USER_API_KEY=test-api-key-12345
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report-i-found-a-bug-in-tldw-.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report(I found a bug in tldw)
about: Please file a report so I can fix it! (Thank you!)
title: ''
labels: bug
assignees: rmusser01

---

**Are You on the Latest version?**
You did a git pull and are running the latest version/build?
Y/N

**Please describe the bug**
A clear and concise description of what the bug is and how you found it.

**Is the bug reproducable reliably?**
Yes / No

**Steps to to reproduce the issue**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**What was the expected behavior?**
A clear and concise description of what you expected to happen, if there was no bug.

**Screenshots**
If applicable, please add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [Linux/MacOS/Windows]
- Browser [Chrome/Firefox/Safari]
- Date you performed the last git pull:

**Any Additional context**
Please add any other context about the problem here. Thank you!
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Loading
Loading