Trubudget Email Service
Environment Variables
Env Variable name | Required | Default Value | Description |
---|---|---|---|
AUTHENTICATION | no | jwt | If set to none, no JWT-Token is required for all endpoints. If set JWT, a JWT token is necessary. |
PORT | no | 8890 | The port used to expose the email-notification service. Value is a port with minimal value 0 and maximal value 65535 |
DB_TYPE | no | pg | Type of database. A currently supported list can be found in the Database Configuration section. |
DB_USER | no | postgres | User name for connected database. |
DB_PASSWORD | no | test | Password for connected database. |
DB_HOST | no | localhost | IP/host of connected database. |
DB_NAME | no | trubudget_email_service | Name of the database. |
DB_PORT | no | 5432 | Port of connected database. Value is a port with minimal value 0 and maximal value 65535 |
DB_SSL | no | - | If true the DB connection is using the SSL protocol |
DB_SCHEMA | no | public | Schema of connected database |
SQL_DEBUG | no | - | The SQL Debug option is forwarded to the knex configuration. |
USER_TABLE | no | users | Name of the table which is created if the first email address is inserted. |
SMTP_HOST | no | localhost | IP/host of external SMTP-Server used to actually send notification emails. |
SMTP_PORT | no | 2500 | Port of external SMTP-Server. Value is a port with minimal value 0 and maximal value 65535 |
SMTP_SSL | no | - | If true the external SMTP-Server connection is using the SSL protocol. |
SMTP_USER | no | - | This is forwarded to the auth prop of the nodemailer's transport-options, to authenticate with the credentials of the configured SMTP server. |
SMTP_PASSWORD | no | - | Password of external SMTP-Server used to actually send notification emails. |
EMAIL_FROM | yes | - | This is injected into the from field of the email notification. |
EMAIL_SUBJECT | no | Trubudget Notification | This is injected into the subject field of the email notification. |
EMAIL_TEXT | no | You have received a notification. | This is injected into the body of the email notification. |
ACCESS_CONTROL_ALLOW_ORIGIN | no | * | Since the service uses CORS, the domain by which it can be called needs to be set. Setting this value to * means that it can be called from any domain. Read more about this topic here. |
RATE_LIMIT | no | - | Defines the limit each IP to RATE_LIMIT requests per windowMs (1 minute) |
JWT_SECRET | yes (if JWT_ALGORITM=HS256) | - | If JWT_ALGORITHM is set to HS256 , this is required and holds a secret to verify API-issued JWTs, with 32 length. If JWT_ALGORITHM is RS256 , leave blank. |
JWT_ALGORITHM | no | HS256 | Algorithm used for signing and verifying JWTs. Currently HS256 or RS256 are supported. |
JWT_PUBLIC_KEY | yes (if JWT_ALGORITHM=RS256) | - | If JWT_ALGORITHM is set to RS256 , this is required and holds BASE64 encoded PEM encoded public key for RSA. |
LOG_LEVEL | no | info | Defines the log output. |
PRETTY_PRINT | no | - | If true the log output is pretty printed. |
JWT_SECRET
The JWT_SECRET is shared between Trubudget's blockchain api and email-service. The endpoints of the email-service can only be used by providing a valid JWT_TOKEN signed with this JWT_SECRET. Since the blockchain is using the notification endpoints and the ui is using the user endpoints the secret has to be shared.