Compare commits
4 Commits
iblogs-boo
...
8437d62394
| Author | SHA1 | Date | |
|---|---|---|---|
| 8437d62394 | |||
| 4fced60a83 | |||
| 33fcd0d81f | |||
| f72e2d0936 |
@@ -2,6 +2,7 @@ FROM dunglas/frankenphp:1-php8.5
|
|||||||
|
|
||||||
# System Setup
|
# System Setup
|
||||||
RUN install-php-extensions mongodb zip
|
RUN install-php-extensions mongodb zip
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ARG USER=iblogs
|
ARG USER=iblogs
|
||||||
RUN useradd ${USER} && \
|
RUN useradd ${USER} && \
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
"ext-mongodb": "*",
|
"ext-mongodb": "*",
|
||||||
"ext-uri": "*",
|
"ext-uri": "*",
|
||||||
"ext-zlib": "*",
|
"ext-zlib": "*",
|
||||||
"indifferentketchup/codex": "^0.2.0",
|
"indifferentketchup/codex": "^0.3.0",
|
||||||
"mongodb/mongodb": "2.1.2"
|
"mongodb/mongodb": "2.1.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|||||||
8
composer.lock
generated
8
composer.lock
generated
@@ -4,15 +4,15 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "821a03243eb4b751e38ca3f8f063dd3e",
|
"content-hash": "c970170e823f1c31130ee1eec742a090",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "indifferentketchup/codex",
|
"name": "indifferentketchup/codex",
|
||||||
"version": "v0.2.0",
|
"version": "v0.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.indifferentketchup.com/indifferentketchup/ik-codex",
|
"url": "https://git.indifferentketchup.com/indifferentketchup/ik-codex",
|
||||||
"reference": "2bd4fe6189c21be5b1fb03e8ac23b1a3c01d747c"
|
"reference": "656142dbf8979da7d5f06908e5dd53afa1b5e56d"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.4"
|
"php": ">=8.4"
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Generic PHP log parsing and analysis framework.",
|
"description": "Generic PHP log parsing and analysis framework.",
|
||||||
"time": "2026-05-01T22:08:43+00:00"
|
"time": "2026-05-06T19:04:37+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mongodb/mongodb",
|
"name": "mongodb/mongodb",
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ services:
|
|||||||
- IBLOGS_WORKER_REQUESTS=1
|
- IBLOGS_WORKER_REQUESTS=1
|
||||||
- FRANKENPHP_WORKERS=4
|
- FRANKENPHP_WORKERS=4
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "4217:80"
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/app
|
- ../:/app
|
||||||
- ./dev.ini:/usr/local/etc/php/conf.d/dev.ini
|
- ./dev.ini:/usr/local/etc/php/conf.d/dev.ini
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ abstract class Filter implements \JsonSerializable
|
|||||||
new TrimFilter(),
|
new TrimFilter(),
|
||||||
new LimitBytesFilter(),
|
new LimitBytesFilter(),
|
||||||
new LimitLinesFilter(),
|
new LimitLinesFilter(),
|
||||||
new IPv4Filter(),
|
new ProjectZomboidRedactorFilter(),
|
||||||
new IPv6Filter(),
|
|
||||||
new UsernameFilter(),
|
new UsernameFilter(),
|
||||||
new AccessTokenFilter(),
|
new AccessTokenFilter(),
|
||||||
];
|
];
|
||||||
|
|||||||
45
src/Filter/ProjectZomboidRedactorFilter.php
Normal file
45
src/Filter/ProjectZomboidRedactorFilter.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace IndifferentKetchup\Iblogs\Filter;
|
||||||
|
|
||||||
|
use IndifferentKetchup\Codex\Util\ProjectZomboid\ProjectZomboidRedactor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save-time wrapper that delegates to codex's ProjectZomboidRedactor.
|
||||||
|
*
|
||||||
|
* Codex owns the canonical Project Zomboid PII patterns (Steam IDs, player
|
||||||
|
* names, world coordinates, plus IPv4 / IPv6 addresses with the v0.3.0
|
||||||
|
* release). This filter is the single point at which PZ-shaped PII is
|
||||||
|
* scrubbed on save; it replaces the previous IPv4Filter + IPv6Filter
|
||||||
|
* stage (whose IP-only matches left port suffixes intact) and adds the
|
||||||
|
* PZ-specific Steam ID, player-name, and coordinate redaction the generic
|
||||||
|
* filters never touched.
|
||||||
|
*
|
||||||
|
* Codex's IPv4 / IPv6 regexes are generic and apply to non-PZ pastes too;
|
||||||
|
* the PZ-specific regexes (Steam ID, player name, coords) mostly no-op on
|
||||||
|
* non-PZ content because they rely on PZ-specific anchors (`76561198`,
|
||||||
|
* the Steam-ID placeholder, `Combat:` / `Safety:` prefixes, `at` / `[`
|
||||||
|
* coord wrappers + trailing PvP verbs).
|
||||||
|
*
|
||||||
|
* Patterns are encapsulated inside the codex redactor and are not exposed
|
||||||
|
* to the client-side preview JS (`getData()` returns an empty array).
|
||||||
|
* Server-side redaction on save is the privacy guarantee; the preview is
|
||||||
|
* only a UX hint for users about what gets scrubbed.
|
||||||
|
*/
|
||||||
|
class ProjectZomboidRedactorFilter extends Filter
|
||||||
|
{
|
||||||
|
public function getType(): FilterType
|
||||||
|
{
|
||||||
|
return FilterType::REGEX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getData(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function filter(string $data): string
|
||||||
|
{
|
||||||
|
return new ProjectZomboidRedactor()->redact($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user