Skip to content

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 mode
    • local - the application is running in local development mode
    • testing - 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 address
  • DB_PORT - Database port number
  • DB_DATABASE - Name of the database to connect to
  • DB_USERNAME - Username for the database connection
  • DB_PASSWORD - Password for the database connection
  • DB_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 in storage/app/cache/data dir
    • apc: Cache data is stored in the Alternative PHP Cache (APC)
    • database: Cache data is stored in the database
    • memcached: Cache data is stored in Memcached
    • redis: Cache data is stored in Redis
    • dynamodb: 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 in storage/app/cache/data dir
    • apc: Cache tags are stored in the Alternative PHP Cache (APC)
    • database: Cache tags are stored in the database
    • memcached: Cache tags are stored in Memcached
    • redis: Cache tags are stored in Redis
    • dynamodb: Cache tags are stored in Amazon DynamoDB

Cache::memcached

  • MEMCACHED_HOST - Memcached server host address
  • MEMCACHED_PORT - Memcached server port number
  • MEMCACHED_USERNAME - Memcached server user name
  • MEMCACHED_PASSWORD - Memcached server user password
  • MEMCACHED_PERSISTENT_ID - Unique identifiers for creating a persistent storage

Cache::redis

  • REDIS_HOST - Redis server host address
  • REDIS_PORT - Redis server port number
  • REDIS_PASSWORD - Redis server password
  • REDIS_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 account
  • AWS_SECRET_ACCESS_KEY - The secret access key for your AWS account
  • AWS_DEFAULT_REGION - The AWS region
  • DYNAMODB_CACHE_TABLE - The AWS DynamoDB table name
  • DYNAMODB_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" visibility
  • FILESYSTEM_LOCAL_FILE_PRIVATE_PERMISSION - File permissions with "private" visibility
  • FILESYSTEM_LOCAL_DIR_PUBLIC_PERMISSION - Directory permissions with "public" visibility
  • FILESYSTEM_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 or s3
  • AWS_ACCESS_KEY_ID - The access key for your AWS account
  • AWS_SECRET_ACCESS_KEY - The secret access key for your AWS account
  • FILESYSTEM_PUBLIC_DISK_AWS_REGION - AWS bucket region
  • FILESYSTEM_PUBLIC_DISK_AWS_BUCKET - AWS bucket name
  • FILESYSTEM_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 or s3
  • AWS_ACCESS_KEY_ID - The access key for your AWS account
  • AWS_SECRET_ACCESS_KEY - The secret access key for your AWS account
  • FILESYSTEM_PRIVATE_DISK_AWS_REGION - The AWS bucket region
  • FILESYSTEM_PRIVATE_DISK_AWS_BUCKET - The AWS bucket name
  • FILESYSTEM_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 or s3
  • AWS_ACCESS_KEY_ID - The access key for your AWS account
  • AWS_SECRET_ACCESS_KEY - The secret access key for your AWS account
  • FILESYSTEM_IMAGES_DISK_AWS_REGION - The AWS bucket region
  • FILESYSTEM_IMAGES_DISK_AWS_BUCKET - The AWS bucket name
  • FILESYSTEM_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 files
  • single - file log without rotation
  • syslog - redirects logs to syslog
  • errorlog - redirects logs to PHP errorlog
  • stderr - 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 permissions
  • LOG_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 the daily 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

  • MAIL_MAILER - The mail sending method can have the following values:
    • smtp - sending via SMTP
    • ses - sending via Amazon SES
    • mailgun - sending via Mailgun
    • postmark - sending via Postmark
    • sendmail - sending via sendmail
    • log - logging the mail sending to a file
  • MAIL_FROM_ADDRESS - Mail from address
  • MAIL_FROM_NAME - Mail from name

Mail::smtp

  • MAIL_HOST - Host of the SMTP server
  • MAIL_PORT - Port of the SMTP server
  • MAIL_ENCRYPTION - Encryption method, possible values: tls or ssl
  • MAIL_USERNAME - User's name
  • MAIL_PASSWORD - User's password
  • MAIL_TIMEOUT - Timeout for sending mail

Mail::ses

  • AWS_ACCESS_KEY_ID - The access key for your AWS account
  • AWS_SECRET_ACCESS_KEY - The secret access key for your AWS account
  • AWS_DEFAULT_REGION - The AWS region

Mail::mailgun

  • MAILGUN_DOMAIN - Mailgun domain
  • MAILGUN_SECRET - Mailgun secret key
  • MAILGUN_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 is mail, which means all emails will be logged to the file storage/logs/mail.log.

Task Scheduling

To fully operate the task scheduler, it is sufficient to run schedule:run every minute. Example task for cron:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

Queues

  • QUEUE_CONNECTION - Queue connection name, the following values are possible:
    • database - the database will be used as the queue server
    • sqs - Amazon SQS will be used as the queue server
    • redis - 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:

php artisan queue:work

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 account
  • AWS_SECRET_ACCESS_KEY - The secret access key for your AWS account
  • AWS_DEFAULT_REGION - The AWS region
  • SQS_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 server
  • REDIS_QUEUE_PORT - Port number of the Redis server
  • REDIS_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, the APP_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 ElasticSearch
  • ELASTICSEARCH_API_ID - API key ID required for APIKey authentication
  • ELASTICSEARCH_API_KEY - API key required for APIKey authentication
  • ELASTICSEARCH_AUTH_USERNAME - User name required for HTTP authentication
  • ELASTICSEARCH_AUTH_PASSWORD - User password required for HTTP authentication
  • ELASTICSEARCH_VERIFY_SSL - Enables or disables SSL certificate verification
  • ELASTICSEARCH_NUMBER_OF_SHARDS - Number of shards used for index creation
  • ELASTICSEARCH_NUMBER_OF_REPLICAS - Number of replicas used for index creation
  • ELASTICSEARCH_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 in APP_URL.

Laravel

You can learn more about Laravel configuration here: https://laravel.com/docs/10.x/configuration