Compare commits
5 Commits
bf3870ccca
...
3e03f81e74
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e03f81e74 | |||
| 94326d5a19 | |||
| 6724320c9a | |||
| 8f0b067e38 | |||
| 4aeebf3732 |
@@ -3,7 +3,7 @@ FROM dunglas/frankenphp:1-php8.5
|
||||
# System Setup
|
||||
RUN install-php-extensions mongodb zip
|
||||
|
||||
ARG USER=mclogs
|
||||
ARG USER=iblogs
|
||||
RUN useradd ${USER} && \
|
||||
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp
|
||||
|
||||
@@ -20,7 +20,7 @@ RUN --mount=type=cache,target=/tmp/cache/composer \
|
||||
|
||||
# Application Setup
|
||||
COPY docker/Caddyfile /etc/frankenphp/Caddyfile
|
||||
COPY docker/mclogs.ini /usr/local/etc/php/conf.d/mclogs.ini
|
||||
COPY docker/iblogs.ini /usr/local/etc/php/conf.d/iblogs.ini
|
||||
|
||||
COPY . .
|
||||
|
||||
|
||||
42
README.md
42
README.md
@@ -13,7 +13,7 @@
|
||||
* Syntax highlighting
|
||||
* Line numbers
|
||||
* Direct links to specific lines
|
||||
* Analysis and parsing using [codex](https://github.com/aternosorg/codex-minecraft)
|
||||
* Analysis and parsing using [indifferentketchup/codex](https://git.indifferentketchup.com/indifferentketchup/ik-codex), forked from [aternos/codex-minecraft](https://github.com/aternosorg/codex-minecraft)
|
||||
|
||||
### For developers
|
||||
* Upload your logs using the API
|
||||
@@ -22,34 +22,34 @@
|
||||
* Open source and self-hostable
|
||||
|
||||
## Self-hosting
|
||||
You can self-host mclogs using Docker. A [docker image](https://github.com/aternosorg/mclogs/pkgs/container/mclogs) is available in the GitHub Container Registry: `ghcr.io/aternosorg/mclogs`.
|
||||
A MongoDB instance is also required to run mclogs.
|
||||
You can self-host iblogs using Docker. A [docker image](https://github.com/indifferentketchup/iblogs/pkgs/container/iblogs) is available in the GitHub Container Registry: `ghcr.io/indifferentketchup/iblogs`.
|
||||
A MongoDB instance is also required to run iblogs.
|
||||
|
||||
An example docker compose files for self-hosting can be found here: [docker/compose.production.yaml](docker/compose.production.yaml).
|
||||
|
||||
### Config
|
||||
You can configure mclogs by creating a `config.json` file in the root directory, see [example.config.json](example.config.json) or by setting
|
||||
You can configure iblogs by creating a `config.json` file in the root directory, see [example.config.json](example.config.json) or by setting
|
||||
environment variables. Environment variables override settings in the config file.
|
||||
|
||||
Here is a list of all available config options:
|
||||
|
||||
| Variable / JSON Path | Default | Description |
|
||||
|:--------------------------------------------------------------------|:--------------------|:--------------------------------------------|
|
||||
| `MCLOGS_STORAGE_TTL` <br> `storage.ttl` | `7776000` (90d) | Time until logs are deleted after last view |
|
||||
| `MCLOGS_STORAGE_LIMIT_BYTES` <br> `storage.limit.bytes` | `10485760` (10 MiB) | Maximum size of a log in bytes |
|
||||
| `MCLOGS_STORAGE_LIMIT_LINES` <br> `storage.limit.lines` | `25000` | Maximum number of lines in a log |
|
||||
| `MCLOGS_MONGODB_URL` <br> `mongodb.url` | `"mongodb://mongo"` | MongoDB connection URL |
|
||||
| `MCLOGS_MONGODB_DATABASE` <br> `mongodb.database` | `"mclogs"` | Name of the MongoDB database |
|
||||
| `MCLOGS_ID_LENGTH` <br> `id.length` | `7` | The default length for new IDs |
|
||||
| `MCLOGS_LEGAL_ABUSE` <br> `legal.abuse` | `null` | Public email address to report abuse |
|
||||
| `MCLOGS_LEGAL_IMPRINT` <br> `legal.imprint` | `null` | The imprint URL |
|
||||
| `MCLOGS_LEGAL_PRIVACY` <br> `legal.privacy` | `null` | The privacy policy URL |
|
||||
| `MCLOGS_FRONTEND_NAME` <br> `frontend.name` | `null` | Instance name (defaults to domain) |
|
||||
| `MCLOGS_FRONTEND_COLOR_ACCENT` <br> `frontend.color.accent` | `#5cb85c` | The accent/primary color |
|
||||
| `MCLOGS_FRONTEND_COLOR_BACKGROUND` <br> `frontend.color.background` | `#1a1a1a` | The background color |
|
||||
| `MCLOGS_FRONTEND_COLOR_TEXT` <br> `frontend.color.text` | `#e8e8e8` | The text color |
|
||||
| `MCLOGS_FRONTEND_COLOR_ERROR` <br> `frontend.color.error` | `#f62451` | The error color |
|
||||
| `MCLOGS_WORKER_REQUESTS` <br> `worker.requests` | `500` | Max requests per single worker |
|
||||
| `IBLOGS_STORAGE_TTL` <br> `storage.ttl` | `7776000` (90d) | Time until logs are deleted after last view |
|
||||
| `IBLOGS_STORAGE_LIMIT_BYTES` <br> `storage.limit.bytes` | `10485760` (10 MiB) | Maximum size of a log in bytes |
|
||||
| `IBLOGS_STORAGE_LIMIT_LINES` <br> `storage.limit.lines` | `25000` | Maximum number of lines in a log |
|
||||
| `IBLOGS_MONGODB_URL` <br> `mongodb.url` | `"mongodb://mongo"` | MongoDB connection URL |
|
||||
| `IBLOGS_MONGODB_DATABASE` <br> `mongodb.database` | `"iblogs"` | Name of the MongoDB database |
|
||||
| `IBLOGS_ID_LENGTH` <br> `id.length` | `7` | The default length for new IDs |
|
||||
| `IBLOGS_LEGAL_ABUSE` <br> `legal.abuse` | `null` | Public email address to report abuse |
|
||||
| `IBLOGS_LEGAL_IMPRINT` <br> `legal.imprint` | `null` | The imprint URL |
|
||||
| `IBLOGS_LEGAL_PRIVACY` <br> `legal.privacy` | `null` | The privacy policy URL |
|
||||
| `IBLOGS_FRONTEND_NAME` <br> `frontend.name` | `null` | Instance name (defaults to domain) |
|
||||
| `IBLOGS_FRONTEND_COLOR_ACCENT` <br> `frontend.color.accent` | `#5cb85c` | The accent/primary color |
|
||||
| `IBLOGS_FRONTEND_COLOR_BACKGROUND` <br> `frontend.color.background` | `#1a1a1a` | The background color |
|
||||
| `IBLOGS_FRONTEND_COLOR_TEXT` <br> `frontend.color.text` | `#e8e8e8` | The text color |
|
||||
| `IBLOGS_FRONTEND_COLOR_ERROR` <br> `frontend.color.error` | `#f62451` | The error color |
|
||||
| `IBLOGS_WORKER_REQUESTS` <br> `worker.requests` | `500` | Max requests per single worker |
|
||||
|
||||
There are a few more environment variables that can be set to modify the FrankenPHP/Caddy setup directly:
|
||||
|
||||
@@ -69,10 +69,10 @@ There are a few more environment variables that can be set to modify the Franken
|
||||
### Installation
|
||||
```bash
|
||||
# clone repository
|
||||
git clone git@github.com:aternosorg/mclogs.git
|
||||
git clone git@github.com:indifferentketchup/iblogs.git
|
||||
|
||||
# install composer dependencies
|
||||
cd mclogs
|
||||
cd iblogs
|
||||
composer install
|
||||
|
||||
# start development environment
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
\Aternos\Mclogs\Frontend\Assets\AssetLoader::getInstance()->writeCache();
|
||||
\IndifferentKetchup\Iblogs\Frontend\Assets\AssetLoader::getInstance()->writeCache();
|
||||
@@ -1,10 +1,16 @@
|
||||
{
|
||||
"name": "aternos/mclogs",
|
||||
"description": "Paste, share and analyse Minecraft logs",
|
||||
"name": "indifferentketchup/iblogs",
|
||||
"description": "Paste, share, and analyse game-server logs.",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Matthias Neid",
|
||||
"email": "matthias@aternos.org"
|
||||
"name": "indifferentketchup",
|
||||
"email": "samkintop@gmail.com"
|
||||
}
|
||||
],
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://git.indifferentketchup.com/indifferentketchup/ik-codex"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
@@ -15,14 +21,12 @@
|
||||
"ext-mongodb": "*",
|
||||
"ext-uri": "*",
|
||||
"ext-zlib": "*",
|
||||
"aternos/codex-hytale": "^2.0",
|
||||
"aternos/codex-minecraft": "^5.0.1",
|
||||
"aternos/sherlock": "^1.0.2",
|
||||
"indifferentketchup/codex": "^0.2.0",
|
||||
"mongodb/mongodb": "2.1.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Aternos\\Mclogs\\": "src/"
|
||||
"IndifferentKetchup\\Iblogs\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
184
composer.lock
generated
184
composer.lock
generated
@@ -4,21 +4,15 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "a570f76a4698742115ca4d1d4113a836",
|
||||
"content-hash": "821a03243eb4b751e38ca3f8f063dd3e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aternos/codex",
|
||||
"version": "v4.1.0",
|
||||
"name": "indifferentketchup/codex",
|
||||
"version": "v0.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aternosorg/codex.git",
|
||||
"reference": "2d0b1930464d9c5129e90c5e69314b1da22c7c4a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aternosorg/codex/zipball/2d0b1930464d9c5129e90c5e69314b1da22c7c4a",
|
||||
"reference": "2d0b1930464d9c5129e90c5e69314b1da22c7c4a",
|
||||
"shasum": ""
|
||||
"url": "https://git.indifferentketchup.com/indifferentketchup/ik-codex",
|
||||
"reference": "2bd4fe6189c21be5b1fb03e8ac23b1a3c01d747c"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.4"
|
||||
@@ -29,161 +23,31 @@
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Aternos\\Codex\\": "src/"
|
||||
"IndifferentKetchup\\Codex\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Matthias Neid",
|
||||
"email": "matthias@aternos.org"
|
||||
}
|
||||
],
|
||||
"description": "PHP library to read, parse, print and analyse log files.",
|
||||
"support": {
|
||||
"issues": "https://github.com/aternosorg/codex/issues",
|
||||
"source": "https://github.com/aternosorg/codex/tree/v4.1.0"
|
||||
},
|
||||
"time": "2026-01-21T14:12:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "aternos/codex-hytale",
|
||||
"version": "v2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aternosorg/codex-hytale.git",
|
||||
"reference": "9b48e2d0fa4b82a3f10c8833a766b7e76e233271"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aternosorg/codex-hytale/zipball/9b48e2d0fa4b82a3f10c8833a766b7e76e233271",
|
||||
"reference": "9b48e2d0fa4b82a3f10c8833a766b7e76e233271",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"aternos/codex": "^v4.1.0",
|
||||
"ext-json": "*",
|
||||
"php": ">=8.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^12.4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Aternos\\Codex\\Hytale\\": "src/"
|
||||
"IndifferentKetchup\\Codex\\Test\\Src\\": "test/src/",
|
||||
"IndifferentKetchup\\Codex\\Test\\Tests\\": "test/tests/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"scripts": {
|
||||
"test": [
|
||||
"phpunit test/tests"
|
||||
]
|
||||
},
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Matthias",
|
||||
"email": "matthias@aternos.org"
|
||||
"name": "indifferentketchup",
|
||||
"email": "samkintop@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP library to read, parse, print and analyse Hytale log files.",
|
||||
"support": {
|
||||
"issues": "https://github.com/aternosorg/codex-hytale/issues",
|
||||
"source": "https://github.com/aternosorg/codex-hytale/tree/v2.0.0"
|
||||
},
|
||||
"time": "2026-01-23T12:25:09+00:00"
|
||||
},
|
||||
{
|
||||
"name": "aternos/codex-minecraft",
|
||||
"version": "v5.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aternosorg/codex-minecraft.git",
|
||||
"reference": "f921d0277449af04a72c3dbb784e37b5fa4934b1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aternosorg/codex-minecraft/zipball/f921d0277449af04a72c3dbb784e37b5fa4934b1",
|
||||
"reference": "f921d0277449af04a72c3dbb784e37b5fa4934b1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"aternos/codex": "^v4.1.0",
|
||||
"ext-json": "*",
|
||||
"php": ">=8.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^12"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Aternos\\Codex\\Minecraft\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Matthias",
|
||||
"email": "matthias@aternos.org"
|
||||
}
|
||||
],
|
||||
"description": "PHP library to read, parse, print and analyse Minecraft log files.",
|
||||
"support": {
|
||||
"issues": "https://github.com/aternosorg/codex-minecraft/issues",
|
||||
"source": "https://github.com/aternosorg/codex-minecraft/tree/v5.1.0"
|
||||
},
|
||||
"time": "2026-03-30T18:21:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "aternos/sherlock",
|
||||
"version": "v1.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aternosorg/sherlock.git",
|
||||
"reference": "2bfb6427790b24df860f20905b76f09978a7df3a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aternosorg/sherlock/zipball/2bfb6427790b24df860f20905b76f09978a7df3a",
|
||||
"reference": "2bfb6427790b24df860f20905b76f09978a7df3a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"ext-simplexml": "*",
|
||||
"ext-zlib": "*",
|
||||
"php": ">=8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Aternos\\Sherlock\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Julian Vennen",
|
||||
"email": "julian@aternos.org"
|
||||
}
|
||||
],
|
||||
"description": "PHP library to apply minecraft mappings to log files",
|
||||
"support": {
|
||||
"issues": "https://github.com/aternosorg/sherlock/issues",
|
||||
"source": "https://github.com/aternosorg/sherlock/tree/v1.1.3"
|
||||
},
|
||||
"time": "2026-02-09T10:37:21+00:00"
|
||||
"description": "Generic PHP log parsing and analysis framework.",
|
||||
"time": "2026-05-01T22:08:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mongodb/mongodb",
|
||||
@@ -314,16 +178,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php85",
|
||||
"version": "v1.33.0",
|
||||
"version": "v1.37.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php85.git",
|
||||
"reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91"
|
||||
"reference": "fcfa4973a9917cef23f2e38774da74a2b7d115ee"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91",
|
||||
"reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/fcfa4973a9917cef23f2e38774da74a2b7d115ee",
|
||||
"reference": "fcfa4973a9917cef23f2e38774da74a2b7d115ee",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -370,7 +234,7 @@
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php85/tree/v1.33.0"
|
||||
"source": "https://github.com/symfony/polyfill-php85/tree/v1.37.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -390,7 +254,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-06-23T16:12:55+00:00"
|
||||
"time": "2026-04-26T13:10:57+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
name: "mclogs"
|
||||
name: "iblogs"
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ./Dockerfile
|
||||
environment:
|
||||
- MCLOGS_WORKER_REQUESTS=1
|
||||
- IBLOGS_WORKER_REQUESTS=1
|
||||
- FRANKENPHP_WORKERS=4
|
||||
ports:
|
||||
- "80:80"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
web:
|
||||
image: ghcr.io/aternosorg/mclogs:2
|
||||
image: ghcr.io/indifferentketchup/iblogs:2
|
||||
restart: always
|
||||
ports:
|
||||
# Expose HTTP (80) and HTTPS (443)
|
||||
@@ -9,16 +9,16 @@ services:
|
||||
- "443:443"
|
||||
- "443:443/udp"
|
||||
environment:
|
||||
# Set this to your domain (e.g., mclogs.example.com) to enable Auto-SSL.
|
||||
# Set this to your domain (e.g., iblogs.example.com) to enable Auto-SSL.
|
||||
# If running behind a proxy (Cloudflare/Nginx), set to ":80" to disable Auto-SSL.
|
||||
SERVER_NAME: :80
|
||||
|
||||
MCLOGS_MONGODB_URL: mongodb://mongo:27017
|
||||
MCLOGS_MONGODB_DATABASE: mclogs
|
||||
IBLOGS_MONGODB_URL: mongodb://mongo:27017
|
||||
IBLOGS_MONGODB_DATABASE: iblogs
|
||||
|
||||
# Optional MCLOGS configuration
|
||||
# Optional IBLOGS configuration
|
||||
# See README.md for full list of available options
|
||||
# MCLOGS_FRONTEND_NAME: "mclogs"
|
||||
# IBLOGS_FRONTEND_NAME: "iblogs"
|
||||
|
||||
volumes:
|
||||
# For caddy cache (SSL certificates)
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
},
|
||||
"mongodb": {
|
||||
"url": "mongodb://127.0.0.1:27017",
|
||||
"database": "mclogs"
|
||||
"database": "iblogs"
|
||||
},
|
||||
"id": {
|
||||
"length": 7
|
||||
},
|
||||
"legal": {
|
||||
"abuse": "abuse@aternos.org",
|
||||
"imprint": "https://aternos.gmbh/imprint/",
|
||||
"privacy": "https://aternos.gmbh/en/mclogs/privacy"
|
||||
"abuse": "samkintop@gmail.com",
|
||||
"imprint": "https://indifferentketchup.com/imprint",
|
||||
"privacy": "https://indifferentketchup.com/iblogs/privacy"
|
||||
},
|
||||
"frontend": {
|
||||
"name": "mclo.gs",
|
||||
"name": "iblogs.example",
|
||||
"assets": {
|
||||
"integrity": true
|
||||
},
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\LogContentParser;
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\CodexLogResponse;
|
||||
use Aternos\Mclogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Api\LogContentParser;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\CodexLogResponse;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
|
||||
class AnalyseLogAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\ContentParser;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Router\Action;
|
||||
use IndifferentKetchup\Iblogs\Api\ContentParser;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Router\Action;
|
||||
|
||||
abstract class ApiAction extends Action
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\ContentParser;
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\MultiResponse;
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Storage\MongoDBClient;
|
||||
use IndifferentKetchup\Iblogs\Api\ContentParser;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\MultiResponse;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Storage\MongoDBClient;
|
||||
|
||||
class BulkDeleteLogsAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\LogContentParser;
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\LogResponse;
|
||||
use Aternos\Mclogs\Data\MetadataEntry;
|
||||
use Aternos\Mclogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Api\LogContentParser;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\LogResponse;
|
||||
use IndifferentKetchup\Iblogs\Data\MetadataEntry;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
|
||||
class CreateLogAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class DeleteLogAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Router\Action;
|
||||
use IndifferentKetchup\Iblogs\Router\Action;
|
||||
|
||||
class EmptyAction extends Action
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
|
||||
class EndpointNotFoundAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\FiltersResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\FiltersResponse;
|
||||
|
||||
class GetFiltersAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\LimitsResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\LimitsResponse;
|
||||
|
||||
class GetLimitsAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\LogResponse;
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\LogResponse;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class LogInfoAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\CodexLogResponse;
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\CodexLogResponse;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class LogInsightsAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
|
||||
class RateLimitErrorAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Action;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\RawLogResponse;
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\RawLogResponse;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class RawLogAction extends ApiAction
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api;
|
||||
namespace IndifferentKetchup\Iblogs\Api;
|
||||
|
||||
use Aternos\Mclogs\Router\Router;
|
||||
use Aternos\Mclogs\Frontend;
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Router\Method;
|
||||
use IndifferentKetchup\Iblogs\Router\Router;
|
||||
use IndifferentKetchup\Iblogs\Frontend;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Router\Method;
|
||||
|
||||
class ApiRouter extends Router
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api;
|
||||
namespace IndifferentKetchup\Iblogs\Api;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
|
||||
/**
|
||||
* Utility class for reading log content from the http request
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api;
|
||||
namespace IndifferentKetchup\Iblogs\Api;
|
||||
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
|
||||
class LogContentParser extends ContentParser
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
class ApiError extends ApiResponse
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
class ApiResponse implements \JsonSerializable
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
use Aternos\Codex\Log\LogInterface;
|
||||
use IndifferentKetchup\Codex\Log\LogInterface;
|
||||
|
||||
class CodexLogResponse extends ApiResponse
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
use Aternos\Mclogs\Filter\Filter;
|
||||
use IndifferentKetchup\Iblogs\Filter\Filter;
|
||||
|
||||
class FiltersResponse extends ApiResponse
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
|
||||
class LimitsResponse extends ApiResponse
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class LogResponse extends ApiResponse
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
class MultiResponse extends ApiResponse
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Api\Response;
|
||||
namespace IndifferentKetchup\Iblogs\Api\Response;
|
||||
|
||||
use Aternos\Mclogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
|
||||
class RawLogResponse extends ApiResponse
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Cache;
|
||||
namespace IndifferentKetchup\Iblogs\Cache;
|
||||
|
||||
use Aternos\Mclogs\Storage\MongoDBClient;
|
||||
use IndifferentKetchup\Iblogs\Storage\MongoDBClient;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
|
||||
class CacheEntry
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Config;
|
||||
namespace IndifferentKetchup\Iblogs\Config;
|
||||
|
||||
use Aternos\Mclogs\Util\Singleton;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Util\Singleton;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class Config
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Config;
|
||||
namespace IndifferentKetchup\Iblogs\Config;
|
||||
|
||||
enum ConfigKey
|
||||
{
|
||||
@@ -40,7 +40,7 @@ enum ConfigKey
|
||||
ConfigKey::STORAGE_LIMIT_LINES => 25000,
|
||||
|
||||
ConfigKey::MONGODB_URL => 'mongodb://mongo:27017',
|
||||
ConfigKey::MONGODB_DATABASE => 'mclogs',
|
||||
ConfigKey::MONGODB_DATABASE => 'iblogs',
|
||||
|
||||
ConfigKey::ID_LENGTH => 7,
|
||||
|
||||
@@ -66,7 +66,7 @@ enum ConfigKey
|
||||
*/
|
||||
public function getEnvironmentVariable(): string
|
||||
{
|
||||
return "MCLOGS_" . $this->name;
|
||||
return "IBLOGS_" . $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Data;
|
||||
namespace IndifferentKetchup\Iblogs\Data;
|
||||
|
||||
use Aternos\Codex\Analysis\Information;
|
||||
use Aternos\Codex\Log\AnalysableLog;
|
||||
use Aternos\Codex\Log\LogInterface;
|
||||
use Aternos\Codex\Minecraft\Analysis\Information\Vanilla\VanillaVersionInformation;
|
||||
use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\Fabric\FabricLog;
|
||||
use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaClientLog;
|
||||
use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaCrashReportLog;
|
||||
use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaLog;
|
||||
use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaNetworkProtocolErrorReportLog;
|
||||
use Aternos\Codex\Minecraft\Log\Minecraft\Vanilla\VanillaServerLog;
|
||||
use Aternos\Mclogs\Cache\CacheEntry;
|
||||
use Aternos\Sherlock\MapLocator\FabricMavenMapLocator;
|
||||
use Aternos\Sherlock\MapLocator\LauncherMetaMapLocator;
|
||||
use Aternos\Sherlock\Maps\GZURLYarnMap;
|
||||
use Aternos\Sherlock\Maps\ObfuscationMap;
|
||||
use Aternos\Sherlock\Maps\URLVanillaObfuscationMap;
|
||||
use Aternos\Sherlock\Maps\VanillaObfuscationMap;
|
||||
use Aternos\Sherlock\Maps\YarnMap;
|
||||
use Aternos\Sherlock\ObfuscatedString;
|
||||
use Exception;
|
||||
use IndifferentKetchup\Codex\Log\LogInterface;
|
||||
|
||||
/**
|
||||
* Stub for v1 — `mclogs` used `aternos/sherlock` plus the Vanilla / Fabric
|
||||
* Minecraft codex log subclasses to deobfuscate Mojang and Yarn mappings
|
||||
* in stack traces. iblogs targets Project Zomboid, which uses no such
|
||||
* mapping scheme, so the deobfuscator is a no-op until iblogs gains
|
||||
* Minecraft support.
|
||||
*
|
||||
* Restore the original mapping flow (Sherlock map locators + obfuscation
|
||||
* maps) when re-introducing Minecraft logs. The historical implementation
|
||||
* lives in mclogs upstream commits prior to the iblogs fork.
|
||||
*/
|
||||
class Deobfuscator
|
||||
{
|
||||
public function __construct(protected LogInterface $codexLog)
|
||||
@@ -31,108 +23,6 @@ class Deobfuscator
|
||||
|
||||
public function deobfuscate(): ?string
|
||||
{
|
||||
if (!$this->codexLog instanceof AnalysableLog) {
|
||||
return null;
|
||||
}
|
||||
if (!$this->codexLog instanceof VanillaLog) {
|
||||
return null;
|
||||
}
|
||||
$analysis = $this->codexLog->analyse();
|
||||
|
||||
/**
|
||||
* @var ?Information $version
|
||||
*/
|
||||
$version = $analysis->getFilteredInsights(VanillaVersionInformation::class)[0] ?? null;
|
||||
if (!$version) {
|
||||
return null;
|
||||
}
|
||||
$version = $version->getValue();
|
||||
|
||||
try {
|
||||
$map = $this->getObfuscationMap($version);
|
||||
} catch (Exception) {
|
||||
$map = null;
|
||||
}
|
||||
|
||||
if ($map === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$obfuscatedContent = new ObfuscatedString($this->codexLog->getLogFile()->getContent(), $map);
|
||||
if ($content = $obfuscatedContent->getMappedContent()) {
|
||||
return $content;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the obfuscation map matching this log
|
||||
*
|
||||
* @param $version
|
||||
* @return ObfuscationMap|null
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function getObfuscationMap($version): ?ObfuscationMap
|
||||
{
|
||||
if (in_array(get_class($this->codexLog), [
|
||||
VanillaServerLog::class,
|
||||
VanillaClientLog::class,
|
||||
VanillaCrashReportLog::class,
|
||||
VanillaNetworkProtocolErrorReportLog::class
|
||||
])) {
|
||||
$urlCache = new CacheEntry("sherlock:vanilla:$version:client");
|
||||
|
||||
$mapURL = $urlCache->get();
|
||||
if (!$mapURL) {
|
||||
$mapURL = new LauncherMetaMapLocator($version, "client")->findMappingURL();
|
||||
|
||||
if (!$mapURL) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$urlCache->set($mapURL, 30 * 24 * 60 * 60);
|
||||
}
|
||||
|
||||
try {
|
||||
$mapCache = new CacheEntry("sherlock:$mapURL");
|
||||
if ($mapContent = $mapCache->get()) {
|
||||
$map = new VanillaObfuscationMap($mapContent);
|
||||
} else {
|
||||
$map = new URLVanillaObfuscationMap($mapURL);
|
||||
$mapCache->set($map->getContent());
|
||||
}
|
||||
} catch (Exception) {
|
||||
}
|
||||
return $map ?? null;
|
||||
}
|
||||
|
||||
if ($this->codexLog instanceof FabricLog) {
|
||||
$urlCache = new CacheEntry("sherlock:yarn:$version:server");
|
||||
|
||||
$mapURL = $urlCache->get();
|
||||
if (!$mapURL) {
|
||||
$mapURL = new FabricMavenMapLocator($version)->findMappingURL();
|
||||
|
||||
if (!$mapURL) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$urlCache->set($mapURL, 24 * 60 * 60);
|
||||
}
|
||||
|
||||
try {
|
||||
$mapCache = new CacheEntry("sherlock:$mapURL");
|
||||
if ($mapContent = $mapCache->get()) {
|
||||
$map = new YarnMap($mapContent);
|
||||
} else {
|
||||
$map = new GZURLYarnMap($mapURL);
|
||||
$mapCache->set($map->getContent());
|
||||
}
|
||||
} catch (Exception) {
|
||||
}
|
||||
return $map ?? null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Data;
|
||||
namespace IndifferentKetchup\Iblogs\Data;
|
||||
|
||||
use MongoDB\BSON\Serializable;
|
||||
use MongoDB\Model\BSONDocument;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Data;
|
||||
namespace IndifferentKetchup\Iblogs\Data;
|
||||
|
||||
use Random\RandomException;
|
||||
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs;
|
||||
namespace IndifferentKetchup\Iblogs;
|
||||
|
||||
use Aternos\Codex\Minecraft\Log\Minecraft\MinecraftLog;
|
||||
use IndifferentKetchup\Codex\Detective\ProjectZomboid\ProjectZomboidDetective;
|
||||
|
||||
class Detective extends \Aternos\Codex\Detective\Detective
|
||||
class Detective extends \IndifferentKetchup\Codex\Detective\Detective
|
||||
{
|
||||
protected string $defaultLogClass = MinecraftLog::class;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->addDetective(new \Aternos\Codex\Minecraft\Detective\Detective())
|
||||
->addDetective(new \Aternos\Codex\Hytale\Detective\Detective());
|
||||
$this->addDetective(new ProjectZomboidDetective());
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
use Aternos\Mclogs\Filter\Pattern\PatternWithReplacement;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\PatternWithReplacement;
|
||||
|
||||
class AccessTokenFilter extends RegexFilter
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
abstract class Filter implements \JsonSerializable
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
enum FilterType: string
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
use Aternos\Mclogs\Filter\Pattern\Pattern;
|
||||
use Aternos\Mclogs\Filter\Pattern\PatternWithReplacement;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\Pattern;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\PatternWithReplacement;
|
||||
|
||||
class IPv4Filter extends RegexFilter
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
use Aternos\Mclogs\Filter\Pattern\Pattern;
|
||||
use Aternos\Mclogs\Filter\Pattern\PatternWithReplacement;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\Pattern;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\PatternWithReplacement;
|
||||
|
||||
class IPv6Filter extends RegexFilter
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
|
||||
class LimitBytesFilter extends Filter
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
|
||||
class LimitLinesFilter extends Filter
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter\Pattern;
|
||||
namespace IndifferentKetchup\Iblogs\Filter\Pattern;
|
||||
|
||||
/**
|
||||
* https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter\Pattern;
|
||||
namespace IndifferentKetchup\Iblogs\Filter\Pattern;
|
||||
|
||||
class Pattern implements \JsonSerializable
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter\Pattern;
|
||||
namespace IndifferentKetchup\Iblogs\Filter\Pattern;
|
||||
|
||||
class PatternWithReplacement extends Pattern
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
use Aternos\Mclogs\Filter\Pattern\Pattern;
|
||||
use Aternos\Mclogs\Filter\Pattern\PatternWithReplacement;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\Pattern;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\PatternWithReplacement;
|
||||
|
||||
abstract class RegexFilter extends Filter
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
class TrimFilter extends Filter
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Filter;
|
||||
namespace IndifferentKetchup\Iblogs\Filter;
|
||||
|
||||
use Aternos\Mclogs\Filter\Pattern\PatternWithReplacement;
|
||||
use IndifferentKetchup\Iblogs\Filter\Pattern\PatternWithReplacement;
|
||||
|
||||
class UsernameFilter extends RegexFilter
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Action;
|
||||
|
||||
use Aternos\Mclogs\Router\Action;
|
||||
use IndifferentKetchup\Iblogs\Router\Action;
|
||||
|
||||
class ApiDocsAction extends Action
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Action;
|
||||
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class CreateLogAction extends \Aternos\Mclogs\Api\Action\CreateLogAction
|
||||
class CreateLogAction extends \IndifferentKetchup\Iblogs\Api\Action\CreateLogAction
|
||||
{
|
||||
protected bool $includeCookie = true;
|
||||
protected bool $includeToken = false;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Action;
|
||||
|
||||
use Aternos\Mclogs\Frontend\Cookie\TokenCookie;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Cookie\TokenCookie;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class DeleteLogAction extends \Aternos\Mclogs\Api\Action\DeleteLogAction
|
||||
class DeleteLogAction extends \IndifferentKetchup\Iblogs\Api\Action\DeleteLogAction
|
||||
{
|
||||
protected function getAllowedOrigin(): string
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Action;
|
||||
|
||||
use Aternos\Mclogs\Router\Action;
|
||||
use IndifferentKetchup\Iblogs\Router\Action;
|
||||
|
||||
class FaviconAction extends Action
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Action;
|
||||
|
||||
use Aternos\Mclogs\Router\Action;
|
||||
use IndifferentKetchup\Iblogs\Router\Action;
|
||||
|
||||
class NotFoundAction extends Action
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Action;
|
||||
|
||||
use Aternos\Mclogs\Router\Action;
|
||||
use IndifferentKetchup\Iblogs\Router\Action;
|
||||
|
||||
class StartAction extends Action
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Action;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Action;
|
||||
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Router\Action;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Router\Action;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class ViewLogAction extends Action
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Assets;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Assets;
|
||||
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
|
||||
class Asset implements \JsonSerializable
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Assets;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Assets;
|
||||
|
||||
use Aternos\Mclogs\Util\Singleton;
|
||||
use IndifferentKetchup\Iblogs\Util\Singleton;
|
||||
|
||||
class AssetLoader
|
||||
{
|
||||
@@ -90,7 +90,7 @@ class AssetLoader
|
||||
public function writeCache(): void
|
||||
{
|
||||
$assets = [
|
||||
new Asset(AssetType::CSS, "css/mclogs.css"),
|
||||
new Asset(AssetType::CSS, "css/iblogs.css"),
|
||||
new Asset(AssetType::JS, "js/start.js"),
|
||||
new Asset(AssetType::JS, "js/log.js"),
|
||||
new Asset(AssetType::CSS, "vendor/fontawesome/css/fontawesome.min.css")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Assets;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Assets;
|
||||
|
||||
enum AssetType: string
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Cookie;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Cookie;
|
||||
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
abstract class Cookie
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Cookie;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Cookie;
|
||||
|
||||
class SettingsCookie extends Cookie
|
||||
{
|
||||
@@ -9,6 +9,6 @@ class SettingsCookie extends Cookie
|
||||
*/
|
||||
protected function getKey(): string
|
||||
{
|
||||
return "MCLOGS_SETTINGS";
|
||||
return "IBLOGS_SETTINGS";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Cookie;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Cookie;
|
||||
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use Aternos\Mclogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
|
||||
class TokenCookie extends Cookie
|
||||
{
|
||||
@@ -23,7 +23,7 @@ class TokenCookie extends Cookie
|
||||
*/
|
||||
protected function getKey(): string
|
||||
{
|
||||
return "MCLOGS_LOG_TOKEN";
|
||||
return "IBLOGS_LOG_TOKEN";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend;
|
||||
|
||||
use Aternos\Mclogs\Router\Router;
|
||||
use Aternos\Mclogs\Id;
|
||||
use Aternos\Mclogs\Router\Method;
|
||||
use IndifferentKetchup\Iblogs\Router\Router;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
use IndifferentKetchup\Iblogs\Router\Method;
|
||||
|
||||
class FrontendRouter extends Router
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Settings;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Settings;
|
||||
|
||||
enum Setting: string
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Frontend\Settings;
|
||||
namespace IndifferentKetchup\Iblogs\Frontend\Settings;
|
||||
|
||||
use Aternos\Mclogs\Frontend\Cookie\SettingsCookie;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Cookie\SettingsCookie;
|
||||
|
||||
class Settings
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs;
|
||||
namespace IndifferentKetchup\Iblogs;
|
||||
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
|
||||
class Id implements \JsonSerializable
|
||||
{
|
||||
@@ -26,7 +26,7 @@ class Id implements \JsonSerializable
|
||||
*/
|
||||
protected function generate(): string
|
||||
{
|
||||
$config = \Aternos\Mclogs\Config\Config::getInstance();
|
||||
$config = \IndifferentKetchup\Iblogs\Config\Config::getInstance();
|
||||
$idLength = $config->get(ConfigKey::ID_LENGTH);
|
||||
|
||||
$newId = "";
|
||||
|
||||
32
src/Log.php
32
src/Log.php
@@ -1,21 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs;
|
||||
namespace IndifferentKetchup\Iblogs;
|
||||
|
||||
use Aternos\Codex\Analysis\Analysis;
|
||||
use Aternos\Codex\Log\AnalysableLogInterface;
|
||||
use Aternos\Codex\Log\File\StringLogFile;
|
||||
use Aternos\Codex\Log\Level;
|
||||
use Aternos\Codex\Log\LogInterface;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use Aternos\Mclogs\Data\Deobfuscator;
|
||||
use Aternos\Mclogs\Data\MetadataEntry;
|
||||
use Aternos\Mclogs\Data\Token;
|
||||
use Aternos\Mclogs\Filter\Filter;
|
||||
use Aternos\Mclogs\Frontend\Cookie\TokenCookie;
|
||||
use Aternos\Mclogs\Printer\Printer;
|
||||
use Aternos\Mclogs\Storage\MongoDBClient;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Codex\Analysis\Analysis;
|
||||
use IndifferentKetchup\Codex\Log\AnalysableLogInterface;
|
||||
use IndifferentKetchup\Codex\Log\File\StringLogFile;
|
||||
use IndifferentKetchup\Codex\Log\Level;
|
||||
use IndifferentKetchup\Codex\Log\LogInterface;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Data\Deobfuscator;
|
||||
use IndifferentKetchup\Iblogs\Data\MetadataEntry;
|
||||
use IndifferentKetchup\Iblogs\Data\Token;
|
||||
use IndifferentKetchup\Iblogs\Filter\Filter;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Cookie\TokenCookie;
|
||||
use IndifferentKetchup\Iblogs\Printer\Printer;
|
||||
use IndifferentKetchup\Iblogs\Storage\MongoDBClient;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
use Uri\Rfc3986\Uri;
|
||||
|
||||
@@ -371,7 +371,7 @@ class Log
|
||||
*/
|
||||
protected function getExpiryTimestamp(): UTCDateTime
|
||||
{
|
||||
$ttl = \Aternos\Mclogs\Config\Config::getInstance()->get(ConfigKey::STORAGE_TTL);
|
||||
$ttl = \IndifferentKetchup\Iblogs\Config\Config::getInstance()->get(ConfigKey::STORAGE_TTL);
|
||||
$expires = time() + $ttl;
|
||||
return new UTCDateTime($expires * 1000);
|
||||
}
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Printer;
|
||||
namespace IndifferentKetchup\Iblogs\Printer;
|
||||
|
||||
use IndifferentKetchup\Codex\Printer\Modification;
|
||||
|
||||
/**
|
||||
* Class FormatModification
|
||||
* Stub for v1 — `mclogs` extended `Aternos\Codex\Minecraft\Printer\FormatModification`
|
||||
* to translate Minecraft section-sign format codes into HTML format spans
|
||||
* (`format-black`, `format-darkblue`, etc., backed by the format-colors block
|
||||
* in the iblogs CSS). Project Zomboid logs do not carry these codes, so this
|
||||
* Modification is a pass-through under iblogs.
|
||||
*
|
||||
* @package Printer
|
||||
* The CSS `format-*` color classes are retained so re-introducing a real
|
||||
* Minecraft FormatModification later (or any other game with its own
|
||||
* format-code scheme) can reuse the existing styling.
|
||||
*/
|
||||
class FormatModification extends \Aternos\Codex\Minecraft\Printer\FormatModification
|
||||
class FormatModification extends Modification
|
||||
{
|
||||
/**
|
||||
* @param string $format
|
||||
* @return string
|
||||
*/
|
||||
protected function getClasses(string $format): string
|
||||
public function modify(string $text): string
|
||||
{
|
||||
return "format format-" . $format;
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Printer;
|
||||
namespace IndifferentKetchup\Iblogs\Printer;
|
||||
|
||||
use Aternos\Codex\Log\Entry;
|
||||
use Aternos\Codex\Log\EntryInterface;
|
||||
use Aternos\Codex\Log\Level;
|
||||
use Aternos\Codex\Log\LineInterface;
|
||||
use Aternos\Codex\Printer\ModifiableDefaultPrinter;
|
||||
use Aternos\Mclogs\Id;
|
||||
use IndifferentKetchup\Codex\Log\Entry;
|
||||
use IndifferentKetchup\Codex\Log\EntryInterface;
|
||||
use IndifferentKetchup\Codex\Log\Level;
|
||||
use IndifferentKetchup\Codex\Log\LineInterface;
|
||||
use IndifferentKetchup\Codex\Printer\ModifiableDefaultPrinter;
|
||||
use IndifferentKetchup\Iblogs\Id;
|
||||
|
||||
/**
|
||||
* Class Printer
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Router;
|
||||
namespace IndifferentKetchup\Iblogs\Router;
|
||||
|
||||
abstract class Action
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Router;
|
||||
namespace IndifferentKetchup\Iblogs\Router;
|
||||
|
||||
enum Method: string
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Router;
|
||||
namespace IndifferentKetchup\Iblogs\Router;
|
||||
|
||||
class Route
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Router;
|
||||
namespace IndifferentKetchup\Iblogs\Router;
|
||||
|
||||
use Aternos\Mclogs\Util\Singleton;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Util\Singleton;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
class Router
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Storage;
|
||||
namespace IndifferentKetchup\Iblogs\Storage;
|
||||
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use Aternos\Mclogs\Util\Singleton;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Util\Singleton;
|
||||
use MongoDB\BSON\UTCDateTime;
|
||||
use MongoDB\Client;
|
||||
use MongoDB\Collection;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Util;
|
||||
namespace IndifferentKetchup\Iblogs\Util;
|
||||
|
||||
trait Singleton
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Util;
|
||||
namespace IndifferentKetchup\Iblogs\Util;
|
||||
|
||||
class TimeInterval
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Aternos\Mclogs\Util;
|
||||
namespace IndifferentKetchup\Iblogs\Util;
|
||||
|
||||
use Uri\Rfc3986\Uri;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Aternos\Mclogs\Api\Action\BulkDeleteLogsAction;
|
||||
use Aternos\Mclogs\Api\Response\ApiError;
|
||||
use Aternos\Mclogs\Api\Response\ApiResponse;
|
||||
use Aternos\Mclogs\Api\Response\MultiResponse;
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Api\Action\BulkDeleteLogsAction;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiError;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\ApiResponse;
|
||||
use IndifferentKetchup\Iblogs\Api\Response\MultiResponse;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
$config = Config::getInstance();
|
||||
?>
|
||||
@@ -433,8 +433,8 @@ $config = Config::getInstance();
|
||||
{
|
||||
"message": "Label: value",
|
||||
"counter": 1,
|
||||
"label": "The label of this information, e.g. Minecraft version",
|
||||
"value": "The value of this information, e.g. 1.12.2",
|
||||
"label": "The label of this information, e.g. Engine version",
|
||||
"value": "The value of this information, e.g. 42.16.3",
|
||||
"entry": {
|
||||
"level": 6,
|
||||
"time": null,
|
||||
@@ -515,8 +515,8 @@ $config = Config::getInstance();
|
||||
{
|
||||
"message": "Label: value",
|
||||
"counter": 1,
|
||||
"label": "The label of this information, e.g. Minecraft version",
|
||||
"value": "The value of this information, e.g. 1.12.2",
|
||||
"label": "The label of this information, e.g. Engine version",
|
||||
"value": "The value of this information, e.g. 42.16.3",
|
||||
"entry": {
|
||||
"level": 6,
|
||||
"time": null,
|
||||
@@ -586,7 +586,7 @@ $config = Config::getInstance();
|
||||
</div>
|
||||
<h3>Success <span class="content-type">application/json</span></h3>
|
||||
<pre class="api-code">
|
||||
<?=htmlspecialchars(json_encode(\Aternos\Mclogs\Filter\Filter::getAll(), JSON_PRETTY_PRINT)); ?></pre>
|
||||
<?=htmlspecialchars(json_encode(\IndifferentKetchup\Iblogs\Filter\Filter::getAll(), JSON_PRETTY_PRINT)); ?></pre>
|
||||
<h3>Filter types</h3>
|
||||
<table class="api-table">
|
||||
<tr>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Aternos\Mclogs\Frontend\Assets\AssetLoader;
|
||||
use Aternos\Mclogs\Frontend\Assets\AssetType;
|
||||
use Aternos\Mclogs\Log;
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use Aternos\Mclogs\Frontend\Settings\Setting;
|
||||
use Aternos\Mclogs\Frontend\Settings\Settings;
|
||||
use Aternos\Mclogs\Util\TimeInterval;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Assets\AssetLoader;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Assets\AssetType;
|
||||
use IndifferentKetchup\Iblogs\Log;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Settings\Setting;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Settings\Settings;
|
||||
use IndifferentKetchup\Iblogs\Util\TimeInterval;
|
||||
|
||||
/** @var Log $log */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<svg width="41" height="42" viewBox="0 0 41 42" fill="<?=htmlspecialchars(\Aternos\Mclogs\Config\Config::getInstance()->get(\Aternos\Mclogs\Config\ConfigKey::FRONTEND_COLOR_ACCENT)); ?>" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="41" height="42" viewBox="0 0 41 42" fill="<?=htmlspecialchars(\IndifferentKetchup\Iblogs\Config\Config::getInstance()->get(\IndifferentKetchup\Iblogs\Config\ConfigKey::FRONTEND_COLOR_ACCENT)); ?>" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="41" height="5" rx="2"/>
|
||||
<rect y="9.25" width="33" height="5" rx="2"/>
|
||||
<rect y="18.5" width="19" height="5" rx="2"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 470 B After Width: | Height: | Size: 492 B |
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
use Aternos\Mclogs\Config\Config;use Aternos\Mclogs\Config\ConfigKey;use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;use IndifferentKetchup\Iblogs\Config\ConfigKey;use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
$imprintUrl = Config::getInstance()->get(ConfigKey::LEGAL_IMPRINT);
|
||||
$privacyUrl = Config::getInstance()->get(ConfigKey::LEGAL_PRIVACY);
|
||||
@@ -19,10 +19,9 @@ $privacyUrl = Config::getInstance()->get(ConfigKey::LEGAL_PRIVACY);
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<nav class="footer-nav">
|
||||
<a href="https://github.com/aternosorg/mclogs" title="mclo.gs on Github" target="_blank"><i class="fa-brands fa-github"></i>GitHub</a>
|
||||
<a href="https://modrinth.com/plugin/mclogs" title="Download mclo.gs Mod/Plugin" target="_blank"><i class="fa-solid fa-cube"></i>Mod/Plugin</a>
|
||||
<a href="<?=htmlspecialchars(URL::getApi()->toString()); ?>" title="mclo.gs API"><i class="fa-solid fa-code"></i>API</a>
|
||||
<a href="https://github.com/indifferentketchup/iblogs" title="iblogs on Github" target="_blank"><i class="fa-brands fa-github"></i>GitHub</a>
|
||||
<a href="<?=htmlspecialchars(URL::getApi()->toString()); ?>" title="iblogs API"><i class="fa-solid fa-code"></i>API</a>
|
||||
</nav>
|
||||
<span class="footer-text">developed by <a href="https://aternos.org" target="_blank" title="Aternos website">Aternos</a>
|
||||
<span class="footer-text">based on <a href="https://github.com/aternosorg/mclogs" target="_blank" title="Original mclogs project">mclogs</a> by <a href="https://github.com/aternosorg" target="_blank" title="Aternos on GitHub"><i class="fa-brands fa-github"></i> Aternos</a>
|
||||
</span>
|
||||
</footer>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use Aternos\Mclogs\Frontend\Assets\AssetLoader;
|
||||
use Aternos\Mclogs\Frontend\Assets\AssetType;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Assets\AssetLoader;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Assets\AssetType;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
?>
|
||||
<meta charset="utf-8"/>
|
||||
|
||||
<base href="/"/>
|
||||
<?= AssetLoader::getInstance()->getHTML(AssetType::CSS, "vendor/fontawesome/css/fontawesome.min.css"); ?>
|
||||
<?= AssetLoader::getInstance()->getHTML(AssetType::CSS, "css/mclogs.css"); ?>
|
||||
<?= AssetLoader::getInstance()->getHTML(AssetType::CSS, "css/iblogs.css"); ?>
|
||||
|
||||
<style>
|
||||
:root {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<header>
|
||||
<a href="<?=htmlspecialchars(\Aternos\Mclogs\Util\URL::getBase()->toString()); ?>" class="logo">
|
||||
<a href="<?=htmlspecialchars(\IndifferentKetchup\Iblogs\Util\URL::getBase()->toString()); ?>" class="logo">
|
||||
<svg class="logo-icon" width="41" height="42" viewBox="0 0 41 42" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="41" height="5" rx="2" fill="currentColor"/>
|
||||
@@ -8,11 +8,11 @@
|
||||
<rect y="27.75" width="33" height="5" rx="2" fill="currentColor"/>
|
||||
<rect y="37" width="41" height="5" rx="2" fill="currentColor"/>
|
||||
</svg>
|
||||
<span class="logo-text"><?= htmlspecialchars(\Aternos\Mclogs\Config\Config::getInstance()->getName()); ?></span>
|
||||
<span class="logo-text"><?= htmlspecialchars(\IndifferentKetchup\Iblogs\Config\Config::getInstance()->getName()); ?></span>
|
||||
</a>
|
||||
<div class="tagline">
|
||||
<h1 class="tagline-main"><span class="title-verb">Paste</span> your logs.</h1>
|
||||
<div class="tagline-sub">Built for Minecraft & Hytale</div>
|
||||
<div class="tagline-sub">Built for game-server logs</div>
|
||||
</div>
|
||||
<script>
|
||||
const titles = ["Paste", "Share", "Analyse"];
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Filter\Filter;
|
||||
use Aternos\Mclogs\Frontend\Assets\AssetLoader;
|
||||
use Aternos\Mclogs\Frontend\Assets\AssetType;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Filter\Filter;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Assets\AssetLoader;
|
||||
use IndifferentKetchup\Iblogs\Frontend\Assets\AssetType;
|
||||
?><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<?php include __DIR__ . '/parts/head.php'; ?>
|
||||
<title><?= htmlspecialchars(Config::getInstance()->getName()); ?> - Paste, share & analyse your logs</title>
|
||||
<meta name="description" content="Easily paste your Minecraft & Hytale logs to share and analyse them." />
|
||||
<meta name="description" content="Easily paste your game-server logs to share and analyse them." />
|
||||
</head>
|
||||
<body data-name="<?=htmlspecialchars(Config::getInstance()->getName()); ?>">
|
||||
<?php include __DIR__ . '/parts/header.php'; ?>
|
||||
|
||||
@@ -1145,7 +1145,7 @@ main {
|
||||
color: #A4A4A4;
|
||||
}
|
||||
|
||||
/** Minecraft Format Colors **/
|
||||
/** Format colors (legacy mclogs syntax-highlighting palette) **/
|
||||
|
||||
.format-black {
|
||||
color: #000;
|
||||
@@ -203,7 +203,7 @@ function saveSettings() {
|
||||
for (const checkbox of settingCheckboxes) {
|
||||
data[checkbox.dataset.key] = checkbox.checked;
|
||||
}
|
||||
document.cookie = "MCLOGS_SETTINGS=" + encodeURIComponent(JSON.stringify(data)) + ";path=/;expires=" + new Date(new Date().getTime() + 100 * 365 * 24 * 60 * 60 * 1000).toUTCString();
|
||||
document.cookie = "IBLOGS_SETTINGS=" + encodeURIComponent(JSON.stringify(data)) + ";path=/;expires=" + new Date(new Date().getTime() + 100 * 365 * 24 * 60 * 60 * 1000).toUTCString();
|
||||
}
|
||||
|
||||
/* copy to clipboard */
|
||||
|
||||
12
worker.php
12
worker.php
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Aternos\Mclogs\Api\ApiRouter;
|
||||
use Aternos\Mclogs\Config\Config;
|
||||
use Aternos\Mclogs\Config\ConfigKey;
|
||||
use Aternos\Mclogs\Frontend\FrontendRouter;
|
||||
use Aternos\Mclogs\Storage\MongoDBClient;
|
||||
use Aternos\Mclogs\Util\URL;
|
||||
use IndifferentKetchup\Iblogs\Api\ApiRouter;
|
||||
use IndifferentKetchup\Iblogs\Config\Config;
|
||||
use IndifferentKetchup\Iblogs\Config\ConfigKey;
|
||||
use IndifferentKetchup\Iblogs\Frontend\FrontendRouter;
|
||||
use IndifferentKetchup\Iblogs\Storage\MongoDBClient;
|
||||
use IndifferentKetchup\Iblogs\Util\URL;
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user