thedmsgroup/mautic-eb

Mautic开源发行版 - 修改以提高可扩展性

安装: 0

依赖项: 0

建议者: 0

安全: 0

星标: 104

关注者: 35

分支: 27

开放问题: 9

语言:Shell

类型:项目

2.15.0 2018-12-19 17:47 UTC

README

在可扩展的Amazon Elastic Beanstalk集群中部署Mautic。

Mautic and AWS

目标是使Mautic每周扩展到数百万个潜在客户变得简单和安全,同时保持HIPAA & PCI合规性。其他有用的服务,如CloudFlare和Newrelic,也受到支持,但可选。

要求

  1. AWS EB环境运行PHP 7.1,以下列出了环境变量
  2. AWS RDS MySQL实例(推荐使用Aurora,最好是加密的)
  3. AWS EFS卷(用于共享媒体/缓存等)
  4. 将AmazonEC2ReadOnlyAccess策略添加到aws-elasticbeanstalk-ec2-role(仅限于主实例运行cron脚本)
  5. 我们建议在本地安装Elastic Beanstalk CLI 安装

Elastic Beanstalk环境变量

必需

APP_URL               - The default full URL for your site.
DB_HOST               - RDS Host.
DB_HOST_RO            - Optional: RDS Host for read-only slave cluster.
DB_USER               - RDS User.
DB_PASSWD             - RDS Password.
DB_NAME               - RDS Database name.
DB_PORT               - RDS port.
SECRET_KEY            - Hash key for encryption.
MAILER_FROM_NAME      - Default "from" email name.
MAILER_FROM_EMAIL     - Default "from" email address.
EFS_DNS_NAME          - The full DNS of the EFS mount.

可选

REDIS_HOST               - Set to the path of your Redis server/cluster to use Redis for session storage. Helps avoid CSRF errors when scaling. See https://github.com/phpredis/phpredis
MAUTIC_INSTALL           - Set to "1" to initialize mautic for the first/cold deployment only!
MAUTIC_WORKERS           - Number of concurrent campaign trigger workers to run on the leading instance.
                         - Instead of MAUTIC_WORKERS, we reccomend using the following 3 variables now to better control your timing.
MAUTIC_WORKERS_KICKOFF   - Number of concurrent campaign trigger workers running kickoff actions only. Overrides MAUTIC_WORKERS when present.
MAUTIC_WORKERS_SCHEDULED - Number of concurrent campaign trigger workers running scheduled actions only. Overrides MAUTIC_WORKERS when present.
MAUTIC_WORKERS_INACTIVE  - Number of concurrent campaign trigger workers running inactive actions only. Overrides MAUTIC_WORKERS when present.
MAUTIC_WORKERS_SCHEDULED_MID - Optionally sets a minimum contact ID for the scheduled worker group (for performance at large scale). 
MAUTIC_WORKERS_KICKOFF_MID   - Optionally sets a minimum contact ID for the kickoff worker group (for performance at large scale). 
MAUTIC_WORKERS_INACTIVE_MID  - Optionally sets a minimum contact ID for the inactive worker group (for performance at large scale). 
NR_APPNAME               - Newrelic application name.
NR_APPID                 - Newrelic application ID number for deployment notifications.
NR_APM_INSTALL_KEY       - NewRelic install key for Application Monitoring.
NR_INF_INSTALL_KEY       - NewRelic install key for Infrastructure.
NR_API_KEY               - NewRelic API key (optional, for Health plugin).
IP_RESTRICT              - Restrict all UI (/s/) access by IP address/range, must also select URI.
IP_RESTRICT_URI          - The URI to which 403 IP Restriction should be sent.

Travis CI环境变量

如果您希望从Travis自动部署分支到Elastic Beanstalk环境,则需要设置这些变量。

AWS_ACCESS_KEY_ID             - From your IAM console (keep hidden).
AWS_SECRET_ACCESS_KEY         - From your IAM console (keep hidden).
AWS_REGION                    - The region to deploy to (us-east-1).
AWS_EB_APP                    - App name to deploy (mautic-eb).
AWS_EB_ENV                    - Elastic beanstalk environment name (mautic-eb-dev).
ELASTIC_BEANSTALK_LABEL       - Label name of the new version (optional).
ELASTIC_BEANSTALK_DESCRIPTION - Description of the new version (optional). Defaults to the last commit message.

Mautic自定义

/mautic_eb中的文件结构将在composer安装或更新时(破坏性地)复制到/mautic文件夹。对于无法基于插件配置的配置文件和其他更改。同样,您可以使用/mautic_custom进行特定品牌的自定义。使用"mautic-plugin"安装程序的第三方插件将它们的文件夹符号链接到正确位置。

  • mautic_eb/* --> mautic/*
  • mautic_custom/* --> mautic/*
  • plugins/* --> mautic/plugins/*

可以在根composer.custom中包含自定义依赖项

本地设置

基本上与处理Mautic核心相同

  1. 克隆 & composer
git clone https://github.com/TheDMSGroup/mautic-eb.git
cd mautic-eb
composer install
  1. http://mautic.loc设置本地主机,该主机指向.../mautic-eb/mautic子文件夹。
  2. 浏览到http://mautic.loc并完成标准设置。

插件/mautic-eb开发的本地设置

  1. 克隆 & composer
git clone https://github.com/TheDMSGroup/mautic-eb.git
cd mautic-eb
bash ./scripts/build-local.sh
  1. http://mautic.loc设置本地主机,该主机指向.../mautic-eb/mautic子文件夹。
  2. 浏览到http://mautic.loc并完成标准设置。

传统部署(从本地)

如果您不希望使用Travis进行部署,您可以从本地机器手动完成

  • 确保您已设置上述要求
  • 运行bash ./scripts/build.sh
  • 如果您还没有,运行eb init
  • 运行eb deploy

本地技巧和命令

  • 重要:不要在./mautic文件夹内运行composer install,只在没有子文件夹的根项目文件夹中运行。
  • composer cc以清除所有Mautic/Symfony缓存。
  • composer custom以更新所有自定义到mautic核心的符号链接(从mautic_eb和mautic_custom)。
  • composer less以编译LESS样式(如果您需要使用SCSS扩展或修改核心样式)。
  • composer assets以重新生成核心CSS和JS文件用于部署(如果您需要修改核心JS或SCSS)。
  • composer test以运行完整的codeception套件。
  • 可以为第三方依赖项/插件/自定义创建composer.custom文件

附加插件/自定义

每天需要处理一百万个新联系信息吗?需要每天添加自定义集成,而无需编写代码吗?

这些是我们性能营销中所需的要求。考虑到这一点,我们包含了一些可选插件来增强这个构建。您可以通过将composer.custom.dev重命名为composer.custom并运行composer install来一次性访问它们。