├── .github ├── tests │ └── phpunit_matcher.json └── workflows │ ├── code_quality.yml │ ├── delete-bot-branch.yaml │ ├── shielding-check-cron-manual.yaml │ └── shielding-check-cron.yaml ├── Block ├── Cache │ └── Additional.php ├── Dashboard │ ├── Grids.php │ └── Tab │ │ └── Stats │ │ └── Historic.php ├── GeoIp │ └── GetAction.php └── System │ └── Config │ └── Form │ ├── Dialogs.php │ ├── Field │ ├── Acl.php │ ├── AllModulesBtn.php │ ├── Auth.php │ ├── Backend.php │ ├── BlockingBtn.php │ ├── Checkbox.php │ ├── CountryMapping.php │ ├── CreateBackendBtn.php │ ├── CreateLogEndpointBtn.php │ ├── CustomSnippetBtn.php │ ├── CustomSnippets.php │ ├── Domains.php │ ├── Edge.php │ ├── EnableAuth.php │ ├── ErrorPageBtn.php │ ├── Export │ │ └── Fastly.php │ ├── ExportBtn.php │ ├── ImageBtn.php │ ├── ImportBtn.php │ ├── IoConfigOptionsBtn.php │ ├── LogEndpoint.php │ ├── ManifestBtn.php │ ├── ModlyActiveModules.php │ ├── PathsBtn.php │ ├── SuBtn.php │ ├── TestConnectionBtn.php │ ├── TlsBtn.php │ ├── ToggleRateLimitingBtn.php │ ├── UpdateBlockingBtn.php │ ├── UpdateBypassBtn.php │ ├── UpdateSuBtn.php │ ├── UploadVclBtn.php │ ├── VersionHistory.php │ ├── WafBtn.php │ ├── WafBypassBtn.php │ └── WafPageBtn.php │ └── Modal │ └── UploadVcl.php ├── Console └── Command │ ├── ConfigGetCommand.php │ ├── ConfigImportCommand.php │ ├── EnableCommand.php │ ├── GenerateVclCommand.php │ ├── JsonToSerialize.php │ ├── SerializeToJson.php │ └── SuperUserCommand.php ├── Controller ├── Adminhtml │ ├── Dashboard │ │ └── Historic.php │ ├── FastlyCdn │ │ ├── Advanced │ │ │ ├── CheckTlsSetting.php │ │ │ └── ForceTls.php │ │ ├── Apply.php │ │ ├── Backend │ │ │ ├── ConfigureBackend.php │ │ │ ├── CreateBackend.php │ │ │ ├── DeleteBackend.php │ │ │ ├── GetBackends.php │ │ │ └── ValidationTrait.php │ │ ├── BasicAuthentication │ │ │ ├── CheckAuthDictionary.php │ │ │ ├── CheckAuthSetting.php │ │ │ ├── CheckAuthUsersAvailable.php │ │ │ ├── Create.php │ │ │ ├── Delete.php │ │ │ ├── EnableAuth.php │ │ │ └── Item │ │ │ │ ├── Create.php │ │ │ │ ├── Delete.php │ │ │ │ └── ListAll.php │ │ ├── Blocking │ │ │ ├── AbstractBlocking.php │ │ │ ├── Blocking.php │ │ │ ├── CheckBlockingSetting.php │ │ │ └── UpdateBlocking.php │ │ ├── Configuration │ │ │ ├── CustomerInfo.php │ │ │ ├── GetFastlyServiceInfo.php │ │ │ ├── IsAlreadyConfigured.php │ │ │ ├── ServiceInfo.php │ │ │ └── TestConnection.php │ │ ├── CustomSnippet │ │ │ ├── ChangeUpdateFlag.php │ │ │ ├── CheckCustomSnippet.php │ │ │ ├── CreateCustomSnippet.php │ │ │ ├── DeleteCustomSnippet.php │ │ │ ├── EditCustomSnippet.php │ │ │ ├── GetCustomSnippet.php │ │ │ └── GetCustomSnippets.php │ │ ├── Domains │ │ │ ├── GetDomains.php │ │ │ └── PushDomains.php │ │ ├── Edge │ │ │ ├── Acl │ │ │ │ ├── Create.php │ │ │ │ ├── Delete.php │ │ │ │ ├── GetAcl.php │ │ │ │ ├── Item │ │ │ │ │ ├── Create.php │ │ │ │ │ ├── Delete.php │ │ │ │ │ ├── ListAll.php │ │ │ │ │ └── Update.php │ │ │ │ └── ListAll.php │ │ │ └── Dictionary │ │ │ │ ├── Create.php │ │ │ │ ├── Delete.php │ │ │ │ ├── Item │ │ │ │ ├── Create.php │ │ │ │ ├── Delete.php │ │ │ │ └── ListAll.php │ │ │ │ └── ListAll.php │ │ ├── ExportVarnishConfig.php │ │ ├── ImageOptimization │ │ │ ├── CheckFastlyIoSetting.php │ │ │ ├── CheckImageSetting.php │ │ │ ├── IoDefaultConfigOptions.php │ │ │ ├── ListAll.php │ │ │ └── PushImageSettings.php │ │ ├── ImportExport │ │ │ ├── DownloadExportData.php │ │ │ ├── GetExportData.php │ │ │ ├── GetImportData.php │ │ │ ├── SaveExportData.php │ │ │ └── SaveImportData.php │ │ ├── Logging │ │ │ ├── CreateEndpoint.php │ │ │ ├── GetAllEndpoints.php │ │ │ ├── GetEndpoint.php │ │ │ ├── GetEndpoints.php │ │ │ └── UpdateEndpoint.php │ │ ├── Maintenance │ │ │ ├── CheckSuSetting.php │ │ │ ├── ToggleSuSetting.php │ │ │ └── UpdateSuIps.php │ │ ├── Manifest │ │ │ ├── Create.php │ │ │ ├── GetActiveModules.php │ │ │ ├── GetAllConditions.php │ │ │ ├── GetAllDomains.php │ │ │ ├── GetAllModules.php │ │ │ ├── GetCountries.php │ │ │ ├── GetModuleData.php │ │ │ ├── GetResponseConditions.php │ │ │ ├── Save.php │ │ │ ├── ToggleModules.php │ │ │ └── Upload.php │ │ ├── Purge │ │ │ ├── All.php │ │ │ ├── ContentType.php │ │ │ ├── Quick.php │ │ │ └── Store.php │ │ ├── RateLimiting │ │ │ ├── CheckRateLimitingSetting.php │ │ │ ├── DisableRateLimiting.php │ │ │ ├── GetPaths.php │ │ │ ├── ToggleRateLimiting.php │ │ │ └── UpdatePaths.php │ │ ├── SyntheticPages │ │ │ ├── GetErrorPageRespObj.php │ │ │ ├── GetWafPageRespObj.php │ │ │ ├── RemoveErrorPageHtml.php │ │ │ ├── SaveErrorPageHtml.php │ │ │ └── SaveWafPage.php │ │ ├── Vcl │ │ │ ├── Comparison.php │ │ │ ├── DismissWarning.php │ │ │ ├── GetUpdateFlag.php │ │ │ ├── IsWarningDismissed.php │ │ │ └── Upload.php │ │ ├── VersionHistory │ │ │ ├── Activate.php │ │ │ ├── ListVersions.php │ │ │ └── Reference.php │ │ └── Waf │ │ │ ├── AbstractWafUpdate.php │ │ │ ├── CheckWafBypassSetting.php │ │ │ ├── GetWafSettings.php │ │ │ ├── UpdateWafAllowlist.php │ │ │ └── WafAllowlist.php │ └── System │ │ └── Message │ │ └── Dismiss.php └── GeoIP │ └── GetAction.php ├── Documentation ├── CLI.md ├── CONFIGURATION.md ├── CONTRIBUTING.md ├── Guides │ ├── ACL.md │ ├── BACKEND-SETTINGS.md │ ├── BASIC-AUTH.md │ ├── BLOCKING.md │ ├── CUSTOM-VCL-SNIPPETS.md │ ├── DICTIONARIES.md │ ├── ERROR-MAINTENANCE-PAGE.md │ ├── ESI.md │ ├── Edge-Modules │ │ ├── EDGE-MODULE-BLACKFIRE-INTEGRATION.md │ │ ├── EDGE-MODULE-CORS-HEADERS.md │ │ ├── EDGE-MODULE-DATADOME-INTEGRATION.md │ │ ├── EDGE-MODULE-HARD-RELOAD-CACHE-BYPASS.md │ │ ├── EDGE-MODULE-IMAGE-OPTIMIZATION-TEST-DRIVE.md │ │ ├── EDGE-MODULE-INCREASE-TIMEOUTS-LONG-JOBS.md │ │ ├── EDGE-MODULE-MOBILE-THEME-SUPPORT.md │ │ ├── EDGE-MODULE-NETACEA-INTEGRATION.md │ │ ├── EDGE-MODULE-OTHER-CMS-INTEGRATION.md │ │ ├── EDGE-MODULE-PERIMETERX-INTEGRATION.md │ │ ├── EDGE-MODULE-REDIRECT-DOMAIN.md │ │ ├── EDGE-MODULE-SITESPECT-INTEGRATION.md │ │ ├── EDGE-MODULE-URL-REWRITES.md │ │ └── EDGE-MODULES.md │ ├── FORCE-TLS.md │ ├── IMAGE-OPTIMIZATION.md │ ├── INSTALLATION.md │ ├── MAINTENANCE-MODE.md │ ├── RATE-LIMITING.md │ └── WEBHOOK-NOTIFICATIONS.md ├── INSTALLATION.md ├── OPENING-ISSUES.md ├── OTHER-FUNCTIONS.md ├── README.md ├── TLS.md ├── TROUBLESHOOTING.md └── images │ ├── .DS_Store │ ├── fastly_config.jpg │ └── guides │ ├── acl │ ├── acl-container.png │ ├── acl-item.png │ └── acl.png │ ├── backend-settings │ ├── edit-backend.png │ └── shielding-configuration.png │ ├── basic-auth │ ├── adding-users.png │ ├── confirmation-screen.png │ ├── create-container-for-authenticated-users.png │ └── main-screen.png │ ├── blocking │ └── blocking_ui.png │ ├── dictionaries │ ├── dictionaries.png │ ├── dictionary-container.png │ └── dictionary-item.png │ ├── edge-modules │ ├── edge-module-blackfire.png │ ├── edge-module-cors.png │ ├── edge-module-create-backend-1.png │ ├── edge-module-create-backend-2.png │ ├── edge-module-create-request-condition.png │ ├── edge-module-datadome.jpg │ ├── edge-module-hard-reload-cache-bypass.png │ ├── edge-module-image-optimization-test-drive-overlaid-image.jpg │ ├── edge-module-image-optimization-test-drive-synthetic-page.png │ ├── edge-module-increase-timeouts-long-jobs.png │ ├── edge-module-netacea.jpg │ ├── edge-module-redirect-one-domain-to-another.png │ ├── edge-module-sitespect.jpg │ ├── edge-module-test-drive-image-optimization.png │ ├── edge-module-url-rewrites.jpg │ ├── edgemodule-othercms-integration.png │ ├── fastly-edge-modules-list-of-modules.png │ ├── fastly-edgemodules-first-use.png │ └── fastly-edgemodules-onemodule.png │ ├── error-maintenance-page │ ├── default-error-page.png │ ├── error-maintenance-page.png │ ├── new-error-page.png │ └── set-html.png │ ├── force-tls │ ├── force-tls-modal.png │ ├── force-tls-success.png │ ├── force-tls.png │ └── secure-url.png │ ├── geoip │ ├── geoip-prompt.png │ └── geoip-settings.png │ ├── image-optimization │ ├── io_default_config_dialog.png │ ├── io_main_screen.png │ ├── io_not_enabled.png │ └── io_tunables.png │ ├── installation │ ├── account-api-key.png │ ├── choosefastly.png │ ├── clearcache.png │ ├── golive.png │ ├── newfeatures.png │ ├── show-service-id.png │ ├── successvcl.png │ ├── testcredentials.png │ ├── vclupload.png │ └── wizard.png │ ├── maintenance-mode │ └── maint-mode.png │ ├── rate-limiting │ ├── rate-limiting1.png │ └── rate-limiting2.png │ ├── vcl-snippets │ ├── after_snippet_create.png │ ├── snippet_create.png │ └── vcl_snippets_main.png │ └── webhooks │ ├── example_notifications.png │ └── webhooks_ui.png ├── Helper ├── Acl.php ├── AutomaticCompression.php ├── CacheTags.php ├── Data.php ├── Manifest.php ├── StoreMessage.php └── Vcl.php ├── LICENSE_FASTLY_CDN.txt ├── Model ├── AdaptivePixelRatio.php ├── Api.php ├── Config.php ├── Config │ ├── Backend │ │ ├── AutomaticCompression.php │ │ ├── BlocklistAllowlist.php │ │ ├── CustomSnippetUpload.php │ │ ├── Geoipcountry.php │ │ ├── ImportFile.php │ │ ├── ListAcl.php │ │ ├── PixelRatios.php │ │ └── ValidateInt.php │ ├── ConfigRewrite.php │ └── GeolocationRedirectMatcher.php ├── FrontControllerPlugin.php ├── Importer.php ├── Layout │ └── LayoutPlugin.php ├── Manifest.php ├── Modly │ ├── Manifest.php │ └── Node.php ├── Notification.php ├── PageCache │ ├── ConfigPlugin.php │ └── PurgeCachePlugin.php ├── Product │ └── Image.php ├── PurgeCache.php ├── Resolver │ └── GeoIP │ │ ├── CountryCodeProviderInterface.php │ │ └── HttpCountryProvider.php ├── ResourceModel │ ├── Manifest.php │ ├── Manifest │ │ └── Collection.php │ ├── Statistic.php │ └── Statistic │ │ └── Collection.php ├── ResponsePlugin.php ├── Statistic.php ├── StatisticRepository.php ├── System │ ├── Config │ │ ├── Shielding │ │ │ └── DataCenters.php │ │ └── Source │ │ │ ├── ApplicationPlugin.php │ │ │ └── GeoIP │ │ │ └── Action.php │ └── Message │ │ └── BetterImageOptimization.php ├── Upload │ ├── Acl.php │ └── Dictionary.php └── View │ └── Asset │ └── Image.php ├── Observer ├── CheckVersion.php ├── ConfigurationSave.php ├── FlushAllCacheObserver.php ├── InvalidateVarnishObserver.php ├── MarkEsiBlock.php ├── MarkEsiPage.php └── SendInstalledRequestToGA.php ├── Plugin ├── AdaptivePixelRatioPlugin.php ├── Block │ └── Product │ │ └── View │ │ └── Type │ │ └── ConfigurablePlugin.php ├── Catalog │ └── Observer │ │ └── DisableImageResizeAfterProductSave.php ├── Config │ └── StructurePlugin.php ├── ExcludeFilesFromMinification.php ├── GalleryPlugin.php ├── GraphQl │ └── AfterRenderResult.php ├── MediaStorage │ └── App │ │ └── AroundMedia.php └── Swatches │ └── Helper │ └── Data │ └── AppendSrcsetInformationPlugin.php ├── README.md ├── Release-Notes.md ├── Setup └── Patch │ └── Data │ ├── ChangeConstValueInDb.php │ ├── Config.php │ ├── InstalledFlag.php │ └── RateLimitPath.php ├── Test └── Unit │ ├── Controller │ └── Adminhtml │ │ └── FastlyCdn │ │ └── ExportVarnishConfigTest.php │ └── Model │ ├── Config │ └── GeolocationRedirectMatcherTest.php │ ├── ConfigTest.php │ ├── Layout │ └── LayoutPluginTest.php │ ├── PageCache │ └── ConfigPluginTest.php │ └── _files │ ├── result.vcl │ └── test.vcl ├── VERSION ├── composer.json ├── etc ├── adminhtml │ ├── di.xml │ ├── events.xml │ ├── routes.xml │ └── system.xml ├── config.xml ├── db_schema.xml ├── db_schema_whitelist.json ├── di.xml ├── events.xml ├── fastly_edge_modules │ ├── blackfire_integration.json │ ├── cors_headers.json │ ├── datadome_integration.json │ ├── disabled │ │ ├── aclblacklist.json │ │ ├── countryblock.json │ │ ├── error.json │ │ ├── esi.json │ │ ├── forcetls.json │ │ ├── gzip.json │ │ ├── hostoverride.json │ │ ├── nocache.json │ │ ├── normalise.json │ │ ├── redirects.json │ │ ├── stale.json │ │ └── ttloverride.json │ ├── force_cache_miss_on_hard_reload_for_admins.json │ ├── increase_timeouts_long_jobs.json │ ├── io_test_drive.json │ ├── magento_cloud_sitemap_rewrite.json │ ├── mobile_device_detection.json │ ├── netacea_integration.json │ ├── other_cms_integration.json │ ├── perimeterx_bot_defender.json │ ├── redirect_hosts.json │ └── sitespect_integration.json ├── frontend │ ├── di.xml │ ├── events.xml │ └── routes.xml ├── graphql │ └── di.xml ├── module.xml ├── setup │ └── di.xml ├── shielding │ ├── README.md │ └── datacenters.json ├── vcl_snippets │ ├── deliver.vcl │ ├── error.vcl │ ├── fetch.vcl │ ├── hash.vcl │ ├── miss.vcl │ ├── pass.vcl │ └── recv.vcl ├── vcl_snippets_basic_auth │ ├── error.vcl │ └── recv.vcl ├── vcl_snippets_blocking │ └── recv.vcl ├── vcl_snippets_error_page │ └── deliver.vcl ├── vcl_snippets_force_tls │ ├── deliver.vcl │ └── recv.vcl ├── vcl_snippets_image_optimizations │ └── recv.vcl ├── vcl_snippets_rate_limiting │ ├── deliver.vcl │ ├── fetch.vcl │ ├── hash.vcl │ ├── miss.vcl │ └── recv.vcl ├── vcl_snippets_waf │ └── recv.vcl └── webapi_rest │ └── di.xml ├── i18n ├── de_DE.csv └── en_US.csv ├── registration.php ├── update_version.sh └── view ├── adminhtml ├── layout │ ├── adminhtml_cache_index.xml │ ├── adminhtml_system_config_edit.xml │ └── default.xml ├── requirejs-config.js ├── templates │ ├── dashboard │ │ └── stats │ │ │ └── historic.phtml │ └── system │ │ ├── cache │ │ └── additional.phtml │ │ └── config │ │ ├── dialogs.phtml │ │ └── form │ │ ├── field │ │ ├── acl.phtml │ │ ├── allModulesBtn.phtml │ │ ├── array.phtml │ │ ├── auth.phtml │ │ ├── backend.phtml │ │ ├── blockingBtn.phtml │ │ ├── checkbox.phtml │ │ ├── createBackendBtn.phtml │ │ ├── createLogEndpointBtn.phtml │ │ ├── customSnippetBtn.phtml │ │ ├── customSnippets.phtml │ │ ├── domains.phtml │ │ ├── edge.phtml │ │ ├── enableAuth.phtml │ │ ├── errorPageBtn.phtml │ │ ├── exportBtn.phtml │ │ ├── imageBtn.phtml │ │ ├── importBtn.phtml │ │ ├── ioConfigOptionsBtn.phtml │ │ ├── logEndpoint.phtml │ │ ├── manifestBtn.phtml │ │ ├── modlyActiveModules.phtml │ │ ├── pathsBtn.phtml │ │ ├── suBtn.phtml │ │ ├── testConnectionBtn.phtml │ │ ├── tlsBtn.phtml │ │ ├── toggleRateLimitingBtn.phtml │ │ ├── updateBlockingBtn.phtml │ │ ├── updateBypassBtn.phtml │ │ ├── updateSuBtn.phtml │ │ ├── uploadVclBtn.phtml │ │ ├── versionHistory.phtml │ │ ├── wafBtn.phtml │ │ ├── wafBypassBtn.phtml │ │ └── wafPageBtn.phtml │ │ └── log │ │ └── azure.phtml └── web │ ├── css │ └── fastly.css │ ├── images │ ├── cloud.svg │ ├── fastly.gif │ ├── fastly16.gif │ ├── fastly32.gif │ ├── fastly48.gif │ └── view.svg │ └── js │ ├── backends.js │ ├── basic-authentication.js │ ├── blocking.js │ ├── custom-snippets.js │ ├── custom-synthetic-pages.js │ ├── domains.js │ ├── edge-acl.js │ ├── edge-dictionaries.js │ ├── error-message.js │ ├── export.js │ ├── handlebars-v4.7.7.js │ ├── historicstats.js │ ├── image-optimization.js │ ├── import-export-renderer.js │ ├── import.js │ ├── init.js │ ├── log-endpoints.js │ ├── maintenance.js │ ├── modly.js │ ├── overlay.js │ ├── rate-limiting.js │ ├── reset-all-messages.js │ ├── service-label.js │ ├── success-message.js │ ├── system │ ├── cache │ │ └── additional.js │ └── config │ │ └── form │ │ └── field │ │ └── array.js │ ├── testconnection.js │ ├── tls.js │ ├── upload-vcl.js │ ├── version-history.js │ ├── waf.js │ ├── wafBypass.js │ └── warning-message.js └── frontend ├── layout ├── default.xml ├── geoip_getaction_dialog.xml └── geoip_getaction_redirect.xml ├── requirejs-config.js ├── templates └── geoip │ ├── dialog.phtml │ └── redirect.phtml └── web └── js ├── dialog.js ├── gallery └── gallery-mixin.js └── swatch-renderer-mixin.js /.github/tests/phpunit_matcher.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "phpunit-failure", 5 | "severity": "error", 6 | "pattern": [ 7 | { 8 | "regexp": "##teamcity\\[testFailed.+message='(.+)' details='\\s+\\/.*\\/app\\/code\\/Fastly\\/Cdn\\/(.*\\.php):(\\d+)|n\\s+'.*\\]", 9 | "message": 1, 10 | "file": 2, 11 | "line": 3 12 | } 13 | ] 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /.github/workflows/delete-bot-branch.yaml: -------------------------------------------------------------------------------- 1 | name: Delete bot branch on PR close/merge 2 | on: 3 | pull_request: 4 | types: [ closed ] 5 | 6 | jobs: 7 | delete-bot-branch: 8 | if: ${{ startsWith(github.head_ref, 'datacenters-json-auto-update-') }} 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout code 12 | uses: actions/checkout@v2 13 | - name: Delete branch 14 | run: | 15 | git config user.name "github-actions" 16 | git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" 17 | git push origin --delete "${{ github.head_ref }}" 18 | env: 19 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 | -------------------------------------------------------------------------------- /.github/workflows/shielding-check-cron-manual.yaml: -------------------------------------------------------------------------------- 1 | name: Datacenters check cron job (manual kick) 2 | on: [ workflow_dispatch ] 3 | jobs: 4 | check-diff-and-create-pr: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Checkout code 8 | uses: actions/checkout@v2 9 | - name: Fetch latest JSON via Fastly API 10 | run: | 11 | curl -s https://api.fastly.com/datacenters -H "fastly-key: ${FASTLY_API_KEY}" --fail -o ./temp.json 12 | env: 13 | FASTLY_API_KEY: ${{ secrets.FASTLY_API_KEY }} 14 | - name: Update JSON 15 | id: update-json 16 | if: success() 17 | run: | 18 | cat ./temp.json | jq . > etc/shielding/datacenters.json 19 | rm -f ./temp.json 20 | echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT" 21 | SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'` 22 | echo "sha1=$SHA1" >> "$GITHUB_OUTPUT" 23 | echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT" 24 | env: 25 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | - name: Check diff and create PR 27 | if: | 28 | steps.update-json.outputs.pr-count == 0 && 29 | steps.update-json.outputs.diff-count > 0 30 | run: | 31 | DATE=`date +"%Y%m%d"` 32 | BRANCH_NAME="datacenters-json-auto-update-${DATE}" 33 | git config user.name "github-actions" 34 | git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" 35 | git checkout -b "${BRANCH_NAME}" 36 | git add . 37 | git commit -m "Update datacenters.json" 38 | git push origin "${BRANCH_NAME}" 39 | gh pr create --title "Update datacenters.json - ${{ steps.update-json.outputs.sha1 }}" --base master --head "${BRANCH_NAME}" \ 40 | --body "Submitted by GitHub Actions automation. 41 | 42 | You may want to close old bot PRs if they haven't merged yet." 43 | env: 44 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 45 | -------------------------------------------------------------------------------- /.github/workflows/shielding-check-cron.yaml: -------------------------------------------------------------------------------- 1 | name: Datacenters check cron job 2 | on: 3 | schedule: 4 | # UTC, at midnight every Monday 5 | - cron: "0 0 * * 1" 6 | jobs: 7 | check-diff-and-create-pr: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout code 11 | uses: actions/checkout@v2 12 | - name: Fetch latest JSON via Fastly API 13 | run: | 14 | curl -s https://api.fastly.com/datacenters -H "fastly-key: ${FASTLY_API_KEY}" --fail -o ./temp.json 15 | env: 16 | FASTLY_API_KEY: ${{ secrets.FASTLY_API_KEY }} 17 | - name: Update JSON 18 | id: update-json 19 | if: success() 20 | run: | 21 | cat ./temp.json | jq . > etc/shielding/datacenters.json 22 | rm -f ./temp.json 23 | echo "diff-count=$(git diff --name-only | wc -l)" >> "$GITHUB_OUTPUT" 24 | SHA1=`sha1sum etc/shielding/datacenters.json | awk '{print $1}'` 25 | echo "sha1=$SHA1" >> "$GITHUB_OUTPUT" 26 | echo "pr-count=$(gh pr list --search "${SHA1} in:title is:open" --json title -q '.[] | .title' | wc -l)" >> "$GITHUB_OUTPUT" 27 | env: 28 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | - name: Check diff and create PR 30 | if: | 31 | steps.update-json.outputs.pr-count == 0 && 32 | steps.update-json.outputs.diff-count > 0 33 | run: | 34 | DATE=`date +"%Y%m%d"` 35 | BRANCH_NAME="datacenters-json-auto-update-${DATE}" 36 | git config user.name "github-actions" 37 | git config user.email "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" 38 | git checkout -b "${BRANCH_NAME}" 39 | git add . 40 | git commit -m "Update datacenters.json" 41 | git push origin "${BRANCH_NAME}" 42 | gh pr create --title "Update datacenters.json - ${{ steps.update-json.outputs.sha1 }}" --base master --head "${BRANCH_NAME}" \ 43 | --body "Submitted by GitHub Actions automation. 44 | 45 | You may want to close old bot PRs if they haven't merged yet." 46 | env: 47 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 48 | -------------------------------------------------------------------------------- /Block/Dashboard/Grids.php: -------------------------------------------------------------------------------- 1 | addTab( 35 | 'fastly_historic_stats', 36 | [ 37 | 'label' => __('Fastly'), 38 | 'url' => $this->getUrl('adminhtml/dashboard/historic', ['_current' => true]), 39 | 'class' => 'ajax', 40 | 'active' => false 41 | ] 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Block/Dashboard/Tab/Stats/Historic.php: -------------------------------------------------------------------------------- 1 | _template = 'Fastly_Cdn::dashboard/stats/historic.phtml'; 35 | 36 | parent::_construct(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Block/System/Config/Form/Field/AllModulesBtn.php: -------------------------------------------------------------------------------- 1 | _template = 'Fastly_Cdn::system/config/form/field/allModulesBtn.phtml'; 13 | 14 | parent::_construct(); 15 | } 16 | 17 | /** 18 | * Remove scope label 19 | * 20 | * @param AbstractElement $element 21 | * @return string 22 | */ 23 | public function render(AbstractElement $element) 24 | { 25 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); 26 | return parent::render($element); 27 | } 28 | 29 | /** 30 | * Return element html 31 | * 32 | * @param AbstractElement $element 33 | * @return string 34 | */ 35 | protected function _getElementHtml(AbstractElement $element) // @codingStandardsIgnoreLine - required by parent class 36 | { 37 | return $this->_toHtml(); 38 | } 39 | 40 | /** 41 | * Generate upload button html 42 | * 43 | * @return mixed 44 | * @throws \Magento\Framework\Exception\LocalizedException 45 | */ 46 | public function getButtonHtml() 47 | { 48 | $button = $this->getLayout()->createBlock( 49 | 'Magento\Backend\Block\Widget\Button' 50 | )->setData( 51 | [ 52 | 'id' => 'modly_all_modules_btn', 53 | 'label' => __('Manage'), 54 | ] 55 | ); 56 | 57 | return $button->toHtml(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Block/System/Config/Form/Field/ManifestBtn.php: -------------------------------------------------------------------------------- 1 | _template = 'Fastly_Cdn::system/config/form/field/manifestBtn.phtml'; 13 | 14 | parent::_construct(); 15 | } 16 | 17 | /** 18 | * Remove scope label 19 | * 20 | * @param AbstractElement $element 21 | * @return string 22 | */ 23 | public function render(AbstractElement $element) 24 | { 25 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); 26 | return parent::render($element); 27 | } 28 | 29 | /** 30 | * Return element html 31 | * 32 | * @param AbstractElement $element 33 | * @return string 34 | */ 35 | protected function _getElementHtml(AbstractElement $element) // @codingStandardsIgnoreLine - required by parent class 36 | { 37 | return $this->_toHtml(); 38 | } 39 | 40 | /** 41 | * Generate upload button html 42 | * 43 | * @return mixed 44 | * @throws \Magento\Framework\Exception\LocalizedException 45 | */ 46 | public function getButtonHtml() 47 | { 48 | $button = $this->getLayout()->createBlock( 49 | 'Magento\Backend\Block\Widget\Button' 50 | )->setData( 51 | [ 52 | 'id' => 'fastly_manifest_btn', 53 | 'label' => __('Refresh'), 54 | ] 55 | ); 56 | 57 | return $button->toHtml(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Block/System/Config/Form/Field/PathsBtn.php: -------------------------------------------------------------------------------- 1 | _template = 'Fastly_Cdn::system/config/form/field/pathsBtn.phtml'; 13 | 14 | parent::_construct(); 15 | } 16 | 17 | /** 18 | * Remove scope label 19 | * 20 | * @param AbstractElement $element 21 | * @return string 22 | */ 23 | public function render(AbstractElement $element) 24 | { 25 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); 26 | return parent::render($element); 27 | } 28 | 29 | /** 30 | * Return element html 31 | * 32 | * @param AbstractElement $element 33 | * @return string 34 | */ 35 | protected function _getElementHtml(AbstractElement $element) // @codingStandardsIgnoreLine - required by parent class 36 | { 37 | return $this->_toHtml(); 38 | } 39 | 40 | /** 41 | * Generate upload button html 42 | * 43 | * @return mixed 44 | * @throws \Magento\Framework\Exception\LocalizedException 45 | */ 46 | public function getButtonHtml() 47 | { 48 | $button = $this->getLayout()->createBlock( 49 | 'Magento\Backend\Block\Widget\Button' 50 | )->setData( 51 | [ 52 | 'id' => 'fastly_paths_btn', 53 | 'label' => __('Manage Paths'), 54 | ] 55 | ); 56 | 57 | return $button->toHtml(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Block/System/Config/Form/Field/ToggleRateLimitingBtn.php: -------------------------------------------------------------------------------- 1 | _template = 'Fastly_Cdn::system/config/form/field/toggleRateLimitingBtn.phtml'; 13 | 14 | parent::_construct(); 15 | } 16 | 17 | /** 18 | * Remove scope label 19 | * 20 | * @param AbstractElement $element 21 | * @return string 22 | */ 23 | public function render(AbstractElement $element) 24 | { 25 | $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); 26 | return parent::render($element); 27 | } 28 | 29 | /** 30 | * Return element html 31 | * 32 | * @param AbstractElement $element 33 | * @return string 34 | */ 35 | protected function _getElementHtml(AbstractElement $element) // @codingStandardsIgnoreLine - required by parent class 36 | { 37 | return $this->_toHtml(); 38 | } 39 | 40 | /** 41 | * Generate upload button html 42 | * 43 | * @return mixed 44 | * @throws \Magento\Framework\Exception\LocalizedException 45 | */ 46 | public function getButtonHtml() 47 | { 48 | $button = $this->getLayout()->createBlock( 49 | 'Magento\Backend\Block\Widget\Button' 50 | )->setData( 51 | [ 52 | 'id' => 'fastly_toggle_rate_limiting_btn', 53 | 'label' => __('Enable/Disable'), 54 | ] 55 | ); 56 | 57 | return $button->toHtml(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Block/System/Config/Form/Field/VersionHistory.php: -------------------------------------------------------------------------------- 1 | addColumn('backend_name', ['label' => __('Id')]); 18 | $this->_addAfter = false; 19 | $this->_template = 'Fastly_Cdn::system/config/form/field/versionHistory.phtml'; 20 | parent::_construct(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Block/System/Config/Form/Modal/UploadVcl.php: -------------------------------------------------------------------------------- 1 | getChildHtml('dialogs'); 40 | } 41 | 42 | /** 43 | * Return dialog html 44 | * 45 | * @return string 46 | */ 47 | public function _toHtml() 48 | { 49 | return $this->getDialogsHtml(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Console/Command/GenerateVclCommand.php: -------------------------------------------------------------------------------- 1 | setName('fastly:vcl:generate') 41 | ->setDescription('DEPRECATED: Generates Fastly VCL and echos it to the command line'); 42 | } 43 | 44 | /** 45 | * @param InputInterface $input 46 | * @param OutputInterface $output 47 | * @return int|null|void 48 | */ 49 | protected function execute(InputInterface $input, OutputInterface $output) // @codingStandardsIgnoreLine - required by parent class 50 | { 51 | $output->writeln( 52 | "Fastly custom VCL use been deprecated." 53 | . "Please upload VCL snippets from the Magento admin UI or using the CLI commands." 54 | ); 55 | 56 | return Cli::RETURN_SUCCESS; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Dashboard/Historic.php: -------------------------------------------------------------------------------- 1 | layoutFactory->create() 40 | ->createBlock('Fastly\Cdn\Block\Dashboard\Tab\Stats\Historic') 41 | ->toHtml(); 42 | $resultRaw = $this->resultRawFactory->create(); 43 | return $resultRaw->setContents($output); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Controller/Adminhtml/FastlyCdn/Blocking/AbstractBlocking.php: -------------------------------------------------------------------------------- 1 | configWriter = $configWriter; 20 | 21 | parent::__construct($context); 22 | } 23 | 24 | /** 25 | * @param string[] $countryCodes 26 | * @param string[] $acls 27 | * @param int $blockingType 28 | * @return string 29 | */ 30 | protected function prepareBlockedItems(array $countryCodes, array $acls, int $blockingType): string 31 | { 32 | $list = []; 33 | foreach ($countryCodes as $countryCode) { 34 | $list[] = sprintf('client.geo.country_code == "%s"', $countryCode); 35 | } 36 | 37 | foreach ($acls as $acl) { 38 | $list[] = sprintf('req.http.Fastly-Client-Ip ~ %s', $acl); 39 | } 40 | 41 | $result = implode(' || ', $list); 42 | if ($blockingType === 1 && !empty($result)) { 43 | $result = sprintf('!(%s)', $result); 44 | } 45 | 46 | return $result; 47 | } 48 | 49 | protected function storeConfigArray(string $path, array $data): void 50 | { 51 | $this->configWriter->save( 52 | $path, 53 | implode(',', $data), 54 | 'default', 55 | '0' 56 | ); 57 | } 58 | 59 | protected function getParamArray(string $param): array 60 | { 61 | $request = $this->getRequest(); 62 | 63 | $data = $request->getParam($param); 64 | if (empty($data)) { 65 | return []; 66 | } 67 | 68 | return array_map(static function ($row) { 69 | return $row['value']; 70 | }, $data); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Controller/Adminhtml/FastlyCdn/ExportVarnishConfig.php: -------------------------------------------------------------------------------- 1 | fileFactory = $fileFactory; 34 | parent::__construct($context); 35 | } 36 | 37 | /** 38 | * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface 39 | */ 40 | public function execute() 41 | { 42 | try { 43 | return $this->fileFactory->create( 44 | Config::EXPORT_FILE_NAME, 45 | [ 46 | 'type' => 'filename', 47 | 'value' => Config::EXPORT_FILE_NAME, 48 | 'rm' => true 49 | ], 50 | DirectoryList::VAR_DIR 51 | ); 52 | } catch (\Exception $e) { 53 | $this->messageManager->addErrorMessage($e->getMessage()); 54 | return $this->_redirect($this->_redirect->getRefererUrl()); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Controller/Adminhtml/FastlyCdn/Vcl/GetUpdateFlag.php: -------------------------------------------------------------------------------- 1 | scopeConfig = $scopeConfig; 42 | $this->jsonFactory = $jsonFactory; 43 | } 44 | 45 | public function execute() 46 | { 47 | $json = $this->jsonFactory->create(); 48 | $flag = $this->scopeConfig->getValue(Config::UPDATED_VCL_FLAG); 49 | if (!$flag && $flag !== null) { 50 | return $json->setData([ 51 | 'flag' => false, 52 | 'msg' => 'Upload VCL to activate modified custom snippet' 53 | ]); 54 | } 55 | 56 | return $json->setData([ 57 | 'flag' => true 58 | ]); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Controller/Adminhtml/FastlyCdn/Waf/AbstractWafUpdate.php: -------------------------------------------------------------------------------- 1 | flagManager = $flagManager; 42 | } 43 | 44 | /** 45 | * @return \Magento\Framework\App\ResponseInterface 46 | */ 47 | public function execute() 48 | { 49 | $dismissedMessages = $this->flagManager->getFlagData('fastly_cdn_dismissed_messages') ?? []; 50 | array_push($dismissedMessages, $this->getRequest()->getParam('message_code')); 51 | $this->flagManager->saveFlag('fastly_cdn_dismissed_messages', array_unique($dismissedMessages)); 52 | 53 | return $this->_redirect($this->_redirect->getRefererUrl()); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Documentation/CLI.md: -------------------------------------------------------------------------------- 1 | # CLI Functions 2 | 3 | ## Contents 4 | 5 | * [Configuration](#configuration) 6 | * [Format conversion](#format) 7 | 8 | ## Configuration 9 | 10 | Certain configuration options can be set using CLI: 11 | 12 | - Service ID (--service-id) 13 | - Token (--token) 14 | - Uploading default VCL files (--upload-vcl) 15 | - Activating last cloned version (--activate) 16 | - Enabling Fastly (--enable) 17 | - Disabling Fastly (will set default build-in cache as used caching mechanism) (--disable) 18 | - Testing connection (--test-connection) 19 | - Flushing configuration cache (--cache) 20 | 21 | Notes: To upload VCL or activate version, service ID and token must be correct (you can check this with test option) 22 | 23 | Full usage example for setup of fastly from command line: 24 | php bin/magento fastly:conf:set --service-id xxxxxxxxxxx --token xxxxxxxxxxx --upload-vcl --activate --enable --test-connection --cache 25 | 26 | 27 | ## Format conversion 28 | 29 | Magento 2.2 and above differs in format saving from prior versions as it uses JSON format instead of serialization from M2.2. 30 | If by any chance you encounter issues with this, this functions will convert Fastly configuration data to required format. 31 | Use this only if you encounter issues when opening Fastly options in admin configuration. 32 | 33 | Serialization to JSON 34 | ``` 35 | bin/magento fastly:format:serializetojson" 36 | ``` 37 | 38 | JSON to Serialization (In case you need to revert changes, run): 39 | ``` 40 | bin/magento fastly:format:jsontoserialize" 41 | ``` 42 | -------------------------------------------------------------------------------- /Documentation/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We welcome community contribution to this repository. To help add 4 | functionality or address issued please take the following steps: 5 | 6 | - Fork the repository from the master branch. 7 | - Create a new branch for your features / fixes. 8 | - Make the changes you wish to see. 9 | - Add tests for all changes. 10 | - Create a pull request with details of what changes have been made. 11 | Explanation of new behaviour. Link to issue that is addressed. Ensure 12 | documentation contains the correct information. 13 | - Pull requests will be reviewed and hopefully merged into a release. 14 | -------------------------------------------------------------------------------- /Documentation/Guides/ACL.md: -------------------------------------------------------------------------------- 1 | # ACL (Access Control Lists) 2 | 3 | This guide will show how to add a Fastly ACL to your Fastly configuration. You can find more 4 | details on what ACLs are [here](https://docs.fastly.com/en/guides/about-acls) 5 | 6 | To add an ACL, go to: 7 | ``` 8 | Magento admin > Stores > Configuration > Advanced > System > Full Page Cache > Fastly Configuration 9 | ``` 10 | Under *Edge acl* tab, new ACL can be created by clicking **Add ACL** button 11 | 12 | ![ACL](../images/guides/acl/acl.png "ACL") 13 | 14 | A popup will appear in which name of ACL must be entered, and if you want 15 | ACL active from new version, a checkbox for activation must be ticked. 16 | 17 | ![ACL_Add_Container](../images/guides/acl/acl-container.png "ACL Add Container") 18 | 19 | After adding ACL container we can add new items that will belong to this ACL. 20 | To add new items we click on gear right of newly created entry under *Edge acl* tab which will trigger a popup. 21 | 22 | ![ACL_Item](../images/guides/acl/acl-item.png "ACL Item") 23 | 24 | Under **IP Value** enter the IP you want to handle. It is also possible to enter IPs in CIDR format, example: 192.168.1.0/24. 25 | Negate option allows you to exclude certain IP or prefix from matching an ACL. Negation is achieved by adding *!* before the IP or CIDR address. 26 | For example you can add an ACL for 192.168.1.0/24 but negate *!192.168.1.5* which if ACL is applied for blocking access will block access to all IPs in 27 | 192.168.1.0/24 except for *192.168.1.5*. In general you are unlikely to need negation. 28 | 29 | Click **Save** button to the right of the newly created entry to save, or click **Delete** button to remove an entry. 30 | -------------------------------------------------------------------------------- /Documentation/Guides/BLOCKING.md: -------------------------------------------------------------------------------- 1 | # Blocking 2 | 3 | This guide will show how to setup blocking. This particular function supports blocking by 4 | 5 | * List of countries 6 | * List of [Access Control Lists - ACLs](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/ACL.md) 7 | 8 | This is useful in the cases where you want to block access for users coming from specific countries 9 | or certain IPs or IP ranges. 10 | 11 | To enable Blocking, go to: 12 | 13 | ``` 14 | Magento admin > Stores > Configuration > Advanced > System > Full Page Cache > Fastly Configuration 15 | ``` 16 | 17 | Under the *Blocking* tab, you will see a screen like this. 18 | 19 | Blocking main screen UI 20 | 21 | ## Configuring Blocking 22 | 23 | ## Blocking modes 24 | 25 | First thing to decide is how you want to block traffic. Two modes are available 26 | 27 | * **Blocklist**: blocks all access for users from selected countries/ACLs 28 | * **Allowlist**: block all access EXCEPT for users from selected countries/ACLs (Available in 1.2.70+) 29 | 30 | Blocklist is the default mode. 31 | 32 | ## Country/ACL selection 33 | 34 | You can select to block by list of countries and/or ACLs. Multiple selections are possible if you hold the Control key 35 | when selecting a list of countries. If you don't see any [ACL](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/ACL.md) listed in the selection box you will need to create one. 36 | 37 | ## Enable Blocking 38 | 39 | To enable Blocking click the **Enable/Disable** button and follow the directions. 40 | 41 | ## Changing blocking config 42 | 43 | After any change to the country list or ACL list you need to click the *Update Blocking Config* button to push the config change. 44 | 45 | If you decide to switch blocking modes you have to save the config before clicking Update Blocking Config. 46 | 47 | ## Turning off Blocking 48 | 49 | Once you are ready to go live you will want to turn off Blocking. This can be achieved by clicking the **Enable/Disable** button then clicking the **Upload button**. 50 | -------------------------------------------------------------------------------- /Documentation/Guides/DICTIONARIES.md: -------------------------------------------------------------------------------- 1 | # Dictionaries 2 | 3 | This guide will show how to add Fastly Dictionaries to your site. 4 | 5 | To add dictionary, go to: 6 | ``` 7 | Magento admin > Stores > Configuration > Advanced > System > Full Page Cache > Fastly Configuration 8 | ``` 9 | Under *Edge dictionaries* tab, new dictionary can be created by clicking **Add container** button 10 | 11 | ![Dictionaries](../images/guides/dictionaries/dictionaries.png "Dictionaries") 12 | 13 | After adding new dictionary container, a popup will appear in which name of dictionary must be entered, and if you want 14 | dictionary active from new version, a checkbox for activation must be ticked. 15 | 16 | ![Dictionaries_Add_Container](../images/guides/dictionaries/dictionary-container.png "Dictionaries Add Container") 17 | 18 | After adding dictionary container we can add new items that will belong to this dictionary. 19 | To add new items we click on gear left of newly created entry under *Edge dictionaries* tab which will trigger a popup. 20 | 21 | ![Dictionaries_Item](../images/guides/dictionaries/dictionary-item.png "Dictionary Item") 22 | 23 | Once you enter **Key** and **Value**, you can add dictionary item by clicking **Save** button to the right of the item. 24 | To remove dictionary item, click **Delete** button to the right of the item. -------------------------------------------------------------------------------- /Documentation/Guides/ERROR-MAINTENANCE-PAGE.md: -------------------------------------------------------------------------------- 1 | # Set Error / Maintenance page guide 2 | 3 | The Fastly CDN will sometimes return a 503 error due to various issues that can occur. The generic text associated with a 503 error is “Service Unavailable” and it can mean variety of things. This default error response can be confusing to the customers and have a basic look and feel. 4 | 5 | This guide will show you how to set friendly or prettier 503 custom error page through Fastly module which will be served when: 6 | * When origin returns a response status greater than 500 7 | * When origin is down (i.e unhealthy, timeout, etc) 8 | 9 | To set custom Error page, go to: 10 | 11 | ``` 12 | Magento admin > Stores > Configuration > Advanced > System > Full Page Cache > Fastly Configuration 13 | ``` 14 | 15 | Under the Fastly Configuration, click on the **Error/Maintenance page:** 16 | 17 | ![Error Maintenance page](../images/guides/error-maintenance-page/error-maintenance-page.png "Error/Maintenance page") 18 | 19 | The modal window will pop up. Paste your custom HTML code into the HTML textarea and press the Upload button to save changes. 20 | 21 | ![Set HTML](../images/guides/error-maintenance-page/set-html.png "Set HTML") 22 | 23 | Now when Fastly returns 503 error, instead of default error page which looks something like this: 24 | 25 | ![Default error page](../images/guides/error-maintenance-page/default-error-page.png "Default error page") 26 | 27 | You will serve your custom error page: 28 | 29 | ![New error page](../images/guides/error-maintenance-page/new-error-page.png "New error page") 30 | -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-BLACKFIRE-INTEGRATION.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - Blackfire integration 2 | 3 | This module will enable Blackfire integration. It's available in module version 1.2.103+. It's based on instructions 4 | from [Blackfire reference guide on bypassing reverse proxy cache and CDNs](https://blackfire.io/docs/reference-guide/configuration#bypassing-reverse-proxy-cache-and-content-delivery-networks-cdn). 5 | 6 | Before you can use Fastly Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) and that you have selected the Blackfire integration module. 7 | 8 | When you click on the configuration you will be prompted with a screen like this 9 | 10 | ![Fastly Edge Module Blackfire configuration](../../images/guides/edge-modules/edge-module-blackfire.png "Fastly Edge Module Blackfire configuration") 11 | 12 | ## Configurable options 13 | 14 | ### ACL 15 | 16 | Pick ACL (Access Control List) that contains a list of admin IPs that are allowed to initiate profiling. If there are no ACLs listed or you want to specify a new 17 | one [you can create it using the ACL interface](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/ACL.md). 18 | 19 | ## Enabling 20 | 21 | After any change to the settings you need to click Upload as that will upload require VCL code to Fastly. 22 | 23 | ## Technical details 24 | 25 | Following VCL will be uploaded 26 | 27 | Snippet Type: vcl_recv 28 | 29 | ```vcl 30 | if (req.http.X-Blackfire-Query && req.http.Fastly-Client-IP ~ maint_allowlist) { 31 | if (req.esi_level > 0) { 32 | # ESI request should not be included in the profile. 33 | # Instead you should profile them separately, each one 34 | # in their dedicated profile. 35 | # Removing the Blackfire header avoids to trigger the profiling. 36 | # Not returning let it go through your usual workflow as a regular 37 | # ESI request without distinction. 38 | unset req.http.X-Blackfire-Query; 39 | } else { 40 | set req.http.X-Pass = "1"; 41 | } 42 | } 43 | ``` 44 | -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-DATADOME-INTEGRATION.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - DataDome integration 2 | 3 | DataDome is a real-time bot protection. To enable the module, start your 30 days free trial at https://datadome.co/free-signup/. 4 | 5 | This module enables [DataDome integration](https://docs.datadome.co/docs/magento-with-fastly-cdn "DataDome Documetation"), it provides integration between Fastly Edge module and DataDome. It is available from module version 1.2.127+. 6 | 7 | Before you can use Fastly Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) and that you have selected the Datadome integration module. 8 | 9 | Once the module is enabled, the following settings screen should be configured: 10 | 11 | ![Fastly Edge Module DataDome configuration](../../images/guides/edge-modules/edge-module-datadome.jpg "Fastly Edge Module DataDome configuration") 12 | 13 | ## Configurable options 14 | 15 | | Setting | Description | 16 | |---------|-------------| 17 | | API Key | Your DataDome License key | 18 | | Exclusion Regex | The regex that will be applied to req.url.ext | 19 | | Connection Timeout | How long to wait for a timeout in milliseconds. | 20 | | First byte timeout | How long to wait for the first byte in milliseconds. | 21 | | Between bytes tiemout | How long to wait between bytes in milliseconds. | 22 | 23 | ## Enabling 24 | 25 | After any change to the settings you need to click *Upload* as that will upload require VCL code to Fastly. 26 | 27 | ## Full documentation 28 | 29 | You can access the full documentation on [DataDome's website](https://docs.datadome.co/docs/magento-with-fastly-cdn "Documentation") -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-HARD-RELOAD-CACHE-BYPASS.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - Hard Reload Cache Bypass for admins 2 | 3 | This guide will show how to configure hard reload cache bypass for admin IPs. This feature allows 4 | administrators to force a cache miss in their browser by pressing CMD/CTRL + SHIFT + R or SHIFT + F5. 5 | Administrators are defined as those users on the selected Access Control List (ACL). 6 | [More details can be found here](https://github.com/fastly/fastly-magento2/issues/147) 7 | 8 | Before you can use Fastly Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) 9 | 10 | When you click on the configuration you will be prompted with a screen like this 11 | 12 | ![Fastly Edge Module hard reload cache bypass](../../images/guides/edge-modules/edge-module-hard-reload-cache-bypass.png "Fastly Edge Module hard reload cache bypass") 13 | 14 | ## Configurable options 15 | 16 | ### ACL 17 | 18 | Pick ACL (Access Control List) that contains a list of admin IPs. If there are no ACLs listed or you want to specify a new 19 | one [you can create it using the ACL interface](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/ACL.md). 20 | 21 | 22 | ## Enabling 23 | 24 | After any change to the settings you need to click Upload as that will activate the functionality you configured. 25 | 26 | ## Technical details 27 | 28 | Following VCL snippets are being uploaded 29 | 30 | Snippet Type: vcl_recv 31 | 32 | ```vcl 33 | if ( req.http.Fastly-Client-IP ~ maint_allowlist && req.http.pragma ~ "no-cache" ) { 34 | set req.hash_always_miss = true; 35 | } 36 | ``` 37 | 38 | Snippet Type: vcl_hash 39 | 40 | ```vcl 41 | if ( req.http.Fastly-Client-IP ~ maint_allowlist && req.http.pragma ~ "no-cache" ) { 42 | set req.hash += "NOCACHE"; 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-NETACEA-INTEGRATION.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - Netacea integration 2 | 3 | This module will enable Netacea integration. Netacea is a security provider providing services such 4 | as bot detection, etc. You have to have an account with Netacea before proceeding. This module only provides 5 | integration with Netacea service. It's available in module version 1.2.131+. 6 | 7 | Before you can use Fastly Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) and that you have selected the Netacea integration module. 8 | 9 | After you have enabled the module it's time to configure. You will be prompted with a screen like this 10 | 11 | ![Fastly Edge Module Netacea configuration](../../images/guides/edge-modules/edge-module-netacea.jpg "Fastly Edge Module Netacea configuration") 12 | 13 | ## Configurable options 14 | 15 | In order to configure Netacea module please see the following documentation.
16 | [Netacea - Fastly/Magento](https://docs.netacea.com/netacea-plugin-information/fastly-magento/installation-and-configuration) 17 | 18 | ## Enabling 19 | 20 | After any change to the settings you need to click *Upload* as that will upload require VCL code to Fastly. 21 | -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-PERIMETERX-INTEGRATION.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - PerimeterX Integration 2 | 3 | This module will enable the PerimeterX Bot Defender Integration. You must have a Bot Defender account with PerimeterX before proceeding. This module provides integration for PerimeterX's Bot Defender solution. 4 | 5 | Before you can use Fastly Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) and that you have selected the PerimeterX integration module. 6 | 7 | Additional installation and configuration details for the PerimeterX integration can be found in [this](https://docs.perimeterx.com/pxconsole/docs/fastly-magento2-installation) PerimeterX Knowledgebase article. 8 | -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-REDIRECT-DOMAIN.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - Redirect one domain to another 2 | 3 | This guide will show how to configure domain redirection from one to another. This particular feature is useful to redirect apex/naked 4 | domains to www e.g. domain.com => www.domain.com. 5 | 6 | Before you can use Fastly Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) 7 | 8 | When you click on the configuration you will be prompted with a screen like this 9 | 10 | ![Fastly Edge Module Cloud Sitemap rewrites configuration](../../images/guides/edge-modules/edge-module-redirect-one-domain-to-another.png "Fastly Edge Module Cloud Sitemap rewrites") 11 | 12 | You can specify multiple domain redirects by clicking *Add Group* button 13 | 14 | ## Configurable options 15 | 16 | ### Incoming Domain/Host 17 | 18 | Incoming domain e.g. `domain.com` 19 | 20 | ### Destination domain/host 21 | 22 | Destination domain/host e.g. `www.domain.com` 23 | 24 | ### Ignore path 25 | 26 | Strip incoming path and set it to /. Default only rewrites host retaining the path e.g. http://domain.com/category is redirected to https://www.domain.com/category 27 | 28 | ## Enabling 29 | 30 | After any change to the settings you need to click Upload as that will activate the functionality you configured. 31 | 32 | ## Technical details 33 | 34 | Following VCL snippets are being uploaded 35 | 36 | ### Ignore path 37 | 38 | Snippet Type: vcl_recv 39 | 40 | ```vcl 41 | if (req.http.host == "domain.com") { 42 | set req.http.host = "www.domain.com"; 43 | set req.url = "/"; 44 | error 801; 45 | } 46 | ``` 47 | 48 | ### Leave path alone 49 | 50 | Snippet Type: vcl_recv 51 | 52 | ```vcl 53 | if (req.http.host == "domain.com") { 54 | set req.http.host = "www.domain.com"; 55 | error 801; 56 | } 57 | ``` 58 | 59 | -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-SITESPECT-INTEGRATION.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - SiteSpect integration 2 | 3 | This module will enable SiteSpect integration. SiteSpect is an optimization platform providing services such 4 | as A/B testing, personalization, etc. You have to have an account with SiteSpect before proceeding. It's available in versions 1.2.168+. 5 | 6 | Before you can use Fastly Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) and that you have selected the Netacea integration module. 7 | 8 | After you have enabled the module it's time to configure. You will be prompted with a screen like this 9 | 10 | ![Fastly Edge Module SiteSpect configuration](../../images/guides/edge-modules/edge-module-sitespect.jpg "Fastly Edge Module SiteSpect configuration") 11 | 12 | ## Configurable options 13 | 14 | ### SiteSpect Hostname 15 | 16 | This is the SiteSpect endpoint provided to you by the SiteSpect team e.g. domain.com.ssopt.net 17 | 18 | ### Exclusion regex 19 | 20 | Provides a regular expression to match file extensions that should not be processed by SiteSpect e.g. any images such as JPG, PNG etc. Typically you will not need to modify it. 21 | 22 | ## Healthcheck string 23 | 24 | This is a random alphanumeric string you should enter for SiteSpect healthchecks to work. Please do not add any special characters only numbers and letters. 25 | 26 | ## Apply SiteSpect to all hostnames 27 | 28 | In multi-site setups you may opt to send only a limited set of hostnames/domains to SiteSpect. If so please choose `Limit to a set of hosts defined by regular expression` and specify a regular expression that will match such hostnames. 29 | 30 | ## Regex matching hostnames 31 | 32 | This is an optional setting that specifies a list regular expression to match hostnames we want to send to SiteSpect. It requires you to choose `Limit to a set of hosts defined by regular expression` in the `Apply SiteSpect to all hostnames` drop down. 33 | -------------------------------------------------------------------------------- /Documentation/Guides/Edge-Modules/EDGE-MODULE-URL-REWRITES.md: -------------------------------------------------------------------------------- 1 | # Fastly Edge Modules - URL rewrites 2 | 3 | This guide will show how to configure URL rewritesto point to the correct URL on the backend. Before you can use Fastly 4 | Edge Modules you need to [make sure they are enabled](https://github.com/fastly/fastly-magento2/blob/master/Documentation/Guides/Edge-Modules/EDGE-MODULES.md) 5 | 6 | When you click on the configuration you will be prompted with a screen like this 7 | 8 | ![Fastly Edge Module URL rewrites configuration](../../images/guides/edge-modules/edge-module-url-rewrites.jpg "Fastly Edge Module URL rewrites") 9 | 10 | 11 | Purpose of this module is to rewrite the location of the sitemap.xml file. It is not a redirect. You can specify multiple rewrites by clicking 12 | Add Group button 13 | 14 | ## Configurable options 15 | 16 | ### Source path 17 | 18 | Source URL path. Typically this will be `/sitemap.xml` 19 | 20 | ### Destination path 21 | 22 | Destination path e.g. `/media/sitemap.xml` 23 | 24 | ### Regex matching hostnames 25 | 26 | Regular expression that matches a set of hostnames e.g. `www\.google\.com` or `^google\.com`. If it's left 27 | blank it will apply to all hosts 28 | 29 | ## Enabling 30 | 31 | After any change to the settings you need to click Upload as that will upload require VCL code to Fastly. 32 | 33 | ## Technical details 34 | 35 | Following VCL snippets are being uploaded. Feel free to use them as custom snippets if module doesn't do what you expect. 36 | 37 | Snippet Type: vcl_miss 38 | 39 | ```vcl 40 | if (!req.backend.is_shield && req.url.path == "/sitemap.xml") { 41 | set bereq.url = "/media/sitemap.xml"; 42 | } 43 | ``` 44 | 45 | Snippet Type: vcl_pass 46 | 47 | ```vcl 48 | if (!req.backend.is_shield && req.url.path == "/sitemap.xml") { 49 | set bereq.url = "/media/sitemap.xml"; 50 | } 51 | ``` 52 | -------------------------------------------------------------------------------- /Documentation/Guides/MAINTENANCE-MODE.md: -------------------------------------------------------------------------------- 1 | # Maintenance Mode guide 2 | 3 | Available in version 1.2.91 of the plugin and higher 4 | 5 | Enabling maintenance mode allows admin IPs (IPs specified in .maintenance.ip file) to access the site as normal while 6 | returning an error page to everyone else. 7 | 8 | ![Maintenance Mode Screen](../images/guides/maintenance-mode/maint-mode.png "Maintenance Mode Screen") 9 | 10 | # Requirements 11 | 12 | Before using this feature, make sure to Upload VCL to Fastly from the Fastly Configuration menu, or 13 | by using the CLI command `bin/magento fastly:conf:set -u`. This will ensure that your Fastly service has the required 14 | snippets, dictionary and ACL containers. 15 | 16 | # Toggle Maintenance Mode 17 | 18 | To enable Maintenance Mode, use the Enable Maintenance Mode button in the Maintenance Mode tab of the Fastly 19 | Configuration, or use the CLI command `bin/magento fastly:maintenance -e`. Enabling Maintenance Mode will block all 20 | traffic from IP addresses not located in the `maint_allowlist` ACL container. The IP addresses should be updated by 21 | using the Update Admin IPs list option. 22 | 23 | To disable Maintenance Mode, use the same button or the CLI command `bin/magento fastly:maintenance -d`. 24 | 25 | # Update Admin IPs list 26 | 27 | Before Maintenance Mode can be enabled, the list of allowed IP addresses in the `maint_allowlist` ACL container has to 28 | contain at least one IP address. To update the list, use the Update Admin IPs list button in the Maintenance 29 | Mode tab of the Fastly Configuration or the CLI command `bin/magento fastly:maintenance -u`. This process will read 30 | all of the IP addresses contained in the `var/.maintenance.ip` file and add them to the `maint_allowlist` ACL container. 31 | 32 | The `var/.maintenance.ip` file can be manually created or by using the Magento default CLI commands 33 | `bin/magento maintenance:enable [--ip= ... --ip=]` or 34 | `bin/magento maintenance:allow-ips .. ` 35 | 36 | 37 | -------------------------------------------------------------------------------- /Documentation/Guides/WEBHOOK-NOTIFICATIONS.md: -------------------------------------------------------------------------------- 1 | # Webhook Notifications 2 | 3 | This guide will show you how to how to set up webhook notifications from the Fastly module. [Webhooks](https://en.wikipedia.org/wiki/Webhook) 4 | are a way of surfacing activity from your Fastly plugin. Currently this integration is geared for Slack however you should be able to repurpose 5 | it elsewhere. 6 | 7 | ## Prerequisites 8 | 9 | * Webhook URL. To create a webhook URL follow [this guide from Slack](https://api.slack.com/incoming-webhooks). 10 | 11 | ### Fastly configuration 12 | 13 | You can configure Webhook notifications in Fastly module by going to: 14 | 15 | ``` 16 | Magento admin > Stores > Configuration > Advanced > System > Full Page Cache > Fastly Configuration 17 | ``` 18 | 19 | Under the Fastly Configuration, click on the **Webhook notifications settings:**. After you enable it you will be presented with a menu 20 | like this 21 | 22 | Webhooks config UI 23 | 24 | At a minimum you will need to provide the webhook URL e.g. 25 | 26 | https://hooks.slack.com/services/XXX/XXXX/XXXXX 27 | 28 | By default Fastly module will send following notifications 29 | 30 | * Publish Key and URL Purge Events 31 | * Publish Purge All/Clean All Items Events 32 | * Publish Config change events 33 | 34 | Optionally you can 35 | 36 | * Turn on showing stack trace of purge all events - this is useful if you are experiencing issues due to frequent purges and don't know 37 | what may be triggering them 38 | * Message prefix - useful if you are sending messages from multiple Magento instances 39 | 40 | Once you have configured the webhook notifications you should see messages like this in your Slack channel 41 | 42 | Example notifications 43 | -------------------------------------------------------------------------------- /Documentation/OPENING-ISSUES.md: -------------------------------------------------------------------------------- 1 | # How to open issues for Fastly_Cdn Module 2 | 3 | Issues are for tracking broken functionality and are intended for managing 4 | development work to address these. 5 | 6 | If you have an issue with usage or need general assistance using this module, 7 | or Fastly in general please use the [support infomation](../README.md#support). 8 | 9 | This describes what content should be added to a issue to help with an 10 | expedient resolution. 11 | 12 | ## What to post 13 | 14 | A good bug report contains the data necessary to reproduce, identify, locate 15 | and address a problem in code. Where possible it should also indicate what 16 | steps have already been taken to address the issue and their result too. 17 | 18 | A report should be reproducible on a base install of Magento to an up to date 19 | system with no additional modules. 20 | 21 | At a bare minimum include: 22 | 23 | 1. OS name and version. 24 | 1. PHP version 25 | 1. Database server name and version. 26 | 1. Magento version. 27 | 1. Composer version. 28 | 1. Description of the problem. What is happening that shouldn't? 29 | 1. Description of the expected behaviour. 30 | 1. Exact steps to reproduce the error. 31 | 32 | Additional data which can help: 33 | 34 | 1. Logs showing errors or behaviour. 35 | 1. Steps which have been taken to try address the issue. 36 | 1. Other data which indicates what may be causing the issue. 37 | 1. Stack trace if any error is seen. -------------------------------------------------------------------------------- /Documentation/README.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | This folder contains the collected documentation for the Fastly_Cdn module. 4 | 5 | ## Contents 6 | 7 | * [Installation instructions](INSTALLATION.md) 8 | * [TLS Deployment instructions](TLS.md) 9 | * [Configuration instructions](CONFIGURATION.md) 10 | * [Purging and Other Functions](OTHER-FUNCTIONS.md) 11 | * [CLI Functions](CLI.md) 12 | * [Troubleshooting instructions](TROUBLESHOOTING.md) 13 | * [How to report bugs](OPENING-ISSUES.md) 14 | 15 | Please report any errors or problems with these documents as GitHub issues. -------------------------------------------------------------------------------- /Documentation/TROUBLESHOOTING.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting the Fastly_Cdn Module 2 | 3 | Here are a few notes on troubleshooting the Fastly_Cdn module. 4 | 5 | 1. Try disabling other non-essential modules. 6 | 1. Try disabling the Fastly_Cdn module. 7 | 1. Put the server into developer mode and see if errors are generated. 8 | 1. Check the logs in `/var/log` to see if there are indications 9 | of the cause. 10 | 1. Double check API credential and service ID are correct. -------------------------------------------------------------------------------- /Documentation/images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/.DS_Store -------------------------------------------------------------------------------- /Documentation/images/fastly_config.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/fastly_config.jpg -------------------------------------------------------------------------------- /Documentation/images/guides/acl/acl-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/acl/acl-container.png -------------------------------------------------------------------------------- /Documentation/images/guides/acl/acl-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/acl/acl-item.png -------------------------------------------------------------------------------- /Documentation/images/guides/acl/acl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/acl/acl.png -------------------------------------------------------------------------------- /Documentation/images/guides/backend-settings/edit-backend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/backend-settings/edit-backend.png -------------------------------------------------------------------------------- /Documentation/images/guides/backend-settings/shielding-configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/backend-settings/shielding-configuration.png -------------------------------------------------------------------------------- /Documentation/images/guides/basic-auth/adding-users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/basic-auth/adding-users.png -------------------------------------------------------------------------------- /Documentation/images/guides/basic-auth/confirmation-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/basic-auth/confirmation-screen.png -------------------------------------------------------------------------------- /Documentation/images/guides/basic-auth/create-container-for-authenticated-users.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/basic-auth/create-container-for-authenticated-users.png -------------------------------------------------------------------------------- /Documentation/images/guides/basic-auth/main-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/basic-auth/main-screen.png -------------------------------------------------------------------------------- /Documentation/images/guides/blocking/blocking_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/blocking/blocking_ui.png -------------------------------------------------------------------------------- /Documentation/images/guides/dictionaries/dictionaries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/dictionaries/dictionaries.png -------------------------------------------------------------------------------- /Documentation/images/guides/dictionaries/dictionary-container.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/dictionaries/dictionary-container.png -------------------------------------------------------------------------------- /Documentation/images/guides/dictionaries/dictionary-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/dictionaries/dictionary-item.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-blackfire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-blackfire.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-cors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-cors.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-create-backend-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-create-backend-1.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-create-backend-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-create-backend-2.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-create-request-condition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-create-request-condition.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-datadome.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-datadome.jpg -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-hard-reload-cache-bypass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-hard-reload-cache-bypass.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-image-optimization-test-drive-overlaid-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-image-optimization-test-drive-overlaid-image.jpg -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-image-optimization-test-drive-synthetic-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-image-optimization-test-drive-synthetic-page.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-increase-timeouts-long-jobs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-increase-timeouts-long-jobs.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-netacea.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-netacea.jpg -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-redirect-one-domain-to-another.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-redirect-one-domain-to-another.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-sitespect.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-sitespect.jpg -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-test-drive-image-optimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-test-drive-image-optimization.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edge-module-url-rewrites.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edge-module-url-rewrites.jpg -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/edgemodule-othercms-integration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/edgemodule-othercms-integration.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/fastly-edge-modules-list-of-modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/fastly-edge-modules-list-of-modules.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/fastly-edgemodules-first-use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/fastly-edgemodules-first-use.png -------------------------------------------------------------------------------- /Documentation/images/guides/edge-modules/fastly-edgemodules-onemodule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/edge-modules/fastly-edgemodules-onemodule.png -------------------------------------------------------------------------------- /Documentation/images/guides/error-maintenance-page/default-error-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/error-maintenance-page/default-error-page.png -------------------------------------------------------------------------------- /Documentation/images/guides/error-maintenance-page/error-maintenance-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/error-maintenance-page/error-maintenance-page.png -------------------------------------------------------------------------------- /Documentation/images/guides/error-maintenance-page/new-error-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/error-maintenance-page/new-error-page.png -------------------------------------------------------------------------------- /Documentation/images/guides/error-maintenance-page/set-html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/error-maintenance-page/set-html.png -------------------------------------------------------------------------------- /Documentation/images/guides/force-tls/force-tls-modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/force-tls/force-tls-modal.png -------------------------------------------------------------------------------- /Documentation/images/guides/force-tls/force-tls-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/force-tls/force-tls-success.png -------------------------------------------------------------------------------- /Documentation/images/guides/force-tls/force-tls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/force-tls/force-tls.png -------------------------------------------------------------------------------- /Documentation/images/guides/force-tls/secure-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/force-tls/secure-url.png -------------------------------------------------------------------------------- /Documentation/images/guides/geoip/geoip-prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/geoip/geoip-prompt.png -------------------------------------------------------------------------------- /Documentation/images/guides/geoip/geoip-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/geoip/geoip-settings.png -------------------------------------------------------------------------------- /Documentation/images/guides/image-optimization/io_default_config_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/image-optimization/io_default_config_dialog.png -------------------------------------------------------------------------------- /Documentation/images/guides/image-optimization/io_main_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/image-optimization/io_main_screen.png -------------------------------------------------------------------------------- /Documentation/images/guides/image-optimization/io_not_enabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/image-optimization/io_not_enabled.png -------------------------------------------------------------------------------- /Documentation/images/guides/image-optimization/io_tunables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/image-optimization/io_tunables.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/account-api-key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/account-api-key.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/choosefastly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/choosefastly.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/clearcache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/clearcache.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/golive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/golive.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/newfeatures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/newfeatures.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/show-service-id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/show-service-id.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/successvcl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/successvcl.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/testcredentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/testcredentials.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/vclupload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/vclupload.png -------------------------------------------------------------------------------- /Documentation/images/guides/installation/wizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/installation/wizard.png -------------------------------------------------------------------------------- /Documentation/images/guides/maintenance-mode/maint-mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/maintenance-mode/maint-mode.png -------------------------------------------------------------------------------- /Documentation/images/guides/rate-limiting/rate-limiting1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/rate-limiting/rate-limiting1.png -------------------------------------------------------------------------------- /Documentation/images/guides/rate-limiting/rate-limiting2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/rate-limiting/rate-limiting2.png -------------------------------------------------------------------------------- /Documentation/images/guides/vcl-snippets/after_snippet_create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/vcl-snippets/after_snippet_create.png -------------------------------------------------------------------------------- /Documentation/images/guides/vcl-snippets/snippet_create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/vcl-snippets/snippet_create.png -------------------------------------------------------------------------------- /Documentation/images/guides/vcl-snippets/vcl_snippets_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/vcl-snippets/vcl_snippets_main.png -------------------------------------------------------------------------------- /Documentation/images/guides/webhooks/example_notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/webhooks/example_notifications.png -------------------------------------------------------------------------------- /Documentation/images/guides/webhooks/webhooks_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fastly/fastly-magento2/8ac56fcfc7df115c5686a613da29aaf810d680e4/Documentation/images/guides/webhooks/webhooks_ui.png -------------------------------------------------------------------------------- /Helper/CacheTags.php: -------------------------------------------------------------------------------- 1 | 'p', 43 | 'catalog_category_' => 'c', 44 | 'cms_page' => 'cpg', 45 | 'cms_block' => 'cb', 46 | 47 | // 2.2.* 48 | 'cat_p_' => 'p', 49 | 'cat_c_' => 'c', 50 | 'cms_p' => 'cpg', 51 | 'cms_b' => 'cb', 52 | 53 | // Other 54 | 'brands_brand_' => 'b' 55 | ]; 56 | 57 | return str_replace(array_keys($fastlyTags), $fastlyTags, $tags); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /LICENSE_FASTLY_CDN.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Fastly, Inc. (http://www.fastly.com) 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Model/AdaptivePixelRatio.php: -------------------------------------------------------------------------------- 1 | toArray() as $value => $label) { 41 | $options[] = [ 42 | 'value' => $value, 43 | 'label' => $label, 44 | ]; 45 | } 46 | return $options; 47 | } 48 | 49 | /** 50 | * Get options in "key-value" format 51 | * 52 | * @return array 53 | */ 54 | public function toArray() 55 | { 56 | return [ 57 | 'off' => __('Off'), 58 | 'low' => __('Low'), 59 | 'medium' => __('Medium'), 60 | 'high' => __('High'), 61 | ]; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Model/Config/Backend/BlocklistAllowlist.php: -------------------------------------------------------------------------------- 1 | 0, 'label' => __('Blocklist')], ['value' => 1, 'label' => __('Allowlist')]]; 37 | } 38 | 39 | /** 40 | * Get options in "key-value" format 41 | * 42 | * @return array 43 | */ 44 | public function toArray() 45 | { 46 | return [0 => __('Blocklist'), 1 => __('Allowlist')]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Model/Config/Backend/ImportFile.php: -------------------------------------------------------------------------------- 1 | '1', 'label'=>__('1x')], 39 | ['value' => '1.5', 'label'=>__('1.5x')], 40 | ['value' => '2', 'label'=>__('2x')], 41 | ['value' => '3', 'label'=>__('3x')], 42 | ['value' => '3.5', 'label'=>__('3.5x')], 43 | ['value' => '4', 'label'=>__('4x')] 44 | ]; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Model/Config/Backend/ValidateInt.php: -------------------------------------------------------------------------------- 1 | getValue(); 41 | $field = $this->getField(); 42 | 43 | if (ctype_digit($value) === false) { 44 | throw new LocalizedException( 45 | __('%1 field must contain a numeric value.', $this->getFieldConfig('label')) 46 | ); 47 | } 48 | 49 | if ($field == 'admin_path_timeout') { 50 | $maxValue = Config::XML_FASTLY_MAX_FIRST_BYTE_TIMEOUT; 51 | if ($value > $maxValue || $value < 0) { 52 | throw new LocalizedException( 53 | __( 54 | '%1 field value must be larger than 0 and smaller or equal to ' . $maxValue, 55 | $this->getFieldConfig('label') 56 | ) 57 | ); 58 | } 59 | } 60 | 61 | return $value; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Model/Config/GeolocationRedirectMatcher.php: -------------------------------------------------------------------------------- 1 | $bestMatchScore) { 44 | $match = (int)$mapEntry['store_id']; 45 | $bestMatchScore = $matchScore; 46 | } 47 | } 48 | 49 | return $match; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Model/Manifest.php: -------------------------------------------------------------------------------- 1 | _init(ManifestModel::class); 19 | } 20 | 21 | /** 22 | * @param $id 23 | * @return $this 24 | */ 25 | public function setManifestId($id) 26 | { 27 | return $this->setData('manifest_id', $id); 28 | } 29 | 30 | /** 31 | * @param $name 32 | * @return $this 33 | */ 34 | public function setManifestName($name) 35 | { 36 | return $this->setData('manifest_name', $name); 37 | } 38 | 39 | /** 40 | * @param $version 41 | * @return $this 42 | */ 43 | public function setManifestVersion($version) 44 | { 45 | return $this->setData('manifest_version', $version); 46 | } 47 | 48 | /** 49 | * @param $content 50 | * @return $this 51 | */ 52 | public function setManifestContent($content) 53 | { 54 | return $this->setData('manifest_content', $content); 55 | } 56 | 57 | public function getManifestId($id) 58 | { 59 | return $this->getData('manifest_id', $id); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Model/PageCache/PurgeCachePlugin.php: -------------------------------------------------------------------------------- 1 | config = $config; 47 | } 48 | 49 | /** 50 | * Prevent Magento from executing purge requests on Varnish when Fastly is enabled 51 | * 52 | * @param PurgeCache $subject 53 | * @param callable $proceed 54 | * @param array ...$args 55 | */ 56 | public function aroundSendPurgeRequest(PurgeCache $subject, callable $proceed, ...$args) // @codingStandardsIgnoreLine - unused parameter 57 | { 58 | if ($this->config->isFastlyEnabled() !== true) { 59 | $proceed(...$args); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Model/PurgeCache.php: -------------------------------------------------------------------------------- 1 | api = $api; 47 | $this->config = $config; 48 | } 49 | 50 | /** 51 | * Send API purge request to invalidate cache by pattern 52 | * 53 | * @param string $pattern 54 | * @return array|bool|\Magento\Framework\Controller\Result\Json 55 | */ 56 | public function sendPurgeRequest($pattern = '') 57 | { 58 | if (empty($pattern)) { 59 | if ($this->config->canPreserveStatic()) { 60 | $result = $this->api->cleanBySurrogateKey(['text']); 61 | } else { 62 | $result = $this->api->cleanAll(); 63 | } 64 | } elseif (!is_array($pattern) && strpos($pattern, 'http') === 0) { 65 | $result = $this->api->cleanUrl($pattern); 66 | } elseif (is_array($pattern)) { 67 | $result = $this->api->cleanBySurrogateKey($pattern); 68 | } else { 69 | return false; 70 | } 71 | return $result; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Model/Resolver/GeoIP/CountryCodeProviderInterface.php: -------------------------------------------------------------------------------- 1 | request = $request; 23 | } 24 | /** 25 | * @return string|null 26 | */ 27 | public function getCountryCode(): ?string 28 | { 29 | return $this->request->getParam(self::REQUEST_PARAM_COUNTRY); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Model/ResourceModel/Manifest.php: -------------------------------------------------------------------------------- 1 | _init('fastly_modly_manifests', 'manifest_id'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Model/ResourceModel/Manifest/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 21 | 'Fastly\Cdn\Model\Manifest', 22 | 'Fastly\Cdn\Model\ResourceModel\Manifest' 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Model/ResourceModel/Statistic/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 44 | 'Fastly\Cdn\Model\Statistic', 45 | 'Fastly\Cdn\Model\ResourceModel\Statistic' 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Model/System/Config/Source/ApplicationPlugin.php: -------------------------------------------------------------------------------- 1 | Config::FASTLY, 'label' => __('Fastly CDN')]]); 41 | } 42 | 43 | /** 44 | * @param Application $application 45 | * @param array $optionArray 46 | * @return array 47 | */ 48 | public function afterToArray(Application $application, array $optionArray) // @codingStandardsIgnoreLine - unused parameter 49 | { 50 | $optionArray[Config::FASTLY] = __('Fastly CDN'); 51 | return $optionArray; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Model/System/Config/Source/GeoIP/Action.php: -------------------------------------------------------------------------------- 1 | \Fastly\Cdn\Model\Config::GEOIP_ACTION_DIALOG, 40 | 'label' => __('Dialog'), 41 | ], 42 | [ 43 | 'value' => \Fastly\Cdn\Model\Config::GEOIP_ACTION_REDIRECT, 44 | 'label' => __('Redirect') 45 | ] 46 | ]; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Model/Upload/Acl.php: -------------------------------------------------------------------------------- 1 | api = $api; 23 | } 24 | 25 | /** 26 | * @param $cloneNumber 27 | * @param $currActiveVersion 28 | * @return bool|mixed 29 | */ 30 | public function setupAcl($cloneNumber, $currActiveVersion) 31 | { 32 | try { 33 | $aclName = Config::MAINT_ACL_NAME; 34 | $acl = $this->api->getSingleAcl($currActiveVersion, $aclName); 35 | 36 | if (!$acl) { 37 | $params = ['name' => $aclName]; 38 | $acl = $this->api->createAcl($cloneNumber, $params); 39 | } 40 | return $acl; 41 | } catch (\Exception $e) { 42 | 43 | return false; 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Model/Upload/Dictionary.php: -------------------------------------------------------------------------------- 1 | api = $api; 23 | } 24 | 25 | /** 26 | * @param $cloneNumber 27 | * @param $currActiveVersion 28 | * @return bool|mixed 29 | */ 30 | public function setupDictionary($cloneNumber, $currActiveVersion) 31 | { 32 | try { 33 | $dictionaryName = Config::CONFIG_DICTIONARY_NAME; 34 | $dictionary = $this->api->getSingleDictionary($currActiveVersion, $dictionaryName); 35 | 36 | if (!$dictionary) { 37 | $params = ['name' => $dictionaryName]; 38 | $dictionary = $this->api->createDictionary($cloneNumber, $params); 39 | } 40 | return $dictionary; 41 | } catch (\Exception $e) { 42 | 43 | return false; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Observer/FlushAllCacheObserver.php: -------------------------------------------------------------------------------- 1 | config = $config; 50 | $this->purgeCache = $purgeCache; 51 | } 52 | 53 | /** 54 | * Flush Fastly CDN cache 55 | * 56 | * @param Observer $observer 57 | * @return void 58 | */ 59 | public function execute(Observer $observer): void // @codingStandardsIgnoreLine - unused parameter 60 | { 61 | if ($this->config->getType() === Config::FASTLY && $this->config->isEnabled()) { 62 | $this->purgeCache->sendPurgeRequest(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Plugin/Catalog/Observer/DisableImageResizeAfterProductSave.php: -------------------------------------------------------------------------------- 1 | config = $config; 25 | } 26 | 27 | /** 28 | * Disable image resize if deep image optimization is enabled 29 | * 30 | * @param ImageResizeAfterProductSave $subject 31 | * @param callable $proceed 32 | * @param Observer $observer 33 | */ 34 | public function aroundExecute(ImageResizeAfterProductSave $subject, callable $proceed, Observer $observer) 35 | { 36 | if ($this->config->isImageOptimizationEnabled()) { 37 | return; 38 | } 39 | $proceed($observer); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Plugin/ExcludeFilesFromMinification.php: -------------------------------------------------------------------------------- 1 | isEnabled($contentType)) { 42 | return $result; 43 | } 44 | $result[] = 'https://www.gstatic.com/charts/loader.js'; 45 | return $result; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Test/Unit/Model/_files/result.vcl: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Fastly CDN for Magento 2 4 | # 5 | # NOTICE OF LICENSE 6 | # 7 | # This source file is subject to the Fastly CDN for Magento 2 End User License 8 | # Agreement that is bundled with this package in the file LICENSE_FASTLY_CDN.txt. 9 | # 10 | # @copyright Copyright (c) 2016 Fastly, Inc. (http://www.fastly.com) 11 | # @license BSD, see LICENSE_FASTLY_CDN.txt 12 | # 13 | ############################################################################### 14 | 15 | if (req.url ~ "^/(pub/)?(media|static)/.*") { 16 | if (req.http.user-agent ~ "(?pattern)?i") { 17 | set req.hash += "value_for_pattern"; 18 | } 19 | } -------------------------------------------------------------------------------- /Test/Unit/Model/_files/test.vcl: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # 3 | # Fastly CDN for Magento 2 4 | # 5 | # NOTICE OF LICENSE 6 | # 7 | # This source file is subject to the Fastly CDN for Magento 2 End User License 8 | # Agreement that is bundled with this package in the file LICENSE_FASTLY_CDN.txt. 9 | # 10 | # @copyright Copyright (c) 2016 Fastly, Inc. (http://www.fastly.com) 11 | # @license BSD, see LICENSE_FASTLY_CDN.txt 12 | # 13 | ############################################################################### 14 | 15 | ### {{ design_exceptions_code }} ### -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.2.229 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fastly/magento2", 3 | "description": "Fastly CDN Module for Magento 2.4.x", 4 | "require": { 5 | "php": "~7.3.0|~7.4.0|~8.0.0|~8.1.0|~8.2.0|~8.3.0|~8.4.0", 6 | "magento/module-config": ">=101.2.0", 7 | "magento/module-store": ">=101.1.0", 8 | "magento/module-page-cache": ">=100.4.0", 9 | "magento/module-cache-invalidate": ">=100.4.0", 10 | "magento/framework": ">=103.0.0", 11 | "laminas/laminas-http": "^2.6.0", 12 | "zordius/lightncandy": "^1.2" 13 | }, 14 | "type": "magento2-module", 15 | "version": "1.2.229", 16 | "license": "BSD-3-Clause", 17 | "autoload": { 18 | "files": [ "registration.php" ], 19 | "psr-4": { 20 | "Fastly\\Cdn\\": "" 21 | } 22 | }, 23 | "repositories": { 24 | "fastly-magento2": { 25 | "type": "git", 26 | "url": "https://github.com/fastly/fastly-magento2.git" 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /etc/adminhtml/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /etc/adminhtml/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /etc/db_schema_whitelist.json: -------------------------------------------------------------------------------- 1 | { 2 | "fastly_statistics": { 3 | "column": { 4 | "stat_id": true, 5 | "action": true, 6 | "sent": true, 7 | "state": true, 8 | "created_at": true 9 | }, 10 | "constraint": { 11 | "PRIMARY": true 12 | } 13 | }, 14 | "fastly_modly_manifests": { 15 | "column": { 16 | "manifest_id": true, 17 | "manifest_name": true, 18 | "manifest_description": true, 19 | "manifest_version": true, 20 | "manifest_properties": true, 21 | "manifest_content": true, 22 | "manifest_vcl": true, 23 | "manifest_values": true, 24 | "manifest_status": true, 25 | "last_uploaded": true 26 | }, 27 | "constraint": { 28 | "PRIMARY": true 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/blackfire_integration.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Necessary Fastly configuration to enable Blackfire profiling. Not required for Magento Commerce Cloud.", 3 | "id": "blackfire_integration", 4 | "name": "Blackfire integration", 5 | "properties": [ 6 | { 7 | "description": "ACL that contains IPs of users allowing to profile", 8 | "label": "ACL", 9 | "name": "Acl", 10 | "required": true, 11 | "type": "acl" 12 | } 13 | ], 14 | "test": { 15 | "origins": [ 16 | "https://httpbin.org" 17 | ], 18 | "reqUrl": "/status/500" 19 | }, 20 | "vcl": [ 21 | { 22 | "priority": 70, 23 | "template": " if (req.http.X-Blackfire-Query && req.http.Fastly-Client-IP ~ {{Acl}}) {\r\n if (req.esi_level > 0) {\r\n # ESI request should not be included in the profile.\r\n # Instead you should profile them separately, each one\r\n # in their dedicated profile.\r\n # Removing the Blackfire header avoids to trigger the profiling.\r\n # Not returning let it go through your usual workflow as a regular\r\n # ESI request without distinction.\r\n unset req.http.X-Blackfire-Query;\r\n } else {\r\n set req.http.X-Pass = \"1\";\r\n }\r\n }", 24 | "type": "recv" 25 | } 26 | ], 27 | "version": 1 28 | } 29 | -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/countryblock.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "description": "Block requests from a set of countries", 4 | "name": "Country block", 5 | "test": { 6 | "reqHeaders": "Fastly-Debug: 1", 7 | "reqUrl": "/html", 8 | "origins": [ 9 | "https://httpbin.org" 10 | ] 11 | }, 12 | "vcl": [ 13 | { 14 | "type": "recv", 15 | "template": "if (client.geo.country_code ~ \"(?i)^({{replace countryList '[ ,]+' '|'}})$\") {\n error 921 \"[modly:countryblock]\";\n}" 16 | }, 17 | { 18 | "type": "error", 19 | "template": "if (obj.status == 921 && obj.response == \"[modly:countryblock]\") {\n set obj.status = 403;\n set obj.response = \"Forbidden\";\n if (req.http.Fastly-Debug) {\n set obj.http.Fastly-Country-Block = client.geo.country_code;\n }\n synthetic \"\";\n return (deliver);\n}" 20 | } 21 | ], 22 | "id": "countryblock", 23 | "properties": [ 24 | { 25 | "validation": "^\\w{2}(\\s+\\w{2})*$", 26 | "description": "List countries to block, using [ISO-3166-1 alpha 2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes, separated by spaces, eg `us de cn`", 27 | "name": "countryList", 28 | "required": true, 29 | "type": "string", 30 | "label": "Countries" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/error.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "description": "In the event of 4xx or 5xx errors being returned from your origin server, replace the output with something else at the edge.", 4 | "name": "Custom error pages", 5 | "test": { 6 | "reqUrl": "/status/500", 7 | "origins": [ 8 | "https://httpbin.org" 9 | ] 10 | }, 11 | "vcl": [ 12 | { 13 | "type": "fetch", 14 | "template": "{{#each responses}}\nif (beresp.status == {{type}}) {\n error 921 \"[modly:customerrors]{{type}}\";\n}\n{{/each}}" 15 | }, 16 | { 17 | "type": "error", 18 | "template": "if (obj.status == 921 && obj.response ~ \"^\\[modly:customerrors\\](.*)$\") {\n {{#each responses}}\n if (re.group.1 == \"{{type}}\") {\n synthetic {\"{{responseBody}}\"};\n return (deliver);\n }\n {{/each}}\n}\n#TODO: errors during fetch ('nofetch')" 19 | } 20 | ], 21 | "id": "customerrors", 22 | "properties": [ 23 | { 24 | "label": "Responses", 25 | "type": "group", 26 | "properties": [ 27 | { 28 | "label": "Error type", 29 | "required": true, 30 | "type": "select", 31 | "options": { 32 | "404": "404 Not Found", 33 | "nofetch": "Origin offline", 34 | "401": "401 Unauthorized", 35 | "403": "403 Forbidden", 36 | "503": "503 Service Unavailable", 37 | "500": "500 Internal Server Error" 38 | }, 39 | "name": "type" 40 | }, 41 | { 42 | "required": true, 43 | "type": "longstring", 44 | "name": "responseBody", 45 | "label": "Response content" 46 | } 47 | ], 48 | "name": "responses", 49 | "entryTemplate": "{{type}}" 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/esi.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Edge side includes (ESI)", 3 | "id": "esi", 4 | "description": "Enable processing of ESI tags on HTML responses", 5 | "version": 1, 6 | "vcl": [ 7 | { 8 | "type": "fetch", 9 | "template": "if (beresp.http.Content-Type ~ \"text/html\") {\n esi;\n}" 10 | } 11 | ], 12 | "test": { 13 | "origins": [ 14 | "https://httpbin.org" 15 | ], 16 | "reqUrl": "/html" 17 | } 18 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/forcetls.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "description": "Redirect all non-secure requests to the equivalent secure URL, and optionally enable HTTP Strict Transport Security", 4 | "name": "Force TLS / HTTPS / SSL", 5 | "test": { 6 | "reqUrl": "/html", 7 | "origins": [ 8 | "https://httpbin.org" 9 | ] 10 | }, 11 | "vcl": [ 12 | { 13 | "type": "recv", 14 | "template": "if (!req.http.Fastly-SSL) {\n error 801 \"Force TLS\";\n}" 15 | }, 16 | { 17 | "type": "deliver", 18 | "template": "{{#ifEq hsts \"standard\"}}\n set resp.http.Strict-Transport-Security = \"max-age={{../hstsTTL}}\";\n{{/ifEq}}\n{{#ifEq hsts \"subdom\"}}\n set resp.http.Strict-Transport-Security = \"max-age={{../hstsTTL}}; includeSubdomains\";\n{{/ifEq}}\n{{#ifEq hsts \"preload\"}}\n set resp.http.Strict-Transport-Security = \"max-age={{../hstsTTL}}; includeSubdomains; preload\";\n{{/ifEq}}" 19 | } 20 | ], 21 | "id": "forcetls", 22 | "properties": [ 23 | { 24 | "description": "When HTTP Strict Transport Security is enabled, browsers are required to make an initial connection over HTTPS, even if the user does not enter a `https://` prefix", 25 | "name": "hsts", 26 | "default": "none", 27 | "required": false, 28 | "type": "select", 29 | "options": { 30 | "preload": "Include subdomains and preload", 31 | "none": "None", 32 | "subdom": "Include subdomains", 33 | "standard": "Standard" 34 | }, 35 | "label": "HTTP Strict Transport Security" 36 | }, 37 | { 38 | "description": "Duration of time in seconds for which the browser will apply any received HSTS rule. Typically set to a year once you are confident in your TLS setup.", 39 | "name": "hstsTTL", 40 | "default": 3600, 41 | "required": false, 42 | "type": "integer", 43 | "label": "Lifetime of HSTS rule" 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/gzip.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "GZip", 3 | "id": "gzip", 4 | "description": "Dynamically compress responses at the edge", 5 | "version": 1, 6 | "properties": [ 7 | { 8 | "name": "fileExtensions", 9 | "label": "File extensions", 10 | "description": "The file extensions for each file type you wish to have dynamically\ngzipped, separated by spaces.", 11 | "default": "css js html eot ico otf ttf json", 12 | "required": false, 13 | "validation": "^(\\w{1,4} )+\\w{1,4}$" 14 | }, 15 | { 16 | "name": "contentTypes", 17 | "label": "Content types", 18 | "description": "The mime type for each type of content you wish to have dynamically\ngzipped, separated by spaces.", 19 | "default": "text/html application/x-javascript text/css application/javascript text/javascript\napplication/json application/vnd.ms-fontobject application/x-font-opentype application/x-font-truetype\napplication/x-font-ttf application/xml font/eot font/opentype font/otf image/svg+xml\nimage/vnd.microsoft.icon text/plain text/xml" 20 | } 21 | ], 22 | "vcl": [ 23 | { 24 | "type": "fetch", 25 | "template": "if ((beresp.status == 200 || beresp.status == 404) && (beresp.http.content-type ~ \"^({{replace contentTypes '[ ,]+' '|'}})($|;)\" || req.url ~ \"\\.({{replace fileExtensions '[ ,]+' '|'}})($|\\?)\" ) ) {\n\n if (!beresp.http.Vary ~ \"Accept-Encoding\") {\n if (beresp.http.Vary) {\n set beresp.http.Vary = beresp.http.Vary \", Accept-Encoding\";\n } else {\n set beresp.http.Vary = \"Accept-Encoding\";\n }\n }\n if (req.http.Accept-Encoding == \"gzip\") {\n set beresp.gzip = true;\n }\n}" 26 | } 27 | ], 28 | "test": { 29 | "origins": [ 30 | "https://httpbin.org" 31 | ], 32 | "reqUrl": "/html" 33 | } 34 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/hostoverride.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "description": "When fetching from origin, set the origin's own hostname as Host header, rather than the public domain of your Fastly service.", 4 | "name": "Origin host header override", 5 | "test": { 6 | "reqUrl": "/html", 7 | "origins": [ 8 | "https://httpbin.org" 9 | ] 10 | }, 11 | "vcl": [ 12 | { 13 | "type": "miss", 14 | "template": "if (!req.backend.is_shield) { set bereq.http.Host = \"{{hostname}}\"; }" 15 | }, 16 | { 17 | "type": "pass", 18 | "template": "if (!req.backend.is_shield) { set bereq.http.Host = \"{{hostname}}\"; }" 19 | } 20 | ], 21 | "id": "hostoverride", 22 | "properties": [ 23 | { 24 | "label": "Origin Host", 25 | "required": true, 26 | "type": "domain", 27 | "description": "The string to send as `Host:` header for origin requests.", 28 | "name": "hostname" 29 | } 30 | ] 31 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/nocache.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Disable caching", 3 | "id": "disablecache", 4 | "description": "For selected requests, disable caching, either on Fastly, or in the browser, or both.", 5 | "version": 1, 6 | "properties": [ 7 | { 8 | "name": "rules", 9 | "label": "Disable caching for", 10 | "type": "group", 11 | "entryTemplate": "{{pathpattern}}: {{mode}}", 12 | "properties": [ 13 | { 14 | "name": "pathpattern", 15 | "label": "Path pattern", 16 | "description": "Regular expressions are supported", 17 | "type": "string", 18 | "required": true 19 | }, 20 | { 21 | "name": "mode", 22 | "label": "Where to disable caching", 23 | "type": "select", 24 | "options": { 25 | "browser": "Browser", 26 | "fastly": "Fastly edge cache", 27 | "both": "Browser and Fastly" 28 | }, 29 | "required": true 30 | } 31 | ] 32 | } 33 | ], 34 | "vcl": [ 35 | { 36 | "type": "recv", 37 | "template": "{{#each rules}}\n{{#ifMatch mode 'both|fastly'}}\nif (req.url ~ \"{{../pathpattern}}\") {\n return(pass);\n}\n{{/ifMatch}}\n{{/each}}" 38 | }, 39 | { 40 | "type": "deliver", 41 | "template": "{{#each rules}}\n{{#ifMatch mode 'both|browser'}}\nif (req.url ~ \"{{../pathpattern}}\") {\n set resp.http.Cache-Control = \"no-cache, private\";\n unset resp.http.Expires;\n unset resp.http.Pragma;\n}\n{{/ifMatch}}\n{{/each}}" 42 | } 43 | ], 44 | "test": { 45 | "origins": [ 46 | "https://httpbin.org" 47 | ], 48 | "reqUrl": "/html" 49 | } 50 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/disabled/ttloverride.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Override Edge TTL / cache time", 3 | "id": "ttloverride", 4 | "description": "For selected requests, override caching directives received from the origin server. Often used to increase TTL for static assets.", 5 | "version": 1, 6 | "properties": [ 7 | { 8 | "name": "rules", 9 | "label": "Override rules", 10 | "type": "group", 11 | "entryTemplate": "{{pathpattern}}: {{ttl}}s", 12 | "properties": [ 13 | { 14 | "name": "pathpattern", 15 | "label": "Path pattern", 16 | "description": "Regular expressions are supported", 17 | "type": "string", 18 | "required": true 19 | }, 20 | { 21 | "name": "ttl", 22 | "label": "Freshness duration", 23 | "type": "rtime", 24 | "required": true 25 | }, 26 | { 27 | "name": "swr", 28 | "label": "Stale while revalidate duration", 29 | "type": "rtime", 30 | "required": false 31 | }, 32 | { 33 | "name": "sie", 34 | "label": "Stale if error duration", 35 | "type": "rtime", 36 | "required": false 37 | } 38 | ] 39 | } 40 | ], 41 | "vcl": [ 42 | { 43 | "type": "fetch", 44 | "template": "{{#each rules}}\nif (req.url ~ \"{{pathpattern}}\") {\n set beresp.ttl = {{ttl}};\n {{#if swr}}set beresp.stale-while-revalidate = {{swr}};{{/if}}\n {{#if sie}}set beresp.stale-if-error = {{sie}};{{/if}}\n}\n{{/each}}" 45 | } 46 | ], 47 | "test": { 48 | "origins": [ 49 | "https://httpbin.org" 50 | ], 51 | "reqUrl": "/html" 52 | } 53 | } -------------------------------------------------------------------------------- /etc/fastly_edge_modules/force_cache_miss_on_hard_reload_for_admins.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Hard Reload cache bypass for set of admin IPs", 3 | "id": "force_cache_miss_on_hard_reload_for_admins", 4 | "description": "Force cache miss for users on allowlist. Invoke it on your browser by pressing CMD/CTRL + SHIFT + R or SHIFT + F5 depending on your browser. It only affects your own session. It will not affected already cached content.", 5 | "version": 1, 6 | "properties": [ 7 | { 8 | "name": "Acl", 9 | "label": "ACL", 10 | "description": "ACL that contains IPs of users allowing to force cache misses", 11 | "type": "acl", 12 | "required": true 13 | } 14 | ], 15 | "vcl": [ 16 | { 17 | "type": "recv", 18 | "template": "if ( req.http.Fastly-Client-IP ~ {{Acl}} && req.http.pragma ~ \"no-cache\" ) {\n set req.hash_always_miss = true;\n}" 19 | }, 20 | { 21 | "type": "hash", 22 | "template": "if ( req.http.Fastly-Client-IP ~ {{Acl}} && req.http.pragma ~ \"no-cache\" ) {\n set req.hash += \"NOCACHE\";\n\n}" 23 | } 24 | ], 25 | "test": { 26 | "origins": [ 27 | "https://httpbin.org" 28 | ], 29 | "reqUrl": "/status/500" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /etc/fastly_edge_modules/increase_timeouts_long_jobs.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Increase timeouts for long running jobs", 3 | "id": "increase_timeouts_long_jobs", 4 | "description": "For selected requests, override default backend timeout. Often used for long running jobs that take over 1 minute. Please note these paths will no longer be cached. Fastly imposes hard limit 10 minute timeout.", 5 | "version": 1, 6 | "properties": [ 7 | { 8 | "name": "rules", 9 | "label": "Timeout override rules", 10 | "type": "group", 11 | "properties": [ 12 | { 13 | "name": "pathpattern", 14 | "label": "Path pattern (regular expression)", 15 | "description": "Regular expressions are supported", 16 | "type": "string", 17 | "required": true 18 | }, 19 | { 20 | "name": "timeout", 21 | "label": "Timeout in seconds", 22 | "type": "integer", 23 | "default": "300", 24 | "required": true 25 | } 26 | ] 27 | } 28 | ], 29 | "vcl": [ 30 | { 31 | "type": "recv", 32 | "template": "if (req.restarts == 0) {\n unset req.http.x-edge-module-timeout;\n}{{#each rules}}\nif (req.url ~ \"{{pathpattern}}\") {\n set req.http.x-pass = \"1\";\n set req.http.x-edge-module-timeout = \"{{timeout}}\";\n}\n{{/each}}", 33 | "priority": 80 34 | }, 35 | { 36 | "type": "pass", 37 | "template": "if (req.http.x-edge-module-timeout) {\n set bereq.first_byte_timeout = std.atof(req.http.x-edge-module-timeout);\n}" 38 | } 39 | ], 40 | "test": { 41 | "origins": [ 42 | "https://httpbin.org" 43 | ], 44 | "reqUrl": "/html" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /etc/fastly_edge_modules/mobile_device_detection.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Mobile Theme support", 3 | "id": "mobile_device_detection", 4 | "description": "By default Fastly caches a single version of a page ignoring device type e.g. mobile/desktop. This module adds Vary-ing by a device type. It supports iPhone, Android and Tizen mobile device detection. It will cache separate page versions for mobile and desktop", 5 | "version": 1, 6 | "vcl": [ 7 | { 8 | "priority": 45, 9 | "type": "recv", 10 | "template": " # Mobile device detection for mobile themes\n set req.http.X-UA-Device = \"desktop\";\n\n if (req.http.User-Agent ~ \"(?i)ip(hone|od)\") {\n set req.http.X-UA-Device = \"mobile\";\n } elsif (req.http.User-Agent ~ \"(?i)android.*(mobile|mini)\") {\n set req.http.X-UA-Device = \"mobile\";\n } elsif (req.http.User-Agent ~ \"(?i)tizen.*mobile\") {\n set req.http.X-UA-Device = \"mobile\";\n }" 11 | }, 12 | { 13 | "priority": 70, 14 | "type": "fetch", 15 | "template": " # Add X-UA-Device Vary for HTML\n if ( beresp.http.Content-Type ~ \"text/html\" ) {\n set beresp.http.Vary:X-UA-Device = \"\";\n }" 16 | }, 17 | { 18 | "priority": 70, 19 | "type": "deliver", 20 | "template": " # Execute only on the edge nodes\n if ( fastly.ff.visits_this_service == 0 && !req.http.Fastly-Debug ) {\n unset resp.http.Vary:X-UA-Device;\n }" 21 | } 22 | ], 23 | "test": { 24 | "origins": [ 25 | "https://httpbin.org" 26 | ], 27 | "reqUrl": "/status/500" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /etc/fastly_edge_modules/redirect_hosts.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Set up domain/host redirects (301) e.g. domain.com => www.domain.com", 3 | "id": "redirect_hosts", 4 | "name": "Redirect one domain to another", 5 | "properties": [ 6 | { 7 | "entryTemplate": "{{incomingHost}} => {{destinationHost}}", 8 | "label": "Rules", 9 | "name": "rules", 10 | "properties": [ 11 | { 12 | "description": "Incoming domain/host e.g. www.domain.com", 13 | "label": "Incoming Domain/Host", 14 | "name": "incomingHost", 15 | "required": true, 16 | "type": "string" 17 | }, 18 | { 19 | "description": "Destination domain/host", 20 | "label": "Destination domain/host", 21 | "name": "destinationHost", 22 | "required": true, 23 | "type": "string" 24 | }, 25 | { 26 | "default": false, 27 | "description": "Strip incoming path and set it to /. Default only rewrites host retaining the path e.g. http://domain.com/category is redirected to https://www.domain.com/category", 28 | "label": "Ignore path", 29 | "name": "ignorePath", 30 | "required": true, 31 | "type": "boolean" 32 | } 33 | ], 34 | "type": "group" 35 | } 36 | ], 37 | "test": { 38 | "origins": [ 39 | "https://httpbin.org" 40 | ], 41 | "reqUrl": "/sourcePath" 42 | }, 43 | "vcl": [ 44 | { 45 | "priority": 4, 46 | "template": "{{#each rules}}\nif (req.http.host == \"{{incomingHost}}\") {\n set req.http.host = \"{{destinationHost}}\";\n {{#if ignorePath }}\n set req.url = \"/\";\n{{/if}} error 801;\n}\n{{/each}}", 47 | "type": "recv" 48 | } 49 | ], 50 | "version": 1 51 | } 52 | -------------------------------------------------------------------------------- /etc/frontend/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /etc/frontend/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /etc/frontend/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /etc/graphql/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /etc/setup/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /etc/shielding/README.md: -------------------------------------------------------------------------------- 1 | # Updating datacenters.json 2 | 3 | The `datacenters.json` file is used by the code base to generate a shielding dropdown list in the backend configuration UI. 4 | - https://github.com/fastly/fastly-magento2/search?q=DataCenters 5 | 6 | This file should be updated when POPs are added or retired (e.g., shielding migration). 7 | 8 | ```sh 9 | # update "datacenters.json" with the latest data 10 | $ cd etc/shielding 11 | $ curl -sv https://api.fastly.com/datacenters -H 'fastly-key: your_personal_token' | jq . > datacenters.json 12 | ``` 13 | 14 | then review diff, and push the changes or submit a PR. 15 | -------------------------------------------------------------------------------- /etc/vcl_snippets/error.vcl: -------------------------------------------------------------------------------- 1 | /* handle 503s */ 2 | if (obj.status >= 500 && obj.status < 600) { 3 | 4 | /* deliver stale object if it is available */ 5 | if (stale.exists) { 6 | return(deliver_stale); 7 | } 8 | } 9 | 10 | # Return empty response in case fastlyCdn/geoip/getaction/ has been processed already 11 | if (obj.status == 980) { 12 | set obj.status = 200; 13 | synthetic {""}; 14 | return (deliver); 15 | } 16 | -------------------------------------------------------------------------------- /etc/vcl_snippets/hash.vcl: -------------------------------------------------------------------------------- 1 | if (req.http.graphql) { 2 | # GraphQL should cache on X-Magento-Cache-Id if available, which has a bunch of variations so it should be part of the key and not a Vary factor 3 | if (req.http.X-Magento-Cache-Id) { 4 | set req.hash += req.http.X-Magento-Cache-Id; 5 | } 6 | # When the frontend stops sending the auth token, make sure users stop getting results cached for logged-in users 7 | # Unfortunately we don't yet have a way to authenticate before hitting the cache, so this is as close as we can get for now 8 | if ( req.http.Authorization ~ "^Bearer" ) { 9 | set req.hash += "Authorized"; 10 | } 11 | 12 | set req.hash += req.url; 13 | set req.hash += req.http.Host; 14 | set req.hash += req.http.Fastly-SSL; 15 | set req.hash += req.vcl.generation; 16 | return (hash); 17 | } 18 | -------------------------------------------------------------------------------- /etc/vcl_snippets/miss.vcl: -------------------------------------------------------------------------------- 1 | # Deactivate gzip on origin. This is so we can make sure that ESI fragments 2 | # come uncompressed. 3 | unset bereq.http.Accept-Encoding; 4 | 5 | # Send VCL version uploaded to the backend 6 | set bereq.http.Fastly-Magento-VCL-Uploaded = "1.2.229"; 7 | -------------------------------------------------------------------------------- /etc/vcl_snippets/pass.vcl: -------------------------------------------------------------------------------- 1 | # Deactivate gzip on origin. This is so we can make sure that ESI fragments 2 | # come uncompressed. 3 | unset bereq.http.Accept-Encoding; 4 | 5 | # Increase first byte timeouts for /admin* URLs. By default it's set to 3 minutes 6 | # however it can be adjusted by adjusting the Admin path timeout under Advanced configs 7 | # ####ADMIN_PATH#### is replaced with value of frontName from app/etc/env.php 8 | if ( req.http.magento-admin-path ) { 9 | 10 | set bereq.first_byte_timeout = ####ADMIN_PATH_TIMEOUT####s; 11 | 12 | } 13 | 14 | # Send VCL version uploaded to the backend 15 | set bereq.http.Fastly-Magento-VCL-Uploaded = "1.2.229"; 16 | -------------------------------------------------------------------------------- /etc/vcl_snippets_basic_auth/error.vcl: -------------------------------------------------------------------------------- 1 | if (obj.status == 771) { 2 | set obj.http.Content-Type = "text/html; charset=utf-8"; 3 | set obj.http.WWW-Authenticate = "Basic realm=Secured"; 4 | set obj.status = 401; 5 | synthetic {" 7 | 8 | 9 | Error 10 | 11 | 12 |

401 Unauthorized

13 | 14 | "}; 15 | return (deliver); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /etc/vcl_snippets_basic_auth/recv.vcl: -------------------------------------------------------------------------------- 1 | # Check Basic auth against a table. /admin URLs are not basic auth protected to avoid the possibility of people 2 | # locking themselves out. /oauth and /rest have their own auth so we can skip Basic Auth on them as well 3 | if ( req.method != "FASTLYPURGE" && 4 | table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && 5 | !req.url ~ "^/(index\.php/)?####ADMIN_PATH####/" && 6 | !req.url ~ "^/(index\.php/)?(rest|oauth|graphql)($|[\/?])" && 7 | !req.url ~ "^/pub/static/" ) { 8 | error 771; 9 | } 10 | -------------------------------------------------------------------------------- /etc/vcl_snippets_blocking/recv.vcl: -------------------------------------------------------------------------------- 1 | # Make sure we lookup end user geo not shielding. More at https://docs.fastly.com/vcl/geolocation/#using-geographic-variables-with-shielding 2 | set client.geo.ip_override = req.http.Fastly-Client-IP; 3 | if (req.method != "FASTLYPURGE" && ( ####BLOCKED_ITEMS#### )) { 4 | error 405 "Not allowed"; 5 | } -------------------------------------------------------------------------------- /etc/vcl_snippets_error_page/deliver.vcl: -------------------------------------------------------------------------------- 1 | # If we are about to serve a 5xx we need to restart then in vcl_recv error out to 2 | # get the holding page 3 | if ( resp.status >= 500 && resp.status < 600 && !req.http.ResponseObject ) { 4 | set req.http.ResponseObject = "970"; 5 | restart; 6 | } 7 | -------------------------------------------------------------------------------- /etc/vcl_snippets_force_tls/deliver.vcl: -------------------------------------------------------------------------------- 1 | set resp.http.strict-transport-security = "max-age=31536000"; 2 | -------------------------------------------------------------------------------- /etc/vcl_snippets_force_tls/recv.vcl: -------------------------------------------------------------------------------- 1 | # Force SSL immediately to avoid magento module VCL stripping off 2 | # google campaign ids like gclid 3 | if (!req.http.Fastly-SSL) { 4 | error 801 "Force SSL"; 5 | } 6 | -------------------------------------------------------------------------------- /etc/vcl_snippets_image_optimizations/recv.vcl: -------------------------------------------------------------------------------- 1 | if ( req.url.ext ~ "(?i)^(gif|png|jpg|jpeg|webp)$" ) { 2 | 3 | set req.http.X-Fastly-Imageopto-Api = "fastly"; 4 | 5 | #set req.url = querystring.set(req.url, "optimize", "(low|medium|high)"); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /etc/vcl_snippets_rate_limiting/deliver.vcl: -------------------------------------------------------------------------------- 1 | # Tarpit Rate limited requests 2 | if ( resp.status == 429 && (req.http.Rate-Limit || resp.http.Fastly-Vary) ) { 3 | resp.tarpit(std.atoi(table.lookup(magentomodule_config, "tarpit_interval", "5")), 100000); 4 | set resp.http.Vary = "Cookie"; 5 | } 6 | 7 | if ( fastly.ff.visits_this_service == 0 ) { 8 | remove resp.http.Fastly-Vary; 9 | } 10 | -------------------------------------------------------------------------------- /etc/vcl_snippets_rate_limiting/fetch.vcl: -------------------------------------------------------------------------------- 1 | # VCL support for Rate limiting. Rate limiting needs to be turned on through the UI 2 | if ( req.http.Rate-Limit ) { 3 | if ( beresp.status == 429 ) { 4 | set beresp.cacheable = true; 5 | remove beresp.http.Vary; 6 | return(deliver); 7 | } else { 8 | set beresp.cacheable = false; 9 | return(pass); 10 | } 11 | } 12 | 13 | # If we get Fastly-Vary it means it was set by the Crawler Module. Unfortunately magento overwrites 14 | # Vary headers so we had to set our own Fastly-Vary header we set here. 15 | if ( beresp.status == 429 && beresp.http.Fastly-Vary ) { 16 | set beresp.http.Vary = beresp.http.Fastly-Vary; 17 | } 18 | -------------------------------------------------------------------------------- /etc/vcl_snippets_rate_limiting/hash.vcl: -------------------------------------------------------------------------------- 1 | if (req.http.Rate-Limit) { 2 | set req.hash += client.ip; 3 | return(hash); 4 | } -------------------------------------------------------------------------------- /etc/vcl_snippets_rate_limiting/miss.vcl: -------------------------------------------------------------------------------- 1 | if (req.http.Rate-Limit) { 2 | set bereq.method = req.http.X-Orig-Method; 3 | } 4 | -------------------------------------------------------------------------------- /etc/vcl_snippets_rate_limiting/recv.vcl: -------------------------------------------------------------------------------- 1 | if (####RATE_LIMITED_PATHS####) { 2 | if (req.http.Fastly-Client-Ip !~ maint_allowlist) { 3 | set req.http.Rate-Limit = "1"; 4 | set req.http.X-Orig-Method = req.method; 5 | set req.hash_ignore_busy = true; 6 | if (req.method !~ "^(GET|POST)$") { 7 | set req.method = "POST"; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /etc/vcl_snippets_waf/recv.vcl: -------------------------------------------------------------------------------- 1 | # Specify one or multiple ACLs that are allowed to bypass WAF blocking ie. no WAF rules are going to trigger for those IPs. 2 | if(####WAF_ALLOWLIST####) { 3 | set req.http.bypasswaf = "1"; 4 | } 5 | -------------------------------------------------------------------------------- /etc/webapi_rest/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /i18n/de_DE.csv: -------------------------------------------------------------------------------- 1 | "Fastly CDN","Fastly CDN" 2 | "Fastly Configuration","Fastly Konfiguration" 3 | "Fastly API Endpoint","Fastly API Endpunkt" 4 | "Default https://api.fastly.com/ should not be changed.","Standardwert https://api.fastly.com/ sollte nicht geändert werden." 5 | "Fastly Service ID","Fastly Service ID" 6 | "Your Service ID appears as an alphanumeric string immediately below the name of your service on the fastly configure tab.","Your Service ID appears as an alphanumeric string immediately below the name of your service on the fastly configure tab." 7 | "Fastly API token","Fastly API token" 8 | "Please create a Fastly API token with a global scope.","Please create a Fastly API token with a global scope." 9 | "Stale content delivery time","Stale content delivery time" 10 | "Time in seconds for that stale content will be served. Set to 0 to disable this feature.","Time in seconds for that stale content will be served. Set to 0 to disable this feature." 11 | "Stale content delivery time in case of backend error","Stale content delivery time in case of backend error" 12 | "Purge category","Purge category" 13 | "Purge category's cache items on save","Purge category's cache items on save" 14 | "Purge product","Purge product" 15 | "Purge product's cache items on save","Purge product's cache items on save" 16 | "Purge CMS page","Purge CMS page" 17 | "Purge CMS page's cache item on save","Purge CMS page's cache item on save" 18 | "Use Soft Purge","Use Soft Purge" 19 | "Use Soft Purge in conjunction with stale content delivery times, to serve stale content.","Use Soft Purge in conjunction with stale content delivery times, to serve stale content." 20 | "Export VCL for Fastly","Exportiere VCL für Fastly" 21 | "You are in the wrong store. Click OK to visit the %1 store.","Sie sind in der falschen Sprache. Klicken Sie OK, um zum %1 Store zu wechseln." 22 | -------------------------------------------------------------------------------- /i18n/en_US.csv: -------------------------------------------------------------------------------- 1 | "Fastly CDN","Fastly CDN" 2 | "Fastly Configuration","Fastly Configuration" 3 | "Fastly API Endpoint","Fastly API Endpoint" 4 | "Default https://api.fastly.com/ should not be changed.","Default https://api.fastly.com/ should not be changed." 5 | "Fastly Service ID","Fastly Service ID" 6 | "Your Service ID appears as an alphanumeric string immediately below the name of your service on the fastly configure tab.","Your Service ID appears as an alphanumeric string immediately below the name of your service on the fastly configure tab." 7 | "Fastly API token","Fastly API token" 8 | "Please create a Fastly API token with a global scope.","Please create a Fastly API token with a global scope." 9 | "Stale content delivery time","Stale content delivery time" 10 | "Time in seconds for that stale content will be served. Set to 0 to disable this feature.","Time in seconds for that stale content will be served. Set to 0 to disable this feature." 11 | "Stale content delivery time in case of backend error","Stale content delivery time in case of backend error" 12 | "Purge category","Purge category" 13 | "Purge category's cache items on save","Purge category's cache items on save" 14 | "Purge product","Purge product" 15 | "Purge product's cache items on save","Purge product's cache items on save" 16 | "Purge CMS page","Purge CMS page" 17 | "Purge CMS page's cache item on save","Purge CMS page's cache item on save" 18 | "Use Soft Purge","Use Soft Purge" 19 | "Use Soft Purge in conjunction with stale content delivery times, to serve stale content.","Use Soft Purge in conjunction with stale content delivery times, to serve stale content." 20 | "Export VCL for Fastly","Export VCL for Fastly" 21 | "You are in the wrong store. Click OK to visit the %1 store.","You are in the wrong store. Click OK to visit the %1 store." 22 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 2 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /view/adminhtml/layout/adminhtml_system_config_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /view/adminhtml/layout/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /view/adminhtml/requirejs-config.js: -------------------------------------------------------------------------------- 1 | let config = { 2 | map: { 3 | '*': { 4 | historicStats: 'Fastly_Cdn/js/historicstats', 5 | handlebars: 'Fastly_Cdn/js/handlebars-v4.7.7', 6 | uploadVcl: 'Fastly_Cdn/js/upload-vcl', 7 | tls: 'Fastly_Cdn/js/tls', 8 | blocking: 'Fastly_Cdn/js/blocking', 9 | dictionaries: 'Fastly_Cdn/js/edge-dictionaries', 10 | acl: 'Fastly_Cdn/js/edge-acl', 11 | customSyntheticPages: 'Fastly_Cdn/js/custom-synthetic-pages', 12 | backends: 'Fastly_Cdn/js/backends', 13 | logEndpoints: 'Fastly_Cdn/js/log-endpoints', 14 | customSnippets: 'Fastly_Cdn/js/custom-snippets', 15 | setServiceLabel: 'Fastly_Cdn/js/service-label', 16 | overlay: 'Fastly_Cdn/js/overlay', 17 | fastlyTestConnection: 'Fastly_Cdn/js/testconnection', 18 | resetAllMessages: 'Fastly_Cdn/js/reset-all-messages', 19 | showErrorMessage: 'Fastly_Cdn/js/error-message', 20 | showSuccessMessage: 'Fastly_Cdn/js/success-message', 21 | showWarningMessage: 'Fastly_Cdn/js/warning-message', 22 | imageOptimization: 'Fastly_Cdn/js/image-optimization', 23 | basicAuthentication: 'Fastly_Cdn/js/basic-authentication', 24 | modly: 'Fastly_Cdn/js/modly', 25 | waf: 'Fastly_Cdn/js/waf', 26 | wafBypass: 'Fastly_Cdn/js/wafBypass', 27 | domains: 'Fastly_Cdn/js/domains', 28 | rateLimiting: 'Fastly_Cdn/js/rate-limiting', 29 | maintenance: 'Fastly_Cdn/js/maintenance', 30 | fastlyImport: 'Fastly_Cdn/js/import', 31 | fastlyExport: 'Fastly_Cdn/js/export', 32 | versionHistory: 'Fastly_Cdn/js/version-history', 33 | importExportRenderer: 'Fastly_Cdn/js/import-export-renderer' 34 | } 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/form/field/allModulesBtn.phtml: -------------------------------------------------------------------------------- 1 | getButtonHtml() ?> 2 | 3 | 6 | 7 | 10 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/form/field/auth.phtml: -------------------------------------------------------------------------------- 1 | 14 | 15 | getHtmlId() ? $block->getHtmlId() : '_' . uniqid(); 17 | $_colspan = $block->isAddAfter() ? 2 : 1; 18 | ?> 19 | 20 | 23 |
24 |
25 | 30 | 31 | 34 |