├── src ├── conf │ ├── .gitkeep │ ├── git │ │ └── hooks │ │ │ └── post-merge │ └── nginx │ │ └── site.com ├── templates ├── js │ ├── @types │ │ └── shims.d.ts │ ├── utils │ │ ├── lazysizes-wrapper.ts │ │ └── lazy-load-component.js │ └── app.ts ├── public │ └── logo.png ├── css │ ├── vendor.css │ ├── components │ │ ├── webfonts.css │ │ ├── typography.css │ │ └── global.css │ ├── pages │ │ └── homepage.css │ └── app.css ├── img │ └── favicon-src.png └── vue │ ├── App.vue │ ├── @types │ ├── shims-vue.d.ts │ └── confetti.d.ts │ └── ConfettiParty.vue ├── cms ├── templates │ ├── .gitkeep │ ├── _partials │ │ ├── amp-inline-css.css │ │ ├── navbar.twig │ │ ├── info-footer.twig │ │ ├── amp-info-footer.twig │ │ ├── info-header.twig │ │ ├── amp-info-header.twig │ │ ├── global-footer.twig │ │ └── amp-navbar.twig │ ├── errors │ │ ├── 404.twig │ │ ├── 503.twig │ │ ├── error.twig │ │ └── offline.twig │ ├── _boilerplate │ │ ├── _partials │ │ │ ├── body-js.twig │ │ │ ├── amp-head-js.twig │ │ │ ├── head-js.twig │ │ │ ├── amp-analytics.twig │ │ │ ├── amp-boilerplate-css.twig │ │ │ ├── head-meta.twig │ │ │ ├── register-service-worker.twig │ │ │ ├── critical-css.twig │ │ │ └── tab-handler.twig │ │ └── _layouts │ │ │ ├── base-ajax-layout.twig │ │ │ ├── base-web-layout.twig │ │ │ ├── base-html-layout.twig │ │ │ └── amp-base-html-layout.twig │ ├── index.twig │ ├── _inline-css │ │ └── site-fonts.css │ ├── amp-index.twig │ ├── _inline-js │ │ ├── lazyload-image-shim.js │ │ └── tiny-cookie.min.js │ ├── _layouts │ │ ├── global-variables.twig │ │ ├── error-page-layout.twig │ │ ├── generic-page-layout.twig │ │ └── amp-generic-page-layout.twig │ └── _macros │ │ └── cookies.twig ├── web │ ├── assets │ │ └── .gitignore │ ├── cpresources │ │ └── .gitignore │ ├── index.php │ ├── .htaccess │ ├── offline.svg │ ├── web.config │ └── img │ │ └── site │ │ └── login-background-image.svg ├── config │ ├── project │ │ ├── fieldGroups │ │ │ ├── 94b4d5ac-d7ea-4241-a6cb-92b39f482f99.yaml │ │ │ └── d08a0d16-0e00-49e6-9cd4-465fa2d65d7d.yaml │ │ ├── siteGroups │ │ │ └── f89601e9-4ba9-4a48-9e99-350aa9914912.yaml │ │ ├── entryTypes │ │ │ ├── errors--faceb3ed-6771-453c-9c2a-aa330847f6db.yaml │ │ │ └── homepage--fb3a8f31-d1cc-4c13-903b-a501f7e51f54.yaml │ │ ├── volumes │ │ │ └── site--5c642d7e-b16b-4836-9575-668d75d242e5.yaml │ │ ├── sites │ │ │ └── default--5da841b1-ca0d-46ff-8bb1-04d6c889ac54.yaml │ │ ├── sections │ │ │ ├── errors--a72bfe0c-3389-4f9f-8ec1-ab318ec10b29.yaml │ │ │ └── homepage--54e60257-f31a-44aa-960e-bbd364197e28.yaml │ │ ├── fields │ │ │ ├── errorText--e6d658aa-c335-4f15-bbcd-59fe05d9e913.yaml │ │ │ ├── errorHeadline--b8ba7115-3804-4c06-8a96-501963d1fc5c.yaml │ │ │ └── errorImage--a5cb77be-c4d9-4d3e-88fb-d5384ca13941.yaml │ │ └── project.yaml │ ├── redactor │ │ ├── Simple.json │ │ └── Default.json │ ├── htmlpurifier │ │ └── Default.json │ ├── app.console.php │ ├── db.php │ ├── routes.php │ ├── fastcgi-cache-bust.php │ ├── app.web.php │ ├── general.php │ ├── app.php │ ├── seomatic-config │ │ └── globalmeta │ │ │ └── Creator.php │ └── vite.php ├── modules │ └── sitemodule │ │ ├── src │ │ ├── assetbundles │ │ │ └── sitemodule │ │ │ │ ├── dist │ │ │ │ ├── js │ │ │ │ │ └── SiteModule.js │ │ │ │ ├── css │ │ │ │ │ └── SiteModule.css │ │ │ │ └── img │ │ │ │ │ └── SiteModule-icon.svg │ │ │ │ └── SiteModuleAsset.php │ │ ├── translations │ │ │ └── en │ │ │ │ └── site-module.php │ │ ├── services │ │ │ └── Helper.php │ │ ├── variables │ │ │ └── SiteVariable.php │ │ ├── config.php │ │ ├── helpers │ │ │ └── Config.php │ │ └── SiteModule.php │ │ ├── CHANGELOG.md │ │ ├── .craftplugin │ │ ├── .gitignore │ │ ├── LICENSE.md │ │ └── README.md ├── craft ├── craft.bat ├── bootstrap.php ├── example.env └── composer.json ├── db-seed ├── .gitignore └── project--2021-05-16-014155--v3.6.14.sql.gz ├── docker-config ├── mariadb │ └── Dockerfile ├── redis │ └── Dockerfile ├── nginx │ ├── Dockerfile │ └── default.conf ├── node-dev-vite │ ├── npm_install.sh │ └── Dockerfile ├── php-prod-craft │ ├── composer_install.sh │ ├── run_queue.sh │ └── Dockerfile └── php-dev-craft │ └── Dockerfile ├── scripts ├── common │ ├── common_env.sh │ ├── common_db.sh │ ├── common_pgsql.sh │ ├── defaults.sh │ └── common_mysql.sh ├── example.env.sh ├── docker_restore_db.sh └── docker_pull_db.sh ├── LICENSE.md ├── composer.json ├── .gitignore ├── Makefile ├── docker-compose.yml ├── buddy.yml ├── README.md └── CHANGELOG.md /src/conf/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cms/templates/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/templates: -------------------------------------------------------------------------------- 1 | ../cms/templates -------------------------------------------------------------------------------- /db-seed/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | -------------------------------------------------------------------------------- /cms/web/assets/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /cms/web/cpresources/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/js/@types/shims.d.ts: -------------------------------------------------------------------------------- 1 | declare module "app"; 2 | -------------------------------------------------------------------------------- /docker-config/mariadb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mariadb:10.5 2 | -------------------------------------------------------------------------------- /docker-config/redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM redis:5-alpine 2 | -------------------------------------------------------------------------------- /cms/templates/_partials/amp-inline-css.css: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | -------------------------------------------------------------------------------- /cms/templates/_partials/navbar.twig: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /cms/config/project/fieldGroups/94b4d5ac-d7ea-4241-a6cb-92b39f482f99.yaml: -------------------------------------------------------------------------------- 1 | name: Common 2 | -------------------------------------------------------------------------------- /cms/config/project/fieldGroups/d08a0d16-0e00-49e6-9cd4-465fa2d65d7d.yaml: -------------------------------------------------------------------------------- 1 | name: Errors 2 | -------------------------------------------------------------------------------- /cms/config/project/siteGroups/f89601e9-4ba9-4a48-9e99-350aa9914912.yaml: -------------------------------------------------------------------------------- 1 | name: $SITE_NAME 2 | -------------------------------------------------------------------------------- /cms/templates/_partials/info-footer.twig: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /cms/templates/_partials/amp-info-footer.twig: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/craft/craft-vite/src/public/logo.png -------------------------------------------------------------------------------- /cms/config/redactor/Simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": ["bold", "italic"], 3 | "toolbarFixed": true 4 | } 5 | -------------------------------------------------------------------------------- /cms/templates/_partials/info-header.twig: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/css/vendor.css: -------------------------------------------------------------------------------- 1 | /** 2 | * vendor.css 3 | * 4 | * All vendor CSS is imported here. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/img/favicon-src.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/craft/craft-vite/src/img/favicon-src.png -------------------------------------------------------------------------------- /cms/templates/_partials/amp-info-header.twig: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /docker-config/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx:1.19-alpine 2 | 3 | COPY ./default.conf /etc/nginx/conf.d/default.conf 4 | -------------------------------------------------------------------------------- /src/css/components/webfonts.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/webfonts.css 3 | * 4 | * Project webfonts. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/css/components/typography.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/typography.css 3 | * 4 | * Typography rules. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /src/css/pages/homepage.css: -------------------------------------------------------------------------------- 1 | /** 2 | * pages/homepage.css 3 | * 4 | * Styles for the Homepage page. 5 | * 6 | */ 7 | -------------------------------------------------------------------------------- /cms/templates/errors/404.twig: -------------------------------------------------------------------------------- 1 | {% set entry = craft.entries.section('errors').slug('error404').one() %} 2 | 3 | {% extends "_layouts/error-page-layout.twig" %} 4 | -------------------------------------------------------------------------------- /cms/templates/errors/503.twig: -------------------------------------------------------------------------------- 1 | {% set entry = craft.entries.section('errors').slug('error503').one() %} 2 | 3 | {% extends "_layouts/error-page-layout.twig" %} 4 | -------------------------------------------------------------------------------- /db-seed/project--2021-05-16-014155--v3.6.14.sql.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nystudio107/craft/craft-vite/db-seed/project--2021-05-16-014155--v3.6.14.sql.gz -------------------------------------------------------------------------------- /cms/templates/errors/error.twig: -------------------------------------------------------------------------------- 1 | {% set entry = craft.entries.section('errors').slug('errorError').one() %} 2 | 3 | {% extends "_layouts/error-page-layout.twig" %} 4 | -------------------------------------------------------------------------------- /cms/templates/errors/offline.twig: -------------------------------------------------------------------------------- 1 | {% set entry = craft.entries.section('errors').slug('errorOffline').one() %} 2 | 3 | {% extends "_layouts/error-page-layout.twig" %} 4 | -------------------------------------------------------------------------------- /src/vue/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /src/css/components/global.css: -------------------------------------------------------------------------------- 1 | /** 2 | * components/global.css 3 | * 4 | * Project-wide styles 5 | * 6 | */ 7 | 8 | body { 9 | background-color: yellow; 10 | } 11 | -------------------------------------------------------------------------------- /src/vue/@types/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.vue" { 2 | import { defineComponent } from "vue"; 3 | const Component : ReturnType; 4 | export default Component; 5 | } 6 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/body-js.twig: -------------------------------------------------------------------------------- 1 | {# -- Shim to handle lazy image loading if native isn't available -- #} 2 | 5 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/amp-head-js.twig: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /cms/config/project/entryTypes/errors--faceb3ed-6771-453c-9c2a-aa330847f6db.yaml: -------------------------------------------------------------------------------- 1 | handle: errors 2 | hasTitleField: true 3 | name: Errors 4 | section: a72bfe0c-3389-4f9f-8ec1-ab318ec10b29 5 | sortOrder: 1 6 | titleFormat: null 7 | titleLabel: Title 8 | -------------------------------------------------------------------------------- /cms/config/project/volumes/site--5c642d7e-b16b-4836-9575-668d75d242e5.yaml: -------------------------------------------------------------------------------- 1 | handle: site 2 | hasUrls: true 3 | name: Site 4 | settings: 5 | path: '@webroot/assets/site' 6 | sortOrder: 1 7 | type: craft\volumes\Local 8 | url: '@assetsUrl/assets/site' 9 | -------------------------------------------------------------------------------- /cms/config/project/sites/default--5da841b1-ca0d-46ff-8bb1-04d6c889ac54.yaml: -------------------------------------------------------------------------------- 1 | baseUrl: $SITE_URL 2 | handle: default 3 | hasUrls: true 4 | language: en-US 5 | name: $SITE_NAME 6 | primary: true 7 | siteGroup: f89601e9-4ba9-4a48-9e99-350aa9914912 8 | sortOrder: 1 9 | -------------------------------------------------------------------------------- /cms/config/project/entryTypes/homepage--fb3a8f31-d1cc-4c13-903b-a501f7e51f54.yaml: -------------------------------------------------------------------------------- 1 | handle: homepage 2 | hasTitleField: false 3 | name: Homepage 4 | section: 54e60257-f31a-44aa-960e-bbd364197e28 5 | sortOrder: 1 6 | titleFormat: '{section.name|raw}' 7 | titleLabel: null 8 | -------------------------------------------------------------------------------- /cms/templates/_partials/global-footer.twig: -------------------------------------------------------------------------------- 1 | {#-- Global footer --#} 2 | 3 | {#-- Browser fixes --#} 4 | 8 | -------------------------------------------------------------------------------- /cms/templates/_partials/amp-navbar.twig: -------------------------------------------------------------------------------- 1 | 2 |

navbar

3 | 10 |
11 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/assetbundles/sitemodule/dist/js/SiteModule.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Site module for Craft CMS 3 | * 4 | * Site JS 5 | * 6 | * @author nystudio107 7 | * @copyright Copyright (c) 2018 nystudio107 8 | * @link https://nystudio107.com/ 9 | * @package SiteModule 10 | * @since 1.0.0 11 | */ 12 | -------------------------------------------------------------------------------- /cms/web/index.php: -------------------------------------------------------------------------------- 1 | run(); 13 | -------------------------------------------------------------------------------- /cms/config/htmlpurifier/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "Attr.AllowedFrameTargets": [ 3 | "_blank" 4 | ], 5 | "Attr.EnableID": true, 6 | "HTML.AllowedComments": [ 7 | "pagebreak" 8 | ], 9 | "HTML.SafeIframe": true, 10 | "URI.SafeIframeRegexp": "%^(https?:)?//(www.youtube.com/embed/|player.vimeo.com/video/)%" 11 | } 12 | -------------------------------------------------------------------------------- /cms/config/project/sections/errors--a72bfe0c-3389-4f9f-8ec1-ab318ec10b29.yaml: -------------------------------------------------------------------------------- 1 | enableVersioning: false 2 | handle: errors 3 | name: Errors 4 | propagationMethod: all 5 | siteSettings: 6 | 5da841b1-ca0d-46ff-8bb1-04d6c889ac54: 7 | enabledByDefault: true 8 | hasUrls: false 9 | template: null 10 | uriFormat: null 11 | type: channel 12 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Site Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). 6 | 7 | ## 1.0.0 - 2018-01-19 8 | ### Added 9 | - Initial release 10 | -------------------------------------------------------------------------------- /cms/web/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | 4 | # Send would-be 404 requests to Craft 5 | RewriteCond %{REQUEST_FILENAME} !-f 6 | RewriteCond %{REQUEST_FILENAME} !-d 7 | RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC] 8 | RewriteRule (.+) index.php?p=$1 [QSA,L] 9 | 10 | -------------------------------------------------------------------------------- /cms/config/project/sections/homepage--54e60257-f31a-44aa-960e-bbd364197e28.yaml: -------------------------------------------------------------------------------- 1 | enableVersioning: false 2 | handle: homepage 3 | name: Homepage 4 | propagationMethod: all 5 | siteSettings: 6 | 5da841b1-ca0d-46ff-8bb1-04d6c889ac54: 7 | enabledByDefault: true 8 | hasUrls: true 9 | template: index 10 | uriFormat: __home__ 11 | type: single 12 | -------------------------------------------------------------------------------- /cms/config/redactor/Default.json: -------------------------------------------------------------------------------- 1 | { 2 | "buttons": [ 3 | "html", 4 | "formatting", 5 | "bold", 6 | "italic", 7 | "unorderedlist", 8 | "orderedlist", 9 | "link", 10 | "image", 11 | "video" 12 | ], 13 | "plugins": [ 14 | "fullscreen", 15 | "video" 16 | ], 17 | "linkNewTab": true, 18 | "toolbarFixed": true 19 | } 20 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/.craftplugin: -------------------------------------------------------------------------------- 1 | {"pluginName":"Site","pluginDescription":"An example module for Craft CMS 3 that lets you enhance your websites with a custom site module","pluginVersion":"1.0.0","pluginAuthorName":"nystudio107","pluginVendorName":"nystudio107","pluginAuthorUrl":"https://nystudio107.com/","codeComments":[],"pluginComponents":[],"apiVersion":"module_api_version_3_0"} -------------------------------------------------------------------------------- /cms/craft: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run(); 14 | exit($exitCode); 15 | -------------------------------------------------------------------------------- /src/js/utils/lazysizes-wrapper.ts: -------------------------------------------------------------------------------- 1 | // Load the lazysizes JS for legacy browsers 2 | // this small shim is used to allow tranpilation of the loading code 3 | const main = async () => { 4 | const LazySizes = await import(/* webpackChunkName: "lazysizes" */ 'lazysizes'); 5 | LazySizes.init(); 6 | }; 7 | // Execute async function 8 | main().then(() => { 9 | console.log(); 10 | }); 11 | -------------------------------------------------------------------------------- /cms/web/offline.svg: -------------------------------------------------------------------------------- 1 | Offlineoffline 2 | -------------------------------------------------------------------------------- /cms/craft.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | rem ------------------------------------------------------------- 4 | rem Craft command line bootstrap script for Windows 5 | rem ------------------------------------------------------------- 6 | 7 | @setlocal 8 | 9 | set CRAFT_PATH=%~dp0 10 | 11 | if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe 12 | 13 | "%PHP_COMMAND%" "%CRAFT_PATH%craft" %* 14 | 15 | @endlocal 16 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/translations/en/site-module.php: -------------------------------------------------------------------------------- 1 | 'Site plugin loaded', 18 | ]; 19 | -------------------------------------------------------------------------------- /scripts/common/common_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Common Env 4 | # 5 | # Shared script to set various environment-related variables 6 | # 7 | # @author nystudio107 8 | # @copyright Copyright (c) 2020 nystudio107 9 | # @link https://nystudio107.com/ 10 | # @license MIT 11 | 12 | # Commands to output database dumps, using gunzip -c instead of zcat for MacOS X compatibility 13 | DB_ZCAT_CMD="gunzip -c" 14 | DB_CAT_CMD="cat" 15 | -------------------------------------------------------------------------------- /cms/config/project/fields/errorText--e6d658aa-c335-4f15-bbcd-59fe05d9e913.yaml: -------------------------------------------------------------------------------- 1 | contentColumnType: text 2 | fieldGroup: d08a0d16-0e00-49e6-9cd4-465fa2d65d7d 3 | handle: errorText 4 | instructions: '' 5 | name: 'Error Text' 6 | searchable: true 7 | settings: 8 | charLimit: '' 9 | code: '' 10 | columnType: text 11 | initialRows: '4' 12 | multiline: '1' 13 | placeholder: '' 14 | translationKeyFormat: null 15 | translationMethod: none 16 | type: craft\fields\PlainText 17 | -------------------------------------------------------------------------------- /cms/config/project/fields/errorHeadline--b8ba7115-3804-4c06-8a96-501963d1fc5c.yaml: -------------------------------------------------------------------------------- 1 | contentColumnType: text 2 | fieldGroup: d08a0d16-0e00-49e6-9cd4-465fa2d65d7d 3 | handle: errorHeadline 4 | instructions: '' 5 | name: 'Error Headline' 6 | searchable: true 7 | settings: 8 | charLimit: '' 9 | code: '' 10 | columnType: text 11 | initialRows: '4' 12 | multiline: '' 13 | placeholder: '' 14 | translationKeyFormat: null 15 | translationMethod: none 16 | type: craft\fields\PlainText 17 | -------------------------------------------------------------------------------- /docker-config/node-dev-vite/npm_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # NPM Install shell script 4 | # 5 | # This shell script runs `npm install` if either the `package-lock.json` file or 6 | # the `node_modules/` directory is not present` 7 | # 8 | # @author nystudio107 9 | # @copyright Copyright (c) 2022 nystudio107 10 | # @link https://nystudio107.com/ 11 | # @license MIT 12 | 13 | cd /var/www/project/buildchain 14 | if [ ! -f "package-lock.json" ] || [ ! -d "node_modules" ]; then 15 | npm install 16 | fi 17 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/head-js.twig: -------------------------------------------------------------------------------- 1 | {# -- Register our Service Worker -- #} 2 | {% if not craft.app.config.general.devMode %} 3 | {% include "_boilerplate/_partials/register-service-worker.twig" %} 4 | {% endif %} 5 | 6 | {# -- Handle tabs gracefully as per https://hackernoon.com/removing-that-ugly-focus-ring-and-keeping-it-too-6c8727fefcd2 -- #} 7 | {% include "_boilerplate/_partials/tab-handler.twig" %} 8 | 9 | {# -- Tiny Cookie JavaScript -- #} 10 | 13 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/.gitignore: -------------------------------------------------------------------------------- 1 | # CRAFT ENVIRONMENT 2 | .env.php 3 | .env.sh 4 | .env 5 | 6 | # COMPOSER 7 | /vendor 8 | 9 | # BUILD FILES 10 | /bower_components/* 11 | /node_modules/* 12 | /build/* 13 | /yarn-error.log 14 | 15 | # MISC FILES 16 | .cache 17 | .DS_Store 18 | .idea 19 | .project 20 | .settings 21 | *.esproj 22 | *.sublime-workspace 23 | *.sublime-project 24 | *.tmproj 25 | *.tmproject 26 | .vscode/* 27 | !.vscode/settings.json 28 | !.vscode/tasks.json 29 | !.vscode/launch.json 30 | !.vscode/extensions.json 31 | config.codekit3 32 | prepros-6.config 33 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/services/Helper.php: -------------------------------------------------------------------------------- 1 | 6 | {% endblock headLinks %} 7 | 8 | {% block content %} 9 |
10 |

content

11 |
12 | {% endblock %} 13 | 14 | {% block subcontent %} 15 |
16 |

subcontent

17 |
18 | {% endblock %} 19 | 20 | {# -- Any JavaScript that should be included before -- #} 21 | {% block bodyJs %} 22 | {{ parent() }} 23 | {% endblock bodyJs %} 24 | -------------------------------------------------------------------------------- /src/js/app.ts: -------------------------------------------------------------------------------- 1 | import App from '@/vue/App.vue'; 2 | import {createApp} from 'vue'; 3 | 4 | // Import our CSS 5 | import '@/css/app.css'; 6 | 7 | // App main 8 | const main = async () => { 9 | // Create our vue instance 10 | const app = createApp(App); 11 | 12 | // Mount the app 13 | return app.mount('#component-container'); 14 | }; 15 | 16 | // Execute async function 17 | main().then(() => { 18 | console.log(); 19 | }); 20 | 21 | // Accept HMR as per: https://vitejs.dev/guide/api-hmr.html 22 | if (import.meta.hot) { 23 | import.meta.hot.accept(() => { 24 | console.log("HMR") 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/variables/SiteVariable.php: -------------------------------------------------------------------------------- 1 | safeLoad(); 16 | } 17 | 18 | // Define additional PHP constants 19 | // (see https://craftcms.com/docs/3.x/config/#php-constants) 20 | define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production'); 21 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/config.php: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | -------------------------------------------------------------------------------- /cms/templates/_inline-css/site-fonts.css: -------------------------------------------------------------------------------- 1 | /* -- Site fonts */ 2 | 3 | /* -- Operator Mono normal */ 4 | 5 | @font-face { 6 | font-family: 'Operator Mono'; 7 | font-display: swap; 8 | src: url('{{ baseUrl }}dist/fonts/OperatorMonoSSm-Book.eot'); 9 | src: url('{{ baseUrl }}dist/fonts/OperatorMonoSSm-Book.eot?#iefix') format('embedded-opentype'), 10 | url('{{ baseUrl }}dist/fonts/OperatorMonoSSm-Book.woff2') format('woff2'), 11 | url('{{ baseUrl }}dist/fonts/OperatorMonoSSm-Book.woff') format('woff'), 12 | url('{{ baseUrl }}dist/fonts/OperatorMonoSSm-Book.ttf') format('truetype'); 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /src/vue/ConfettiParty.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) Pixel & Tonic, Inc. 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any 4 | purpose with or without fee is hereby granted. 5 | 6 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 7 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 8 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 9 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 10 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 11 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 12 | PERFORMANCE OF THIS SOFTWARE. 13 | -------------------------------------------------------------------------------- /cms/templates/amp-index.twig: -------------------------------------------------------------------------------- 1 | {% extends "_layouts/amp-generic-page-layout.twig" %} 2 | 3 | {% if entry is not defined %} 4 | {% set entry = craft.entries({ 5 | "uri": "__home__", 6 | }).one() %} 7 | {% endif %} 8 | 9 | {% do seomatic.helper.loadMetadataForUri(entry.uri) %} 10 | {% do seomatic.script.container().include(false) %} 11 | 12 | {% block content %} 13 |
14 |

content

15 |
16 | {% endblock %} 17 | 18 | {% block subcontent %} 19 |
20 |

subcontent

21 |
22 | {% endblock %} 23 | 24 | {# -- Any JavaScript that should be included before -- #} 25 | {% block bodyJs %} 26 | {% endblock bodyJs %} 27 | -------------------------------------------------------------------------------- /cms/config/db.php: -------------------------------------------------------------------------------- 1 | App::env('DB_DSN') ?: null, 15 | 'driver' => App::env('DB_DRIVER'), 16 | 'server' => App::env('DB_SERVER'), 17 | 'port' => App::env('DB_PORT'), 18 | 'database' => App::env('DB_DATABASE'), 19 | 'user' => App::env('DB_USER'), 20 | 'password' => App::env('DB_PASSWORD'), 21 | 'schema' => App::env('DB_SCHEMA'), 22 | 'tablePrefix' => App::env('DB_TABLE_PREFIX'), 23 | ]; 24 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/amp-boilerplate-css.twig: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cms/config/routes.php: -------------------------------------------------------------------------------- 1 | ' => ['template' => 'blog/_archive'], 15 | * 16 | * That example would match URIs such as `/blog/archive/2012`, and pass the 17 | * request along to the `blog/_archive` template, providing it a `year` variable 18 | * set to the value `2012`. 19 | */ 20 | 21 | return [ 22 | 'amp' => ['template' => 'amp-index'], 23 | ]; 24 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/head-meta.twig: -------------------------------------------------------------------------------- 1 | {# -- Basic meta tags -- #} 2 | 3 | 4 | 5 | {# -- Prefetch & preconnect headers and links -- #} 6 | {% set headerLink = "Link: " %} 7 | {% for url in prefetchUrls %} 8 | {% set headerLink = headerLink ~ "<#{url}>; rel=dns-prefetch;," %} 9 | {% set headerLink = headerLink ~ "<#{url}>; rel=preconnect; crossorigin;" %} 10 | {% if not loop.last %} 11 | {% set headerLink = headerLink ~ "," %} 12 | {% endif %} 13 | 14 | 15 | {% endfor %} 16 | {% header headerLink %} 17 | 18 | {# -- Favicons, webapp manifests, etc. -- #} 19 | {{ craft.vite.inline("@webroot/dist/assets/favicons/webapp.html") }} 20 | -------------------------------------------------------------------------------- /src/vue/@types/confetti.d.ts: -------------------------------------------------------------------------------- 1 | declare module "vue-confetti/src/confetti.js"; 2 | 3 | interface ConfettiInterface { 4 | start(opts: Partial): void, 5 | update(opts: Partial): void, 6 | stop(): void, 7 | } 8 | 9 | enum ParticlesType { 10 | circle = "circle", 11 | rect = "rect", 12 | heart = "heart", 13 | image = "image", 14 | } 15 | 16 | interface ParticlesConfig { 17 | type : ParticlesType, 18 | size : number, 19 | dropRate : number, 20 | colors : string[], 21 | url : string | null, 22 | } 23 | 24 | interface ConfettiConfig { 25 | particles : Partial[], 26 | defaultType : ParticlesType, 27 | defaultSize : number, 28 | defaultDropRate : number, 29 | defaultColors : string[], 30 | canvasId : number, 31 | particlesPerFrame : number, 32 | } 33 | -------------------------------------------------------------------------------- /docker-config/node-dev-vite/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nystudio107/node-dev-base:16-alpine 2 | 3 | WORKDIR /var/www/project/ 4 | 5 | COPY ./npm_install.sh . 6 | RUN chmod a+x npm_install.sh 7 | 8 | WORKDIR /var/www/project/buildchain 9 | 10 | # Run our webpack build in debug mode 11 | 12 | # We'd normally use `npm ci` here, but by using `install`: 13 | # - If `package-lock.json` is present, it will install what is in the lock file 14 | # - If `package-lock.json` is missing, it will update to the latest dependencies 15 | # and create the `package-lock-json` file 16 | # This automatic running adds to the startup overhead of `docker-compose up` 17 | # but saves far more time in not having to deal with out of sync versions 18 | # when working with teams or multiple environments 19 | CMD export CPPFLAGS="-DPNG_ARM_NEON_OPT=0" \ 20 | && \ 21 | /var/www/project/npm_install.sh \ 22 | && \ 23 | npm run dev 24 | -------------------------------------------------------------------------------- /cms/config/project/fields/errorImage--a5cb77be-c4d9-4d3e-88fb-d5384ca13941.yaml: -------------------------------------------------------------------------------- 1 | contentColumnType: string 2 | fieldGroup: d08a0d16-0e00-49e6-9cd4-465fa2d65d7d 3 | handle: errorImage 4 | instructions: '' 5 | name: 'Error Image' 6 | searchable: true 7 | settings: 8 | allowedKinds: 9 | - image 10 | defaultUploadLocationSource: 'volume:5c642d7e-b16b-4836-9575-668d75d242e5' 11 | defaultUploadLocationSubpath: '' 12 | limit: '1' 13 | localizeRelations: false 14 | restrictFiles: '1' 15 | selectionLabel: '' 16 | singleUploadLocationSource: 'volume:5c642d7e-b16b-4836-9575-668d75d242e5' 17 | singleUploadLocationSubpath: '' 18 | source: null 19 | sources: 20 | - 'volume:5c642d7e-b16b-4836-9575-668d75d242e5' 21 | targetSiteId: null 22 | useSingleFolder: '' 23 | validateRelatedElements: '' 24 | viewMode: large 25 | translationKeyFormat: null 26 | translationMethod: site 27 | type: craft\fields\Assets 28 | -------------------------------------------------------------------------------- /cms/templates/_inline-js/lazyload-image-shim.js: -------------------------------------------------------------------------------- 1 | // From https://web.dev/native-lazy-loading/#how-do-i-handle-browsers-that-don't-yet-support-native-lazy-loading 2 | if ('loading' in HTMLImageElement.prototype) { 3 | // Replace the img.src with what is in the data-src property 4 | const images = document.querySelectorAll('img[loading="lazy"]'); 5 | images.forEach(img => { 6 | img.src = img.dataset.src; 7 | }); 8 | // Replace the source.srcset with what is in the data-srcset property 9 | const sources = document.querySelectorAll('source[data-srcset]') 10 | sources.forEach(source => { 11 | source.srcset = source.dataset.srcset; 12 | }); 13 | } else { 14 | // Dynamically import the LazySizes library 15 | const script = document.createElement('script'); 16 | script.type = 'module'; 17 | script.src = 18 | '{{ craft.vite.entry("src/js/utils/lazysizes-wrapper.ts") }}'; 19 | document.body.appendChild(script); 20 | } 21 | -------------------------------------------------------------------------------- /cms/config/fastcgi-cache-bust.php: -------------------------------------------------------------------------------- 1 | App::env('FAST_CGI_CACHE_PATH'), 30 | ]; 31 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/register-service-worker.twig: -------------------------------------------------------------------------------- 1 | {# Service Worker was removed due to questionable benefits vs. the caching issues it can present 2 | 15 | #} 16 | {# Unregister any lingering Service Workers #} 17 | 26 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/critical-css.twig: -------------------------------------------------------------------------------- 1 | {# -- Critical CSS -- #} 2 | {# 3 | # Use Nginx Server Sider Includes (SSI) to render different HTML depending on 4 | # the value in the `critical-css` cookie. ref: http://nginx.org/en/docs/http/ngx_http_ssi_module.html 5 | #} 6 | {% set cssHash = craft.vite.getCssHash("src/js/app.ts") %} 7 | {# 8 | # If the `critical-css` cookie is set, the client already has the CSS file download, 9 | # so don't include the critical CSS, and load the full stylesheet(s) synchronously 10 | #} 11 | 12 | {{ craft.vite.script("src/js/app.ts", false) }} 13 | 14 | {# 15 | # If the cookie is not set, set the cookie, then include the critical CSS for this page, 16 | # and load the full stylesheet(s) asychronously 17 | #} 18 | 21 | {{ craft.vite.includeCriticalCssTags() }} 22 | {{ craft.vite.script("src/js/app.ts", true) }} 23 | 24 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "craftcms/craft", 3 | "description": "nystudio107 Craft 3 CMS scaffolding project", 4 | "keywords": [ 5 | "craft", 6 | "cms", 7 | "craftcms", 8 | "project" 9 | ], 10 | "license": "0BSD", 11 | "homepage": "https://craftcms.com/", 12 | "type": "project", 13 | "support": { 14 | "email": "support@craftcms.com", 15 | "issues": "https://github.com/craftcms/cms/issues", 16 | "forum": "https://craftcms.stackexchange.com/", 17 | "source": "https://github.com/craftcms/cms", 18 | "docs": "https://craftcms.com/docs", 19 | "rss": "https://craftcms.com/changelog.rss" 20 | }, 21 | "scripts": { 22 | "post-create-project-cmd": [ 23 | "@php -r \"copy('./cms/example.env', './cms/.env');\"", 24 | "@php -r \"copy('./scripts/example.env.sh', './scripts/.env.sh');\"", 25 | "@php -r \"@unlink('composer.json');\"", 26 | "@php -r \"@unlink('composer.lock');\"", 27 | "@php -r \"@unlink('LICENSE.md');\"", 28 | "@php -r \"@unlink('README.md');\"" 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/css/app.css: -------------------------------------------------------------------------------- 1 | /** 2 | * app.css 3 | * 4 | * The entry point for the css. 5 | * 6 | */ 7 | 8 | /** 9 | * This injects Tailwind's base styles, which is a combination of 10 | * Normalize.css and some additional base styles. 11 | */ 12 | 13 | @import "tailwindcss/base"; 14 | 15 | /** 16 | * This injects any component classes registered by plugins. 17 | * 18 | */ 19 | @import "tailwindcss/components"; 20 | 21 | /** 22 | * Here we add custom component classes; stuff we want loaded 23 | * *before* the utilities so that the utilities can still 24 | * override them. 25 | * 26 | */ 27 | @import "./components/webfonts.css"; 28 | @import "./components/typography.css"; 29 | @import "./components/global.css"; 30 | 31 | /** 32 | * This injects all of Tailwind's utility classes, generated based on your 33 | * config file. 34 | * 35 | */ 36 | @import "tailwindcss/utilities"; 37 | 38 | /** 39 | * Include styles for individual pages 40 | * 41 | */ 42 | @import "./pages/homepage.css"; 43 | 44 | /** 45 | * Include vendor css. 46 | * 47 | */ 48 | @import "vendor.css"; 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Craft 3 .gitignore 2 | # 3 | # Example .gitignore file for Craft 3 CMS projects 4 | # 5 | # @author nystudio107 6 | # @copyright Copyright (c) 2017 nystudio107 7 | # @link https://nystudio107.com/ 8 | # @package nystudio107/craft 9 | # @since 1.0.0 10 | # @license MIT 11 | 12 | # This file should be placed in your Craft 3 CMS project root directory 13 | 14 | # CRAFT ENVIRONMENT 15 | .env* 16 | 17 | # COMPOSER 18 | */vendor/* 19 | 20 | # CRAFT STORAGE 21 | */storage/* 22 | 23 | # ASSETS 24 | /cms/web/assets/* 25 | /cms/web/cpresources/* 26 | /cms/web/dist/* 27 | /cms/web/favicon.* 28 | /cms/web/sw.* 29 | 30 | # BUILD FILES 31 | node_modules 32 | yarn-error.log 33 | npm-debug.log 34 | 35 | # TRANSCODER 36 | /cms/web/transcoder/* 37 | 38 | # MISC FILES 39 | .cache 40 | .DS_Store 41 | .idea 42 | .project 43 | .settings 44 | *.esproj 45 | *.sublime-workspace 46 | *.sublime-project 47 | *.tmproj 48 | *.tmproject 49 | .vscode/* 50 | !.vscode/settings.json 51 | !.vscode/tasks.json 52 | !.vscode/launch.json 53 | !.vscode/extensions.json 54 | config.codekit3 55 | prepros-6.config 56 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 nystudio107 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_partials/tab-handler.twig: -------------------------------------------------------------------------------- 1 | {# -- Handle tabs gracefully as per https://david-gilbertson.medium.com/removing-that-ugly-focus-ring-and-keeping-it-too-6c8727fefcd2 -- #} 2 | 10 | 29 | -------------------------------------------------------------------------------- /cms/templates/_layouts/global-variables.twig: -------------------------------------------------------------------------------- 1 | {# -- Root global variables that all templates inherit from -- #} 2 | {# -- This allows for defining site-wide Twig variables as needed -- #} 3 | {# 4 | ┌─────────────────────────────────────────────────────────────────────────────┐ 5 | │ │ 6 | │ │ 7 | │ │ 8 | │ htmlPage │ 9 | └─────────────────────────────────────────────────────────────────────────────┘ 10 | #} 11 | {% apply spaceless %} 12 | 13 | {# -- Prefetch & preconnect headers and links -- #} 14 | {% set prefetchUrls = [ 15 | alias("@assetsUrl"), 16 | ] %} 17 | 18 | {# -- General global variables -- #} 19 | {% set baseUrl = alias('@assetsUrl') ~ '/' %} 20 | {% set gaTrackingId = getenv('GA_TRACKING_ID') %} 21 | 22 | {# -- Twig output from the render; this must be in a block -- #} 23 | {% block htmlPage %} 24 | {% endblock %} 25 | 26 | {% endapply %} 27 | -------------------------------------------------------------------------------- /docker-config/php-prod-craft/composer_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Composer Install shell script 4 | # 5 | # This shell script runs `composer install` if either the `composer.lock` file or 6 | # the `vendor/` directory is not present` 7 | # 8 | # @author nystudio107 9 | # @copyright Copyright (c) 2022 nystudio107 10 | # @link https://nystudio107.com/ 11 | # @license MIT 12 | 13 | # Ensure permissions on directories Craft needs to write to 14 | chown -R www-data:www-data /var/www/project/cms/storage 15 | chown -R www-data:www-data /var/www/project/cms/web/cpresources 16 | # Check for `composer.lock` & `vendor/autoload.php` 17 | cd /var/www/project/cms 18 | if [ ! -f "composer.lock" ] || [ ! -f "vendor/autoload.php" ]; then 19 | su-exec www-data composer install --verbose --no-progress --no-scripts --optimize-autoloader --no-interaction 20 | # Wait until the MySQL db container responds 21 | echo "### Waiting for MySQL database" 22 | until eval "mysql -h mariadb -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 23 | do 24 | sleep 1 25 | done 26 | # Run any pending migrations/project config changes 27 | su-exec www-data composer craft-update 28 | fi 29 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/assetbundles/sitemodule/SiteModuleAsset.php: -------------------------------------------------------------------------------- 1 | sourcePath = "@modules/sitemodule/assetbundles/sitemodule/dist"; 33 | 34 | $this->depends = [ 35 | CpAsset::class, 36 | ]; 37 | 38 | $this->js = [ 39 | 'js/SiteModule.js', 40 | ]; 41 | 42 | $this->css = [ 43 | 'css/SiteModule.css', 44 | ]; 45 | 46 | parent::init(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /scripts/common/common_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Common DB 4 | # 5 | # Shared script to set various database-related variables 6 | # 7 | # @author nystudio107 8 | # @copyright Copyright (c) 2020 nystudio107 9 | # @link https://nystudio107.com/ 10 | # @license MIT 11 | 12 | # Tables to exclude from the db dump 13 | EXCLUDED_DB_TABLES=( 14 | "assetindexdata" 15 | "assettransformindex" 16 | "cache" 17 | "sessions" 18 | "templatecaches" 19 | "templatecachecriteria" 20 | "templatecacheelements" 21 | "templatecachequeries" 22 | ) 23 | 24 | TMP_DB_DUMP_CREDS_PATH="/tmp/craftscripts.creds" 25 | 26 | # -- LOCAL settings -- hard-coded for Docker 27 | 28 | # Local database constants; default port for mysql is 3306, default port for postgres is 5432 29 | LOCAL_DB_NAME="project" 30 | LOCAL_DB_PASSWORD="project" 31 | LOCAL_DB_USER="project" 32 | LOCAL_DB_HOST="localhost" 33 | LOCAL_DB_PORT="5432" 34 | LOCAL_DB_SCHEMA="public" 35 | 36 | # The `mysql` and `mysqldump` commands to run locally 37 | LOCAL_MYSQL_CMD="mysql" 38 | LOCAL_MYSQLDUMP_CMD="mysqldump" 39 | 40 | # The `psql` and `pg_dump` commands to run locally 41 | LOCAL_PSQL_CMD="psql" 42 | LOCAL_PG_DUMP_CMD="pg_dump" 43 | -------------------------------------------------------------------------------- /cms/templates/_boilerplate/_layouts/base-ajax-layout.twig: -------------------------------------------------------------------------------- 1 | {# -- Base layout template that all AJAX requests inherit from -- #} 2 | {# 3 | ┌─────────────────────────────────────────────────────────────────────────────┐ 4 | │ ┌─────────────────────────────────────────────────────────────────────────┐ │ 5 | │ │ │ │ 6 | │ │ │ │ 7 | │ │ │ │ 8 | │ │ content │ │ 9 | │ └─────────────────────────────────────────────────────────────────────────┘ │ 10 | │ │ 11 | │ htmlPage │ 12 | └─────────────────────────────────────────────────────────────────────────────┘ 13 | #} 14 | {% extends "_layouts/global-variables.twig" %} 15 | 16 | {% block htmlPage %} 17 | {% minify %} 18 | {# -- Primary content block -- #} 19 | {% block content %} 20 | No content block defined. 21 | {% endblock content %} 22 | {% endminify %} 23 | {% endblock htmlPage %} 24 | -------------------------------------------------------------------------------- /cms/web/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /cms/config/app.web.php: -------------------------------------------------------------------------------- 1 | [ 22 | 'session' => static function() { 23 | // Get the default component config 24 | $config = App::sessionConfig(); 25 | // Override the class to use Redis' session class and our config settings 26 | $config['class'] = yii\redis\Session::class; 27 | $config['keyPrefix'] = App::env('APP_ID') ?: 'CraftCMS'; 28 | $config['redis'] = [ 29 | 'hostname' => App::env('REDIS_HOSTNAME'), 30 | 'port' => App::env('REDIS_PORT'), 31 | 'database' => App::env('REDIS_DEFAULT_DB'), 32 | ]; 33 | // Instantiate and return it 34 | return Craft::createObject($config); 35 | }, 36 | ], 37 | ]; 38 | -------------------------------------------------------------------------------- /docker-config/php-prod-craft/run_queue.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run Queue shell script 4 | # 5 | # This shell script runs the Craft CMS queue via `php craft queue/listen` 6 | # It waits until the database container responds, then runs any pending 7 | # migrations / project config changes via the `craft-update` Composer script, 8 | # then runs the queue listener that listens for and runs pending queue jobs 9 | # 10 | # @author nystudio107 11 | # @copyright Copyright (c) 2022 nystudio107 12 | # @link https://nystudio107.com/ 13 | # @license MIT 14 | 15 | cd /var/www/project/cms 16 | # Wait until the MySQL db container responds 17 | echo "### Waiting for MySQL database" 18 | until eval "mysql -h mariadb -u $DB_USER -p$DB_PASSWORD $DB_DATABASE -e 'select 1' > /dev/null 2>&1" 19 | do 20 | sleep 1 21 | done 22 | # Wait until the `composer install` is done by looking for the `vendor/autoload.php` and `composer.lock` files 23 | echo "### Waiting for vendor/autoload.php" 24 | while [ ! -f "vendor/autoload.php" ] || [ ! -f "composer.lock" ] 25 | do 26 | sleep 1 27 | done 28 | # Ensure permissions on directories Craft needs to write to 29 | chown -R www-data:www-data /var/www/project/cms/storage 30 | chown -R www-data:www-data /var/www/project/cms/web/cpresources 31 | # Run any pending migrations/project config changes 32 | su-exec www-data composer craft-update 33 | # Run a queue listener 34 | su-exec www-data php craft queue/listen 10 35 | -------------------------------------------------------------------------------- /cms/templates/_inline-js/tiny-cookie.min.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.Cookie=t()}(this,function(){"use strict";function e(t,n,o){return void 0===n?e.get(t):void(null===n?e.remove(t):e.set(t,n,o))}function t(e){return e.replace(/[.*+?^$|[\](){}\\-]/g,"\\$&")}function n(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){if("expires"===n){var r=e[n];"object"!=typeof r&&(r+="number"==typeof r?"D":"",r=o(r)),e[n]=r.toUTCString()}if("secure"===n){if(!e[n])continue;t+=";"+n}t+=";"+n+"="+e[n]}return e.hasOwnProperty("path")||(t+=";path=/"),t}function o(e){var t=new Date,n=e.charAt(e.length-1),o=parseInt(e,10);switch(n){case"Y":t.setFullYear(t.getFullYear()+o);break;case"M":t.setMonth(t.getMonth()+o);break;case"D":t.setDate(t.getDate()+o);break;case"h":t.setHours(t.getHours()+o);break;case"m":t.setMinutes(t.getMinutes()+o);break;case"s":t.setSeconds(t.getSeconds()+o);break;default:t=new Date(e)}return t}return e.enabled=function(){var t,n="__test_key";return document.cookie=n+"=1",t=!!document.cookie,t&&e.remove(n),t},e.get=function(e,n){if("string"!=typeof e||!e)return null;e="(?:^|; )"+t(e)+"(?:=([^;]*?))?(?:;|$)";var o=new RegExp(e),r=o.exec(document.cookie);return null!==r?n?r[1]:decodeURIComponent(r[1]):null},e.getRaw=function(t){return e.get(t,!0)},e.set=function(e,t,o,r){o!==!0&&(r=o,o=!1),r=n(r?r:{});var u=e+"="+(o?t:encodeURIComponent(t))+r;document.cookie=u},e.setRaw=function(t,n,o){e.set(t,n,!0,o)},e.remove=function(t){e.set(t,"a",{expires:new Date})},e}); 2 | -------------------------------------------------------------------------------- /cms/example.env: -------------------------------------------------------------------------------- 1 | # Craft general settings 2 | ALLOW_UPDATES=1 3 | ALLOW_ADMIN_CHANGES=1 4 | BACKUP_ON_UPDATE=0 5 | DEV_MODE=1 6 | ENABLE_TEMPLATE_CACHING=0 7 | ENVIRONMENT=dev 8 | RUN_QUEUE_AUTOMATICALLY=0 9 | SECURITY_KEY=EOdiVBONceb8zFGJP7InMui2pMkvNACz 10 | 11 | # Craft database settings 12 | DB_DRIVER=mysql 13 | DB_SERVER=mariadb 14 | DB_USER=project 15 | DB_PASSWORD=project 16 | DB_DATABASE=project 17 | DB_SCHEMA=public 18 | DB_TABLE_PREFIX= 19 | DB_PORT=3306 20 | 21 | # URL & path settings 22 | ASSETS_URL=http://localhost:8000 23 | SITE_URL=http://localhost:8000 24 | WEB_ROOT_PATH=/var/www/project/cms/web 25 | 26 | # S3 settings 27 | S3_KEY_ID= 28 | S3_SECRET= 29 | S3_BUCKET= 30 | S3_REGION= 31 | S3_SUBFOLDER= 32 | 33 | # CloudFront settings 34 | CLOUDFRONT_URL= 35 | CLOUDFRONT_DISTRIBUTION_ID= 36 | CLOUDFRONT_PATH_PREFIX= 37 | SERVERLESS_SHARP_CLOUDFRONT_URL= 38 | 39 | # Redis settings 40 | REDIS_HOSTNAME=redis 41 | REDIS_PORT=6379 42 | REDIS_DEFAULT_DB=0 43 | REDIS_CRAFT_DB=1 44 | 45 | # webpack settings 46 | PUBLIC_PATH=/dist/ 47 | DEVSERVER_HOST=0.0.0.0 48 | DEVSERVER_POLL=0 49 | DEVSERVER_PORT=8080 50 | DEVSERVER_HTTPS=0 51 | DEVSERVER_PUBLIC=http://localhost:8080 52 | 53 | # Vite settings 54 | VITE_DEV_SERVER_PUBLIC=http://localhost:3000/ 55 | VITE_DEV_SERVER_INTERNAL=http://vite:3000/ 56 | 57 | # Disqus settings 58 | DISQUS_PUBLIC_KEY= 59 | DISQUS_SECRET_KEY= 60 | 61 | # Google Analytics settings 62 | GA_TRACKING_ID= 63 | 64 | # FastCGI Cache Bust settings 65 | FAST_CGI_CACHE_PATH= 66 | 67 | # Xdebug Settings 68 | DBGP_IDEKEY=phpstorm 69 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Determine the docker compose API version to get the separator character 2 | VERSION?=$(shell docker-compose -v) 3 | ifneq (,$(findstring v2.,$(VERSION))) 4 | SEPARATOR:=- 5 | else 6 | SEPARATOR:=_ 7 | endif 8 | CONTAINER?=$(shell basename $(CURDIR))$(SEPARATOR)php$(SEPARATOR)1 9 | BUILDCHAIN?=$(shell basename $(CURDIR))$(SEPARATOR)vite$(SEPARATOR)1 10 | 11 | .PHONY: build clean composer craft dev npm pulldb restoredb nuke ssh up 12 | 13 | build: up 14 | docker exec -it $(BUILDCHAIN) npm run build 15 | clean: 16 | rm -f cms/composer.lock 17 | rm -rf cms/vendor/ 18 | rm -f buildchain/package-lock.json 19 | rm -rf buildchain/node_modules/ 20 | composer: up 21 | docker exec -it $(CONTAINER) su-exec www-data composer \ 22 | $(filter-out $@,$(MAKECMDGOALS)) 23 | craft: up 24 | docker exec -it $(CONTAINER) su-exec www-data php craft \ 25 | $(filter-out $@,$(MAKECMDGOALS)) 26 | dev: up 27 | npm: up 28 | docker exec -it $(BUILDCHAIN) npm \ 29 | $(filter-out $@,$(MAKECMDGOALS)) 30 | pulldb: up 31 | cd scripts/ && ./docker_pull_db.sh 32 | restoredb: up 33 | cd scripts/ && ./docker_restore_db.sh \ 34 | $(filter-out $@,$(MAKECMDGOALS)) 35 | nuke: clean 36 | docker-compose down -v 37 | docker-compose up --build --force-recreate 38 | ssh: 39 | docker exec -it $(CONTAINER) su-exec www-data /bin/sh 40 | up: 41 | if [ ! "$$(docker ps -q -f name=$(CONTAINER))" ]; then \ 42 | cp -n cms/example.env cms/.env; \ 43 | docker-compose up; \ 44 | fi 45 | %: 46 | @: 47 | # ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line 48 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/README.md: -------------------------------------------------------------------------------- 1 | # Site module for Craft CMS 3.x 2 | 3 | An example module for Craft CMS 3 that lets you enhance your websites with a custom site module 4 | 5 | ## Requirements 6 | 7 | This module requires Craft CMS 3.0.0-RC1 or later. 8 | 9 | ## Installation 10 | 11 | To install the module, follow these instructions. 12 | 13 | First, you'll need to add the contents of the `app.php` file to your `config/app.php` (or just copy it there if it does not exist). This ensures that your module will get loaded for each request. The file might look something like this: 14 | ``` 15 | return [ 16 | 'modules' => [ 17 | 'site-module' => [ 18 | 'class' => \modules\sitemodule\SiteModule::class, 19 | ], 20 | ], 21 | 'bootstrap' => ['site-module'], 22 | ]; 23 | ``` 24 | You'll also need to make sure that you add the following to your project's `composer.json` file so that Composer can find your module: 25 | 26 | "autoload": { 27 | "psr-4": { 28 | "modules\\sitemodule\\": "modules/sitemodule/src/" 29 | } 30 | }, 31 | 32 | After you have added this, you will need to do: 33 | 34 | composer dump-autoload 35 | 36 | …from the project’s root directory, to rebuild the Composer autoload map. This will happen automatically any time you do a `composer install` or `composer update` as well. 37 | 38 | ## Site Overview 39 | 40 | -Insert text here- 41 | 42 | ## Using Site 43 | 44 | -Insert text here- 45 | 46 | ## Site Roadmap 47 | 48 | Some things to do, and ideas for potential features: 49 | 50 | * Release it 51 | 52 | Brought to you by [nystudio107](https://nystudio107.com/) 53 | -------------------------------------------------------------------------------- /docker-config/php-dev-craft/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nystudio107/php-dev-base:8.0-alpine 2 | 3 | # dependencies required for running "phpize" 4 | # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) 5 | ENV PHPIZE_DEPS \ 6 | autoconf \ 7 | dpkg-dev \ 8 | dpkg \ 9 | file \ 10 | g++ \ 11 | gcc \ 12 | libc-dev \ 13 | make \ 14 | pkgconf \ 15 | re2c \ 16 | wget 17 | 18 | # Install packages 19 | RUN set -eux; \ 20 | # Packages needed only for build 21 | apk add --no-cache --virtual .build-deps \ 22 | $PHPIZE_DEPS \ 23 | && \ 24 | # Packages to install 25 | apk add --no-cache \ 26 | su-exec \ 27 | gifsicle \ 28 | jpegoptim \ 29 | libwebp-tools \ 30 | nano \ 31 | optipng \ 32 | mysql-client \ 33 | && \ 34 | # Install PHP extensions 35 | docker-php-ext-install \ 36 | pdo_mysql \ 37 | && \ 38 | # Install Composer 39 | curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \ 40 | && \ 41 | # Remove the build deps 42 | apk del .build-deps \ 43 | && \ 44 | # Clean out directories that don't need to be part of the image 45 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 46 | 47 | WORKDIR /var/www/project 48 | 49 | RUN mkdir -p /var/www/project/cms/storage \ 50 | && \ 51 | mkdir -p /var/www/project/cms/web/cpresources \ 52 | && \ 53 | chown -R www-data:www-data /var/www/project 54 | 55 | WORKDIR /var/www/project/cms 56 | 57 | # Start php-fpm 58 | CMD php-fpm 59 | -------------------------------------------------------------------------------- /cms/config/general.php: -------------------------------------------------------------------------------- 1 | [ 16 | '@assetsUrl' => App::env('ASSETS_URL'), 17 | '@cloudfrontUrl' => App::env('CLOUDFRONT_URL'), 18 | '@web' => App::env('SITE_URL'), 19 | '@webroot' => App::env('WEB_ROOT_PATH'), 20 | ], 21 | 'allowUpdates' => (bool)App::env('ALLOW_UPDATES'), 22 | 'allowAdminChanges' => (bool)App::env('ALLOW_ADMIN_CHANGES'), 23 | 'backupOnUpdate' => (bool)App::env('BACKUP_ON_UPDATE'), 24 | 'devMode' => (bool)App::env('DEV_MODE'), 25 | 'enableTemplateCaching' => (bool)App::env('ENABLE_TEMPLATE_CACHING'), 26 | 'resourceBasePath' => App::env('WEB_ROOT_PATH') . '/cpresources', 27 | 'runQueueAutomatically' => (bool)App::env('RUN_QUEUE_AUTOMATICALLY'), 28 | 'securityKey' => App::env('SECURITY_KEY'), 29 | // Craft config settings from constants 30 | 'cacheDuration' => false, 31 | 'defaultSearchTermOptions' => [ 32 | 'subLeft' => true, 33 | 'subRight' => true, 34 | ], 35 | 'defaultTokenDuration' => 'P2W', 36 | 'enableCsrfProtection' => true, 37 | 'errorTemplatePrefix' => 'errors/', 38 | 'generateTransformsBeforePageLoad' => true, 39 | 'maxCachedCloudImageSize' => 3000, 40 | 'maxUploadFileSize' => '100M', 41 | 'omitScriptNameInUrls' => true, 42 | 'useEmailAsUsername' => true, 43 | 'usePathInfo' => true, 44 | ]; 45 | -------------------------------------------------------------------------------- /scripts/example.env.sh: -------------------------------------------------------------------------------- 1 | # Craft 3 Scripts Environment 2 | # 3 | # Local environmental config for nystudio107 Craft scripts 4 | # 5 | # @author nystudio107 6 | # @copyright Copyright (c) 2020 nystudio107 7 | # @link https://nystudio107.com/ 8 | # @license MIT 9 | # 10 | # This file should be renamed to '.env.sh' and it should reside in the 11 | # `scripts` directory. Add '.env.sh' to your .gitignore. 12 | 13 | # -- GLOBAL settings -- 14 | 15 | # The database driver for this Craft install ('mysql' or 'pgsql') 16 | GLOBAL_DB_DRIVER="mysql" 17 | 18 | # -- LOCAL settings -- 19 | 20 | LOCAL_DB_CONTAINER="REPLACE_ME" 21 | LOCAL_BUILDCHAIN_CONTAINER="REPLACE_ME" 22 | 23 | # -- REMOTE settings -- 24 | 25 | # Remote ssh credentials, user@domain.com and Remote SSH Port 26 | REMOTE_SSH_LOGIN="REPLACE_ME" 27 | REMOTE_SSH_PORT="22" 28 | 29 | # Should we connect to the remote database server via ssh? 30 | REMOTE_DB_USING_SSH="yes" 31 | 32 | # Remote database constants; default port for mysql is 3306, default port for postgres is 5432 33 | REMOTE_DB_NAME="REPLACE_ME" 34 | REMOTE_DB_PASSWORD="REPLACE_ME" 35 | REMOTE_DB_USER="REPLACE_ME" 36 | REMOTE_DB_HOST="localhost" 37 | REMOTE_DB_PORT="3306" 38 | REMOTE_DB_SCHEMA="public" 39 | 40 | # If you are using mysql 5.6.10 or later and you have `login-path` setup as per: 41 | # https://opensourcedbms.com/dbms/passwordless-authentication-using-mysql_config_editor-with-mysql-5-6/ 42 | # you can use it instead of the above REMOTE_DB_* constants; otherwise leave this blank 43 | REMOTE_DB_LOGIN_PATH="" 44 | 45 | # The `mysql` and `mysqldump` commands to run remotely 46 | REMOTE_MYSQL_CMD="mysql" 47 | REMOTE_MYSQLDUMP_CMD="mysqldump" 48 | 49 | # The `psql` and `pg_dump` commands to run remotely 50 | REMOTE_PSQL_CMD="psql" 51 | REMOTE_PG_DUMP_CMD="pg_dump" 52 | -------------------------------------------------------------------------------- /cms/config/app.php: -------------------------------------------------------------------------------- 1 | App::env('APP_ID') ?: 'CraftCMS', 24 | 'modules' => [ 25 | 'site-module' => [ 26 | 'class' => \modules\sitemodule\SiteModule::class, 27 | ], 28 | ], 29 | 'bootstrap' => ['site-module'], 30 | 'components' => [ 31 | 'cache' => [ 32 | 'class' => yii\redis\Cache::class, 33 | 'keyPrefix' => App::env('APP_ID') ?: 'CraftCMS', 34 | 'redis' => [ 35 | 'hostname' => App::env('REDIS_HOSTNAME'), 36 | 'port' => App::env('REDIS_PORT'), 37 | 'database' => App::env('REDIS_CRAFT_DB'), 38 | ], 39 | ], 40 | 'deprecator' => [ 41 | 'throwExceptions' => App::env('DEV_MODE'), 42 | ], 43 | 'queue' => [ 44 | 'class' => craft\queue\Queue::class, 45 | 'ttr' => 10 * 60, 46 | ], 47 | 'redis' => [ 48 | 'class' => yii\redis\Connection::class, 49 | 'hostname' => App::env('REDIS_HOSTNAME'), 50 | 'port' => App::env('REDIS_PORT'), 51 | 'database' => App::env('REDIS_DEFAULT_DB'), 52 | ], 53 | ], 54 | ]; 55 | -------------------------------------------------------------------------------- /cms/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "craftcms/cms": "^3.6.9", 4 | "vlucas/phpdotenv": "^5.4.0", 5 | "yiisoft/yii2-redis": "^2.0.6", 6 | "nystudio107/craft-imageoptimize": "^1.0.0", 7 | "nystudio107/craft-fastcgicachebust": "^1.0.0", 8 | "nystudio107/craft-minify": "^1.2.5", 9 | "nystudio107/craft-typogrify": "^1.1.4", 10 | "nystudio107/craft-retour": "^3.0.0", 11 | "nystudio107/craft-seomatic": "^3.2.0", 12 | "nystudio107/craft-templatecomments": "^1.0.0", 13 | "nystudio107/craft-webperf": "^1.0.0", 14 | "nystudio107/craft-vite": "^1.0.20" 15 | }, 16 | "require-dev": { 17 | "nystudio107/craft-autocomplete": "^1.0.0", 18 | "yiisoft/yii2-shell": "^2.0.3" 19 | }, 20 | "autoload": { 21 | "psr-4": { 22 | "modules\\sitemodule\\": "modules/sitemodule/src/" 23 | } 24 | }, 25 | "config": { 26 | "allow-plugins": { 27 | "craftcms/plugin-installer": true, 28 | "yiisoft/yii2-composer": true 29 | }, 30 | "optimize-autoloader": true, 31 | "sort-packages": true 32 | }, 33 | "scripts": { 34 | "craft-update": [ 35 | "@pre-craft-update", 36 | "@post-craft-update" 37 | ], 38 | "pre-craft-update": [ 39 | ], 40 | "post-craft-update": [ 41 | "Composer\\Config::disableProcessTimeout", 42 | "@php craft install/check && php craft clear-caches/all --interactive=0 || exit 0", 43 | "@php craft install/check && php craft up --interactive=0 || exit 0" 44 | ], 45 | "post-root-package-install": [ 46 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 47 | ], 48 | "post-create-project-cmd": [ 49 | "@php craft setup/welcome" 50 | ], 51 | "pre-update-cmd": "@pre-craft-update", 52 | "pre-install-cmd": "@pre-craft-update", 53 | "post-update-cmd": "@post-craft-update", 54 | "post-install-cmd": "@post-craft-update" 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /docker-config/nginx/default.conf: -------------------------------------------------------------------------------- 1 | # default Docker DNS server 2 | resolver 127.0.0.11; 3 | 4 | # If a cookie doesn't exist, it evaluates to an empty string, so if neither cookie exists, it'll match : 5 | # (empty string on either side of the :), but if either or both cookies are set, it won't match, and will hit the default rule 6 | map $cookie_XDEBUG_SESSION:$cookie_XDEBUG_PROFILE $my_fastcgi_pass { 7 | default php_xdebug; 8 | ':' php; 9 | } 10 | 11 | server { 12 | listen 80; 13 | listen [::]:80; 14 | 15 | server_name _; 16 | root /var/www/project/cms/web; 17 | index index.html index.htm index.php; 18 | charset utf-8; 19 | 20 | gzip_static on; 21 | 22 | ssi on; 23 | 24 | client_max_body_size 0; 25 | 26 | error_page 404 /index.php?$query_string; 27 | 28 | access_log off; 29 | error_log /dev/stdout info; 30 | 31 | location = /favicon.ico { access_log off; log_not_found off; } 32 | 33 | location / { 34 | try_files $uri/index.html $uri $uri/ /index.php?$query_string; 35 | } 36 | 37 | location ~ [^/]\.php(/|$) { 38 | try_files $uri $uri/ /index.php?$query_string; 39 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 40 | fastcgi_pass $my_fastcgi_pass:9000; 41 | fastcgi_index index.php; 42 | include fastcgi_params; 43 | fastcgi_param PATH_INFO $fastcgi_path_info; 44 | fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; 45 | fastcgi_param DOCUMENT_ROOT $realpath_root; 46 | fastcgi_param HTTP_PROXY ""; 47 | 48 | add_header Last-Modified $date_gmt; 49 | add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0"; 50 | if_modified_since off; 51 | expires off; 52 | etag off; 53 | 54 | fastcgi_intercept_errors off; 55 | fastcgi_buffer_size 16k; 56 | fastcgi_buffers 4 16k; 57 | fastcgi_connect_timeout 300; 58 | fastcgi_send_timeout 300; 59 | fastcgi_read_timeout 300; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /scripts/common/common_pgsql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Common pgsql 4 | # 5 | # Shared script to set various database-related variables 6 | # 7 | # @author nystudio107 8 | # @copyright Copyright (c) 2020 nystudio107 9 | # @link https://nystudio107.com/ 10 | # @license MIT 11 | 12 | LOCAL_IGNORED_DB_TABLES_STRING="" 13 | REMOTE_IGNORED_DB_TABLES_STRING="" 14 | for TABLE in "${EXCLUDED_DB_TABLES[@]}" 15 | do 16 | LOCAL_IGNORED_DB_TABLES_STRING+="--exclude-table-data=${LOCAL_DB_SCHEMA}.${GLOBAL_DB_TABLE_PREFIX}${TABLE} " 17 | REMOTE_IGNORED_DB_TABLES_STRING+="--exclude-table-data=${REMOTE_DB_SCHEMA}.${GLOBAL_DB_TABLE_PREFIX}${TABLE} " 18 | done 19 | 20 | # Additional arguments for pg_dump 21 | PG_DUMP_ADDITIONAL_ARGS="" 22 | PG_DUMP_ADDITIONAL_ARGS+="--no-password " 23 | PG_DUMP_ADDITIONAL_ARGS+="--if-exists " 24 | PG_DUMP_ADDITIONAL_ARGS+="--clean " 25 | PG_DUMP_ADDITIONAL_ARGS+="--no-owner " 26 | PG_DUMP_ADDITIONAL_ARGS+="--no-privileges " 27 | PG_DUMP_ADDITIONAL_ARGS+="--no-acl " 28 | 29 | # Arguments to dump just the data 30 | PG_DUMP_ARGS="" 31 | PG_DUMP_ARGS+=$PG_DUMP_ADDITIONAL_ARGS 32 | 33 | # Build the remote psql credentials 34 | REMOTE_DB_CREDS="" 35 | if [[ -n "${REMOTE_DB_HOST}" ]] ; then 36 | REMOTE_DB_CREDS+="--host=${REMOTE_DB_HOST} " 37 | fi 38 | if [[ -n "${REMOTE_DB_PORT}" ]] ; then 39 | REMOTE_DB_CREDS+="--port=${REMOTE_DB_PORT} " 40 | fi 41 | if [[ -n "${REMOTE_DB_NAME}" ]] ; then 42 | REMOTE_DB_CREDS+="--dbname=${REMOTE_DB_NAME} " 43 | fi 44 | if [[ -n "${REMOTE_DB_USER}" ]] ; then 45 | REMOTE_DB_CREDS+="--username=${REMOTE_DB_USER} " 46 | fi 47 | 48 | # Build the local psql credentials 49 | LOCAL_DB_CREDS="" 50 | if [[ -n "${LOCAL_DB_HOST}" ]] ; then 51 | LOCAL_DB_CREDS+="--host=${LOCAL_DB_HOST} " 52 | fi 53 | if [[ -n "${LOCAL_DB_PORT}" ]] ; then 54 | LOCAL_DB_CREDS+="--port=${LOCAL_DB_PORT} " 55 | fi 56 | if [[ -n "${LOCAL_DB_NAME}" ]] ; then 57 | LOCAL_DB_CREDS+="--dbname=${LOCAL_DB_NAME} " 58 | fi 59 | if [[ -n "${LOCAL_DB_USER}" ]] ; then 60 | LOCAL_DB_CREDS+="--username=${LOCAL_DB_USER} " 61 | fi 62 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/assetbundles/sitemodule/dist/img/SiteModule-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 14 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /cms/templates/_layouts/error-page-layout.twig: -------------------------------------------------------------------------------- 1 | {# -- Layout template for error pages -- #} 2 | {# 3 | ┌─────────────────────────────────────────────────────────────────────────────┐ 4 | │ ┌─────────────────────────────────────────────────────────────────────────┐ │ 5 | │ │ │ │ 6 | │ │ │ │ 7 | │ │ │ │ 8 | │ │ content │ │ 9 | │ └─────────────────────────────────────────────────────────────────────────┘ │ 10 | │ ┌─────────────────────────────────────────────────────────────────────────┐ │ 11 | │ │ │ │ 12 | │ │ │ │ 13 | │ │ │ │ 14 | │ │ subContent │ │ 15 | │ └─────────────────────────────────────────────────────────────────────────┘ │ 16 | │ │ 17 | │ bodyHtml │ 18 | └─────────────────────────────────────────────────────────────────────────────┘ 19 | #} 20 | {% extends "_layouts/generic-page-layout.twig" %} 21 | 22 | {% block content %} 23 | {% endblock %} 24 | 25 | {% block subcontent %} 26 |
27 |
28 |
29 |

30 | {{ entry.errorHeadline ?? 'Error' }} 31 |

32 |

33 | {{ (entry.errorText ?? 'An error has occurred.') |nl2br }} 34 |

35 |
36 |
37 |
38 | 39 | {% endblock %} 40 | 41 | {# -- Any JavaScript that should be included before -- #} 42 | {% block bodyJs %} 43 | {% endblock bodyJs %} 44 | -------------------------------------------------------------------------------- /docker-config/php-prod-craft/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nystudio107/php-prod-base:8.0-alpine 2 | 3 | # dependencies required for running "phpize" 4 | # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed) 5 | ENV PHPIZE_DEPS \ 6 | autoconf \ 7 | dpkg-dev \ 8 | dpkg \ 9 | file \ 10 | g++ \ 11 | gcc \ 12 | libc-dev \ 13 | make \ 14 | pkgconf \ 15 | re2c \ 16 | wget 17 | 18 | # Install packages 19 | RUN set -eux; \ 20 | # Packages needed only for build 21 | apk add --no-cache --virtual .build-deps \ 22 | $PHPIZE_DEPS \ 23 | && \ 24 | # Packages to install 25 | apk add --no-cache \ 26 | su-exec \ 27 | gifsicle \ 28 | jpegoptim \ 29 | libwebp-tools \ 30 | nano \ 31 | optipng \ 32 | mysql-client \ 33 | && \ 34 | # Install PHP extensions 35 | docker-php-ext-install \ 36 | pdo_mysql \ 37 | && \ 38 | # Install Composer 39 | curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \ 40 | && \ 41 | # Remove the build deps 42 | apk del .build-deps \ 43 | && \ 44 | # Clean out directories that don't need to be part of the image 45 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 46 | 47 | WORKDIR /var/www/project 48 | 49 | COPY ./run_queue.sh . 50 | RUN chmod a+x run_queue.sh \ 51 | && \ 52 | mkdir -p /var/www/project/cms/storage \ 53 | && \ 54 | mkdir -p /var/www/project/cms/web/cpresources \ 55 | && \ 56 | chown -R www-data:www-data /var/www/project 57 | COPY ./composer_install.sh . 58 | RUN chmod a+x composer_install.sh 59 | 60 | WORKDIR /var/www/project/cms 61 | 62 | # Run the composer_install.sh script that will do a `composer install`: 63 | # - If `composer.lock` is missing 64 | # - If `vendor/` is missing 65 | # ...then start up php-fpm. The `run_queue.sh` script in the queue container 66 | # will take care of running any pending migrations and apply any Project Config changes, 67 | # as well as set permissions via an async CLI process 68 | CMD /var/www/project/composer_install.sh \ 69 | && \ 70 | php-fpm 71 | -------------------------------------------------------------------------------- /src/js/utils/lazy-load-component.js: -------------------------------------------------------------------------------- 1 | // from: https://markus.oberlehner.net/blog/lazy-load-vue-components-when-they-become-visible/ 2 | export default function lazyLoadComponent({ 3 | componentFactory, 4 | loading, 5 | loadingData, 6 | }) { 7 | let resolveComponent; 8 | 9 | return () => ({ 10 | // We return a promise to resolve a 11 | // component eventually. 12 | component: new Promise((resolve) => { 13 | resolveComponent = resolve; 14 | }), 15 | loading: { 16 | mounted() { 17 | // We immediately load the component if 18 | // `IntersectionObserver` is not supported. 19 | if (!('IntersectionObserver' in window)) { 20 | componentFactory().then(resolveComponent); 21 | return; 22 | } 23 | 24 | const observer = new IntersectionObserver((entries) => { 25 | // Use `intersectionRatio` because of Edge 15's 26 | // lack of support for `isIntersecting`. 27 | // See: https://github.com/w3c/IntersectionObserver/issues/211 28 | if (entries[0].intersectionRatio <= 0) return; 29 | 30 | // Cleanup the observer when it's not 31 | // needed anymore. 32 | observer.unobserve(this.$el); 33 | // The `componentFactory()` resolves 34 | // to the result of a dynamic `import()` 35 | // which is passed to the `resolveComponent()` 36 | // function. 37 | componentFactory().then(resolveComponent); 38 | }); 39 | // We observe the root `$el` of the 40 | // mounted loading component to detect 41 | // when it becomes visible. 42 | observer.observe(this.$el); 43 | }, 44 | // Here we render the the component passed 45 | // to this function via the `loading` parameter. 46 | render(createElement) { 47 | return createElement(loading, loadingData); 48 | }, 49 | }, 50 | }); 51 | } 52 | -------------------------------------------------------------------------------- /scripts/common/defaults.sh: -------------------------------------------------------------------------------- 1 | #@IgnoreInspection BashAddShebang 2 | # Craft Scripts Defaults 3 | # 4 | # Default settings for Craft scripts 5 | # 6 | # @author nystudio107 7 | # @copyright Copyright (c) 2020 nystudio107 8 | # @link https://nystudio107.com/ 9 | # @license MIT 10 | 11 | # -- GLOBAL settings -- 12 | 13 | # The database driver for this Craft install ('mysql' or 'pgsql') 14 | GLOBAL_DB_DRIVER="mysql" 15 | 16 | # -- LOCAL settings -- 17 | 18 | # Local database constants; default port for mysql is 3306, default port for postgres is 5432 19 | LOCAL_DB_NAME="REPLACE_ME" 20 | LOCAL_DB_PASSWORD="REPLACE_ME" 21 | LOCAL_DB_USER="REPLACE_ME" 22 | LOCAL_DB_HOST="localhost" 23 | LOCAL_DB_PORT="3306" 24 | LOCAL_DB_SCHEMA="public" 25 | 26 | # If you are using mysql 5.6.10 or later and you have `login-path` setup as per: 27 | # https://opensourcedbms.com/dbms/passwordless-authentication-using-mysql_config_editor-with-mysql-5-6/ 28 | # you can use it instead of the above LOCAL_DB_* constants; otherwise leave this blank 29 | LOCAL_DB_LOGIN_PATH="" 30 | 31 | # The `mysql` and `mysqldump` commands to run locally 32 | LOCAL_MYSQL_CMD="mysql" 33 | LOCAL_MYSQLDUMP_CMD="mysqldump" 34 | 35 | # The `psql` and `pg_dump` commands to run locally 36 | LOCAL_PSQL_CMD="psql" 37 | LOCAL_PG_DUMP_CMD="pg_dump" 38 | 39 | # -- REMOTE settings -- 40 | 41 | # Remote ssh credentials, user@domain.com and Remote SSH Port 42 | REMOTE_SSH_LOGIN="REPLACE_ME" 43 | REMOTE_SSH_PORT="22" 44 | 45 | # Should we connect to the remote database server via ssh? 46 | REMOTE_DB_USING_SSH="yes" 47 | 48 | # Remote database constants; default port for mysql is 3306, default port for postgres is 5432 49 | REMOTE_DB_NAME="REPLACE_ME" 50 | REMOTE_DB_PASSWORD="REPLACE_ME" 51 | REMOTE_DB_USER="REPLACE_ME" 52 | REMOTE_DB_HOST="localhost" 53 | REMOTE_DB_PORT="3306" 54 | REMOTE_DB_SCHEMA="public" 55 | 56 | # If you are using mysql 5.6.10 or later and you have `login-path` setup as per: 57 | # https://opensourcedbms.com/dbms/passwordless-authentication-using-mysql_config_editor-with-mysql-5-6/ 58 | # you can use it instead of the above REMOTE_DB_* constants; otherwise leave this blank 59 | REMOTE_DB_LOGIN_PATH="" 60 | 61 | # The `mysql` and `mysqldump` commands to run remotely 62 | REMOTE_MYSQL_CMD="mysql" 63 | REMOTE_MYSQLDUMP_CMD="mysqldump" 64 | 65 | # The `psql` and `pg_dump` commands to run remotely 66 | REMOTE_PSQL_CMD="psql" 67 | REMOTE_PG_DUMP_CMD="pg_dump" 68 | -------------------------------------------------------------------------------- /cms/modules/sitemodule/src/helpers/Config.php: -------------------------------------------------------------------------------- 1 | getConfig()->env; 44 | 45 | // Try craft/config first 46 | $path = Craft::getAlias('@config/'.$fileName, false); 47 | if ($path === false || !file_exists($path)) { 48 | // Now try our own internal config 49 | $path = Craft::getAlias('@modules/sitemodule/'.$fileName, false); 50 | if ($path === false || !file_exists($path)) { 51 | return []; 52 | } 53 | } 54 | 55 | if (!is_array($config = @include $path)) { 56 | return []; 57 | } 58 | 59 | // If it's not a multi-environment config, return the whole thing 60 | if (!array_key_exists('*', $config)) { 61 | return $config; 62 | } 63 | 64 | // If no environment was specified, just look in the '*' array 65 | if ($currentEnv === null) { 66 | return $config['*']; 67 | } 68 | 69 | $mergedConfig = []; 70 | foreach ($config as $env => $envConfig) { 71 | if ($env === '*' || StringHelper::contains($currentEnv, $env)) { 72 | $mergedConfig = ArrayHelper::merge($mergedConfig, $envConfig); 73 | } 74 | } 75 | 76 | return $mergedConfig; 77 | } 78 | 79 | // Private Methods 80 | // ========================================================================= 81 | } 82 | -------------------------------------------------------------------------------- /cms/config/seomatic-config/globalmeta/Creator.php: -------------------------------------------------------------------------------- 1 | [ 20 | 'siteType' => 'Organization', 21 | 'siteSubType' => '', 22 | 'siteSpecificType' => '', 23 | 'computedType' => 'Organization', 24 | 'genericName' => 'nystudio107', 25 | 'genericAlternateName' => 'nys', 26 | 'genericDescription' => 'We do technology-based consulting, branding, design, and development. Making the web better one site at a time, with a focus on performance, usability & SEO', 27 | 'genericUrl' => 'https://nystudio107.com/', 28 | 'genericImage' => 'https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/site/nys_logo_seo.png', 29 | 'genericImageWidth' => '1042', 30 | 'genericImageHeight' => '1042', 31 | 'genericImageIds' => [], 32 | 'genericTelephone' => '', 33 | 'genericEmail' => 'info@nystudio107.com', 34 | 'genericStreetAddress' => '', 35 | 'genericAddressLocality' => 'Webster', 36 | 'genericAddressRegion' => 'NY', 37 | 'genericPostalCode' => '14580', 38 | 'genericAddressCountry' => 'US', 39 | 'genericGeoLatitude' => '43.2365384', 40 | 'genericGeoLongitude' => '-77.49211620000001', 41 | 'personGender' => '', 42 | 'personBirthPlace' => '', 43 | 'organizationDuns' => '', 44 | 'organizationFounder' => 'Andrew Welch, Polly Welch', 45 | 'organizationFoundingDate' => '2013-05-02', 46 | 'organizationFoundingLocation' => 'Webster, NY', 47 | 'organizationContactPoints' => [], 48 | 'corporationTickerSymbol' => '', 49 | 'localBusinessPriceRange' => '', 50 | 'localBusinessOpeningHours' => [], 51 | 'restaurantServesCuisine' => '', 52 | 'restaurantMenuUrl' => '', 53 | 'restaurantReservationsUrl' => '', 54 | ], 55 | ]; 56 | -------------------------------------------------------------------------------- /scripts/docker_restore_db.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Restore Database 4 | # 5 | # Restore the local database to the file path passed in via ARGV 6 | # 7 | # @author nystudio107 8 | # @copyright Copyright (c) 2020 nystudio107 9 | # @link https://nystudio107.com/ 10 | # @license MIT 11 | 12 | # Get the directory of the currently executing script 13 | DIR="$(dirname "${BASH_SOURCE[0]}")" 14 | 15 | # Include files 16 | INCLUDE_FILES=( 17 | "common/defaults.sh" 18 | ".env.sh" 19 | "common/common_env.sh" 20 | "common/common_db.sh" 21 | ) 22 | for INCLUDE_FILE in "${INCLUDE_FILES[@]}" 23 | do 24 | if [[ ! -f "${DIR}/${INCLUDE_FILE}" ]] ; then 25 | echo "File ${DIR}/${INCLUDE_FILE} is missing, aborting." 26 | exit 1 27 | fi 28 | source "${DIR}/${INCLUDE_FILE}" 29 | done 30 | 31 | # Source the correct file for the database driver 32 | case "$GLOBAL_DB_DRIVER" in 33 | ( 'mysql' ) source "${DIR}/common/common_mysql.sh" ;; 34 | ( 'pgsql' ) source "${DIR}/common/common_pgsql.sh" ;; 35 | ( * ) 36 | echo "Environment variable GLOBAL_DB_DRIVER was neither 'mysql' nor 'pgsql'. Aborting." 37 | exit 1 ;; 38 | esac 39 | 40 | # Get the path to the database passed in 41 | SRC_DB_PATH="$1" 42 | if [[ -z "${SRC_DB_PATH}" ]] ; then 43 | echo "No input database dump specified via variable SRC_DB_PATH" 44 | exit 1 45 | fi 46 | if [[ ! -f "${SRC_DB_PATH}" ]] ; then 47 | echo "File not found for variable SRC_DB_PATH" 48 | exit 1 49 | fi 50 | 51 | # Figure out what type of file we're being passed in 52 | case "$SRC_DB_PATH" in 53 | ( *.gz ) CAT_CMD="${DB_ZCAT_CMD}" ;; 54 | ( *.sql ) CAT_CMD="${DB_CAT_CMD}" ;; 55 | ( * ) 56 | echo "Unknown file type for variable SRC_DB_PATH" 57 | exit 1 ;; 58 | esac 59 | 60 | # Functions 61 | function restore_local_from_dump_mysql() { 62 | # Restore the local db from the passed in db dump 63 | $CAT_CMD "${SRC_DB_PATH}" | docker exec -i ${LOCAL_DB_CONTAINER} ${LOCAL_MYSQL_CMD} ${LOCAL_DB_CREDS} 64 | echo "*** Restored docker MySQL database from ${SRC_DB_PATH}" 65 | } 66 | function restore_local_from_dump_pgsql() { 67 | # Restore the local db from the passed in db dump 68 | $CAT_CMD "${SRC_DB_PATH}" | docker exec -i ${LOCAL_DB_CONTAINER} ${LOCAL_PSQL_CMD} --output /dev/null --quiet ${LOCAL_DB_CREDS} 69 | echo "*** Restored docker Postgres database from ${SRC_DB_PATH}" 70 | } 71 | 72 | case "$GLOBAL_DB_DRIVER" in 73 | ( 'mysql' ) 74 | restore_local_from_dump_mysql 75 | ;; 76 | ( 'pgsql' ) 77 | restore_local_from_dump_pgsql 78 | ;; 79 | esac 80 | 81 | # Normal exit 82 | exit 0 83 | -------------------------------------------------------------------------------- /cms/templates/_macros/cookies.twig: -------------------------------------------------------------------------------- 1 | {# 2 | # Cookies 3 | # 4 | # Macros for getting and setting cookies natively with Craft CMS 3.1.17 or later 5 | # 6 | # Usage: 7 | # {% import "_macros/cookies.twig" as cookies %} 8 | # Get a cookie: 9 | # {% set woof = cookies.get('woof') %} 10 | # Set a cookie: 11 | # {% do cookies.set('woof', 'bark', now | date_modify('+1 hour').timestamp) %} 12 | # 13 | # @package nystudio107\craft 14 | # @since 1.0.0 15 | # @author nystudio107 16 | # @link https://nystudio107.com 17 | # @copyright Copyright (c) 2019 nystudio107 18 | # @license MIT 19 | # @license https://opensource.org/licenses/MIT MIT Licensed 20 | #} 21 | 22 | {# 23 | # Return the value the cookie specified in `name`. The return value will be an 24 | # empty string if the cookie doesn't exist. 25 | # 26 | # @param string name 27 | # @param yii\web\CookieCollection cookieJar 28 | # 29 | # @return string className 30 | #} 31 | {%- macro get(name, cookieJar = null) -%} 32 | {% spaceless %} 33 | {% set cookieJar = cookieJar ?? craft.app.request.cookies %} 34 | {% set cookie = cookieJar.get(name) %} 35 | {{ cookie.value ?? '' }} 36 | {% endspaceless %} 37 | {%- endmacro -%} 38 | 39 | {# 40 | # Set the cookie specified in `name` to the value specified in `value`, with an 41 | # expiration set to the number of seconds in `expires`. You can use an 42 | # expression like `now | date_modify("+1 hour").timestamp` to set `expires`. 43 | # c.f.: https://www.php.net/manual/en/function.setcookie.php 44 | # 45 | # @param string name 46 | # @param string value 47 | # @param int expires 48 | # @param string path 49 | # @param string domain 50 | # @param bool secure 51 | # @param bool httpOnly 52 | # @param yii\web\CookieCollection cookieJar 53 | #} 54 | {%- macro set(name, value = '', expires = 0, path = '/', domain = '', secure = false, httpOnly = false, cookieJar = null) -%} 55 | {% spaceless %} 56 | {% set cookieJar = cookieJar ?? craft.app.response.cookies %} 57 | {% set domain = domain | length ?: craft.app.config.general.defaultCookieDomain %} 58 | {% set cookie = create({ 59 | 'class': 'yii\\web\\Cookie', 60 | 'name': name, 61 | 'value': value, 62 | 'path': path, 63 | 'domain': domain, 64 | 'secure': secure, 65 | 'httpOnly': httpOnly, 66 | 'expire': expires 67 | }) %} 68 | {% do cookieJar.add(cookie) %} 69 | {% endspaceless %} 70 | {%- endmacro -%} 71 | -------------------------------------------------------------------------------- /scripts/common/common_mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Common mysql 4 | # 5 | # Shared script to set various database-related variables 6 | # 7 | # @author nystudio107 8 | # @copyright Copyright (c) 2020 nystudio107 9 | # @link https://nystudio107.com/ 10 | # @license MIT 11 | 12 | 13 | LOCAL_IGNORED_DB_TABLES_STRING="" 14 | REMOTE_IGNORED_DB_TABLES_STRING="" 15 | for TABLE in "${EXCLUDED_DB_TABLES[@]}" 16 | do 17 | LOCAL_IGNORED_DB_TABLES_STRING+="--ignore-table=${LOCAL_DB_NAME}.${GLOBAL_DB_TABLE_PREFIX}${TABLE} " 18 | REMOTE_IGNORED_DB_TABLES_STRING+="--ignore-table=${REMOTE_DB_NAME}.${GLOBAL_DB_TABLE_PREFIX}${TABLE} " 19 | done 20 | 21 | # Additional arguments for mysqldump 22 | MYSQLDUMP_ADDITIONAL_ARGS="" 23 | MYSQLDUMP_ADDITIONAL_ARGS+="--add-drop-table " 24 | MYSQLDUMP_ADDITIONAL_ARGS+="--no-tablespaces " 25 | MYSQLDUMP_ADDITIONAL_ARGS+="--comments " 26 | MYSQLDUMP_ADDITIONAL_ARGS+="--create-options " 27 | MYSQLDUMP_ADDITIONAL_ARGS+="--dump-date " 28 | MYSQLDUMP_ADDITIONAL_ARGS+="--no-autocommit " 29 | MYSQLDUMP_ADDITIONAL_ARGS+="--routines " 30 | MYSQLDUMP_ADDITIONAL_ARGS+="--set-charset " 31 | MYSQLDUMP_ADDITIONAL_ARGS+="--triggers " 32 | MYSQLDUMP_ADDITIONAL_ARGS+="--set-gtid-purged=OFF " 33 | 34 | # Arguments to dump just the schema 35 | MYSQLDUMP_SCHEMA_ARGS="" 36 | MYSQLDUMP_SCHEMA_ARGS+="--single-transaction " 37 | MYSQLDUMP_SCHEMA_ARGS+="--no-data " 38 | MYSQLDUMP_SCHEMA_ARGS+=$MYSQLDUMP_ADDITIONAL_ARGS 39 | 40 | # Arguments to dump just the data 41 | MYSQLDUMP_DATA_ARGS="" 42 | MYSQLDUMP_DATA_ARGS+="--no-create-info " 43 | MYSQLDUMP_DATA_ARGS+=$MYSQLDUMP_ADDITIONAL_ARGS 44 | 45 | # Build the remote mysql credentials 46 | REMOTE_DB_CREDS="" 47 | if [[ -n "${REMOTE_DB_USER}" ]] ; then 48 | REMOTE_DB_CREDS+="--user=${REMOTE_DB_USER} " 49 | fi 50 | if [[ -n "${REMOTE_DB_PASSWORD}" ]] ; then 51 | REMOTE_DB_CREDS+="--password=${REMOTE_DB_PASSWORD} " 52 | fi 53 | if [[ -n "${REMOTE_DB_HOST}" ]] ; then 54 | REMOTE_DB_CREDS+="--host=${REMOTE_DB_HOST} " 55 | fi 56 | if [[ -n "${REMOTE_DB_PORT}" ]] ; then 57 | REMOTE_DB_CREDS+="--port=${REMOTE_DB_PORT} " 58 | fi 59 | # Use login-path if they have it set instead 60 | if [[ -n "${REMOTE_DB_LOGIN_PATH}" ]] ; then 61 | REMOTE_DB_CREDS="--login-path=${REMOTE_DB_LOGIN_PATH} " 62 | fi 63 | REMOTE_DB_CREDS+="${REMOTE_DB_NAME}" 64 | 65 | # Build the local mysql credentials 66 | LOCAL_DB_CREDS="" 67 | if [[ -n "${LOCAL_DB_USER}" ]] ; then 68 | LOCAL_DB_CREDS+="--user=${LOCAL_DB_USER} " 69 | fi 70 | if [[ -n "${LOCAL_DB_PASSWORD}" ]] ; then 71 | LOCAL_DB_CREDS+="--password=${LOCAL_DB_PASSWORD} " 72 | fi 73 | if [[ -n "${LOCAL_DB_HOST}" ]] ; then 74 | LOCAL_DB_CREDS+="--host=${LOCAL_DB_HOST} " 75 | fi 76 | if [[ -n "${LOCAL_DB_PORT}" ]] ; then 77 | LOCAL_DB_CREDS+="--port=${LOCAL_DB_PORT} " 78 | fi 79 | # Use login-path if they have it set instead 80 | if [[ -n "${LOCAL_DB_LOGIN_PATH}" ]] ; then 81 | LOCAL_DB_CREDS="--login-path=${LOCAL_DB_LOGIN_PATH} " 82 | fi 83 | LOCAL_DB_CREDS+="${LOCAL_DB_NAME}" 84 | -------------------------------------------------------------------------------- /cms/templates/_layouts/generic-page-layout.twig: -------------------------------------------------------------------------------- 1 | {# -- Layout template for HTML pages -- #} 2 | {# 3 | ┌─────────────────────────────────────────────────────────────────────────────┐ 4 | │ ┌─────────────────────────────────────────────────────────────────────────┐ │ 5 | │ │ │ │ 6 | │ │ │ │ 7 | │ │ │ │ 8 | │ │ content │ │ 9 | │ └─────────────────────────────────────────────────────────────────────────┘ │ 10 | │ ┌─────────────────────────────────────────────────────────────────────────┐ │ 11 | │ │ │ │ 12 | │ │ │ │ 13 | │ │ │ │ 14 | │ │ subContent │ │ 15 | │ └─────────────────────────────────────────────────────────────────────────┘ │ 16 | │ │ 17 | │ bodyHtml │ 18 | └─────────────────────────────────────────────────────────────────────────────┘ 19 | #} 20 | {% extends "_boilerplate/_layouts/base-html-layout.twig" %} 21 | 22 | {# -- Any tags that should be included in the #} 23 | {% block headMeta %} 24 | {% endblock headMeta %} 25 | 26 | {# -- Any tags that should be included in the #} 27 | {% block headLinks %} 28 | {% endblock headLinks %} 29 | 30 | {# -- Any CSS that should be included before -- #} 31 | {% block headCss %} 32 | {% include "_inline-css/site-fonts.css" %} 33 | {% endblock headCss %} 34 | 35 | {# -- Page body -- #} 36 | {% block bodyHtml %} 37 |
38 |
39 |
40 |
41 | 42 | {# -- Info header, including _navbar.twig -- #} 43 | {% include "_partials/info-header.twig" %} 44 | 45 |
46 |
47 | {# -- Primary content block -- #} 48 | {% block content %} 49 | {% endblock %} 50 |
51 |
52 |
53 | 54 | {# -- Content that appears below the primary content block -- #} 55 | {% block subcontent %} 56 | {% endblock %} 57 | 58 | {# -- Info footer -- #} 59 | {% include "_partials/info-footer.twig" %} 60 | 61 | {# -- HTML Footer -- #} 62 | {% include "_partials/global-footer.twig" %} 63 |
64 | {% endblock bodyHtml %} 65 | -------------------------------------------------------------------------------- /cms/config/vite.php: -------------------------------------------------------------------------------- 1 | App::env('DEV_MODE'), 33 | 34 | /** 35 | * @var string File system path (or URL) to the Vite-built manifest.json 36 | */ 37 | 'manifestPath' => '@webroot/dist/manifest.json', 38 | 39 | /** 40 | * @var string The public URL to the dev server (what appears in `