Configuration
This section contains instructions for configuring CS-Cart Enterprise.
If you have deployed environments using Laravel Sail, you can skip this section as all the environment variables are already configured.
Introduction
CS-Cart Enterprise utilizes environment variables for configuration purposes.
These variables can be set at the server or system level, as well as within the .env file.
By default, only basic variables are described in the .env.example
file. In this section, you will find information about the remaining variables.
Info
Any variable in your .env file can be overridden by external environment variables such as server-level or system-level environment variables.
General
APP_KEY
- Encryption key used for various cryptographic purposes.APP_DEBUG
- Debug mode flag. When enabled, the application will provide detailed information about its state. Only use this mode for local development.APP_ENV
- Current environment. Use this variable to specify the environment the application is running in. This is helpful for adjusting the application's behavior based on the environment, such as enabling verbose logging. Possible values:production
- the application is running in production modelocal
- the application is running in local development modetesting
- the application is running in testing mode
APP_URL
- Application URL.TRUSTED_PROXIES
- List of trusted proxy servers that are placed in front of the application.
Database
DB_CONNECTION
- Specifies the database connection configuration. Available options:mysql
pgsql
sqlite
DB_HOST
- Database host addressDB_PORT
- Database port numberDB_DATABASE
- Name of the database to connect toDB_USERNAME
- Username for the database connectionDB_PASSWORD
- Password for the database connectionDB_TABLE_PREFIX
- Prefix to be applied to all database table names
Warning
Currently, the table prefix functionality is only supported for the mysql
and sqlite
database connections.
If you are using pgsql
, please leave the value of the DB_TABLE_PREFIX
variable empty.
Cache
-
CACHE_DRIVER
- The cache storage driver can have the following values:file
: Cache data is stored in files instorage/app/cache/data
dirapc
: Cache data is stored in the Alternative PHP Cache (APC)database
: Cache data is stored in the databasememcached
: Cache data is stored in Memcachedredis
: Cache data is stored in Redisdynamodb
: Cache data is stored in Amazon DynamoDB
-
CACHE_TAGS_DRIVER
- The cache tags storage driver can have the same values as the cache storage driver:file
: Cache tags are stored in files instorage/app/cache/data
dirapc
: Cache tags are stored in the Alternative PHP Cache (APC)database
: Cache tags are stored in the databasememcached
: Cache tags are stored in Memcachedredis
: Cache tags are stored in Redisdynamodb
: Cache tags are stored in Amazon DynamoDB
Cache::memcached
MEMCACHED_HOST
- Memcached server host addressMEMCACHED_PORT
- Memcached server port numberMEMCACHED_USERNAME
- Memcached server user nameMEMCACHED_PASSWORD
- Memcached server user passwordMEMCACHED_PERSISTENT_ID
- Unique identifiers for creating a persistent storage
Cache::redis
REDIS_HOST
- Redis server host addressREDIS_PORT
- Redis server port numberREDIS_PASSWORD
- Redis server passwordREDIS_CACHE_DB
- Redis server database number
Laravel
You can find information on connecting to a Redis cluster here: https://laravel.com/docs/10.x/redis#clusters
Cache::dynamodb
AWS_ACCESS_KEY_ID
- The access key for your AWS accountAWS_SECRET_ACCESS_KEY
- The secret access key for your AWS accountAWS_DEFAULT_REGION
- The AWS regionDYNAMODB_CACHE_TABLE
- The AWS DynamoDB table nameDYNAMODB_ENDPOINT
- The AWS DynamoDB API endpoint
Storage
For convenience, the file storage is divided into "disks": local
, public
, private
, images
.
Each "disk" can have its own settings.
Storage::local
Local file storage.
Directory in the local file system: storage/app
.
FILESYSTEM_LOCAL_FILE_PUBLIC_PERMISSION
- File permissions with "public" visibilityFILESYSTEM_LOCAL_FILE_PRIVATE_PERMISSION
- File permissions with "private" visibilityFILESYSTEM_LOCAL_DIR_PUBLIC_PERMISSION
- Directory permissions with "public" visibilityFILESYSTEM_LOCAL_DIR_PRIVATE_PERMISSION
- Directory permissions with "private" visibility
Laravel
You can learn more about file visibility here: https://laravel.com/docs/10.x/filesystem#file-visibility
Storage::public
Storage for public data.
By default, it uses local storage but can be configured to work with an S3
compatible storage.
Directory in the local file system: storage/app/public
.
FILESYSTEM_PUBLIC_DISK_DRIVER
- Storage driver:local
ors3
AWS_ACCESS_KEY_ID
- The access key for your AWS accountAWS_SECRET_ACCESS_KEY
- The secret access key for your AWS accountFILESYSTEM_PUBLIC_DISK_AWS_REGION
- AWS bucket regionFILESYSTEM_PUBLIC_DISK_AWS_BUCKET
- AWS bucket nameFILESYSTEM_PUBLIC_DISK_AWS_ENDPOINT
- AWS bucket API endpoint (Optional)FILESYSTEM_PUBLIC_DISK_AWS_URL
- AWS bucket URL (Optional)FILESYSTEM_PUBLIC_DISK_AWS_USE_PATH_STYLE_ENDPOINT
- AWS SDK option URL (Optional). See https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.S3Client.html#___construct
Storage::private
Storage for private data.
By default, it uses local storage but can be configured to work with an S3
compatible storage.
Directory in the local file system: storage/app/private
.
FILESYSTEM_PRIVATE_DISK_DRIVER
- Storage driver:local
ors3
AWS_ACCESS_KEY_ID
- The access key for your AWS accountAWS_SECRET_ACCESS_KEY
- The secret access key for your AWS accountFILESYSTEM_PRIVATE_DISK_AWS_REGION
- The AWS bucket regionFILESYSTEM_PRIVATE_DISK_AWS_BUCKET
- The AWS bucket nameFILESYSTEM_PRIVATE_DISK_AWS_ENDPOINT
- The AWS bucket API endpoint (Optional)FILESYSTEM_PRIVATE_DISK_AWS_URL
- The AWS bucket URL (Optional)FILESYSTEM_PRIVATE_DISK_AWS_USE_PATH_STYLE_ENDPOINT
- The AWS SDK option URL (Optional). See https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.S3Client.html#___construct
Storage::images
Separate public storage for images.
By default, it uses local storage but can be configured to work with an S3
compatible storage.
Directory in the local file system: storage/app/images
.
FILESYSTEM_IMAGES_DISK_DRIVER
- Storage driver:local
ors3
AWS_ACCESS_KEY_ID
- The access key for your AWS accountAWS_SECRET_ACCESS_KEY
- The secret access key for your AWS accountFILESYSTEM_IMAGES_DISK_AWS_REGION
- The AWS bucket regionFILESYSTEM_IMAGES_DISK_AWS_BUCKET
- The AWS bucket nameFILESYSTEM_IMAGES_DISK_AWS_ENDPOINT
- The AWS bucket API endpoint (Optional)FILESYSTEM_IMAGES_DISK_AWS_URL
- The AWS bucket URL (Optional)FILESYSTEM_IMAGES_DISK_AWS_USE_PATH_STYLE_ENDPOINT
- The AWS SDK option URL (Optional). See https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.S3.S3Client.html#___construct
CDN
Warning
Information will be provided later.
Logs
CS-Cart Enterprise uses log separation by channels. The number of channels is not limited and can be expanded with add-ons. The processing of logs in the channel is handled by one of the following drivers:
daily
- file log with daily rotation, limited by the maximum number of filessingle
- file log without rotationsyslog
- redirects logs to syslogerrorlog
- redirects logs to PHP errorlogstderr
- redirects logs to stderr
All file logs are stored in the storage/logs
directory.
By default, each channel is processed through the stderr
and daily
drivers, allowing you to use different approaches for log aggregation.
Warning
The default behavior cannot be changed through environment variables.
If there is a need to do so, you should override the logging configuration by copying platform/framework/config/logging.php
into the config
directory.
The following environment variables are available:
LOG_FILE_PERMISSION
- Logs file permissionsLOG_DEFAULT_LEVEL
- The minimum logging level; anything below this level will be omitted by the channel.LOG_DEFAULT_MAX_FILES
- The maximum number of files for thedaily
driver.LOG_<CHANNEL>_LEVEL
- The minimum logging level for a specific channel, for example:LOG_CHECKOUT_LEVEL
.
Laravel
You can read more about logging in Laravel in detail here: https://laravel.com/docs/10.x/logging
MAIL_MAILER
- The mail sending method can have the following values:smtp
- sending via SMTPses
- sending via Amazon SESmailgun
- sending via Mailgunpostmark
- sending via Postmarksendmail
- sending via sendmaillog
- logging the mail sending to a file
MAIL_FROM_ADDRESS
- Mail from addressMAIL_FROM_NAME
- Mail from name
Mail::smtp
MAIL_HOST
- Host of the SMTP serverMAIL_PORT
- Port of the SMTP serverMAIL_ENCRYPTION
- Encryption method, possible values: tls or sslMAIL_USERNAME
- User's nameMAIL_PASSWORD
- User's passwordMAIL_TIMEOUT
- Timeout for sending mail
Mail::ses
AWS_ACCESS_KEY_ID
- The access key for your AWS accountAWS_SECRET_ACCESS_KEY
- The secret access key for your AWS accountAWS_DEFAULT_REGION
- The AWS region
Mail::mailgun
MAILGUN_DOMAIN
- Mailgun domainMAILGUN_SECRET
- Mailgun secret keyMAILGUN_ENDPOINT
- Mailgun API endpoint
Mail::postmark
POSTMARK_TOKEN
- Postmark API token
Mail::log
MAIL_LOG_CHANNEL
- The name of the logging channel. The default value ismail
, which means all emails will be logged to the filestorage/logs/mail.log
.
Task Scheduling
To fully operate the task scheduler, it is sufficient to run schedule:run
every minute.
Example task for cron
:
Queues
QUEUE_CONNECTION
- Queue connection name, the following values are possible:database
- the database will be used as the queue serversqs
- Amazon SQS will be used as the queue serverredis
- Redis will be used as the queue server
You can programmatically add your own queue servers, such as RabbitMQ or Kafka.
Info
Laravel does not have a built-in solution for working with RabbitMQ or Kafka. You can use third-party solutions such as vyuldashev/laravel-queue-rabbitmq or rapideinternet/laravel-queue-kafka. Alternatively, you can implement support on your own.
To start the workers, use the following command:
Laravel
You can find more information about running workers here: https://laravel.com/docs/10.x/queues#running-the-queue-worker
Queues::sqs
AWS_ACCESS_KEY_ID
- The access key for your AWS accountAWS_SECRET_ACCESS_KEY
- The secret access key for your AWS accountAWS_DEFAULT_REGION
- The AWS regionSQS_PREFIX
- Queue name prefix, is formed as follows:https://sqs.<your-region>.amazonaws.com/<your-account-id>
SQS_SUFFIX
- Queue name suffix, will be appended to the queue name (optional).
Queues::redis
REDIS_QUEUE_HOST
- Host address of the Redis serverREDIS_QUEUE_PORT
- Port number of the Redis serverREDIS_QUEUE_PASSWORD
- Password for accessing the Redis server (if applicable)REDIS_QUEUE_DB
- Number of the Redis server database to use
GraphQL
GRAPHQL_INTROSPECTION_ENABLE
- Enables or disables GraphQL introspection. If the value is not specified, theAPP_DEBUG
variable will be used as the value.GRAPHQL_APQ_ENABLE
- Enables or disables support for Automatic Persisted Queries (APQ).
ElasticSearch/OpenSearch
Support for ElasticSearch/OpenSearch is implemented for the product catalog and is provided as an add-on called cs-cart/elasticsearch
.
ELASTICSEARCH_HOSTS
- List of hosts for ElasticSearchELASTICSEARCH_API_ID
- API key ID required for APIKey authenticationELASTICSEARCH_API_KEY
- API key required for APIKey authenticationELASTICSEARCH_AUTH_USERNAME
- User name required for HTTP authenticationELASTICSEARCH_AUTH_PASSWORD
- User password required for HTTP authenticationELASTICSEARCH_VERIFY_SSL
- Enables or disables SSL certificate verificationELASTICSEARCH_NUMBER_OF_SHARDS
- Number of shards used for index creationELASTICSEARCH_NUMBER_OF_REPLICAS
- Number of replicas used for index creationELASTICSEARCH_PREFIX
- Prefix for the index name
Laravel Sail
Here are the environment variables that only affect the deployment of the environment through Laravel Sail.
APP_PORT
- The host machine port that will be associated with the container's application port. Typically, the port number matches the port inAPP_URL
.
Laravel
You can learn more about Laravel configuration here: https://laravel.com/docs/10.x/configuration