Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This file is a "template" of what your .env file should look like.
# Set variables here that may be different on each deployment target of the app,
# e.g. development, staging, production.
#
# On `composer install`/`composer update`, this file is copied to `.env` (unless
# it already exists) and PHPLIST_SECRET is replaced with a freshly generated value.
#
# https://symfony.com/doc/current/configuration.html#configuring-environment-variables-in-env-files

PHPLIST_DATABASE_DRIVER=pdo_mysql
PHPLIST_DATABASE_PATH=
PHPLIST_DATABASE_HOST=127.0.0.1
PHPLIST_DATABASE_PORT=3306
PHPLIST_DATABASE_NAME=phplistdb
PHPLIST_DATABASE_USER=phplist
PHPLIST_DATABASE_PASSWORD=phplist
DATABASE_PREFIX=phplist_
LIST_TABLE_PREFIX=listattr_

APP_DEV_VERSION=0
[email protected]
APP_POWERED_BY_PHPLIST=0
PREFERENCEPAGE_SHOW_PRIVATE_LISTS=0

API_BASE_URL=http://api.phplist.local/
FRONT_END_BASE_URL=http://frontend.phplist.local

PARALLER_USE_WITH_PHPLIST3=0

# Email configuration
[email protected]
MAILER_DSN=null://null
CONFIRMATION_URL=http://api.phplist.local/api/v2/subscriber/confirm/
SUBSCRIPTION_CONFIRMATION_URL=http://api.phplist.local/api/v2/subscription/confirm/
PASSWORD_RESET_URL=https://example.com/reset/
SHOW_UNSUBSCRIBELINK=1

# Bounce email settings
[email protected]
[email protected]
BOUNCE_IMAP_HOST=imap.phplist.com
BOUNCE_IMAP_PORT=993
BOUNCE_IMAP_ENCRYPTION=ssl
BOUNCE_IMAP_MAILBOX=/var/spool/mail/bounces
BOUNCE_IMAP_MAILBOX_NAME=INBOX,ONE_MORE
BOUNCE_IMAP_PROTOCOL=imap
BOUNCE_IMAP_UNSUBSCRIBE_THRESHOLD=5
BOUNCE_IMAP_BLACKLIST_THRESHOLD=3
BOUNCE_IMAP_PURGE=0
BOUNCE_IMAP_PURGE_UNPROCESSED=0

# Messenger configuration for asynchronous processing
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=true

# A secret key that's used to generate certain security-related tokens
PHPLIST_SECRET=%s
VERIFY_SSL=1

APP_PHPLIST_ISP_CONF_PATH=/etc/phplist.conf

# Message sending
MAILQUEUE_BATCH_SIZE=5
MAILQUEUE_BATCH_PERIOD=5
MAILQUEUE_THROTTLE=5
MESSAGING_MAX_PROCESS_TIME=600
MAX_MAILSIZE=209715200
DEFAULT_MESSAGEAGE=691200
USE_MANUAL_TEXT_PART=0
MESSAGING_BLACKLIST_GRACE_TIME=600
GOOGLE_SENDERID=
USE_AMAZONSES=0
USE_PRECEDENCE_HEADER=0
EMBEDEXTERNALIMAGES=0
EMBEDUPLOADIMAGES=0
EXTERNALIMAGE_MAXAGE=0
EXTERNALIMAGE_TIMEOUT=30
EXTERNALIMAGE_MAXSIZE=204800
FORWARD_ALTERNATIVE_CONTENT=0
EMAILTEXTCREDITS=0
ALWAYS_ADD_USERTRACK=1
SEND_LISTADMIN_COPY=0

FORWARD_EMAIL_PERIOD="1 minute"
FORWARD_EMAIL_COUNT=1
FORWARD_PERSONAL_NOTE_SIZE=0
FORWARD_FRIEND_COUNT_ATTRIBUTE=
KEEPFORWARDERATTRIBUTES=0

UPLOADIMAGES_DIR=uploadimages
PHPLIST_UPLOADS_MAX_SIZE=5M

PUBLIC_SCHEMA=https
PHPLIST_ATTACHMENT_DOWNLOAD_URL=https://example.com/download/
PHPLIST_ATTACHMENT_REPOSITORY_PATH=/tmp
MAX_AVATAR_SIZE=100000
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
/composer.lock
/config/bundles.yml
/config/config_modules.yml
/config/parameters.yml
/.env
/.env.local
/.env.*.local
/config/routing_modules.yml
/nbproject
/var/
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ This project adheres to [Semantic Versioning](https://semver.org/).

### Added
- Graylog integration for centralized logging (#TBD)
- `symfony/dotenv` support: configuration values are now read from a `.env` file (generated from `.env.dist` on install/update), in addition to real environment variables (#TBD)

### Changed
- `config/parameters.yml.dist` no longer contains inline `env(VAR): default` fallbacks; defaults now live in `.env.dist` (#TBD)

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ this code.
The phpList application is configured so that the built-in PHP web server can
run in development and testing mode, while Apache can run in production mode.

Please first set the database credentials in `config/parameters.yml`.
Please first set the database credentials in `.env` (created from `.env.dist` on `composer install`/`composer update`).

### Development

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
"ext-fileinfo": "*",
"setasign/fpdf": "^1.8",
"phpdocumentor/reflection-docblock": "^5.2",
"guzzlehttp/guzzle": "^7.4.5"
"guzzlehttp/guzzle": "^7.4.5",
"symfony/dotenv": "^6.4"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down Expand Up @@ -127,7 +128,7 @@
"PhpList\\Core\\Composer\\ScriptHandler::createGeneralConfiguration",
"PhpList\\Core\\Composer\\ScriptHandler::createBundleConfiguration",
"PhpList\\Core\\Composer\\ScriptHandler::createRoutesConfiguration",
"PhpList\\Core\\Composer\\ScriptHandler::createParametersConfiguration",
"PhpList\\Core\\Composer\\ScriptHandler::createDotenvConfiguration",
"php bin/console cache:clear",
"php bin/console cache:warmup"
],
Expand Down
99 changes: 99 additions & 0 deletions config/parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# This file is a "template" of what your parameters.yml file should look like
# Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
#
# These variables are read from environment variables using the "env" construct.
# The environment variables themselves are defined in the ".env" file (see ".env.dist" for the template)
# and/or in the actual environment (e.g. Apache host configuration, command line).
parameters:
database_driver: '%env(PHPLIST_DATABASE_DRIVER)%'
database_path: '%env(PHPLIST_DATABASE_PATH)%'
database_host: '%env(PHPLIST_DATABASE_HOST)%'
database_port: '%env(PHPLIST_DATABASE_PORT)%'
database_name: '%env(PHPLIST_DATABASE_NAME)%'
database_user: '%env(PHPLIST_DATABASE_USER)%'
database_password: '%env(PHPLIST_DATABASE_PASSWORD)%'
database_prefix: '%env(DATABASE_PREFIX)%'
list_table_prefix: '%env(LIST_TABLE_PREFIX)%'
app.dev_version: '%env(APP_DEV_VERSION)%'
app.dev_email: '%env(APP_DEV_EMAIL)%'
app.powered_by_phplist: '%env(APP_POWERED_BY_PHPLIST)%'
app.preference_page_show_private_lists: '%env(PREFERENCEPAGE_SHOW_PRIVATE_LISTS)%'

app.rest_api_base_url: '%env(API_BASE_URL)%/api/v2'
app.api_base_url: '%env(API_BASE_URL)%'
app.frontend_base_url: '%env(FRONT_END_BASE_URL)%'

parallel_use_with_phplist3: '%env(PARALLER_USE_WITH_PHPLIST3)%'

# Email configuration
app.mailer_from: '%env(MAILER_FROM)%'
app.mailer_dsn: '%env(MAILER_DSN)%'
app.confirmation_url: '%env(CONFIRMATION_URL)%'
app.subscription_confirmation_url: '%env(SUBSCRIPTION_CONFIRMATION_URL)%'
app.password_reset_url: '%env(PASSWORD_RESET_URL)%'
app.show_unsubscribe_link: '%env(SHOW_UNSUBSCRIBELINK)%'

# bounce email settings
imap_bounce.email: '%env(BOUNCE_EMAIL)%'
imap_bounce.password: '%env(BOUNCE_IMAP_PASS)%'
imap_bounce.host: '%env(BOUNCE_IMAP_HOST)%'
imap_bounce.port: '%env(BOUNCE_IMAP_PORT)%'
imap_bounce.encryption: '%env(BOUNCE_IMAP_ENCRYPTION)%'
imap_bounce.mailbox: '%env(BOUNCE_IMAP_MAILBOX)%'
imap_bounce.mailbox_name: '%env(BOUNCE_IMAP_MAILBOX_NAME)%'
imap_bounce.protocol: '%env(BOUNCE_IMAP_PROTOCOL)%'
imap_bounce.unsubscribe_threshold: '%env(BOUNCE_IMAP_UNSUBSCRIBE_THRESHOLD)%'
imap_bounce.blacklist_threshold: '%env(BOUNCE_IMAP_BLACKLIST_THRESHOLD)%'
imap_bounce.purge: '%env(BOUNCE_IMAP_PURGE)%'
imap_bounce.purge_unprocessed: '%env(BOUNCE_IMAP_PURGE_UNPROCESSED)%'

# Messenger configuration for asynchronous processing
app.messenger_transport_dsn: '%env(MESSENGER_TRANSPORT_DSN)%'

# A secret key that's used to generate certain security-related tokens
secret: '%env(PHPLIST_SECRET)%'
phplist.verify_ssl: '%env(VERIFY_SSL)%'

graylog_host: 'graylog.phplist.local'
graylog_port: 12201

app.phplist_isp_conf_path: '%env(APP_PHPLIST_ISP_CONF_PATH)%'

# Message sending
messaging.mail_queue_batch_size: '%env(MAILQUEUE_BATCH_SIZE)%'
messaging.mail_queue_period: '%env(MAILQUEUE_BATCH_PERIOD)%'
messaging.mail_queue_throttle: '%env(MAILQUEUE_THROTTLE)%'
messaging.max_process_time: '%env(MESSAGING_MAX_PROCESS_TIME)%'
messaging.max_mail_size: '%env(MAX_MAILSIZE)%'
messaging.default_message_age: '%env(DEFAULT_MESSAGEAGE)%'
messaging.use_manual_text_part: '%env(USE_MANUAL_TEXT_PART)%'
messaging.blacklist_grace_time: '%env(MESSAGING_BLACKLIST_GRACE_TIME)%'
messaging.google_sender_id: '%env(GOOGLE_SENDERID)%'
messaging.use_amazon_ses: '%env(USE_AMAZONSES)%'
messaging.use_precedence_header: '%env(USE_PRECEDENCE_HEADER)%'
messaging.embed_external_images: '%env(EMBEDEXTERNALIMAGES)%'
messaging.embed_uploaded_images: '%env(EMBEDUPLOADIMAGES)%'
messaging.external_image_max_age: '%env(EXTERNALIMAGE_MAXAGE)%'
messaging.external_image_timeout: '%env(EXTERNALIMAGE_TIMEOUT)%'
messaging.external_image_max_size: '%env(EXTERNALIMAGE_MAXSIZE)%'
messaging.forward_alternative_content: '%env(FORWARD_ALTERNATIVE_CONTENT)%'
messaging.email_text_credits: '%env(EMAILTEXTCREDITS)%'
messaging.always_add_user_track: '%env(ALWAYS_ADD_USERTRACK)%'
messaging.send_list_admin_copy: '%env(SEND_LISTADMIN_COPY)%'

phplist.forward_email_period: '%env(FORWARD_EMAIL_PERIOD)%'
phplist.forward_email_count: '%env(FORWARD_EMAIL_COUNT)%'
phplist.forward_personal_note_size: '%env(FORWARD_PERSONAL_NOTE_SIZE)%'
phplist.forward_friend_count_attribute: '%env(FORWARD_FRIEND_COUNT_ATTRIBUTE)%'
phplist.keep_forwarded_attributes: '%env(KEEPFORWARDERATTRIBUTES)%'

phplist.upload_images_dir: '%env(UPLOADIMAGES_DIR)%'
phplist.uploads.allowed_mime_types: ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml']
phplist.uploads.allowed_extensions: ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg']
phplist.uploads.max_size: '%env(PHPLIST_UPLOADS_MAX_SIZE)%'

phplist.public_schema: '%env(PUBLIC_SCHEMA)%'
phplist.attachment_download_url: '%env(PHPLIST_ATTACHMENT_DOWNLOAD_URL)%'
phplist.attachment_repository_path: '%env(PHPLIST_ATTACHMENT_REPOSITORY_PATH)%'
phplist.max_avatar_size: '%env(MAX_AVATAR_SIZE)%'
Loading
Loading