Fix .env file parsing errors with better validation and error handling
This commit is contained in:
@@ -56,9 +56,11 @@ SMTP_USERNAME=your-email@gmail.com
|
||||
SMTP_PASSWORD=your-app-password
|
||||
SMTP_SECURE=true
|
||||
MAIL_FROM_ADDRESS=your-email@gmail.com
|
||||
MAIL_FROM_NAME=Docmost
|
||||
MAIL_FROM_NAME="Docmost"
|
||||
```
|
||||
|
||||
**Important**: Values with spaces must be quoted with double quotes.
|
||||
|
||||
### S3 Storage
|
||||
|
||||
To use Amazon S3 or compatible storage:
|
||||
@@ -110,6 +112,34 @@ cloudron exec --app docmost -- env | grep -E "(MAIL|STORAGE|S3)" | sort
|
||||
cloudron logs --app docmost
|
||||
```
|
||||
|
||||
### .env File Format Errors
|
||||
|
||||
If you see errors like `line 1: Docmost: command not found`, your .env file has syntax errors:
|
||||
|
||||
1. **Values with spaces must be quoted**:
|
||||
```bash
|
||||
# Wrong:
|
||||
MAIL_FROM_NAME=My Company
|
||||
|
||||
# Correct:
|
||||
MAIL_FROM_NAME="My Company"
|
||||
```
|
||||
|
||||
2. **No spaces around equals sign**:
|
||||
```bash
|
||||
# Wrong:
|
||||
MAIL_DRIVER = smtp
|
||||
|
||||
# Correct:
|
||||
MAIL_DRIVER=smtp
|
||||
```
|
||||
|
||||
3. **Check for invalid characters**:
|
||||
```bash
|
||||
# Validate your .env file:
|
||||
cloudron exec --app docmost -- cat /app/data/.env
|
||||
```
|
||||
|
||||
### Reset to Defaults
|
||||
|
||||
To reset to Cloudron defaults, simply remove the custom .env file:
|
||||
|
Reference in New Issue
Block a user