@styleflow.app/flowpress-deploy 1.0.0-beta.2 → 1.0.0-beta.21
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.
- package/CHANGELOG.md +116 -0
- package/README.md +5 -0
- package/containers/cms/Dockerfile +35 -0
- package/containers/cms/Dockerfile.dockerignore +20 -0
- package/containers/cms/healthz.php +17 -0
- package/containers/cms/install-languages.sh +16 -0
- package/containers/cms/mpm.conf +10 -0
- package/containers/cms/php.ini +16 -0
- package/containers/cms/sanitize-integrations.php +14 -0
- package/containers/cms/sanitize.php +37 -0
- package/containers/cms/smtp.php +13 -0
- package/containers/cms/vhost.conf +61 -0
- package/containers/cms/wp-cli.yml +1 -0
- package/containers/local/cms/Dockerfile +18 -0
- package/containers/local/cms/entrypoint.sh +7 -0
- package/containers/local/cms/php.ini +8 -0
- package/containers/local/cms/vhost.conf +14 -0
- package/containers/local/web/Dockerfile +8 -0
- package/containers/local/web/entrypoint.sh +21 -0
- package/containers/php-runtime/Dockerfile +21 -0
- package/containers/web-ssr/Dockerfile +27 -0
- package/containers/web-ssr/Dockerfile.dockerignore +10 -0
- package/containers/web-static/Caddyfile +40 -0
- package/containers/web-static/Dockerfile +17 -0
- package/containers/web-static/Dockerfile.dockerignore +7 -0
- package/dist/development.d.ts +4 -0
- package/dist/development.d.ts.map +1 -0
- package/dist/development.js +10 -0
- package/dist/development.js.map +1 -0
- package/dist/node-fetch.d.ts +3 -0
- package/dist/node-fetch.d.ts.map +1 -0
- package/dist/node-fetch.js +20 -0
- package/dist/node-fetch.js.map +1 -0
- package/dist/ops/bootstrap.d.ts +21 -0
- package/dist/ops/bootstrap.d.ts.map +1 -0
- package/dist/ops/bootstrap.js +123 -0
- package/dist/ops/bootstrap.js.map +1 -0
- package/dist/ops/build.d.ts +39 -0
- package/dist/ops/build.d.ts.map +1 -0
- package/dist/ops/build.js +110 -0
- package/dist/ops/build.js.map +1 -0
- package/dist/ops/check.d.ts +18 -0
- package/dist/ops/check.d.ts.map +1 -0
- package/dist/ops/check.js +46 -0
- package/dist/ops/check.js.map +1 -0
- package/dist/ops/cli.d.ts +3 -0
- package/dist/ops/cli.d.ts.map +1 -0
- package/dist/ops/cli.js +166 -0
- package/dist/ops/cli.js.map +1 -0
- package/dist/ops/config.d.ts +54 -0
- package/dist/ops/config.d.ts.map +1 -0
- package/dist/ops/config.js +202 -0
- package/dist/ops/config.js.map +1 -0
- package/dist/ops/coolify.d.ts +2 -0
- package/dist/ops/coolify.d.ts.map +1 -0
- package/dist/ops/coolify.js +44 -0
- package/dist/ops/coolify.js.map +1 -0
- package/dist/ops/data.d.ts +31 -0
- package/dist/ops/data.d.ts.map +1 -0
- package/dist/ops/data.js +163 -0
- package/dist/ops/data.js.map +1 -0
- package/dist/ops/deploy.d.ts +38 -0
- package/dist/ops/deploy.d.ts.map +1 -0
- package/dist/ops/deploy.js +127 -0
- package/dist/ops/deploy.js.map +1 -0
- package/dist/ops/editorial.d.ts +23 -0
- package/dist/ops/editorial.d.ts.map +1 -0
- package/dist/ops/editorial.js +79 -0
- package/dist/ops/editorial.js.map +1 -0
- package/dist/ops/environment-files.d.ts +9 -0
- package/dist/ops/environment-files.d.ts.map +1 -0
- package/dist/ops/environment-files.js +125 -0
- package/dist/ops/environment-files.js.map +1 -0
- package/dist/ops/environment.d.ts +29 -0
- package/dist/ops/environment.d.ts.map +1 -0
- package/dist/ops/environment.js +159 -0
- package/dist/ops/environment.js.map +1 -0
- package/dist/ops/health.d.ts +26 -0
- package/dist/ops/health.d.ts.map +1 -0
- package/dist/ops/health.js +27 -0
- package/dist/ops/health.js.map +1 -0
- package/dist/ops/local.d.ts +161 -0
- package/dist/ops/local.d.ts.map +1 -0
- package/dist/ops/local.js +176 -0
- package/dist/ops/local.js.map +1 -0
- package/dist/ops/monitor.d.ts +23 -0
- package/dist/ops/monitor.d.ts.map +1 -0
- package/dist/ops/monitor.js +143 -0
- package/dist/ops/monitor.js.map +1 -0
- package/dist/ops/process.d.ts +9 -0
- package/dist/ops/process.d.ts.map +1 -0
- package/dist/ops/process.js +56 -0
- package/dist/ops/process.js.map +1 -0
- package/dist/ops/provision.d.ts +41 -0
- package/dist/ops/provision.d.ts.map +1 -0
- package/dist/ops/provision.js +268 -0
- package/dist/ops/provision.js.map +1 -0
- package/dist/ops/registry.d.ts +7 -0
- package/dist/ops/registry.d.ts.map +1 -0
- package/dist/ops/registry.js +73 -0
- package/dist/ops/registry.js.map +1 -0
- package/dist/ops/release.d.ts +26 -0
- package/dist/ops/release.d.ts.map +1 -0
- package/dist/ops/release.js +79 -0
- package/dist/ops/release.js.map +1 -0
- package/dist/ops/s3.d.ts +8 -0
- package/dist/ops/s3.d.ts.map +1 -0
- package/dist/ops/s3.js +38 -0
- package/dist/ops/s3.js.map +1 -0
- package/dist/ops/static-config.d.ts +14 -0
- package/dist/ops/static-config.d.ts.map +1 -0
- package/dist/ops/static-config.js +96 -0
- package/dist/ops/static-config.js.map +1 -0
- package/flowpress-deploy.php +2 -2
- package/includes/automatic-build.php +22 -5
- package/package.json +40 -6
- package/schema/deployment.schema.json +185 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,121 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.21
|
|
4
|
+
|
|
5
|
+
- Preserve shell variables through Compose interpolation and use a variable-free PHP readiness probe. Verify the generated Compose configuration and probe syntax through the real CLI.
|
|
6
|
+
- Isolate CMS workspace dependencies and Vite caches in Docker volumes, start the StyleFlow build/watch cycle, and allow the initial Astro compilation to complete before declaring the frontend unhealthy.
|
|
7
|
+
|
|
8
|
+
## 1.0.0-beta.20
|
|
9
|
+
|
|
10
|
+
- Correct the local Apache Options directive and validate the development vhost with the real Apache server in the release gate.
|
|
11
|
+
|
|
12
|
+
## 1.0.0-beta.19
|
|
13
|
+
|
|
14
|
+
- Centralize full local development in flowpress-ops: profile-driven database, WordPress, hot-reload Astro and trusted HTTPS containers; preserve existing database volumes.
|
|
15
|
+
- Keep Docker recipes in the package and generated runtime under ignored .local. Expose local start/stop/status/logs/exec/backup/datagrip commands.
|
|
16
|
+
- Separate public HTTPS origins from internal development ports in the manifest.
|
|
17
|
+
|
|
18
|
+
## 1.0.0-beta.18
|
|
19
|
+
|
|
20
|
+
- Serialize JSON environment settings with native dotenv quoting so Node and PHP read valid frontend registries. Preserve unchanged private assignments verbatim.
|
|
21
|
+
|
|
22
|
+
## 1.0.0-beta.17
|
|
23
|
+
|
|
24
|
+
- Synchronize all four environment files and examples from the deployment manifest, preserving each environment’s private settings with protected backups. Retire legacy dev and provider variables.
|
|
25
|
+
- Prepare cached development safelists without a remote CMS scan; strict builds still regenerate content classes.
|
|
26
|
+
- Resolve explicit media origins from the selected backend, including production-backed previews.
|
|
27
|
+
|
|
28
|
+
## 1.0.0-beta.16
|
|
29
|
+
|
|
30
|
+
- Remove all persisted offload, SMTP and migration connection options from non-production clones; expose explicit integration cleanup for existing clones.
|
|
31
|
+
- Align the JSON schema with supported backend aliases.
|
|
32
|
+
|
|
33
|
+
## 1.0.0-beta.15
|
|
34
|
+
|
|
35
|
+
- Export a Node fetch adapter for media proxies: negotiate identity encoding and remove encoding metadata after automatic decompression.
|
|
36
|
+
- Verify gzip proxying against a real HTTP server.
|
|
37
|
+
|
|
38
|
+
## 1.0.0-beta.14
|
|
39
|
+
|
|
40
|
+
- Preserve provider timestamp offsets when waiting for backup completion.
|
|
41
|
+
- Report WordPress staging as staging in the administration interface.
|
|
42
|
+
- Remove disposable restore volumes after backup verification.
|
|
43
|
+
|
|
44
|
+
## 1.0.0-beta.13
|
|
45
|
+
|
|
46
|
+
- Remove disposable database volumes together with their test and transformation containers.
|
|
47
|
+
|
|
48
|
+
- Activate the shared database only for installations that publish a CMS; frontend-only and preview-only profiles need no database engine.
|
|
49
|
+
- Keep deployment history out of committed provider bindings, with a private local journal and authoritative registry metadata.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## 1.0.0-beta.12
|
|
53
|
+
|
|
54
|
+
- Keep CI on Coolify read/deploy permissions using verified environment image aliases. Derive current, rollback and promotion records from registry metadata instead of stale runner state. Provision frontend environment separately and bake SSR build identity into the image.
|
|
55
|
+
|
|
56
|
+
- Make the sanitization script executable by WP-CLI eval-file and verify its production barrier with the real CLI.
|
|
57
|
+
- Include WordPress GraphQL in CMS release health; optionally save command diagnostics in a private operator file.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## 1.0.0-beta.11
|
|
61
|
+
|
|
62
|
+
- Resolve platform server and panel references from the canonical infrastructure inventory.
|
|
63
|
+
- Reuse an existing CMS image by commit SHA; refuse ambiguous registry failures instead of overwriting a release.
|
|
64
|
+
- Verify status against the image configured in Coolify after CI deployments.
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## 1.0.0-beta.10
|
|
68
|
+
|
|
69
|
+
- Keep local HTTP origins out of remote WordPress frontend registries.
|
|
70
|
+
- Read the shared engine administrator secret from the operator configuration; never silently replace a missing pool password.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## 1.0.0-beta.9
|
|
74
|
+
|
|
75
|
+
- Keep editorial pages under /media/ available in static deployments; proxy only media files. Verify the behavior against a real Caddy runtime.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.0-beta.8
|
|
79
|
+
|
|
80
|
+
- Exclude private backup files from media snapshots and reject them before uploads. Deny HTTP access to SQL dumps and migration backup directories.
|
|
81
|
+
- Preserve existing schema backup bindings across repeated provisioning.
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
## 1.0.0-beta.7
|
|
85
|
+
|
|
86
|
+
- Preserve the local backend selection and explicit environment overrides used by isolated build fixtures. Stored environment URLs still defer to the manifest.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## 1.0.0-beta.6
|
|
90
|
+
|
|
91
|
+
- Encode MariaDB configuration for the Coolify API and preserve robot level when extending Harbor pull permissions.
|
|
92
|
+
- Retain current and previous deployment aliases without changing immutable release tags.
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## 1.0.0-beta.5 — 2026-10-19
|
|
96
|
+
|
|
97
|
+
- Use individually scoped system robots for repeatable Harbor provisioning; pass content build IDs to SSR health checks.
|
|
98
|
+
- [Canonical report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-19-piattaforma-container-flowpress.md).
|
|
99
|
+
|
|
100
|
+
## 1.0.0-beta.4 — 2026-10-19
|
|
101
|
+
|
|
102
|
+
- Add published FlowPress Ops CLI, readable deployment manifests, shared MariaDB bindings, reusable container runtimes, isolated environment loading, immutable releases, backup verification and on-demand preview.
|
|
103
|
+
- [Canonical report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-19-piattaforma-container-flowpress.md).
|
|
104
|
+
|
|
105
|
+
## Unreleased
|
|
106
|
+
|
|
107
|
+
- Agent rules only, no runtime or API change: `AGENTS.md` names the canonical
|
|
108
|
+
docs vault path (2026-10-18) and requires every published change to be
|
|
109
|
+
merged into `main`, with its branches, worktrees and stashes removed in the
|
|
110
|
+
same task.
|
|
111
|
+
[Canonical report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-19-branch-residui-e-regole-di-chiusura.md).
|
|
112
|
+
|
|
113
|
+
## 1.0.0-beta.3 — 2026-10-14
|
|
114
|
+
|
|
115
|
+
- Queue complete builds for term-only changes to published content, including withdrawal after a visibility change. Keep unchanged assignments idle and avoid private data in the queue.
|
|
116
|
+
- Verified public → private → public on disposable WordPress with all outbound HTTP intercepted.
|
|
117
|
+
- [Canonical integration report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-14-consolidamento-tessari.md).
|
|
118
|
+
|
|
3
119
|
## 1.0.0-beta.2 — 2026-10-14
|
|
4
120
|
|
|
5
121
|
- Automatic debounced editorial builds and public asset validation/history.
|
package/README.md
CHANGED
|
@@ -4,3 +4,8 @@ Official npm/Composer integration for FlowPress.
|
|
|
4
4
|
|
|
5
5
|
- [Canonical guide](https://github.com/StyleFlow-App/styleflow-docs/blob/main/wiki/flowpress-routing-deploy.md)
|
|
6
6
|
- [Release and verification report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-14-consolidamento-tessari.md)
|
|
7
|
+
|
|
8
|
+
- [Container platform and FlowPress Ops](https://github.com/StyleFlow-App/styleflow-docs/blob/main/wiki/piattaforma-container-flowpress.md)
|
|
9
|
+
|
|
10
|
+
The npm package also provides the flowpress-ops binary, reusable container
|
|
11
|
+
recipes and the ./ops/environment API. Run flowpress-ops --help for commands.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.7
|
|
2
|
+
# The reusable PHP runtime is built once by platform build-base.
|
|
3
|
+
ARG FLOWPRESS_PHP_IMAGE
|
|
4
|
+
FROM $FLOWPRESS_PHP_IMAGE AS build
|
|
5
|
+
USER root
|
|
6
|
+
RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
|
|
7
|
+
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
|
|
8
|
+
WORKDIR /srv/cms
|
|
9
|
+
COPY apps/cms/ ./
|
|
10
|
+
RUN --mount=type=secret,id=composer_auth,required=true \
|
|
11
|
+
--mount=type=cache,target=/root/.composer/cache \
|
|
12
|
+
COMPOSER_AUTH="$(cat /run/secrets/composer_auth)" \
|
|
13
|
+
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader --no-progress
|
|
14
|
+
COPY --from=flowpress /cms/install-languages.sh /usr/local/bin/install-languages
|
|
15
|
+
RUN sh /usr/local/bin/install-languages /srv/cms/web
|
|
16
|
+
ARG WP_CLI_VERSION=2.12.0
|
|
17
|
+
ARG WP_CLI_SHA256=ce34ddd838f7351d6759068d09793f26755463b4a4610a5a5c0a97b68220d85c
|
|
18
|
+
RUN curl -fsSL "https://github.com/wp-cli/wp-cli/releases/download/v$WP_CLI_VERSION/wp-cli-$WP_CLI_VERSION.phar" -o /wp-cli.phar \
|
|
19
|
+
&& echo "$WP_CLI_SHA256 /wp-cli.phar" | sha256sum -c - && chmod 755 /wp-cli.phar
|
|
20
|
+
FROM $FLOWPRESS_PHP_IMAGE
|
|
21
|
+
WORKDIR /srv/cms
|
|
22
|
+
COPY --from=build /srv/cms/ ./
|
|
23
|
+
COPY --from=build /wp-cli.phar /usr/local/bin/wp
|
|
24
|
+
COPY --from=flowpress /cms/wp-cli.yml /srv/cms/wp-cli.yml
|
|
25
|
+
COPY --from=flowpress /cms/healthz.php /srv/cms/web/healthz.php
|
|
26
|
+
COPY --from=flowpress /cms/smtp.php /usr/local/share/flowpress-smtp.php
|
|
27
|
+
RUN mkdir -p web/app/uploads web/app/webp-express web/app/cache web/app/upgrade \
|
|
28
|
+
&& chown -R www-data:www-data web/app/uploads web/app/webp-express web/app/cache web/app/upgrade \
|
|
29
|
+
&& echo 'auto_prepend_file=/usr/local/share/flowpress-smtp.php' > /usr/local/etc/php/conf.d/zz-smtp.ini
|
|
30
|
+
ARG RELEASE_SHA=unknown
|
|
31
|
+
ENV RELEASE_SHA=$RELEASE_SHA
|
|
32
|
+
LABEL org.opencontainers.image.revision=$RELEASE_SHA
|
|
33
|
+
USER www-data
|
|
34
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=5 CMD curl -fsS http://127.0.0.1:8080/healthz.php > /dev/null || exit 1
|
|
35
|
+
CMD ["apache2-foreground"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.git
|
|
2
|
+
node_modules
|
|
3
|
+
.env*
|
|
4
|
+
.secrets
|
|
5
|
+
.local
|
|
6
|
+
.styleflow
|
|
7
|
+
apps/web
|
|
8
|
+
packages
|
|
9
|
+
docs
|
|
10
|
+
apps/cms/vendor
|
|
11
|
+
apps/cms/auth.json
|
|
12
|
+
apps/cms/.env*
|
|
13
|
+
apps/cms/web/wp
|
|
14
|
+
apps/cms/web/app/plugins
|
|
15
|
+
apps/cms/web/app/uploads
|
|
16
|
+
apps/cms/web/app/webp-express
|
|
17
|
+
apps/cms/web/app/cache
|
|
18
|
+
apps/cms/web/app/upgrade
|
|
19
|
+
apps/cms/web/app/mu-plugins/flowpress-*
|
|
20
|
+
apps/cms/web/app/mu-plugins/flowpress-core
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
declare(strict_types=1);
|
|
3
|
+
header('Content-Type: application/json');
|
|
4
|
+
header('Cache-Control: no-store');
|
|
5
|
+
try {
|
|
6
|
+
define('SHORTINIT', true);
|
|
7
|
+
require __DIR__ . '/wp/wp-load.php';
|
|
8
|
+
global $wpdb;
|
|
9
|
+
$installed = $wpdb->get_var("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
|
|
10
|
+
if (!$installed || !is_readable(__DIR__ . '/app/mu-plugins/flowpress-core/flowpress-core.php')) {
|
|
11
|
+
throw new RuntimeException('CMS not initialized.');
|
|
12
|
+
}
|
|
13
|
+
echo json_encode(['status' => 'ok', 'environment' => getenv('APP_ENV'), 'release' => getenv('RELEASE_SHA')]);
|
|
14
|
+
} catch (Throwable $error) {
|
|
15
|
+
http_response_code(503);
|
|
16
|
+
echo json_encode(['status' => 'error', 'release' => getenv('RELEASE_SHA')]);
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Installs the Italian WordPress core translation matching the installed core.
|
|
3
|
+
# Languages are gitignored and DISALLOW_FILE_MODS blocks installing them at
|
|
4
|
+
# runtime, so they are part of the image.
|
|
5
|
+
set -eu
|
|
6
|
+
web_root="$1"
|
|
7
|
+
version="$(php -r "include '$web_root/wp/wp-includes/version.php'; echo \$wp_version;")"
|
|
8
|
+
package="$(curl -fsSL "https://api.wordpress.org/translations/core/1.0/?version=$version" \
|
|
9
|
+
| php -r '$d = json_decode(stream_get_contents(STDIN), true);
|
|
10
|
+
foreach ($d["translations"] ?? [] as $t) { if ($t["language"] === "it_IT") { echo $t["package"]; exit; } }
|
|
11
|
+
exit(1);')"
|
|
12
|
+
mkdir -p "$web_root/app/languages"
|
|
13
|
+
curl -fsSL "$package" -o /tmp/it_IT.zip
|
|
14
|
+
unzip -oq /tmp/it_IT.zip -d "$web_root/app/languages"
|
|
15
|
+
rm /tmp/it_IT.zip
|
|
16
|
+
echo "Installed it_IT core translation for WordPress $version."
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Sized for a 1536m container limit: 8 workers at up to 256M PHP memory each,
|
|
2
|
+
# typical WordPress requests use far less.
|
|
3
|
+
<IfModule mpm_prefork_module>
|
|
4
|
+
StartServers 2
|
|
5
|
+
MinSpareServers 2
|
|
6
|
+
MaxSpareServers 4
|
|
7
|
+
ServerLimit 8
|
|
8
|
+
MaxRequestWorkers 8
|
|
9
|
+
MaxConnectionsPerChild 500
|
|
10
|
+
</IfModule>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
expose_php = Off
|
|
2
|
+
display_errors = Off
|
|
3
|
+
log_errors = On
|
|
4
|
+
error_log = /proc/self/fd/2
|
|
5
|
+
memory_limit = 256M
|
|
6
|
+
upload_max_filesize = 64M
|
|
7
|
+
post_max_size = 68M
|
|
8
|
+
max_execution_time = 120
|
|
9
|
+
max_input_vars = 3000
|
|
10
|
+
session.save_path = /tmp
|
|
11
|
+
; Code is immutable inside the image: never stat files for changes.
|
|
12
|
+
opcache.enable = 1
|
|
13
|
+
opcache.validate_timestamps = 0
|
|
14
|
+
opcache.memory_consumption = 128
|
|
15
|
+
opcache.interned_strings_buffer = 16
|
|
16
|
+
opcache.max_accelerated_files = 20000
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
if (getenv('FLOWPRESS_RUNTIME_POLICY') !== 'container' || getenv('APP_ENV') === 'production') {
|
|
3
|
+
throw new RuntimeException('Refusing to clean integrations in production.');
|
|
4
|
+
}
|
|
5
|
+
global $wpdb;
|
|
6
|
+
$removed = 0;
|
|
7
|
+
foreach ($wpdb->get_col("SELECT option_name FROM {$wpdb->options}") as $name) {
|
|
8
|
+
if (preg_match('/^(advmo_|wp_mail_smtp|wpmdb_|wp_migrate_)/', $name)) {
|
|
9
|
+
if (delete_option($name)) {
|
|
10
|
+
$removed++;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
echo json_encode(['integrationOptionsRemoved' => $removed]) . "\n";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
// Executed only against a disposable copy, never against the source.
|
|
3
|
+
if (getenv('FLOWPRESS_RUNTIME_POLICY') !== 'container' || getenv('APP_ENV') === 'production') {
|
|
4
|
+
throw new RuntimeException('Refusing to sanitize a production database.');
|
|
5
|
+
}
|
|
6
|
+
global $wpdb;
|
|
7
|
+
foreach (get_users(['fields' => 'ID']) as $user_id) {
|
|
8
|
+
$wpdb->update($wpdb->users, ['user_pass' => wp_hash_password(wp_generate_password(64, true, true)), 'user_activation_key' => ''], ['ID' => $user_id]);
|
|
9
|
+
delete_user_meta((int) $user_id, 'session_tokens');
|
|
10
|
+
delete_user_meta((int) $user_id, '_application_passwords');
|
|
11
|
+
}
|
|
12
|
+
$plugins = get_option('active_plugins', []);
|
|
13
|
+
update_option('active_plugins', array_values(array_filter($plugins, static fn (string $plugin): bool
|
|
14
|
+
=> !preg_match('~^(advanced-media-offloader|wp-mail-smtp|wp-migrate-db-pro)/~', $plugin))));
|
|
15
|
+
require __DIR__ . '/sanitize-integrations.php';
|
|
16
|
+
foreach (['cron'] as $option) {
|
|
17
|
+
delete_option($option);
|
|
18
|
+
}
|
|
19
|
+
update_option('home', getenv('WP_HOME'));
|
|
20
|
+
update_option('siteurl', getenv('WP_SITEURL'));
|
|
21
|
+
update_option('blog_public', '0');
|
|
22
|
+
$wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'flowpress%queue%' OR option_name LIKE '%_transient_%'");
|
|
23
|
+
$attachments = get_posts(['post_type' => 'attachment', 'post_status' => 'any', 'numberposts' => -1, 'fields' => 'ids']);
|
|
24
|
+
foreach ($attachments as $id) {
|
|
25
|
+
$relative = get_post_meta($id, '_wp_attached_file', true);
|
|
26
|
+
if (is_string($relative) && $relative !== '' && !str_contains($relative, '..') && !str_contains($relative, '://')) {
|
|
27
|
+
$wpdb->update($wpdb->posts, ['guid' => rtrim(getenv('WP_HOME'), '/') . '/app/uploads/' . ltrim($relative, '/')], ['ID' => $id]);
|
|
28
|
+
}
|
|
29
|
+
foreach (array_keys(get_post_meta($id)) as $key) {
|
|
30
|
+
if (preg_match('/advmo|offload/i', $key)) delete_post_meta($id, $key);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
echo json_encode([
|
|
34
|
+
'tables' => count($wpdb->get_col($wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($wpdb->prefix) . '%'))),
|
|
35
|
+
'published' => (int) $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_status='publish'"),
|
|
36
|
+
'attachments' => count($attachments),
|
|
37
|
+
]) . "\n";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
// Runs before Bedrock without reading any project file or persisted option.
|
|
3
|
+
if (getenv('FLOWPRESS_RUNTIME_POLICY') === 'container' && getenv('FLOWPRESS_MAIL_MODE') === 'smtp' && getenv('APP_ENV') === 'production') {
|
|
4
|
+
foreach ([
|
|
5
|
+
'WPMS_ON' => true, 'WPMS_MAILER' => 'smtp',
|
|
6
|
+
'WPMS_SMTP_HOST' => getenv('SMTP_HOST'), 'WPMS_SMTP_PORT' => (int) getenv('SMTP_PORT'),
|
|
7
|
+
'WPMS_SMTP_SSL' => getenv('SMTP_ENCRYPTION'), 'WPMS_SMTP_AUTH' => true,
|
|
8
|
+
'WPMS_SMTP_USER' => getenv('SMTP_USER'), 'WPMS_SMTP_PASS' => getenv('SMTP_PASSWORD'),
|
|
9
|
+
'WPMS_MAIL_FROM' => getenv('SMTP_FROM'), 'WPMS_MAIL_FROM_NAME' => getenv('SMTP_FROM_NAME'),
|
|
10
|
+
] as $key => $value) {
|
|
11
|
+
if (!defined($key)) define($key, $value);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Apache vhost for the container CMS. .htaccess files are ignored
|
|
2
|
+
# (AllowOverride None): every rule WordPress needs is declared here.
|
|
3
|
+
<VirtualHost *:8080>
|
|
4
|
+
ServerName localhost
|
|
5
|
+
DocumentRoot /srv/cms/web
|
|
6
|
+
|
|
7
|
+
<Directory /srv/cms/web>
|
|
8
|
+
AllowOverride None
|
|
9
|
+
Options +FollowSymLinks -Indexes
|
|
10
|
+
Require all granted
|
|
11
|
+
DirectoryIndex index.php
|
|
12
|
+
|
|
13
|
+
RewriteEngine On
|
|
14
|
+
# Application Passwords (cms:template) and Bearer callbacks need the
|
|
15
|
+
# Authorization header inside PHP.
|
|
16
|
+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
17
|
+
RewriteRule ^index\.php$ - [L]
|
|
18
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
19
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
20
|
+
RewriteRule . /index.php [L]
|
|
21
|
+
</Directory>
|
|
22
|
+
|
|
23
|
+
# Uploaded files are data, never code.
|
|
24
|
+
<Directory /srv/cms/web/app/uploads>
|
|
25
|
+
<FilesMatch "(?i)\.(php[0-9]?|phtml|phar|pht|sql|sql\.gz|env|bak)$">
|
|
26
|
+
Require all denied
|
|
27
|
+
</FilesMatch>
|
|
28
|
+
</Directory>
|
|
29
|
+
<Directory /srv/cms/web/app/uploads/wp-migrate-db>
|
|
30
|
+
Require all denied
|
|
31
|
+
</Directory>
|
|
32
|
+
<FilesMatch "^\.|^(auth\.json|composer\.(json|lock)|wp-cli\.yml)$">
|
|
33
|
+
Require all denied
|
|
34
|
+
</FilesMatch>
|
|
35
|
+
<Files "xmlrpc.php">
|
|
36
|
+
Require all denied
|
|
37
|
+
</Files>
|
|
38
|
+
|
|
39
|
+
# Traefik (Docker network) sits in front; Cloudflare adds CF-Connecting-IP.
|
|
40
|
+
# Only the private proxy hop is trusted, see docs/wiki/deploy/07-sicurezza-e-accessi.md.
|
|
41
|
+
RemoteIPHeader CF-Connecting-IP
|
|
42
|
+
RemoteIPInternalProxy 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
|
|
43
|
+
SetEnvIfNoCase X-Forwarded-Proto "^https$" HTTPS=on
|
|
44
|
+
|
|
45
|
+
<IfModule mod_expires.c>
|
|
46
|
+
ExpiresActive On
|
|
47
|
+
ExpiresByType image/webp "access plus 30 days"
|
|
48
|
+
ExpiresByType image/avif "access plus 30 days"
|
|
49
|
+
ExpiresByType image/jpeg "access plus 30 days"
|
|
50
|
+
ExpiresByType image/png "access plus 30 days"
|
|
51
|
+
ExpiresByType image/svg+xml "access plus 30 days"
|
|
52
|
+
ExpiresByType font/woff2 "access plus 1 year"
|
|
53
|
+
</IfModule>
|
|
54
|
+
|
|
55
|
+
Header always set X-Content-Type-Options "nosniff"
|
|
56
|
+
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
|
57
|
+
|
|
58
|
+
LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %D" container
|
|
59
|
+
ErrorLog /proc/self/fd/2
|
|
60
|
+
CustomLog /proc/self/fd/1 container
|
|
61
|
+
</VirtualHost>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
path: web/wp
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
FROM php:8.3-apache
|
|
2
|
+
RUN apt-get update \
|
|
3
|
+
&& apt-get install -y --no-install-recommends \
|
|
4
|
+
ca-certificates default-mysql-client libicu-dev libjpeg62-turbo-dev \
|
|
5
|
+
libpng-dev libwebp-dev libzip-dev unzip webp \
|
|
6
|
+
&& docker-php-ext-configure gd --with-jpeg --with-webp \
|
|
7
|
+
&& docker-php-ext-install gd mysqli pdo_mysql intl opcache \
|
|
8
|
+
&& a2enmod rewrite headers expires remoteip \
|
|
9
|
+
&& echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf \
|
|
10
|
+
&& a2enconf servername \
|
|
11
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
12
|
+
COPY local/cms/vhost.conf /etc/apache2/sites-available/000-default.conf
|
|
13
|
+
COPY local/cms/php.ini /usr/local/etc/php/conf.d/zz-local.ini
|
|
14
|
+
COPY local/cms/entrypoint.sh /usr/local/bin/flowpress-local-cms
|
|
15
|
+
RUN chmod 755 /usr/local/bin/flowpress-local-cms
|
|
16
|
+
WORKDIR /workspace/apps/cms/web
|
|
17
|
+
ENTRYPOINT ["flowpress-local-cms"]
|
|
18
|
+
CMD ["apache2-foreground"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<VirtualHost *:80>
|
|
2
|
+
ServerName localhost
|
|
3
|
+
DocumentRoot /workspace/apps/cms/web
|
|
4
|
+
<Directory /workspace/apps/cms/web>
|
|
5
|
+
AllowOverride All
|
|
6
|
+
Options +FollowSymLinks -Indexes
|
|
7
|
+
Require all granted
|
|
8
|
+
DirectoryIndex index.php
|
|
9
|
+
</Directory>
|
|
10
|
+
RemoteIPHeader X-Forwarded-For
|
|
11
|
+
SetEnvIfNoCase X-Forwarded-Proto "^https$" HTTPS=on
|
|
12
|
+
ErrorLog /proc/self/fd/2
|
|
13
|
+
CustomLog /proc/self/fd/1 combined
|
|
14
|
+
</VirtualHost>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
FROM node:22.23.2-bookworm-slim
|
|
2
|
+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
|
|
3
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
4
|
+
&& corepack enable && corepack prepare pnpm@9.15.4 --activate
|
|
5
|
+
COPY local/web/entrypoint.sh /usr/local/bin/flowpress-local-web
|
|
6
|
+
RUN chmod 755 /usr/local/bin/flowpress-local-web
|
|
7
|
+
WORKDIR /workspace
|
|
8
|
+
ENTRYPOINT ["flowpress-local-web"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
# Linux dependencies live in Docker volumes, separate from macOS node_modules.
|
|
4
|
+
fingerprint="$(sha256sum pnpm-lock.yaml | cut -d ' ' -f 1)"
|
|
5
|
+
stamp=node_modules/.flowpress-lock
|
|
6
|
+
if [ ! -r "$stamp" ] || [ "$(cat "$stamp")" != "$fingerprint" ]; then
|
|
7
|
+
pnpm install --frozen-lockfile
|
|
8
|
+
printf '%s' "$fingerprint" > "$stamp"
|
|
9
|
+
fi
|
|
10
|
+
pnpm --if-present styleflow:build
|
|
11
|
+
pnpm --if-present components:check
|
|
12
|
+
pnpm --if-present styleflow:watch &
|
|
13
|
+
watcher=$!
|
|
14
|
+
pnpm --filter "$FLOWPRESS_WEB_PACKAGE" dev --ignore-lock &
|
|
15
|
+
frontend=$!
|
|
16
|
+
trap 'kill "$frontend" "$watcher" 2>/dev/null || true; wait || true' EXIT
|
|
17
|
+
trap 'exit 0' INT TERM
|
|
18
|
+
while kill -0 "$frontend" 2>/dev/null; do
|
|
19
|
+
sleep 1
|
|
20
|
+
done
|
|
21
|
+
exit 1
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.7
|
|
2
|
+
FROM php:8.3-apache-bookworm
|
|
3
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
4
|
+
ca-certificates curl default-mysql-client libicu-dev libjpeg62-turbo-dev \
|
|
5
|
+
libpng-dev libwebp-dev libzip-dev unzip webp \
|
|
6
|
+
&& docker-php-ext-configure gd --with-jpeg --with-webp \
|
|
7
|
+
&& docker-php-ext-install exif gd intl mysqli opcache pdo_mysql zip \
|
|
8
|
+
&& a2enmod expires headers remoteip rewrite \
|
|
9
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
10
|
+
COPY cms/vhost.conf /etc/apache2/sites-available/000-default.conf
|
|
11
|
+
COPY cms/mpm.conf /etc/apache2/mods-available/mpm_prefork.conf
|
|
12
|
+
COPY cms/php.ini /usr/local/etc/php/conf.d/zz-container.ini
|
|
13
|
+
RUN sed -i 's/^Listen 80$/Listen 8080/' /etc/apache2/ports.conf \
|
|
14
|
+
&& sed -i '/Listen 443/d' /etc/apache2/ports.conf \
|
|
15
|
+
&& echo 'ServerName localhost' > /etc/apache2/conf-available/servername.conf \
|
|
16
|
+
&& a2enconf servername \
|
|
17
|
+
&& mkdir -p /tmp/apache2 \
|
|
18
|
+
&& chown www-data:www-data /tmp/apache2 \
|
|
19
|
+
&& find / -xdev -perm /6000 -type f -exec chmod a-s {} + 2>/dev/null
|
|
20
|
+
ENV APACHE_RUN_DIR=/tmp/apache2 APACHE_PID_FILE=/tmp/apache2/apache2.pid APACHE_LOCK_DIR=/tmp/apache2
|
|
21
|
+
EXPOSE 8080
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.7
|
|
2
|
+
FROM node:22-bookworm-slim AS dependencies
|
|
3
|
+
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
|
|
4
|
+
WORKDIR /workspace
|
|
5
|
+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
|
6
|
+
COPY apps/web/package.json apps/web/package.json
|
|
7
|
+
COPY apps/cms/package.json apps/cms/package.json
|
|
8
|
+
COPY packages/ui packages/ui
|
|
9
|
+
ARG WEB_PACKAGE
|
|
10
|
+
RUN --mount=type=cache,target=/root/.local/share/pnpm/store pnpm --filter $WEB_PACKAGE --prod deploy /deploy
|
|
11
|
+
FROM node:22-bookworm-slim
|
|
12
|
+
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl \
|
|
13
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
14
|
+
&& find / -xdev -perm /6000 -type f -exec chmod a-s {} + 2>/dev/null
|
|
15
|
+
WORKDIR /srv/web
|
|
16
|
+
COPY --from=dependencies /deploy/node_modules ./node_modules
|
|
17
|
+
ARG DIST_DIR
|
|
18
|
+
COPY $DIST_DIR/ ./dist/
|
|
19
|
+
ARG RELEASE_SHA=unknown
|
|
20
|
+
ARG FRONTEND_BUILD_ID=unknown
|
|
21
|
+
ENV NODE_ENV=production HOST=0.0.0.0 PORT=8080 RELEASE_SHA=$RELEASE_SHA FRONTEND_BUILD_ID=$FRONTEND_BUILD_ID
|
|
22
|
+
LABEL org.opencontainers.image.revision=$RELEASE_SHA
|
|
23
|
+
LABEL app.flowpress.build-id=$FRONTEND_BUILD_ID
|
|
24
|
+
USER node
|
|
25
|
+
EXPOSE 8080
|
|
26
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 CMD curl -fsS http://127.0.0.1:8080/healthz.json > /dev/null || exit 1
|
|
27
|
+
CMD ["node", "dist/server/entry.mjs"]
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Static production frontend. Cloudflare terminates TLS and caches at the edge;
|
|
2
|
+
# Traefik forwards plain HTTP to port 8080.
|
|
3
|
+
{
|
|
4
|
+
admin off
|
|
5
|
+
auto_https off
|
|
6
|
+
persist_config off
|
|
7
|
+
servers {
|
|
8
|
+
trusted_proxies static private_ranges
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:8080 {
|
|
13
|
+
header X-Content-Type-Options nosniff
|
|
14
|
+
header Referrer-Policy strict-origin-when-cross-origin
|
|
15
|
+
@internal path /.container* /.flowpress* /.env* /server/*
|
|
16
|
+
respond @internal 404
|
|
17
|
+
root * /srv/site
|
|
18
|
+
encode zstd gzip
|
|
19
|
+
|
|
20
|
+
# Redirects, headers and media proxies generated from the Astro build.
|
|
21
|
+
import /srv/site/.container/routes.caddy
|
|
22
|
+
|
|
23
|
+
header /healthz.json Cache-Control "no-store"
|
|
24
|
+
header /_astro/* Cache-Control "public, max-age=31536000, immutable"
|
|
25
|
+
# HTML revalidates in browsers; Cloudflare keeps it at the edge until the
|
|
26
|
+
# deploy purge (see docs/wiki/deploy/06-cloudflare.md).
|
|
27
|
+
@html path / *.html */
|
|
28
|
+
header @html Cache-Control "public, max-age=0, must-revalidate"
|
|
29
|
+
|
|
30
|
+
file_server {
|
|
31
|
+
hide .container .flowpress-baseline.json .flowpress-fingerprint _redirects _headers _routes.json
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
handle_errors 404 {
|
|
35
|
+
header Cache-Control "no-store"
|
|
36
|
+
header CDN-Cache-Control "no-store"
|
|
37
|
+
rewrite * /404.html
|
|
38
|
+
file_server
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.7
|
|
2
|
+
FROM caddy:2.10-alpine
|
|
3
|
+
RUN apk add --no-cache libcap && setcap -r /usr/bin/caddy && apk del libcap \
|
|
4
|
+
&& find / -xdev -perm /6000 -type f -exec chmod a-s {} + 2>/dev/null
|
|
5
|
+
COPY --from=flowpress /web-static/Caddyfile /etc/caddy/Caddyfile
|
|
6
|
+
ARG DIST_DIR
|
|
7
|
+
COPY $DIST_DIR/ /srv/site/
|
|
8
|
+
RUN test -f /srv/site/.container/routes.caddy && caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
|
|
9
|
+
ARG RELEASE_SHA=unknown
|
|
10
|
+
ARG FRONTEND_BUILD_ID=unknown
|
|
11
|
+
ENV RELEASE_SHA=$RELEASE_SHA
|
|
12
|
+
LABEL org.opencontainers.image.revision=$RELEASE_SHA
|
|
13
|
+
LABEL app.flowpress.build-id=$FRONTEND_BUILD_ID
|
|
14
|
+
USER 65534:65534
|
|
15
|
+
EXPOSE 8080
|
|
16
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD wget -q -O /dev/null http://127.0.0.1:8080/healthz.json || exit 1
|
|
17
|
+
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"development.d.ts","sourceRoot":"","sources":["../src/development.js"],"names":[],"mappings":"AAIA;;EAIC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
// Development must not scan every remote WordPress route before opening the
|
|
3
|
+
// server. Strict builds still refresh the complete safelist from the CMS.
|
|
4
|
+
export function prepareDevelopmentSafelist(output, fallback) {
|
|
5
|
+
const cached = existsSync(output) && readFileSync(output, "utf8").trim();
|
|
6
|
+
if (!cached)
|
|
7
|
+
writeFileSync(output, fallback);
|
|
8
|
+
return { source: cached ? "cache" : "structural" };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=development.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"development.js","sourceRoot":"","sources":["../src/development.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAElE,4EAA4E;AAC5E,0EAA0E;AAC1E,MAAM,UAAU,0BAA0B,CAAC,MAAM,EAAE,QAAQ;IACzD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IACzE,IAAI,CAAC,MAAM;QAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-fetch.d.ts","sourceRoot":"","sources":["../src/node-fetch.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,eAAO,MAAM,cAAc,EAAE,OAAO,KAgBnC,CAAC"}
|