From 8a57b32ef66eafa2e1aaced24991e4c8a65065ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Tue, 6 Feb 2024 10:39:27 +0100 Subject: [PATCH] add public individual files + add update.php 404 reject on htaccess --- public/.csslintrc | 40 ++++++++++++++++++ public/.editorconfig | 17 ++++++++ public/.eslintignore | 8 ++++ public/.eslintrc.json | 3 ++ public/.gitattributes | 61 +++++++++++++++++++++++++++ public/.gitignore | 43 +++++++++++++++++++ public/.htaccess | 3 ++ public/autoload.php | 16 +++++++ public/example.gitignore | 42 +++++++++++++++++++ public/index.php | 22 ++++++++++ public/update.php | 30 +++++++++++++ public/web.config | 91 ++++++++++++++++++++++++++++++++++++++++ 12 files changed, 376 insertions(+) create mode 100644 public/.csslintrc create mode 100644 public/.editorconfig create mode 100644 public/.eslintignore create mode 100644 public/.eslintrc.json create mode 100644 public/.gitattributes create mode 100644 public/.gitignore create mode 100644 public/autoload.php create mode 100644 public/example.gitignore create mode 100644 public/index.php create mode 100644 public/update.php create mode 100644 public/web.config diff --git a/public/.csslintrc b/public/.csslintrc new file mode 100644 index 00000000..177e4fcc --- /dev/null +++ b/public/.csslintrc @@ -0,0 +1,40 @@ +--errors=box-model, + display-property-grouping, + duplicate-background-images, + duplicate-properties, + empty-rules, + ids, + import, + important, + known-properties, + outline-none, + overqualified-elements, + qualified-headings, + shorthand, + star-property-hack, + text-indent, + underscore-property-hack, + unique-headings, + unqualified-attributes, + vendor-prefix, + zero-units +--ignore=adjoining-classes, + box-sizing, + bulletproof-font-face, + compatible-vendor-prefixes, + errors, + fallback-colors, + floats, + font-faces, + font-sizes, + gradients, + import-ie-limit, + order-alphabetical, + regex-selectors, + rules-count, + selector-max, + selector-max-approaching, + selector-newline, + universal-selector +--exclude-list=core/assets, + vendor diff --git a/public/.editorconfig b/public/.editorconfig new file mode 100644 index 00000000..686c443c --- /dev/null +++ b/public/.editorconfig @@ -0,0 +1,17 @@ +# Drupal editor configuration normalization +# @see http://editorconfig.org/ + +# This is the top-most .editorconfig file; do not search in parent directories. +root = true + +# All files. +[*] +end_of_line = LF +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[composer.{json,lock}] +indent_size = 4 diff --git a/public/.eslintignore b/public/.eslintignore new file mode 100644 index 00000000..9c134873 --- /dev/null +++ b/public/.eslintignore @@ -0,0 +1,8 @@ +core/**/* +vendor/**/* +sites/**/files/**/* +libraries/**/* +sites/**/libraries/**/* +profiles/**/libraries/**/* +**/js_test_files/**/* +**/node_modules/**/* diff --git a/public/.eslintrc.json b/public/.eslintrc.json new file mode 100644 index 00000000..d4bbc920 --- /dev/null +++ b/public/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./core/.eslintrc.json" +} diff --git a/public/.gitattributes b/public/.gitattributes new file mode 100644 index 00000000..76ea8fee --- /dev/null +++ b/public/.gitattributes @@ -0,0 +1,61 @@ +# Drupal git normalization +# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html +# @see https://www.drupal.org/node/1542048 + +# Normally these settings would be done with macro attributes for improved +# readability and easier maintenance. However macros can only be defined at the +# repository root directory. Drupal avoids making any assumptions about where it +# is installed. + +# Define text file attributes. +# - Treat them as text. +# - Ensure no CRLF line-endings, neither on checkout nor on checkin. +# - Detect whitespace errors. +# - Exposed by default in `git diff --color` on the CLI. +# - Validate with `git diff --check`. +# - Deny applying with `git apply --whitespace=error-all`. +# - Fix automatically with `git apply --whitespace=fix`. + +*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html +*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php +*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 +*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 + +# Define binary file attributes. +# - Do not treat them as text. +# - Include binary diff in patches instead of "binary files differ." +*.eot -text diff +*.exe -text diff +*.gif -text diff +*.gz -text diff +*.ico -text diff +*.jpeg -text diff +*.jpg -text diff +*.otf -text diff +*.phar -text diff +*.png -text diff +*.svgz -text diff +*.ttf -text diff +*.woff -text diff +*.woff2 -text diff diff --git a/public/.gitignore b/public/.gitignore new file mode 100644 index 00000000..feff7aa7 --- /dev/null +++ b/public/.gitignore @@ -0,0 +1,43 @@ +# This file contains default .gitignore rules. To use it, copy it to .gitignore, +# and it will cause files like your settings.php and user-uploaded files to be +# excluded from Git version control. This is a common strategy to avoid +# accidentally including private information in public repositories and patch +# files. +# +# Because .gitignore can be specific to your site, this file has a different +# name; updating Drupal core will not override your custom .gitignore file. + +# Ignore core when managing all of a project's dependencies with Composer +# including Drupal core. +# core + +# Ignore dependencies that are managed with Composer. +# Generally you should only ignore the root vendor directory. It's important +# that core/assets/vendor and any other vendor directories within contrib or +# custom module, theme, etc., are not ignored unless you purposely do so. +/vendor/ + +# Ignore configuration files that may contain sensitive information. +sites/*/settings*.php +sites/*/services*.yml + +# Ignore paths that contain user-generated content. +sites/*/files +sites/*/private + +# Ignore SimpleTest multi-site environment. +sites/simpletest + +# If you prefer to store your .gitignore file in the sites/ folder, comment +# or delete the previous settings and uncomment the following ones, instead. + +# Ignore configuration files that may contain sensitive information. +# */settings*.php + +# Ignore paths that contain user-generated content. +# */files +# */private + +# Ignore SimpleTest multi-site environment. +# simpletest +/autoload.php \ No newline at end of file diff --git a/public/.htaccess b/public/.htaccess index 720d2973..8dafee5d 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -221,6 +221,9 @@ +# Hide update.php +RewriteRule ^update.php$ - [R=404,NC,L] + # Don't show directory listings for URLs which map to a directory. Options -Indexes diff --git a/public/autoload.php b/public/autoload.php new file mode 100644 index 00000000..2c470f33 --- /dev/null +++ b/public/autoload.php @@ -0,0 +1,16 @@ +handle($request); +$response->send(); + +$kernel->terminate($request, $response); diff --git a/public/update.php b/public/update.php new file mode 100644 index 00000000..b65649cb --- /dev/null +++ b/public/update.php @@ -0,0 +1,30 @@ +handle($request); +$response->send(); + +$kernel->terminate($request, $response); diff --git a/public/web.config b/public/web.config new file mode 100644 index 00000000..b769e45e --- /dev/null +++ b/public/web.config @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +