pantheon-systems/pantheon_domain_masking
Composer 安装命令:
composer require pantheon-systems/pantheon_domain_masking
包简介
Domain masking middleware for Drupal
关键字:
README 文档
README
This module allows domain masking in Drupal for environments where Drupal is not running under Apache, or where the hosting configuration is unavailable.
Typically domain masking can be facilitated by adding a few lines to a .htaccess or nginx.conf file; however, if that method is unavailable, this module allows Drupal to be aware of changes to the host and to persist those changes when generating redirects.
Installing the module
The module can be installed by downloading this module and placing directly in modules/contrib (or wherever you have decided to store modules in your filesystem). You can also install via composer by running:
composer require pantheon-systems/pantheon_domain_masking
Enabling and Configuring the module
Once the module has been installed to the filesystem, it can be enabled like any other contrib module. However, this will not enable the domain masking functionality. Once the module is active, the config page for the module (/admin/config/pantheon-domain-masking/options) will allow you to enter the public-facing domain name. You will need to toggle the Enable domain masking? field on this page to enable the middleware.
Alternatively, you may configure the module in your settings.php file (or another file imported by settings.php) by using Drupal's Configuration Override System. Specify values in settings.php like this:
$config['pantheon_domain_masking.settings']['domain'] = 'foo.com';
$config['pantheon_domain_masking.settings']['subpath'] = 'bar';
When you load the configuration page you'll find that the options you set in settings.php appear in the form and that the form inputs are disabled.
Available Config Overrides
domain: The public facing domain.subpath: The subpath for Drupal. DO NOT include the leading/.allow_platform: Allow platform access.
Cache Context
If allow_platform is enabled, you will need to add url.site in renderer.config.required_cache_context (located in sites/default/services.yml) to prevent cache primed in platform domain to be served in public facing domain and vice versa.
renderer.config:
# Renderer required cache contexts:
#
# The Renderer will automatically associate these cache contexts with every
# render array, hence varying every render array by these cache contexts.
#
# @default ['languages:language_interface', 'theme', 'user.permissions']
required_cache_contexts: ['url.site', 'languages:language_interface', 'theme', 'user.permissions']
Example
Assume a site is running on Pantheon with a live environment address of https://live-example.pantheonsite.io. Assume the public-facing domain you wish to use is https://www.example.com. In this case, you would enter www.example.com in the Public-facing domain: field. Once the Enable domain masking? field is set to Yes, Drupal will use www.example.com in generating any internal redirects.
Allowing platform access
Under normal circumstances, this module will force all requests to use the masked domain. However, if you wish to access this site via Pantheon's platform domain (ending in .pantheonsite.io) without going through the masked domain, set the Allow Platform domain access? field to Yes.
Example
Following the example above, suppose the public-facing domain was masking two different Pantheon environments, eg. https://live-example-a.pantheonsite.io and https://live-example-b.pantheonsite.io. Navigating to https://www.example.com/user/login would resolve to whatever backend the edge server chose for that request and, depending on the configuration (eg. round-robin) may not be consistent from request to request. In order to manage both the A and B sites directly, the Allow Platform domain access? field would need to be set to Yes on both sites, and content managers would need to access https://live-example-a.pantheonsite.io/user/login or https://live-example-b.pantheonsite.io/user/login directly to manage those specific instances.
pantheon-systems/pantheon_domain_masking 适用场景与选型建议
pantheon-systems/pantheon_domain_masking 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 348.21k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2022 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「drupal」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pantheon-systems/pantheon_domain_masking 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pantheon-systems/pantheon_domain_masking 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pantheon-systems/pantheon_domain_masking 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides an add-on purchasable entity.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
This module extends Drupal Migrate framework.
Installs and configures the WissKI base environment with mandatory modules.
Tiny set of PHP text utility classes.
统计信息
- 总下载量: 348.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2022-02-17