create-berna-stencil 2.6.3 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/index.js +3 -0
  2. package/package.json +4 -27
  3. package/.eleventy.js +0 -94
  4. package/.eleventyignore +0 -4
  5. package/LICENSE +0 -170
  6. package/NOTICE +0 -5
  7. package/README.md +0 -53
  8. package/_tools/assistant.js +0 -150
  9. package/_tools/buildJs.js +0 -28
  10. package/_tools/cleanOutput.js +0 -20
  11. package/_tools/modules/constants.js +0 -23
  12. package/_tools/modules/pageComponents.js +0 -77
  13. package/_tools/modules/updateData.js +0 -84
  14. package/_tools/modules/updateOutputPath.js +0 -112
  15. package/_tools/modules/updatePage.js +0 -162
  16. package/_tools/modules/utils.js +0 -27
  17. package/_tools/modules/validation.js +0 -20
  18. package/_tools/res/templates/template.js +0 -5
  19. package/_tools/res/templates/template.njk +0 -9
  20. package/_tools/res/templates/template.scss +0 -23
  21. package/_tools/res/templates/template.ts +0 -5
  22. package/bin/create.js +0 -429
  23. package/docs/Assistant CLI.md +0 -61
  24. package/docs/Backend.md +0 -148
  25. package/docs/Components.md +0 -96
  26. package/docs/Creating pages.md +0 -65
  27. package/docs/Deploy.md +0 -55
  28. package/docs/Head and SEO.md +0 -94
  29. package/docs/Javascript.md +0 -53
  30. package/docs/Styling with SCSS.md +0 -140
  31. package/nginx.conf +0 -69
  32. package/src/backend/.htaccess +0 -7
  33. package/src/backend/_core/composer.json +0 -5
  34. package/src/backend/_core/composer.lock +0 -492
  35. package/src/backend/_core/index.php +0 -148
  36. package/src/backend/_core/init.php +0 -34
  37. package/src/backend/_core/modules/RateLimiter.php +0 -31
  38. package/src/backend/_core/modules/Response.php +0 -49
  39. package/src/backend/api/protected/example-protected.php +0 -17
  40. package/src/backend/api/public/example-public.php +0 -17
  41. package/src/backend/database/Database.php +0 -24
  42. package/src/backend/database/migrations/create_example_db.sql +0 -1
  43. package/src/backend/web.config +0 -17
  44. package/src/frontend/.htaccess +0 -16
  45. package/src/frontend/404.njk +0 -17
  46. package/src/frontend/assets/brand/favicon.svg +0 -37
  47. package/src/frontend/assets/brand/logo.svg +0 -37
  48. package/src/frontend/components/global/footer.njk +0 -27
  49. package/src/frontend/components/global/header.njk +0 -11
  50. package/src/frontend/components/welcome.njk +0 -251
  51. package/src/frontend/data/site.json +0 -44
  52. package/src/frontend/index.njk +0 -9
  53. package/src/frontend/js/modules/exampleModule.js +0 -3
  54. package/src/frontend/js/pages/404.js +0 -7
  55. package/src/frontend/js/pages/homepage.js +0 -7
  56. package/src/frontend/layouts/base.njk +0 -137
  57. package/src/frontend/layouts/pageComponents.njk +0 -14
  58. package/src/frontend/llms.njk +0 -18
  59. package/src/frontend/robots.njk +0 -8
  60. package/src/frontend/scss/modules/_animations.scss +0 -25
  61. package/src/frontend/scss/modules/_buttons.scss +0 -24
  62. package/src/frontend/scss/modules/_footer.scss +0 -32
  63. package/src/frontend/scss/modules/_global.scss +0 -46
  64. package/src/frontend/scss/modules/_header.scss +0 -33
  65. package/src/frontend/scss/modules/_mobile.scss +0 -30
  66. package/src/frontend/scss/modules/_notification.scss +0 -56
  67. package/src/frontend/scss/modules/_root.scss +0 -35
  68. package/src/frontend/scss/modules/_typography.scss +0 -15
  69. package/src/frontend/scss/modules/frameworks/_bootstrap.scss +0 -110
  70. package/src/frontend/scss/modules/frameworks/_bulma.scss +0 -109
  71. package/src/frontend/scss/modules/frameworks/_foundation.scss +0 -139
  72. package/src/frontend/scss/modules/frameworks/_uikit.scss +0 -110
  73. package/src/frontend/scss/pages/404.scss +0 -28
  74. package/src/frontend/scss/pages/homepage.scss +0 -23
  75. package/src/frontend/sitemap.njk +0 -17
  76. package/src/frontend/ts/modules/exampleModule.ts +0 -3
  77. package/src/frontend/ts/pages/404.ts +0 -7
  78. package/src/frontend/ts/pages/homepage.ts +0 -7
  79. package/src/frontend/web.config +0 -27
  80. package/tsconfig.json +0 -25
@@ -1,96 +0,0 @@
1
- # Nunjucks (HTML) Components
2
-
3
- ## What is Nunjucks
4
-
5
- Nunjucks (`.njk`) is an HTML file that supports logic like variables, `if` statements, and `for` loops. It can extend a base layout and include other `.njk` components
6
-
7
- ## Create a component
8
-
9
- Create a new `.njk` file anywhere inside `src/frontend/components/`. You can organize them into subfolders freely
10
-
11
- ```
12
- src/frontend/components/
13
- ├── global/
14
- ├── layouts/
15
- ├── modals/
16
- │ └── privacyModal.njk # You can move it to a modals/subfolder
17
- ├── welcome.njk
18
- ```
19
-
20
- ## Include a component
21
-
22
- To render a component inside a page, navigate to `src/frontend/layouts/` and edit `pageComponents.njk`
23
-
24
- ### pageComponents.njk <small>(`src/frontend/layouts/`)</small>
25
-
26
- ```js
27
- {% if title == "homepage" %}
28
- {% include "welcome.njk" %}
29
-
30
- {% elif title == "examplePage" %}
31
- {% include "exampleComponent1.njk" %}
32
- {% include "subfolder/exampleComponent2.njk" %}
33
-
34
- {% else %}
35
- {% include "404/_404.njk" %}
36
- {{ content | safe }}
37
- {% endif %}
38
- ```
39
-
40
- Add a new `{% elif %}` block for each page, listing its components in order. If a component lives in a subfolder, specify the relative path accordingly
41
-
42
- > ⚠️ A new `elif` block is automatically added when you create a page via the Assistant CLI
43
-
44
- > ⚠️ If you move or delete a component, always update `pageComponents.njk` or the site will break
45
-
46
- ### Using Markdown files in components
47
-
48
- You can also render a `.md` file directly inside any `.njk` component using the `mdFile` shortcode:
49
-
50
- ```njk
51
- {% mdFile "docs/your-file.md" %}
52
- ```
53
-
54
- The path is relative to the project root (where `.eleventy.js` lives).
55
-
56
- > ⚠️ The file is read at build time — changes to the `.md` file trigger a rebuild in watch mode.
57
-
58
- ## Nest components
59
-
60
- A component can include other components. This is useful for breaking complex sections into smaller, reusable pieces.
61
-
62
- ### exampleComponent.njk
63
- ```js
64
- <section class="hero">
65
- {% include "ui/heroTitle.njk" %}
66
- {% include "ui/heroButton.njk" %}
67
- </section>
68
- ```
69
-
70
- > The same path rules apply: if the included component is in a subfolder, specify the full relative path.
71
-
72
- ## Global components
73
-
74
- Header and footer live in `src/frontend/components/global/` and are automatically included in every page via `base.njk`. Edit them to change the site-wide layout
75
-
76
- ## Site data in components
77
-
78
- All values defined in `src/frontend/data/site.json` are globally available in every component via `{{ site.* }}`
79
-
80
- ### site.json <small>(`src/data/`)</small>
81
- ```json
82
- {
83
- "title": "My Site",
84
- "logo": "/img/logo.png",
85
- "legal": {
86
- "privacy": "/privacy"
87
- }
88
- }
89
- ```
90
-
91
- ### Usage in any `.njk` file
92
- ```js
93
- <p>{{ site.title }}</p>
94
- <a href="{{ site.legal.privacy }}">Privacy Policy</a>
95
- <img src="{{ site.logo }}" alt="{{ site.title }}">
96
- ```
@@ -1,65 +0,0 @@
1
- # Creating Pages
2
-
3
- > Examples use JavaScript, but everything applies equally to TypeScript. The only difference is the file extension (`.ts` instead of `.js`), that imports do **not** include the extension, and that paths use `src/frontend/ts/` instead of `src/frontend/js/`.
4
-
5
- The recommended way is via the **Assistant CLI**
6
-
7
- ## What gets created
8
- For a page named `my-page`:
9
-
10
- | File | Purpose |
11
- |---|---|
12
- | `src/frontend/_routes_/my-page.njk` | Template with front matter |
13
- | `src/frontend/scss/pages/myPage.scss` | Imports framework + modules |
14
- | `src/frontend/js/pages/myPage.js` | Imports JS modules |
15
-
16
- ## Adding content
17
-
18
- 1. Create a component in `src/frontend/components/` (e.g. `_myPage.njk`)
19
- 2. Include it in `src/frontend/layouts/pageComponents.njk` inside the generated `elif` block:
20
-
21
- ```njk
22
- {% elif title == "myPage" %}
23
- {% include "_myPage.njk" %}
24
- ```
25
-
26
- See **Components** DOC file for more info
27
-
28
- ## URL and title
29
-
30
- The URL is the kebab-case name (`/my-page/`). The `title` in the front matter is camelCase (`myPage`) and is used internally to load the correct CSS and JS files — do not change it.
31
-
32
- ## Subpages (nested URLs)
33
-
34
- To create a URL like `domain.it/about/team`, edit the `permalink` in `src/frontend/_routes/team.njk` and add the parent segment before the final slash:
35
-
36
- ```njk
37
- ---
38
- title: "team"
39
- permalink: "about/team/"
40
- layout: pageComponents.njk
41
- ---
42
- ```
43
-
44
- The parent path (`about`) does **not** need to exist as a real page — it's just a URL prefix. Only the last segment (`team`) must match the filename and the `title` in the front matter.
45
-
46
- | Goal URL | permalink value | File |
47
- |---|---|---|
48
- | `/team/` | `/team/` | `_routes/team.njk` |
49
- | `/about/team/` | `/about/team/` | `_routes/team.njk` |
50
- | `/company/about/team/` | `/company/about/team/` | `_routes/team.njk` |
51
-
52
- ## SEO
53
-
54
- The CLI creates a stub entry in `src/frontend/data/site.json`. Fill it in:
55
-
56
- ```json
57
- "myPage": {
58
- "seo": {
59
- "title": "My Page | Site Name",
60
- "description": "Page description"
61
- }
62
- }
63
- ```
64
-
65
- See **Head & SEO** for all available options.
package/docs/Deploy.md DELETED
@@ -1,55 +0,0 @@
1
- # Server Configuration
2
-
3
- Berna-Stencil includes ready-made server configuration for Apache and IIS. For Nginx, a reference config is provided in the project root.
4
-
5
- ## Apache
6
-
7
- `.htaccess` files at `src/frontend/` and `src/backend/` are automatically copied to the build output by Eleventy. No additional setup required.
8
-
9
- Covers:
10
- - Directory listing disabled
11
- - 403 / 404 → `/404.html`
12
- - Sensitive files blocked (`web.config`, dotfiles, etc.)
13
- - `/api/*` → `backend/_core/index.php`
14
- - HTTPS redirect
15
-
16
- ## IIS
17
-
18
- `web.config` files at `src/frontend/` and `src/backend/` are automatically copied to the build output by Eleventy. No additional setup required.
19
-
20
- Covers the same rules as the Apache configuration above.
21
-
22
- ## Nginx
23
-
24
- Nginx does not support per-directory configuration files. The `nginx.conf` in the project root is a reference config that must be manually placed on the server.
25
-
26
- ### Setup
27
-
28
- 1. Copy `nginx.conf` to the server:
29
- ```bash
30
- scp nginx.conf user@server:/etc/nginx/sites-available/your-site
31
- ```
32
-
33
- 2. Edit `server_name` and `root` to match your environment:
34
- ```nginx
35
- server_name example.com;
36
- root /var/www/html/out;
37
- ```
38
-
39
- 3. Add your SSL certificate paths.
40
-
41
- 4. Enable and reload:
42
- ```bash
43
- ln -s /etc/nginx/sites-available/your-site /etc/nginx/sites-enabled/
44
- nginx -t && systemctl reload nginx
45
- ```
46
-
47
- ### PHP-FPM socket
48
-
49
- The default socket path in `nginx.conf` targets RHEL / Fedora systems. Adjust for your distro:
50
-
51
- | Distro | Path |
52
- |---|---|
53
- | RHEL / Fedora | `unix:/run/php-fpm/php-fpm.sock` |
54
- | Debian / Ubuntu | `unix:/run/php/php-fpm.sock` |
55
- | TCP fallback | `127.0.0.1:9000` |
@@ -1,94 +0,0 @@
1
- # Head & SEO
2
-
3
-
4
- This json holds global settings used across all pages in `base.njk` and other components:
5
-
6
- ### site.json <small>`(src/frontend/data/)`</small>
7
- ```json
8
- "site_name": "Site name",
9
- "title": "Site title",
10
- "description": "Site description",
11
- "keywords": "keyword1, keyword2, keyword3",
12
- "domain": "yoursite.com",
13
- "url": "https://yoursite.com",
14
- "lang": "en",
15
- "author": "Name and surname",
16
- "data_bs_theme": "dark",
17
- "favicon": "/assets/brand/favicon.svg",
18
- "logo": "/assets/brand/logo.svg",
19
- ...
20
- ```
21
-
22
- ## Per-page SEO and CDN
23
-
24
- Each page entry is keyed by its camelCase `title` from the front matter:
25
-
26
- If you don't want to use a particular cdn inserting it in `base.njk` for all pages, you can add extra specific cdn (css, js) by inserting the link in each page of site.json separating them with a `,` and setting them in ""
27
-
28
- ### site.json <small>`(src/frontend/data/)`</small>
29
- ```json
30
- "pages": {
31
- ...
32
- "examplePage": {
33
- "seo": {
34
- "title": "Example Page",
35
- "description": "description"
36
- },
37
- "cdn": {
38
- // You can leave the [] empty
39
- "css": ["https://example1.com/lib.min.css", "https://example2.com/lib.min.css"],
40
- "js": ["https://example1.com/lib.min.js", "https://example2.com/lib.min.js"]
41
- }
42
- }
43
- ...
44
- }
45
- ```
46
-
47
- ## AI & SEO bots
48
-
49
- `llms.txt` and `robots.txt` are generated automatically from `site.json` via their respective `.njk` files — no manual editing needed.
50
-
51
- | File | Purpose | Reachable at |
52
- |---|---|---|
53
- | `llms.njk` | Tells AI models what your site is about | `yoursite.com/llms.txt` |
54
- | `robots.njk` | Controls search engine crawling | `yoursite.com/robots.txt` |
55
-
56
- To customize them, edit `src/llms.njk` or `src/robots.njk` directly.
57
-
58
- ### Customizing llms.txt
59
-
60
- `src/llms.njk` ships with a base template — **replace the placeholders with your own content**:
61
-
62
- ```
63
- # {{ site.site_name }}
64
-
65
- > {{ site.description }}
66
-
67
- Built by {{ site.author }} — {{ site.url }}
68
-
69
- ## Pages
70
-
71
- - {{ site.url }}: Homepage
72
-
73
- ## Notes
74
-
75
- - Language: {{ site.lang }}
76
- - All content may be used for AI inde xing unless otherwise stated
77
- ```
78
-
79
- > The more accurate and detailed your `llms.txt`, the better AI models will understand and reference your site.
80
-
81
- ## Configuration field description
82
-
83
- | Field | Purpose |
84
- |---|---|
85
- | `site_name` | Brand name (used in meta tags) |
86
- | `title` | Default page title |
87
- | `description` | Default meta description |
88
- | `keywords` | Default meta keywords |
89
- | `domain` / `url` | Used for canonical URLs and og:url |
90
- | `lang` | HTML `lang` attribute |
91
- | `author` | Meta author tag |
92
- | `data_bs_theme` | Bootstrap color scheme (`light` / `dark`) |
93
- | `favicon` | Path to the favicon |
94
- | `logo` | Path to the logo (available as `{{ site.logo }}`) |
@@ -1,53 +0,0 @@
1
- # JavaScript
2
-
3
- > Examples use JavaScript, but everything applies equally to TypeScript. The only difference is the file extension (`.ts` instead of `.js`), that imports do **not** include the extension, and that paths use `src/frontend/ts/` instead of `src/frontend/js/`.
4
-
5
- ## Page JS
6
-
7
- Each page has its own JS entry point in `src/frontend/js/pages/`, bundled and minified by esbuild and loaded automatically by `base.njk`.
8
-
9
- Import only what the page needs.
10
-
11
- ### examplePage.js <small>(`src/frontend/js/pages/`)</small>
12
-
13
- ```js
14
- // import { initExampleModule } from '../modules/exampleModule.js';
15
-
16
- document.addEventListener("DOMContentLoaded", () => {
17
- // initExampleModule();
18
- });
19
-
20
- // Page logic here
21
- ```
22
-
23
- ## Modules
24
-
25
- Modules live in `src/frontend/js/modules/`. Modules that interact with the DOM must be called inside `DOMContentLoaded`; others can be called anywhere.
26
-
27
- ## Adding a module
28
-
29
- Create a new `.js` file in `src/frontend/js/modules/`. Subfolders are allowed.
30
-
31
- Use ESM syntax — esbuild handles the bundling:
32
-
33
- ### exampleModule.js <small>(`src/frontend/js/modules/`)</small>
34
-
35
- ```js
36
- export function exampleModule() {
37
- // Module logic here
38
- }
39
- ```
40
-
41
- Then import it in the pages that need it:
42
-
43
- ```js
44
- import { exampleModule } from '../modules/exampleModule.js';
45
- ```
46
-
47
- In TypeScript, omit the extension:
48
-
49
- ```ts
50
- import { exampleModule } from '../modules/exampleModule';
51
- ```
52
-
53
- > ⚠️ Files inside `_tools/` run directly in Node.js without a bundler — use CommonJS (`require` / `module.exports`) there, not ESM.
@@ -1,140 +0,0 @@
1
- # Styling with SCSS
2
-
3
- ## Page CSS
4
-
5
- Each page has its own SCSS entry point in `src/frontend/scss/pages/`
6
-
7
- It must contain `_root.scss` + other modules like `_global.scss` or any other one that you need and its own specific css rules
8
-
9
- `_root.scss` uses `@use` to enable namespaced access (`root.$var`); other modules use `@import` as they don't expose variables.
10
- ### examplePage.scss <small>(`src/frontend/scss/pages/`)</small>
11
- ```scss
12
- //==========================
13
- // CSS MODULES IMPORTS
14
- //==========================
15
-
16
- @use "../modules/root" as root;
17
-
18
- @import "../modules/global";
19
-
20
- @import "../modules/notification";
21
-
22
- //==========================
23
- // PAGE CUSTOM CSS RULES
24
- //==========================
25
-
26
- body {
27
- background-color: root.$primary;
28
- }
29
- ```
30
-
31
- ## Global Variables
32
-
33
- Instead of using `:root` in your custom modules or pages, the best thing to do is to centralize all your variables in a single file (that will be tree-shaken automatically by Sass)
34
-
35
- ### _root.scss <small>(`src/frontend/scss/modules/`)</small>
36
- ```scss
37
- $header-height: 10vh;
38
-
39
- // Usage example (in any other file):
40
- header {
41
- height: root.$header-height;
42
- }
43
- ```
44
- ## Scss modules
45
- You can create your custom css modules by creating a new `.scss` file in `src/frontend/scss/modules/` (the name of the file must start with `_`)
46
-
47
- You can create subfolders if you want to refactor the structure, but be sure to update the relative paths in the pages that import them
48
-
49
- ### _yourModule.scss <small>(`src/frontend/scss/modules/subfolder/`)</small>
50
- ```scss
51
- @use '../root' as root;
52
-
53
- body {
54
- background-color: root.$primary;
55
- }
56
- ```
57
-
58
- ### examplePage.scss
59
- ```scss
60
- @import "../modules/subfolder/yourModule";
61
-
62
- // This page will now inherit the body tag rules
63
- // If the same property is declared in both, the last imported one wins
64
- body {
65
- color: root.$dark;
66
- }
67
- ```
68
-
69
- ### Pre-existing modules
70
-
71
- | File | Purpose |
72
- |---|---|
73
- | `_root.scss` | Global variables (colors, spacing) |
74
- | `_global.scss` | Site-wide base rules and frameworks |
75
- | `_typography.scss` | Font rules
76
- | `_header.scss` | Header styles |
77
- | `_footer.scss` | Footer styles |
78
- | `_mobile.scss` | Media query rules |
79
- | `_buttons.scss` | Style and hovers for buttons
80
- | `_animations.scss` | Keyframe animations (`fade-in`, `spin`) |
81
- | `_notification.scss` | Notification component style |
82
-
83
- ## CSS Framework
84
-
85
- Some of the most popular css frameworks that supports scss with modules are already installed in `node_modules`
86
-
87
- You can choose one or none of them (more than 1 works, but you may get in various conflicts)
88
-
89
- To enable/disable them you have to modify 3 files around the project by just commenting them
90
-
91
-
92
- ### 1. _global.scss <small>(`src/frontend/scss/modules/`)</small>
93
- ```scss
94
- @import "../modules/frameworks/bootstrap";
95
- // @import "../modules/frameworks/bulma";
96
- // @import "../modules/frameworks/foundation";
97
- // @import "../modules/frameworks/uikit";
98
- ```
99
-
100
- ### 2. base.njk <small>(`src/frontend/layouts/`)</small>
101
-
102
- ```html
103
- {# Bootstrap JS #}
104
- <script src="/js/bootstrap.bundle.min.js" defer></script>
105
-
106
- {# Foundation JS #}
107
- {# <script src="/js/foundation.min.js" defer></script> #}
108
-
109
- {# UIkit JS #}
110
- {# <script src="/js/uikit.min.js" defer></script> #}
111
- {# <script src="/js/uikit-icons.min.js" defer></script> #}
112
-
113
- {# Bulma — no JS needed #}
114
- ```
115
-
116
- ### 3. .eleventy.js
117
-
118
- ```javascript
119
- eleventyConfig.addPassthroughCopy({
120
- // Bootstrap
121
- "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js": "js/bootstrap.bundle.min.js",
122
- "node_modules/bootstrap-icons/font/fonts": "css/fonts",
123
-
124
- // Foundation
125
- // "node_modules/foundation-sites/dist/js/foundation.min.js": "js/foundation.min.js",
126
-
127
- // UIkit
128
- // "node_modules/uikit/dist/js/uikit.min.js": "js/uikit.min.js",
129
- // "node_modules/uikit/dist/js/uikit-icons.min.js": "js/uikit-icons.min.js",
130
-
131
- // Bulma — CSS only, no JS passthrough needed
132
- });
133
- ```
134
-
135
- ### Reducing bundle size
136
- To reduce the bundle size, open the corresponding framework file (`src/frontend/scss/modules/frameworks/`) and comment out any modules you don't need
137
- ```scss
138
- @import "bootstrap/scss/card"; // Cards
139
- @import "bootstrap/scss/carousel"; // Carousel
140
- ```
package/nginx.conf DELETED
@@ -1,69 +0,0 @@
1
- # Redirect all HTTP traffic to HTTPS
2
- server {
3
- listen 80;
4
- server_name _;
5
- return 301 https://$host$request_uri;
6
- }
7
-
8
- server {
9
- listen 443 ssl;
10
- server_name _;
11
-
12
- # SSL certificate — replace with your own paths.
13
- # Let's Encrypt default shown below; adjust the domain.
14
- ssl_certificate /etc/letsencrypt/live/your-domain/fullchain.pem;
15
- ssl_certificate_key /etc/letsencrypt/live/your-domain/privkey.pem;
16
-
17
- # Hide the nginx version from response headers
18
- server_tokens off;
19
-
20
- # Force HTTPS on future requests (applies site-wide, including /api)
21
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
22
-
23
- root /var/www/html/out;
24
- index index.html;
25
-
26
- # Disable directory listing
27
- autoindex off;
28
-
29
- error_page 403 404 /404.html;
30
- location = /404.html {
31
- internal;
32
- }
33
-
34
- # Never expose the backend source directory
35
- location ^~ /backend/ {
36
- return 404;
37
- }
38
-
39
- # Block server config files anywhere in the tree (.htaccess, web.config).
40
- # return 404 is served internally as /404.html via error_page above.
41
- location ~* (^|/)(\.htaccess|web\.config)$ {
42
- return 404;
43
- }
44
-
45
- # Block dotfiles (.git, .env, etc.)
46
- location ~ /\. {
47
- return 404;
48
- }
49
-
50
- # Route all /api/ requests to the PHP front controller.
51
- # Security headers for API responses are set by the front controller (PHP).
52
- location ^~ /api/ {
53
- try_files $uri =404;
54
- fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
55
- fastcgi_param SCRIPT_FILENAME $document_root/backend/_core/index.php;
56
- include fastcgi_params;
57
- }
58
-
59
- # Serve static files, fall back to the 404 page.
60
- # A location with add_header does not inherit server-level headers,
61
- # so Strict-Transport-Security is repeated here.
62
- location / {
63
- add_header X-Content-Type-Options "nosniff" always;
64
- add_header X-Frame-Options "SAMEORIGIN" always;
65
- add_header Referrer-Policy "strict-origin-when-cross-origin" always;
66
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
67
- try_files $uri $uri/ /404.html;
68
- }
69
- }
@@ -1,7 +0,0 @@
1
- <IfModule mod_rewrite.c>
2
- RewriteEngine On
3
- RewriteBase /api/
4
-
5
- RewriteRule ^_core/index\.php$ - [L]
6
- RewriteRule ^(.*)$ _core/index.php [QSA,L]
7
- </IfModule>
@@ -1,5 +0,0 @@
1
- {
2
- "require": {
3
- "vlucas/phpdotenv": "^5.6"
4
- }
5
- }