Skip to content
Snippets Groups Projects
Commit b2db783c authored by Yassine Doghri's avatar Yassine Doghri
Browse files

docs(install): add email/smtp configuration options

closes #147
parent eabe3f3b
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,14 @@ database.default.username="root" ...@@ -27,6 +27,14 @@ database.default.username="root"
database.default.password="****" database.default.password="****"
database.default.DBPrefix="cp_" database.default.DBPrefix="cp_"
#--------------------------------------------------------------------
# Email configuration
#--------------------------------------------------------------------
# email.fromEmail="your_email_address"
# email.SMTPHost="your_smtp_host"
# email.SMTPUser="your_smtp_user"
# email.SMTPPass="your_smtp_password"
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Cache configuration (advanced) # Cache configuration (advanced)
# #
...@@ -46,3 +54,5 @@ cache.handler="file" ...@@ -46,3 +54,5 @@ cache.handler="file"
# REST API configuration # REST API configuration
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# restapi.enabled=true # restapi.enabled=true
...@@ -8,7 +8,7 @@ use CodeIgniter\Config\BaseConfig; ...@@ -8,7 +8,7 @@ use CodeIgniter\Config\BaseConfig;
class Email extends BaseConfig class Email extends BaseConfig
{ {
public string $fromEmail = 'hello@castopod.local'; public string $fromEmail = '';
public string $fromName = 'Castopod'; public string $fromName = 'Castopod';
...@@ -17,12 +17,12 @@ class Email extends BaseConfig ...@@ -17,12 +17,12 @@ class Email extends BaseConfig
/** /**
* The "user agent" * The "user agent"
*/ */
public string $userAgent = 'CodeIgniter'; public string $userAgent = 'Castopod/' . CP_VERSION;
/** /**
* The mail sending protocol: mail, sendmail, smtp * The mail sending protocol: mail, sendmail, smtp
*/ */
public string $protocol = 'mail'; public string $protocol = 'smtp';
/** /**
* The server path to Sendmail. * The server path to Sendmail.
...@@ -118,4 +118,11 @@ class Email extends BaseConfig ...@@ -118,4 +118,11 @@ class Email extends BaseConfig
* Enable notify message from server * Enable notify message from server
*/ */
public bool $DSN = false; public bool $DSN = false;
public function __construct()
{
parent::__construct();
$this->userAgent = 'Castopod/' . CP_VERSION . '; +' . base_url('', 'https');
}
} }
...@@ -117,26 +117,32 @@ can be added as a cache handler. ...@@ -117,26 +117,32 @@ can be added as a cache handler.
- **castopod/app** - **castopod/app**
| Variable name | Type (`default`) | | Variable name | Type (`default`) | Default |
| -------------------------- | ----------------------------------- | | ---------------------------- | ----------------------- | ---------------- |
| **`CP_BASEURL`** | string (`undefined`) | | **`CP_BASEURL`** | string | `undefined` |
| **`CP_MEDIA_BASEURL`** | ?string (`(empty)`) | | **`CP_MEDIA_BASEURL`** | ?string | `CP_BASEURL` |
| **`CP_ADMIN_GATEWAY`** | ?string (`"cp-admin"`) | | **`CP_ADMIN_GATEWAY`** | ?string | `"cp-admin"` |
| **`CP_AUTH_GATEWAY`** | ?string (`"cp-auth"`) | | **`CP_AUTH_GATEWAY`** | ?string | `"cp-auth"` |
| **`CP_ANALYTICS_SALT`** | string (`undefined`) | | **`CP_ANALYTICS_SALT`** | string | `undefined` |
| **`CP_DATABASE_HOSTNAME`** | ?string (`"mariadb"`) | | **`CP_DATABASE_HOSTNAME`** | ?string | `"mariadb"` |
| **`CP_DATABASE_NAME`** | string (`MYSQL_DATABASE`) | | **`CP_DATABASE_NAME`** | ?string | `MYSQL_DATABASE` |
| **`CP_DATABASE_USERNAME`** | string (`MYSQL_USER`) | | **`CP_DATABASE_USERNAME`** | ?string | `MYSQL_USER` |
| **`CP_DATABASE_PASSWORD`** | string (`MYSQL_PASSWORD`) | | **`CP_DATABASE_PASSWORD`** | ?string | `MYSQL_PASSWORD` |
| **`CP_DATABASE_PREFIX`** | ?string (`"cp_"`) | | **`CP_DATABASE_PREFIX`** | ?string | `"cp_"` |
| **`CP_CACHE_HANDLER`** | ?[`"file"` or `"redis"`] (`"file"`) | | **`CP_CACHE_HANDLER`** | [`"file"` or `"redis"`] | `"file"` |
| **`CP_REDIS_HOST`** | ?string (`"localhost"`) | | **`CP_REDIS_HOST`** | ?string | `"localhost"` |
| **`CP_REDIS_PASSWORD`** | ?string (`null`) | | **`CP_REDIS_PASSWORD`** | ?string | `null` |
| **`CP_REDIS_PORT`** | ?number (`6379`) | | **`CP_REDIS_PORT`** | ?number | `6379` |
| **`CP_REDIS_DATABASE`** | ?number (`0`) | | **`CP_REDIS_DATABASE`** | ?number | `0` |
| **`CP_EMAIL_SMTP_HOST`** | ?string | `undefined` |
| **`CP_EMAIL_FROM`** | ?string | `undefined` |
| **`CP_EMAIL_SMTP_USERNAME`** | ?string | `"localhost"` |
| **`CP_EMAIL_SMTP_PASSWORD`** | ?string | `null` |
| **`CP_EMAIL_SMTP_PORT`** | ?number | `25` |
| **`CP_EMAIL_SMTP_CRYPTO`** | [`"tls"` or `"ssl"`] | `"tls"` |
- **castopod/web-server** - **castopod/web-server**
| Variable name | Type (`default`) | | Variable name | Type | Default |
| --------------------- | ----------------- | | --------------------- | ------- | ------- |
| **`CP_APP_HOSTNAME`** | ?string (`"app"`) | | **`CP_APP_HOSTNAME`** | ?string | `"app"` |
...@@ -126,11 +126,40 @@ want to generate Video Clips. The following extensions must be installed: ...@@ -126,11 +126,40 @@ want to generate Video Clips. The following extensions must be installed:
::: info Note ::: info Note
The install script writes a `.env` file in the package root. If you cannot go The install script writes a `.env` file in the package root. If you cannot go
through the install wizard, you can through the install wizard, you can create and edit the `.env` file manually
[create and update the `.env` file manually](#alternative-manual-configuration). based on the `.env.example` file.
::: :::
### Email/SMTP setup
Email configuration is required for some features to work properly (eg.
retrieving your forgotten password, sending instructions to premium subscribers,
…)
You may add your email configuration in your instance's `.env` like so:
```ini
# […]
email.fromEmail="your_email_address"
email.SMTPHost="your_smtp_host"
email.SMTPUser="your_smtp_user"
email.SMTPPass="your_smtp_password"
```
#### Email config options
| Variable name | Type | Default |
| ---------------- | -------------------- | ------------ |
| **`fromEmail`** | string | `undefined` |
| **`fromName`** | string | `"Castopod"` |
| **`SMTPHost`** | string | `undefined` |
| **`SMTPUser`** | string | `undefined` |
| **`SMTPPass`** | string | `undefined` |
| **`SMTPPort`** | number | `25` |
| **`SMTPCrypto`** | [`"tls"` or `"ssl"`] | `"tls"` |
## Community packages ## Community packages
If you don't want to bother with installing Castopod manually, you may use one If you don't want to bother with installing Castopod manually, you may use one
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment