Skip to content

Instantly share code, notes, and snippets.

View markf3lton's full-sized avatar

Mark Felton markf3lton

View GitHub Profile
@markf3lton
markf3lton / install-cfcli.md
Last active August 9, 2019 14:02
Install CFCLI

Install CFCLI

CFCLI is available on Docker Hub. You will need to login with your Docker ID and password. The README is on GitHub.

You can use Docker to run a variety of apps like CFCLI, or develop PHP code in a local virtual machine.

If you already have Docker, update to the latest version. Otherwise, begin this tutorial by installing Docker for Windows or Mac.

Windows installation

Getting Started with BLT on Windows

This is a work-in-progress notes stream of links that may be helpful for new Windows users, or macOS to Windows converters.

Create a free sandbox on Acquia Cloud

@markf3lton
markf3lton / geolocation-strategies.md
Created July 22, 2019 18:09
Approaches to geolocation

Geolocation strategies

Cloudflare adds the CF-IPCountry header to all incoming requests, other CDNs may have something similar.

You can the headers incoming in balancer traffic:

[12:25:19] [email protected]:/home/markfelton# varnishlog | grep CF-IPCountry
-   ReqHeader      CF-IPCountry: JP
- ReqHeader CF-IPCountry: JP
@markf3lton
markf3lton / blt-hands-on-tutorial.md
Last active February 1, 2023 18:24
BLT Hands On Tutorial
# From factory-hooks/post-settings-php/search-api-solr.php
<?php
/**
* @file
*
* Used to configure the most appropriate core depending on the environment
* currently in use. Site Factory and the Acquia Connector module vary
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
@markf3lton
markf3lton / ACSF-htaccess.md
Last active March 18, 2025 23:03
Recommendations for .htaccess on Site Factory

Recommendations for .htaccess on Site Factory

This guide builds a set of .htaccess rules that are appropriate for common ACSF use cases and RCAB requirements.

1 - Default .htaccess

2 - ACSF requirement

3 — Force HTTP to HTTPS

Drupal and Acquia BLT on Windows 10

This tutorial provides you with a (minimal) dev environment that you can use to start developing Drupal and use Acquia BLT.

Most corporate users are running a managed laptop, which admin access, but this tutorial should still work.

If you're behind a corporate firewall, you may need to get on the real Internet to run Composer and install dev tools.

Install WSL (Windows Subsystem for Linux)

Acquia BLT in Azure DevOps Pipelines

This guide will get you started with Acquia BLT and AzDo (Azure DevOps).

I wrote a guide for running BLT on Windows that will complement this tutorial.

I also wrote a Getting Started with BLT guide.

Set up your Azure Repo

<?php
/**
* @file
* Contains Environment variables.
*/
$ah_env = isset($_ENV['AH_SITE_ENVIRONMENT']) ? $_ENV['AH_SITE_ENVIRONMENT'] : NULL;
$ah_group = isset($_ENV['AH_SITE_GROUP']) ? $_ENV['AH_SITE_GROUP'] : NULL;
$is_ah_env = (bool) $ah_env;
$is_ah_prod_env = ($ah_env == 'prod' || $ah_env == '01live');