Compare commits

...

2 commits

Author SHA1 Message Date
da130e5855 Updated to use URL registry. 2024-10-05 15:25:27 +00:00
f0ddb6727e Updated Index library in Mince. 2024-10-05 14:48:18 +00:00
37 changed files with 285 additions and 419 deletions

View file

@ -1,8 +1,6 @@
{ {
"require": { "require": {
"flashwave/index": "^0.2408.40014", "flashwave/index": "^0.2410",
"flashwave/sasae": "^1.1",
"flashwave/syokuhou": "^1.2",
"ramsey/uuid": "^4.7", "ramsey/uuid": "^4.7",
"sentry/sdk": "^4.0", "sentry/sdk": "^4.0",
"nesbot/carbon": "^3.7" "nesbot/carbon": "^3.7"

359
composer.lock generated
View file

@ -4,7 +4,7 @@
"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": "1c95218980bc9a8618d881ff3609d3e8", "content-hash": "c55991a4602fd82deb63b990f03b7455",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
@ -137,23 +137,28 @@
}, },
{ {
"name": "flashwave/index", "name": "flashwave/index",
"version": "v0.2408.40014", "version": "v0.2410.51409",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://patchii.net/flash/index.git", "url": "https://patchii.net/flash/index.git",
"reference": "fbca708fbd75e8ecc6b36b39c1307a67bf250808" "reference": "c43c6eb334f85edf8fa7b5e4058b3ba35a27d960"
}, },
"require": { "require": {
"ext-mbstring": "*", "ext-mbstring": "*",
"php": ">=8.3" "php": ">=8.3",
"twig/html-extra": "^3.13",
"twig/twig": "^3.14"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1.11", "phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^11.2" "phpunit/phpunit": "^11.2"
}, },
"suggest": { "suggest": {
"ext-mysqli": "Support for the Index\\Data\\MariaDB namespace (both mysqlnd and libmysql are supported).", "ext-memcache": "Support for the Index\\Cache\\Memcached namespace (only if you can't use ext-memcached for some reason).",
"ext-sqlite3": "Support for the Index\\Data\\SQLite namespace." "ext-memcached": "Support for the Index\\Cache\\Memcached namespace (you should use this instead of ext-memcache).",
"ext-mysqli": "Support for the Index\\Db\\MariaDb namespace (both mysqlnd and libmysql are supported).",
"ext-redis": "Support for the Index\\Cache\\Valkey namespace.",
"ext-sqlite3": "Support for the Index\\Db\\Sqlite namespace."
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -175,85 +180,7 @@
], ],
"description": "Composer package for the common library for my projects.", "description": "Composer package for the common library for my projects.",
"homepage": "https://railgun.sh/index", "homepage": "https://railgun.sh/index",
"time": "2024-08-04T00:14:17+00:00" "time": "2024-10-05T14:10:08+00:00"
},
{
"name": "flashwave/sasae",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://patchii.net/flash/sasae.git",
"reference": "ad63107a4387aa35c45bce71c2d6262a15b96f9d"
},
"require": {
"flashwave/index": "^0.2408.40014",
"php": ">=8.3",
"twig/html-extra": "^3.10",
"twig/twig": "^3.10"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^11.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Sasae\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"bsd-3-clause-clear"
],
"authors": [
{
"name": "flashwave",
"email": "packagist@flash.moe",
"homepage": "https://flash.moe",
"role": "mom"
}
],
"description": "A wrapper for Twig with added common functionality.",
"homepage": "https://railgun.sh/sasae",
"time": "2024-08-04T00:48:17+00:00"
},
{
"name": "flashwave/syokuhou",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://patchii.net/flash/syokuhou.git",
"reference": "129a46c0d917382f9bc195cce278be51984eb87d"
},
"require": {
"flashwave/index": "^0.2408.40014",
"php": ">=8.3"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^11.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Syokuhou\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"bsd-3-clause-clear"
],
"authors": [
{
"name": "flashwave",
"email": "packagist@flash.moe",
"homepage": "https://flash.moe",
"role": "mom"
}
],
"description": "Configuration library for PHP.",
"homepage": "https://railgun.sh/syokuhou",
"time": "2024-08-04T01:07:23+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
@ -432,16 +359,16 @@
}, },
{ {
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "3.7.0", "version": "3.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/briannesbitt/Carbon.git", "url": "https://github.com/briannesbitt/Carbon.git",
"reference": "cb4374784c87d0a0294e8513a52eb63c0aff3139" "reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cb4374784c87d0a0294e8513a52eb63c0aff3139", "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
"reference": "cb4374784c87d0a0294e8513a52eb63c0aff3139", "reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -534,7 +461,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-16T22:29:20+00:00" "time": "2024-08-19T06:22:39+00:00"
}, },
{ {
"name": "psr/clock", "name": "psr/clock",
@ -694,16 +621,16 @@
}, },
{ {
"name": "psr/log", "name": "psr/log",
"version": "3.0.0", "version": "3.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/log.git", "url": "https://github.com/php-fig/log.git",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -738,9 +665,9 @@
"psr-3" "psr-3"
], ],
"support": { "support": {
"source": "https://github.com/php-fig/log/tree/3.0.0" "source": "https://github.com/php-fig/log/tree/3.0.2"
}, },
"time": "2021-07-14T16:46:02+00:00" "time": "2024-09-11T13:17:53+00:00"
}, },
{ {
"name": "ralouphie/getallheaders", "name": "ralouphie/getallheaders",
@ -1024,16 +951,16 @@
}, },
{ {
"name": "sentry/sentry", "name": "sentry/sentry",
"version": "4.8.1", "version": "4.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/getsentry/sentry-php.git", "url": "https://github.com/getsentry/sentry-php.git",
"reference": "61770efd8b7888e0bdd7d234f0ba67b066e47d04" "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/61770efd8b7888e0bdd7d234f0ba67b066e47d04", "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/788ec170f51ebb22f2809a1e3f78b19ccd39b70d",
"reference": "61770efd8b7888e0bdd7d234f0ba67b066e47d04", "reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1097,7 +1024,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/getsentry/sentry-php/issues", "issues": "https://github.com/getsentry/sentry-php/issues",
"source": "https://github.com/getsentry/sentry-php/tree/4.8.1" "source": "https://github.com/getsentry/sentry-php/tree/4.9.0"
}, },
"funding": [ "funding": [
{ {
@ -1109,7 +1036,7 @@
"type": "custom" "type": "custom"
} }
], ],
"time": "2024-07-16T13:45:27+00:00" "time": "2024-08-08T14:40:50+00:00"
}, },
{ {
"name": "symfony/clock", "name": "symfony/clock",
@ -1254,16 +1181,16 @@
}, },
{ {
"name": "symfony/mime", "name": "symfony/mime",
"version": "v7.1.2", "version": "v7.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/mime.git", "url": "https://github.com/symfony/mime.git",
"reference": "26a00b85477e69a4bab63b66c5dce64f18b0cbfc" "reference": "711d2e167e8ce65b05aea6b258c449671cdd38ff"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/26a00b85477e69a4bab63b66c5dce64f18b0cbfc", "url": "https://api.github.com/repos/symfony/mime/zipball/711d2e167e8ce65b05aea6b258c449671cdd38ff",
"reference": "26a00b85477e69a4bab63b66c5dce64f18b0cbfc", "reference": "711d2e167e8ce65b05aea6b258c449671cdd38ff",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1318,7 +1245,7 @@
"mime-type" "mime-type"
], ],
"support": { "support": {
"source": "https://github.com/symfony/mime/tree/v7.1.2" "source": "https://github.com/symfony/mime/tree/v7.1.5"
}, },
"funding": [ "funding": [
{ {
@ -1334,7 +1261,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-06-28T10:03:55+00:00" "time": "2024-09-20T08:28:38+00:00"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
@ -1405,20 +1332,20 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540" "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540", "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"provide": { "provide": {
"ext-ctype": "*" "ext-ctype": "*"
@ -1464,7 +1391,7 @@
"portable" "portable"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -1480,26 +1407,25 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T15:07:36+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-idn", "name": "symfony/polyfill-intl-idn",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git", "url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c" "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773",
"reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c", "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1", "php": ">=7.2",
"symfony/polyfill-intl-normalizer": "^1.10", "symfony/polyfill-intl-normalizer": "^1.10"
"symfony/polyfill-php72": "^1.10"
}, },
"suggest": { "suggest": {
"ext-intl": "For best performance" "ext-intl": "For best performance"
@ -1548,7 +1474,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -1564,24 +1490,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T15:07:36+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/polyfill-intl-normalizer", "name": "symfony/polyfill-intl-normalizer",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
"reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" "reference": "3833d7255cc303546435cb650316bff708a1c75c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c",
"reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "reference": "3833d7255cc303546435cb650316bff708a1c75c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"suggest": { "suggest": {
"ext-intl": "For best performance" "ext-intl": "For best performance"
@ -1629,7 +1555,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -1645,24 +1571,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T15:07:36+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"provide": { "provide": {
"ext-mbstring": "*" "ext-mbstring": "*"
@ -1709,7 +1635,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -1725,24 +1651,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-06-19T12:30:46+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/polyfill-php72", "name": "symfony/polyfill-php81",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php72.git", "url": "https://github.com/symfony/polyfill-php81.git",
"reference": "10112722600777e02d2745716b70c5db4ca70442" "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/10112722600777e02d2745716b70c5db4ca70442", "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"reference": "10112722600777e02d2745716b70c5db4ca70442", "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -1756,80 +1682,7 @@
"bootstrap.php" "bootstrap.php"
], ],
"psr-4": { "psr-4": {
"Symfony\\Polyfill\\Php72\\": "" "Symfony\\Polyfill\\Php81\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php72/tree/v1.30.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-06-19T12:30:46+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.30.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
}, },
"classmap": [ "classmap": [
"Resources/stubs" "Resources/stubs"
@ -1840,10 +1693,6 @@
"MIT" "MIT"
], ],
"authors": [ "authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{ {
"name": "Nicolas Grekas", "name": "Nicolas Grekas",
"email": "p@tchwork.com" "email": "p@tchwork.com"
@ -1853,7 +1702,7 @@
"homepage": "https://symfony.com/contributors" "homepage": "https://symfony.com/contributors"
} }
], ],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"keywords": [ "keywords": [
"compatibility", "compatibility",
@ -1862,7 +1711,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -1878,24 +1727,24 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-31T15:07:36+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/polyfill-php83", "name": "symfony/polyfill-php83",
"version": "v1.30.0", "version": "v1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php83.git", "url": "https://github.com/symfony/polyfill-php83.git",
"reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9" "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491",
"reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9", "reference": "2fb86d65e2d424369ad2905e83b236a8805ba491",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.2"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -1938,7 +1787,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-php83/tree/v1.30.0" "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0"
}, },
"funding": [ "funding": [
{ {
@ -1954,20 +1803,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-06-19T12:35:24+00:00" "time": "2024-09-09T11:45:10+00:00"
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v7.1.3", "version": "v7.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/translation.git",
"reference": "8d5e50c813ba2859a6dfc99a0765c550507934a1" "reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/8d5e50c813ba2859a6dfc99a0765c550507934a1", "url": "https://api.github.com/repos/symfony/translation/zipball/235535e3f84f3dfbdbde0208ede6ca75c3a489ea",
"reference": "8d5e50c813ba2859a6dfc99a0765c550507934a1", "reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2032,7 +1881,7 @@
"description": "Provides tools to internationalize your application", "description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/translation/tree/v7.1.3" "source": "https://github.com/symfony/translation/tree/v7.1.5"
}, },
"funding": [ "funding": [
{ {
@ -2048,7 +1897,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-26T12:41:01+00:00" "time": "2024-09-16T06:30:38+00:00"
}, },
{ {
"name": "symfony/translation-contracts", "name": "symfony/translation-contracts",
@ -2130,23 +1979,23 @@
}, },
{ {
"name": "twig/html-extra", "name": "twig/html-extra",
"version": "v3.10.0", "version": "v3.13.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/html-extra.git", "url": "https://github.com/twigphp/html-extra.git",
"reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda" "reference": "8229e750091171c1f11801a525927811c7ac5a7e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/html-extra/zipball/1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda", "url": "https://api.github.com/repos/twigphp/html-extra/zipball/8229e750091171c1f11801a525927811c7ac5a7e",
"reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda", "reference": "8229e750091171c1f11801a525927811c7ac5a7e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.5|^3", "symfony/deprecation-contracts": "^2.5|^3",
"symfony/mime": "^5.4|^6.4|^7.0", "symfony/mime": "^5.4|^6.4|^7.0",
"twig/twig": "^3.0" "twig/twig": "^3.13|^4.0"
}, },
"require-dev": { "require-dev": {
"symfony/phpunit-bridge": "^6.4|^7.0" "symfony/phpunit-bridge": "^6.4|^7.0"
@ -2182,7 +2031,7 @@
"twig" "twig"
], ],
"support": { "support": {
"source": "https://github.com/twigphp/html-extra/tree/v3.10.0" "source": "https://github.com/twigphp/html-extra/tree/v3.13.0"
}, },
"funding": [ "funding": [
{ {
@ -2194,28 +2043,28 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-11T07:35:57+00:00" "time": "2024-09-03T13:08:40+00:00"
}, },
{ {
"name": "twig/twig", "name": "twig/twig",
"version": "v3.10.3", "version": "v3.14.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "67f29781ffafa520b0bbfbd8384674b42db04572" "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/67f29781ffafa520b0bbfbd8384674b42db04572", "url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
"reference": "67f29781ffafa520b0bbfbd8384674b42db04572", "reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.2.5", "php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.5|^3", "symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8", "symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3", "symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php80": "^1.22" "symfony/polyfill-php81": "^1.29"
}, },
"require-dev": { "require-dev": {
"psr/container": "^1.0|^2.0", "psr/container": "^1.0|^2.0",
@ -2261,7 +2110,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/twigphp/Twig/issues", "issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.10.3" "source": "https://github.com/twigphp/Twig/tree/v3.14.0"
}, },
"funding": [ "funding": [
{ {
@ -2273,7 +2122,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-05-16T10:04:27+00:00" "time": "2024-09-09T17:55:12+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],

View file

@ -1,9 +1,9 @@
<?php <?php
use Index\Data\IDbConnection; use Index\Db\DbConnection;
use Index\Data\Migration\IDbMigration; use Index\Db\Migration\DbMigration;
final class ExistingStructure_20230816_161818 implements IDbMigration { final class ExistingStructure_20230816_161818 implements DbMigration {
public function migrate(IDbConnection $conn): void { public function migrate(DbConnection $conn): void {
$hasWhiteList2020 = false; $hasWhiteList2020 = false;
$hasWhiteList2022 = false; $hasWhiteList2022 = false;

View file

@ -1,9 +1,9 @@
<?php <?php
use Index\Data\IDbConnection; use Index\Db\DbConnection;
use Index\Data\Migration\IDbMigration; use Index\Db\Migration\DbMigration;
final class CreateServersTable_20230817_001507 implements IDbMigration { final class CreateServersTable_20230817_001507 implements DbMigration {
public function migrate(IDbConnection $conn): void { public function migrate(DbConnection $conn): void {
$conn->execute(' $conn->execute('
CREATE TABLE servers ( CREATE TABLE servers (
server_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, server_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,

View file

@ -1,9 +1,9 @@
<?php <?php
use Index\Data\IDbConnection; use Index\Db\DbConnection;
use Index\Data\Migration\IDbMigration; use Index\Db\Migration\DbMigration;
final class CreateNewTables_20230822_231052 implements IDbMigration { final class CreateNewTables_20230822_231052 implements DbMigration {
public function migrate(IDbConnection $conn): void { public function migrate(DbConnection $conn): void {
$conn->execute(' $conn->execute('
CREATE TABLE verifications ( CREATE TABLE verifications (
verify_code BINARY(10) NOT NULL, verify_code BINARY(10) NOT NULL,

View file

@ -1,9 +1,9 @@
<?php <?php
use Index\Data\IDbConnection; use Index\Db\DbConnection;
use Index\Data\Migration\IDbMigration; use Index\Db\Migration\DbMigration;
final class RemoveWhitelistTables_20230823_233728 implements IDbMigration { final class RemoveWhitelistTables_20230823_233728 implements DbMigration {
public function migrate(IDbConnection $conn): void { public function migrate(DbConnection $conn): void {
$conn->execute('DROP TABLE whitelist'); $conn->execute('DROP TABLE whitelist');
$conn->execute('DROP TABLE whitelist_2022'); $conn->execute('DROP TABLE whitelist_2022');
} }

View file

@ -1,8 +1,8 @@
<?php <?php
namespace Mince; namespace Mince;
use Index\Data\DbTools; use Index\Config\Fs\FsConfig;
use Syokuhou\SharpConfig; use Index\Db\DbTools;
define('MCR_STARTUP', microtime(true)); define('MCR_STARTUP', microtime(true));
define('MCR_ROOT', __DIR__); define('MCR_ROOT', __DIR__);
@ -19,7 +19,7 @@ error_reporting(MCR_DEBUG ? -1 : 0);
mb_internal_encoding('UTF-8'); mb_internal_encoding('UTF-8');
date_default_timezone_set('GMT'); date_default_timezone_set('GMT');
$cfg = SharpConfig::fromFile(MCR_ROOT . '/mince.cfg'); $cfg = FsConfig::fromFile(MCR_ROOT . '/mince.cfg');
if($cfg->hasValues('sentry:dsn')) if($cfg->hasValues('sentry:dsn'))
(function($cfg) { (function($cfg) {

View file

@ -1,9 +1,10 @@
<?php <?php
namespace Mince; namespace Mince;
use Index\CSRFP; use Index\CsrfToken;
use Index\Http\Routing\HttpRouter; use Index\Http\Routing\HttpRouter;
use Sasae\SasaeEnvironment; use Index\Templating\TplEnvironment;
use Index\Urls\ArrayUrlRegistry;
require_once __DIR__ . '/../mince.php'; require_once __DIR__ . '/../mince.php';
@ -17,12 +18,12 @@ if($authInfo->success) {
$userInfo = $users->getUser($authInfo->user_id); $userInfo = $users->getUser($authInfo->user_id);
} else $userInfo = null; } else $userInfo = null;
$csrfp = new CSRFP( $csrfp = new CsrfToken(
$cfg->getString('csrfp:secret', 'wowof'), $cfg->getString('csrfp:secret', 'wowof'),
$authInfo->success ? $authToken : $_SERVER['REMOTE_ADDR'] $authInfo->success ? $authToken : $_SERVER['REMOTE_ADDR']
); );
$templating = new SasaeEnvironment(MCR_DIR_TPL, ['Mince'], debug: MCR_DEBUG); $templating = new TplEnvironment(MCR_DIR_TPL, ['Mince'], debug: MCR_DEBUG);
$templating->addGlobal('globals', [ $templating->addGlobal('globals', [
'title' => 'Flashii Minecraft Servers', 'title' => 'Flashii Minecraft Servers',
'is_authed' => $userInfo !== null, 'is_authed' => $userInfo !== null,
@ -36,13 +37,25 @@ $authorisations->prune();
$verifications = new Verifications($db); $verifications = new Verifications($db);
$verifications->prune(); $verifications->prune();
$urls = new ArrayUrlRegistry;
$templating->addFunction('url', $urls->format(...));
$router = new HttpRouter(errorHandler: new RouterErrorHandler($templating)); $router = new HttpRouter(errorHandler: new RouterErrorHandler($templating));
$router->use('/', function($response, $request) { $response->setPoweredBy('Mince'); }); $router->use('/', function($response, $request) { $response->setPoweredBy('Mince'); });
$router->register(new RpcRoutes($users, $accountLinks, $authorisations, $verifications, $cfg->getString('rpc:secret'), $cfg->getString('urls:clients'))); $router->register(new RpcRoutes($users, $accountLinks, $authorisations, $verifications, $cfg->getString('rpc:secret'), $cfg->getString('urls:clients')));
$router->register(new HomeRoutes($templating, new Servers($db), $authInfo, $cfg->getString('site:login')));
$router->register(new ClientsRoutes($templating, $accountLinks, $authorisations, $verifications, $csrfp, $authInfo)); $homeRoutes = new HomeRoutes($templating, $urls, new Servers($db), $authInfo, $cfg->getString('site:login'));
$router->register(new SkinsRoutes($templating, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo, $cfg->getString('urls:skins_base'))); $router->register($homeRoutes);
$urls->register($homeRoutes);
$clientRoutes = new ClientsRoutes($templating, $urls, $accountLinks, $authorisations, $verifications, $csrfp, $authInfo);
$router->register($clientRoutes);
$urls->register($clientRoutes);
$skinsRoutes = new SkinsRoutes($templating, $urls, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo, $cfg->getString('urls:skins_base'));
$router->register($skinsRoutes);
$urls->register($skinsRoutes);
MojangInterop::registerRoutes($router); MojangInterop::registerRoutes($router);

View file

@ -2,7 +2,7 @@
namespace Mince; namespace Mince;
use Carbon\CarbonImmutable; use Carbon\CarbonImmutable;
use Index\Data\IDbResult; use Index\Db\DbResult;
use Ramsey\Uuid\{Uuid,UuidInterface}; use Ramsey\Uuid\{Uuid,UuidInterface};
class AccountLinkInfo { class AccountLinkInfo {
@ -13,7 +13,7 @@ class AccountLinkInfo {
private int $created private int $created
) {} ) {}
public static function fromResult(IDbResult $result): self { public static function fromResult(DbResult $result): self {
return new AccountLinkInfo( return new AccountLinkInfo(
userId: $result->getString(0), userId: $result->getString(0),
uuid: $result->getString(1), uuid: $result->getString(1),

View file

@ -3,13 +3,13 @@ namespace Mince;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection}; use Index\Db\{DbConnection,DbStatementCache};
use Ramsey\Uuid\UuidInterface; use Ramsey\Uuid\UuidInterface;
class AccountLinks { class AccountLinks {
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }

View file

@ -2,8 +2,7 @@
namespace Mince; namespace Mince;
use Carbon\CarbonImmutable; use Carbon\CarbonImmutable;
use Index\Data\IDbResult; use Index\Db\DbResult;
use Index\Net\IPAddress;
use Ramsey\Uuid\{Uuid,UuidInterface}; use Ramsey\Uuid\{Uuid,UuidInterface};
class AuthorisationInfo { class AuthorisationInfo {
@ -16,7 +15,7 @@ class AuthorisationInfo {
private ?int $used, private ?int $used,
) {} ) {}
public static function fromResult(IDbResult $result): self { public static function fromResult(DbResult $result): self {
return new AuthorisationInfo( return new AuthorisationInfo(
id: $result->getString(0), id: $result->getString(0),
uuid: $result->getString(1), uuid: $result->getString(1),
@ -39,14 +38,10 @@ class AuthorisationInfo {
return Uuid::fromBytes($this->uuid); return Uuid::fromBytes($this->uuid);
} }
public function getAddressRaw(): string { public function getAddress(): string {
return $this->addr; return $this->addr;
} }
public function getAddress(): IPAddress {
return IPAddress::parse($this->addr);
}
public function getRequestedTime(): int { public function getRequestedTime(): int {
return $this->requested; return $this->requested;
} }

View file

@ -3,15 +3,14 @@ namespace Mince;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection}; use Index\Db\{DbConnection,DbStatementCache};
use Index\Net\IPAddress;
use Ramsey\Uuid\UuidInterface; use Ramsey\Uuid\UuidInterface;
class Authorisations { class Authorisations {
private IDbConnection $dbConn; private DbConnection $dbConn;
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(DbConnection $dbConn) {
$this->dbConn = $dbConn; $this->dbConn = $dbConn;
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }
@ -38,7 +37,7 @@ class Authorisations {
public function getAuthorisation( public function getAuthorisation(
?string $authId = null, ?string $authId = null,
AccountLinkInfo|UuidInterface|string|null $uuid = null, AccountLinkInfo|UuidInterface|string|null $uuid = null,
IPAddress|string|null $remoteAddr = null ?string $remoteAddr = null
): AuthorisationInfo { ): AuthorisationInfo {
$hasAuthId = $authId !== null; $hasAuthId = $authId !== null;
$hasUuid = $uuid !== null; $hasUuid = $uuid !== null;
@ -64,9 +63,6 @@ class Authorisations {
} }
if($hasRemoteAddr) { if($hasRemoteAddr) {
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
$query .= sprintf(' %s auth_addr = INET6_ATON(?)', ++$args > 1 ? 'AND' : 'WHERE'); $query .= sprintf(' %s auth_addr = INET6_ATON(?)', ++$args > 1 ? 'AND' : 'WHERE');
$values[] = $remoteAddr; $values[] = $remoteAddr;
} }
@ -90,7 +86,7 @@ class Authorisations {
public function createAuthorisation( public function createAuthorisation(
AccountLinkInfo|VerificationInfo|UuidInterface|string $uuid, AccountLinkInfo|VerificationInfo|UuidInterface|string $uuid,
IPAddress|string|null $remoteAddr = null, ?string $remoteAddr = null,
bool $grant = false bool $grant = false
): void { ): void {
if($uuid instanceof VerificationInfo) { if($uuid instanceof VerificationInfo) {
@ -104,8 +100,6 @@ class Authorisations {
$uuid = $uuid->getUUIDRaw(); $uuid = $uuid->getUUIDRaw();
elseif($uuid instanceof UuidInterface) elseif($uuid instanceof UuidInterface)
$uuid = $uuid->getBytes(); $uuid = $uuid->getBytes();
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
} }
$stmt = $this->cache->get(sprintf( $stmt = $this->cache->get(sprintf(

View file

@ -2,7 +2,7 @@
namespace Mince; namespace Mince;
use Carbon\CarbonImmutable; use Carbon\CarbonImmutable;
use Index\Data\IDbResult; use Index\Db\DbResult;
class CapeInfo { class CapeInfo {
public function __construct( public function __construct(
@ -11,7 +11,7 @@ class CapeInfo {
private int $updated, private int $updated,
) {} ) {}
public static function fromResult(IDbResult $result): self { public static function fromResult(DbResult $result): self {
return new CapeInfo( return new CapeInfo(
userId: $result->getString(0), userId: $result->getString(0),
hash: $result->getString(1), hash: $result->getString(1),

View file

@ -3,12 +3,12 @@ namespace Mince;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection}; use Index\Db\{DbConnection,DbStatementCache};
class Capes { class Capes {
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }

View file

@ -2,10 +2,10 @@
namespace Mince; namespace Mince;
use stdClass; use stdClass;
use Syokuhou\IConfig; use Index\Config\Config;
final class ChatAuth { final class ChatAuth {
public static function attempt(IConfig $config, string $cookie): object { public static function attempt(Config $config, string $cookie): object {
if(!empty($cookie)) { if(!empty($cookie)) {
$method = 'Misuzu'; $method = 'Misuzu';
$signature = sprintf('verify#%s#%s#%s', $method, $cookie, $_SERVER['REMOTE_ADDR']); $signature = sprintf('verify#%s#%s#%s', $method, $cookie, $_SERVER['REMOTE_ADDR']);

View file

@ -3,18 +3,22 @@ namespace Mince;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Index\CSRFP; use Index\CsrfToken;
use Index\Http\Routing\{RouteHandler,HttpGet,HttpMiddleware,HttpPost}; use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
use Index\Templating\TplEnvironment;
use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait};
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
use Sasae\SasaeEnvironment;
class ClientsRoutes extends RouteHandler { class ClientsRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait, UrlSourceTrait;
public function __construct( public function __construct(
private SasaeEnvironment $templating, private TplEnvironment $templating,
private UrlRegistry $urls,
private AccountLinks $accountLinks, private AccountLinks $accountLinks,
private Authorisations $authorisations, private Authorisations $authorisations,
private Verifications $verifications, private Verifications $verifications,
private CSRFP $csrfp, private CsrfToken $csrfp,
private object $authInfo private object $authInfo
) {} ) {}
@ -42,6 +46,7 @@ class ClientsRoutes extends RouteHandler {
]; ];
#[HttpGet('/clients')] #[HttpGet('/clients')]
#[UrlFormat('clients:index', '/clients', ['error' => '<error>'])]
public function getClients($response, $request) { public function getClients($response, $request) {
$template = $this->templating->load('clients/index'); $template = $this->templating->load('clients/index');
@ -74,16 +79,17 @@ class ClientsRoutes extends RouteHandler {
} }
#[HttpPost('/clients/link')] #[HttpPost('/clients/link')]
#[UrlFormat('clients:link', '/clients/link')]
public function postLink($response, $request) { public function postLink($response, $request) {
if($this->accountLinks->checkHasLink($this->authInfo->user_id)) { if($this->accountLinks->checkHasLink($this->authInfo->user_id)) {
$response->redirect('/clients?error=link:already'); $response->redirect($this->urls->format('clients:index', ['error' => 'link:already']));
return; return;
} }
$body = $request->getContent(); $body = $request->getContent();
$code = (string)$body->getParam('code'); $code = (string)$body->getParam('code');
if(strlen($code) !== 10) { if(strlen($code) !== 10) {
$response->redirect('/clients?error=link:format'); $response->redirect($this->urls->format('clients:index', ['error' => 'link:format']));
return; return;
} }
@ -92,7 +98,7 @@ class ClientsRoutes extends RouteHandler {
try { try {
$verifyInfo = $this->verifications->getVerification(code: $code); $verifyInfo = $this->verifications->getVerification(code: $code);
} catch(RuntimeException $ex) { } catch(RuntimeException $ex) {
$response->redirect('/clients?error=link:code'); $response->redirect($this->urls->format('clients:index', ['error' => 'link:code']));
return; return;
} }
@ -100,16 +106,18 @@ class ClientsRoutes extends RouteHandler {
$this->accountLinks->createLink($this->authInfo->user_id, $verifyInfo); $this->accountLinks->createLink($this->authInfo->user_id, $verifyInfo);
$this->authorisations->createAuthorisation($verifyInfo, grant: true); $this->authorisations->createAuthorisation($verifyInfo, grant: true);
$response->redirect('/clients'); $response->redirect($this->urls->format('clients:index'));
} }
#[HttpPost('/clients/unlink')] #[HttpPost('/clients/unlink')]
#[UrlFormat('clients:unlink', '/clients/unlink')]
public function postUnlink($response) { public function postUnlink($response) {
$this->accountLinks->deleteLink(userInfo: $this->authInfo->user_id); $this->accountLinks->deleteLink(userInfo: $this->authInfo->user_id);
$response->redirect('/clients'); $response->redirect($this->urls->format('clients:index'));
} }
#[HttpPost('/clients/authorise')] #[HttpPost('/clients/authorise')]
#[UrlFormat('clients:authorise', '/clients/authorise')]
public function postAuthorise($response, $request) { public function postAuthorise($response, $request) {
$body = $request->getContent(); $body = $request->getContent();
$authId = (string)$body->getParam('auth'); $authId = (string)$body->getParam('auth');
@ -135,10 +143,11 @@ class ClientsRoutes extends RouteHandler {
$this->authorisations->setAuthorisationGranted($authInfo); $this->authorisations->setAuthorisationGranted($authInfo);
$response->redirect('/clients'); $response->redirect($this->urls->format('clients:index'));
} }
#[HttpPost('/clients/deauthorise')] #[HttpPost('/clients/deauthorise')]
#[UrlFormat('clients:deauthorise', '/clients/deauthorise')]
public function postDeauthorise($response, $request) { public function postDeauthorise($response, $request) {
$body = $request->getContent(); $body = $request->getContent();
$authId = (string)$body->getParam('auth'); $authId = (string)$body->getParam('auth');
@ -168,6 +177,6 @@ class ClientsRoutes extends RouteHandler {
$this->authorisations->deleteAuthorisations(authInfo: $authInfo); $this->authorisations->deleteAuthorisations(authInfo: $authInfo);
} }
$response->redirect('/clients'); $response->redirect($this->urls->format('clients:index'));
} }
} }

View file

@ -1,18 +1,23 @@
<?php <?php
namespace Mince; namespace Mince;
use Index\Http\Routing\{HttpGet,RouteHandler}; use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
use Sasae\SasaeEnvironment; use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait};
use Index\Templating\TplEnvironment;
class HomeRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait, UrlSourceTrait;
class HomeRoutes extends RouteHandler {
public function __construct( public function __construct(
private SasaeEnvironment $templating, private TplEnvironment $templating,
private UrlRegistry $urls,
private Servers $servers, private Servers $servers,
private object $userInfo, private object $userInfo,
private string $loginUrl private string $loginUrl
) {} ) {}
#[HttpGet('/')] #[HttpGet('/')]
#[UrlFormat('index', '/')]
public function getIndex($response, $request) { public function getIndex($response, $request) {
return $this->templating->render('index', [ return $this->templating->render('index', [
'servers' => iterator_to_array($this->servers->getServers(deleted: false)), 'servers' => iterator_to_array($this->servers->getServers(deleted: false)),
@ -20,22 +25,25 @@ class HomeRoutes extends RouteHandler {
} }
#[HttpGet('/login')] #[HttpGet('/login')]
#[UrlFormat('login', '/login')]
public function getLogin($response) { public function getLogin($response) {
$response->redirect($this->userInfo->success ? '/' : $this->loginUrl); $response->redirect($this->userInfo->success ? $this->urls->format('index') : $this->loginUrl);
} }
#[HttpGet('/downloads')] #[HttpGet('/downloads')]
#[UrlFormat('downloads', '/downloads')]
public function getDownloads() { public function getDownloads() {
return $this->templating->render('downloads'); return $this->templating->render('downloads');
} }
#[HttpGet('/guide')] #[HttpGet('/guide')]
#[UrlFormat('guide', '/guide')]
public function getGuide() { public function getGuide() {
return $this->templating->render('guide'); return $this->templating->render('guide');
} }
#[HttpGet('/index.php')] #[HttpGet('/index.php')]
public function getRedirect($response) { public function getRedirect($response) {
$response->redirect('/', true); $response->redirect($this->urls->format('index'), true);
} }
} }

View file

@ -3,7 +3,7 @@ namespace Mince;
use stdClass; use stdClass;
use Index\Http\{HttpResponseBuilder,HttpRequest}; use Index\Http\{HttpResponseBuilder,HttpRequest};
use Index\Http\Routing\IRouter; use Index\Http\Routing\Router;
use Ramsey\Uuid\{Uuid,UuidInterface}; use Ramsey\Uuid\{Uuid,UuidInterface};
final class MojangInterop { final class MojangInterop {
@ -33,7 +33,7 @@ final class MojangInterop {
return $uuid->getVersion() === 4; return $uuid->getVersion() === 4;
} }
public static function registerRoutes(IRouter $router): void { public static function registerRoutes(Router $router): void {
$router->get('/uuid', fn($response, $request) => self::uuidResolver($response, $request)); $router->get('/uuid', fn($response, $request) => self::uuidResolver($response, $request));
$router->get('/blockedservers', fn($response, $request) => self::proxyBlockServers($response, $request)); $router->get('/blockedservers', fn($response, $request) => self::proxyBlockServers($response, $request));
} }

View file

@ -1,13 +1,12 @@
<?php <?php
namespace Mince; namespace Mince;
use Index\Http\{HttpResponseBuilder,HttpRequest}; use Index\Http\{HttpErrorHandler,HttpResponseBuilder,HttpRequest};
use Index\Http\ErrorHandling\IErrorHandler; use Index\Templating\TplEnvironment;
use Sasae\SasaeEnvironment;
class RouterErrorHandler implements IErrorHandler { class RouterErrorHandler implements HttpErrorHandler {
public function __construct( public function __construct(
private SasaeEnvironment $templating private TplEnvironment $templating
) {} ) {}
public function handle(HttpResponseBuilder $response, HttpRequest $request, int $code, string $message): void { public function handle(HttpResponseBuilder $response, HttpRequest $request, int $code, string $message): void {

View file

@ -5,10 +5,12 @@ use stdClass;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Stringable; use Stringable;
use Index\Http\Routing\{HttpMiddleware,HttpPost,RouteHandler}; use Index\Http\Routing\{HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
class RpcRoutes extends RouteHandler { class RpcRoutes implements RouteHandler {
use RouteHandlerTrait;
public function __construct( public function __construct(
private Users $users, private Users $users,
private AccountLinks $accountLinks, private AccountLinks $accountLinks,

View file

@ -2,7 +2,7 @@
namespace Mince; namespace Mince;
use Carbon\CarbonImmutable; use Carbon\CarbonImmutable;
use Index\Data\IDbResult; use Index\Db\DbResult;
class ServerInfo { class ServerInfo {
public function __construct( public function __construct(
@ -17,7 +17,7 @@ class ServerInfo {
private ?int $deleted, private ?int $deleted,
) {} ) {}
public static function fromResult(IDbResult $result): self { public static function fromResult(DbResult $result): self {
return new ServerInfo( return new ServerInfo(
id: $result->getString(0), id: $result->getString(0),
name: $result->getString(1), name: $result->getString(1),

View file

@ -1,14 +1,12 @@
<?php <?php
namespace Mince; namespace Mince;
use Index\Data\{DbStatementCache,IDbConnection}; use Index\Db\{DbConnection,DbStatementCache};
class Servers { class Servers {
//private IDbConnection $dbConn;
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(DbConnection $dbConn) {
//$this->dbConn = $dbConn;
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }

View file

@ -2,7 +2,7 @@
namespace Mince; namespace Mince;
use Carbon\CarbonImmutable; use Carbon\CarbonImmutable;
use Index\Data\IDbResult; use Index\Db\DbResult;
class SkinInfo { class SkinInfo {
public function __construct( public function __construct(
@ -12,7 +12,7 @@ class SkinInfo {
private int $updated, private int $updated,
) {} ) {}
public static function fromResult(IDbResult $result): self { public static function fromResult(DbResult $result): self {
return new SkinInfo( return new SkinInfo(
userId: $result->getString(0), userId: $result->getString(0),
hash: $result->getString(1), hash: $result->getString(1),

View file

@ -3,14 +3,14 @@ namespace Mince;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection}; use Index\Db\{DbConnection,DbStatementCache};
class Skins { class Skins {
public const MODELS = ['classic', 'slim']; public const MODELS = ['classic', 'slim'];
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }

View file

@ -6,23 +6,27 @@ use ImagickException;
use ImagickPixel; use ImagickPixel;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Index\{CSRFP,XString}; use Index\{CsrfToken,XString};
use Index\Http\Routing\{RouteHandler,HttpGet,HttpMiddleware,HttpPost}; use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
use Index\Templating\TplEnvironment;
use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait};
use Ramsey\Uuid\{Uuid,UuidInterface}; use Ramsey\Uuid\{Uuid,UuidInterface};
use Sasae\SasaeEnvironment;
class SkinsRoutes extends RouteHandler { class SkinsRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait, UrlSourceTrait;
private const TEXTURES_DIR = '/textures'; private const TEXTURES_DIR = '/textures';
private const TEXTURES_PATH = MCR_DIR_PUB . self::TEXTURES_DIR; private const TEXTURES_PATH = MCR_DIR_PUB . self::TEXTURES_DIR;
private AccountLinkInfo $linkInfo; private AccountLinkInfo $linkInfo;
public function __construct( public function __construct(
private SasaeEnvironment $templating, private TplEnvironment $templating,
private UrlRegistry $urls,
private AccountLinks $accountLinks, private AccountLinks $accountLinks,
private Skins $skins, private Skins $skins,
private Capes $capes, private Capes $capes,
private CSRFP $csrfp, private CsrfToken $csrfp,
private object $authInfo, private object $authInfo,
private string $baseUrl private string $baseUrl
) { ) {
@ -59,7 +63,7 @@ class SkinsRoutes extends RouteHandler {
try { try {
$this->linkInfo = $this->accountLinks->getLink(userInfo: $this->authInfo->user_id); $this->linkInfo = $this->accountLinks->getLink(userInfo: $this->authInfo->user_id);
} catch(RuntimeException $ex) { } catch(RuntimeException $ex) {
$response->redirect('/clients'); $response->redirect($this->urls->format('clients:index'));
return true; return true;
} }
@ -86,6 +90,7 @@ class SkinsRoutes extends RouteHandler {
]; ];
#[HttpGet('/skins')] #[HttpGet('/skins')]
#[UrlFormat('skins:index', '/skins', ['error' => '<error>'])]
public function getSkins($response, $request) { public function getSkins($response, $request) {
$skinInfo = $this->skins->getSkin($this->linkInfo); $skinInfo = $this->skins->getSkin($this->linkInfo);
$skinPath = $skinInfo === null ? null : $this->getRemotePath($skinInfo->getHash(), false); $skinPath = $skinInfo === null ? null : $this->getRemotePath($skinInfo->getHash(), false);
@ -119,6 +124,7 @@ class SkinsRoutes extends RouteHandler {
} }
#[HttpPost('/skins/upload-skin')] #[HttpPost('/skins/upload-skin')]
#[UrlFormat('skins:skin:upload', '/skins/upload-skin')]
public function postUploadSkin($response, $request) { public function postUploadSkin($response, $request) {
$body = $request->getContent(); $body = $request->getContent();
if(!$body->hasUploadedFile('texture')) if(!$body->hasUploadedFile('texture'))
@ -128,12 +134,12 @@ class SkinsRoutes extends RouteHandler {
$model = (string)$body->getParam('model'); $model = (string)$body->getParam('model');
if(!in_array($model, Skins::MODELS)) { if(!in_array($model, Skins::MODELS)) {
$response->redirect('/skins?error=skin:model'); $response->redirect($this->urls->format('skins:index', ['error' => 'skin:model']));
return; return;
} }
if($texture->getSize() > 512000) { if($texture->getSize() > 512000) {
$response->redirect('/skins?error=skin:size'); $response->redirect($this->urls->format('skins:index', ['error' => 'skin:size']));
return; return;
} }
@ -151,7 +157,7 @@ class SkinsRoutes extends RouteHandler {
$imagick->writeImage(); $imagick->writeImage();
$imagick->destroy(); $imagick->destroy();
} catch(ImagickException $ex) { } catch(ImagickException $ex) {
$response->redirect('/skins?error=skin:format'); $response->redirect($this->urls->format('skins:index', ['error' => 'skin:format']));
return; return;
} }
@ -178,10 +184,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($hash); $this->deleteLocalFileMaybe($hash);
} }
$response->redirect('/skins'); $response->redirect($this->urls->format('skins:index'));
} }
#[HttpPost('/skins/delete-skin')] #[HttpPost('/skins/delete-skin')]
#[UrlFormat('skins:skin:delete', '/skins/delete-skin')]
public function postDeleteSkin($response) { public function postDeleteSkin($response) {
$skinInfo = $this->skins->getSkin($this->linkInfo); $skinInfo = $this->skins->getSkin($this->linkInfo);
if($skinInfo !== null) { if($skinInfo !== null) {
@ -189,10 +196,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($skinInfo->getHash()); $this->deleteLocalFileMaybe($skinInfo->getHash());
} }
$response->redirect('/skins'); $response->redirect($this->urls->format('skins:index'));
} }
#[HttpPost('/skins/upload-cape')] #[HttpPost('/skins/upload-cape')]
#[UrlFormat('skins:cape:upload', '/skins/upload-cape')]
public function postUploadCape($response, $request) { public function postUploadCape($response, $request) {
$body = $request->getContent(); $body = $request->getContent();
if(!$body->hasUploadedFile('texture')) if(!$body->hasUploadedFile('texture'))
@ -200,7 +208,7 @@ class SkinsRoutes extends RouteHandler {
$texture = $body->getUploadedFile('texture'); $texture = $body->getUploadedFile('texture');
if($texture->getSize() > 256000) { if($texture->getSize() > 256000) {
$response->redirect('/skins?error=cape:size'); $response->redirect($this->urls->format('skins:index', ['error' => 'cape:size']));
return; return;
} }
@ -215,7 +223,7 @@ class SkinsRoutes extends RouteHandler {
$imagick->writeImage(); $imagick->writeImage();
$imagick->destroy(); $imagick->destroy();
} catch(ImagickException $ex) { } catch(ImagickException $ex) {
$response->redirect('/skins?error=cape:format'); $response->redirect($this->urls->format('skins:index', ['error' => 'cape:format']));
return; return;
} }
@ -241,10 +249,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($hash); $this->deleteLocalFileMaybe($hash);
} }
$response->redirect('/skins'); $response->redirect($this->urls->format('skins:index'));
} }
#[HttpPost('/skins/delete-cape')] #[HttpPost('/skins/delete-cape')]
#[UrlFormat('skins:cape:delete', '/skins/delete-cape')]
public function postDeleteCape($response) { public function postDeleteCape($response) {
$capeInfo = $this->capes->getCape($this->linkInfo); $capeInfo = $this->capes->getCape($this->linkInfo);
if($capeInfo !== null) { if($capeInfo !== null) {
@ -252,10 +261,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($capeInfo->getHash()); $this->deleteLocalFileMaybe($capeInfo->getHash());
} }
$response->redirect('/skins'); $response->redirect($this->urls->format('skins:index'));
} }
#[HttpPost('/skins/import')] #[HttpPost('/skins/import')]
#[UrlFormat('skins:import', '/skins/import')]
public function postImport($response, $request) { public function postImport($response, $request) {
$body = $request->getContent(); $body = $request->getContent();
$userAgent = $request->getHeaderLine('User-Agent'); $userAgent = $request->getHeaderLine('User-Agent');
@ -322,7 +332,7 @@ class SkinsRoutes extends RouteHandler {
} }
} }
$response->redirect('/skins'); $response->redirect($this->urls->format('skins:index'));
} }
private function getProfileInfo(UuidInterface $uuid, bool $includeProfileActions) { private function getProfileInfo(UuidInterface $uuid, bool $includeProfileActions) {

View file

@ -1,8 +1,8 @@
<?php <?php
namespace Mince; namespace Mince;
use Index\Colour\{Colour,ColourRGB}; use Index\Colour\{Colour,ColourRgb};
use Index\Data\IDbResult; use Index\Db\DbResult;
class UserInfo { class UserInfo {
public function __construct( public function __construct(
@ -11,7 +11,7 @@ class UserInfo {
private ?int $colour, private ?int $colour,
) {} ) {}
public static function fromResult(IDbResult $result): self { public static function fromResult(DbResult $result): self {
return new UserInfo( return new UserInfo(
id: $result->getString(0), id: $result->getString(0),
name: $result->getString(1), name: $result->getString(1),
@ -36,6 +36,6 @@ class UserInfo {
} }
public function getColour(): Colour { public function getColour(): Colour {
return $this->colour === null ? Colour::none() : ColourRGB::fromRawRGB($this->colour); return $this->colour === null ? Colour::none() : ColourRgb::fromRawRGB($this->colour);
} }
} }

View file

@ -2,12 +2,12 @@
namespace Mince; namespace Mince;
use RuntimeException; use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection}; use Index\Db\{DbConnection,DbStatementCache};
class Users { class Users {
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }

View file

@ -2,8 +2,7 @@
namespace Mince; namespace Mince;
use Carbon\CarbonImmutable; use Carbon\CarbonImmutable;
use Index\Data\IDbResult; use Index\Db\DbResult;
use Index\Net\IPAddress;
use Ramsey\Uuid\{Uuid,UuidInterface}; use Ramsey\Uuid\{Uuid,UuidInterface};
class VerificationInfo { class VerificationInfo {
@ -15,7 +14,7 @@ class VerificationInfo {
private int $created, private int $created,
) {} ) {}
public static function fromResult(IDbResult $result): self { public static function fromResult(DbResult $result): self {
return new VerificationInfo( return new VerificationInfo(
code: $result->getString(0), code: $result->getString(0),
uuid: $result->getString(1), uuid: $result->getString(1),
@ -41,14 +40,10 @@ class VerificationInfo {
return $this->name; return $this->name;
} }
public function getAddressRaw(): string { public function getAddress(): string {
return $this->addr; return $this->addr;
} }
public function getAddress(): IPAddress {
return IPAddress::parse($this->addr);
}
public function getCreatedTime(): int { public function getCreatedTime(): int {
return $this->created; return $this->created;
} }

View file

@ -4,17 +4,16 @@ namespace Mince;
use InvalidArgumentException; use InvalidArgumentException;
use RuntimeException; use RuntimeException;
use Index\XString; use Index\XString;
use Index\Data\{DbStatementCache,IDbConnection}; use Index\Db\{DbConnection,DbStatementCache};
use Index\Net\IPAddress;
use Ramsey\Uuid\UuidInterface; use Ramsey\Uuid\UuidInterface;
class Verifications { class Verifications {
private const CODE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; private const CODE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
private IDbConnection $dbConn; private DbConnection $dbConn;
private DbStatementCache $cache; private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) { public function __construct(DbConnection $dbConn) {
$this->dbConn = $dbConn; $this->dbConn = $dbConn;
$this->cache = new DbStatementCache($dbConn); $this->cache = new DbStatementCache($dbConn);
} }
@ -30,7 +29,7 @@ class Verifications {
public function getVerification( public function getVerification(
?string $code = null, ?string $code = null,
UuidInterface|string|null $uuid = null, UuidInterface|string|null $uuid = null,
IPAddress|string|null $remoteAddr = null ?string $remoteAddr = null
): VerificationInfo { ): VerificationInfo {
$hasCode = $code !== null; $hasCode = $code !== null;
$hasUuid = $uuid !== null; $hasUuid = $uuid !== null;
@ -54,9 +53,6 @@ class Verifications {
} }
if($hasRemoteAddr) { if($hasRemoteAddr) {
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
$query .= sprintf(' %s verify_addr = INET6_ATON(?)', ++$args > 1 ? 'AND' : 'WHERE'); $query .= sprintf(' %s verify_addr = INET6_ATON(?)', ++$args > 1 ? 'AND' : 'WHERE');
$values[] = $remoteAddr; $values[] = $remoteAddr;
} }
@ -81,12 +77,10 @@ class Verifications {
public function createVerification( public function createVerification(
UuidInterface|string $uuid, UuidInterface|string $uuid,
string $name, string $name,
IPAddress|string $remoteAddr string $remoteAddr
): string { ): string {
if($uuid instanceof UuidInterface) if($uuid instanceof UuidInterface)
$uuid = $uuid->getBytes(); $uuid = $uuid->getBytes();
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
$code = self::generateCode(); $code = self::generateCode();

View file

@ -17,7 +17,7 @@
<p style="color: red;">{{ error.message }}</p> <p style="color: red;">{{ error.message }}</p>
{% endif %} {% endif %}
<form method="post" action="/clients/link"> <form method="post" action="{{ url('clients:link') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<label> <label>
<div class="label-header">Link code</div> <div class="label-header">Link code</div>
@ -69,13 +69,13 @@
</td> </td>
<td class="actions"> <td class="actions">
{% if client.isPending %} {% if client.isPending %}
<form method="post" action="/clients/authorise"> <form method="post" action="{{ url('clients:authorise') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="hidden" name="auth" value="{{ client.id }}"> <input type="hidden" name="auth" value="{{ client.id }}">
<input class="action action-authorise js-authorise-button" type="submit" value="Approve" disabled onclick="return confirm('Are you sure?');"> <input class="action action-authorise js-authorise-button" type="submit" value="Approve" disabled onclick="return confirm('Are you sure?');">
</form> </form>
{% endif %} {% endif %}
<form method="post" action="/clients/deauthorise"> <form method="post" action="{{ url('clients:deauthorise') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="hidden" name="auth" value="{{ client.id }}"> <input type="hidden" name="auth" value="{{ client.id }}">
<input class="action action-deauthorise" type="submit" value="{% if client.isPending %}Deny{% else %}Deauthorise{% endif %}"> <input class="action action-deauthorise" type="submit" value="{% if client.isPending %}Deny{% else %}Deauthorise{% endif %}">
@ -92,7 +92,7 @@
<div class="section accmegadeauth"> <div class="section accmegadeauth">
<h2>Crowd Control</h2> <h2>Crowd Control</h2>
<p>Provided for those who prefer the nuclear option. Pressing the first button will deauthorise all clients, the other one will only remove pending ones.</p> <p>Provided for those who prefer the nuclear option. Pressing the first button will deauthorise all clients, the other one will only remove pending ones.</p>
<form method="post" action="/clients/deauthorise"> <form method="post" action="{{ url('clients:deauthorise') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<button class="form-btn-red" name="auth" value="all">Deauthorise all clients</button> <button class="form-btn-red" name="auth" value="all">Deauthorise all clients</button>
<button class="form-btn-green" name="auth" value="pending">Deny pending clients</button> <button class="form-btn-green" name="auth" value="pending">Deny pending clients</button>
@ -103,7 +103,7 @@
<h2>Linked Minecraft account</h2> <h2>Linked Minecraft account</h2>
<p>This is the Minecraft account currently associated with your Flashii ID. Revoking revoke your access to the servers. <strong>If you're planning on changing your username, please keep in mind that your stats and inventory on the servers WILL NOT carry over automatically.</strong></p> <p>This is the Minecraft account currently associated with your Flashii ID. Revoking revoke your access to the servers. <strong>If you're planning on changing your username, please keep in mind that your stats and inventory on the servers WILL NOT carry over automatically.</strong></p>
<p>Your account has been linked with <b>{{ link.name }}</b> since <b>{{ link.createdTime|date('Y-m-d H:i:s T') }}</b>.</p> <p>Your account has been linked with <b>{{ link.name }}</b> since <b>{{ link.createdTime|date('Y-m-d H:i:s T') }}</b>.</p>
<form method="post" action="/clients/unlink"> <form method="post" action="{{ url('clients:unlink') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="submit" value="Unlink account"> <input type="submit" value="Unlink account">
</form> </form>

View file

@ -21,7 +21,7 @@
<div class="section downloads-item"> <div class="section downloads-item">
<h2>MultiMC/PolyMC/Prism Launcher spoofed accounts file</h2> <h2>MultiMC/PolyMC/Prism Launcher spoofed accounts file</h2>
<p>This file is used in the <a href="/guide">guide</a> to allow you to add an Offline account of your own.</p> <p>This file is used in the <a href="{{ url('guide') }}">guide</a> to allow you to add an Offline account of your own.</p>
<ul> <ul>
<li><a href="/dl/accounts.json" download>Download accounts.json</a></li> <li><a href="/dl/accounts.json" download>Download accounts.json</a></li>

View file

@ -94,7 +94,7 @@
<p>Press the <strong>Add Instance</strong> button on the top left.</p> <p>Press the <strong>Add Instance</strong> button on the top left.</p>
<p> <p>
Under <strong>Custom</strong> make sure the version the server you want to connect to is currently running is selected. Under <strong>Custom</strong> make sure the version the server you want to connect to is currently running is selected.
The versions of the servers are listing on the <a href="/">home page</a> along with their addresses for your convenience. The versions of the servers are listing on the <a href="{{ url('index') }}">home page</a> along with their addresses for your convenience.
</p> </p>
<p>If you plan on using our client side mod, select <strong>Fabric</strong> under <strong>Mod Loader</strong> and just pick whatever the latest version is, which is also what should be selected by default.</p> <p>If you plan on using our client side mod, select <strong>Fabric</strong> under <strong>Mod Loader</strong> and just pick whatever the latest version is, which is also what should be selected by default.</p>
<p>When you've done those things, press OK.</p> <p>When you've done those things, press OK.</p>
@ -104,7 +104,7 @@
<div class="section" id="gac5"> <div class="section" id="gac5">
<h3><a href="#gac5">Step 5. Installing the Flashii Extensions client side mod (Optional)</a></h3> <h3><a href="#gac5">Step 5. Installing the Flashii Extensions client side mod (Optional)</a></h3>
<p> <p>
You can download the Flashii Extensions mod from the <a href="/downloads">downloads page</a>, the latest version of the mod is the first thing linked in the list. You can download the Flashii Extensions mod from the <a href="{{ url('downloads') }}">downloads page</a>, the latest version of the mod is the first thing linked in the list.
Save it anywhere you like as long as you remember where you saved it. Save it anywhere you like as long as you remember where you saved it.
</p> </p>
<p> <p>
@ -124,7 +124,7 @@
<div class="section" id="ctos"> <div class="section" id="ctos">
<h2><a href="#ctos">Connecting to a server</a></h2> <h2><a href="#ctos">Connecting to a server</a></h2>
<p>We're assuming you've already picked a server to play from from the <a href="/">home page</a> and have added it to your server list.</p> <p>We're assuming you've already picked a server to play from from the <a href="{{ url('index') }}">home page</a> and have added it to your server list.</p>
</div> </div>
<div class="section" id="ctos1"> <div class="section" id="ctos1">

View file

@ -35,7 +35,11 @@
<div class="section"> <div class="section">
<h2>Authentication and Skins</h2> <h2>Authentication and Skins</h2>
<p>Because of the deprecation of Mojang/Minecraft accounts and the general distrust in Microsoft's ability to not suspend your account for no reason, our servers run in offline mode with an authentication plugin. This means you can play the game with any username you want without logging in with a Microsoft account in your launcher, so long as someone else isn't already using that name. You don't have to install any mods on your client for the authentication side of things to work, in order to be able to see skins of other players you'll need to install a mod though. You can grab the mod through the <a href="/downloads">downloads</a> page and if you're not sure what to do you can follow the <a href="/guide">guide</a> page!</p> <p>
Because of the deprecation of Mojang/Minecraft accounts and the general distrust in Microsoft's ability to not suspend your account for no reason, our servers run in offline mode with an authentication plugin.
This means you can play the game with any username you want without logging in with a Microsoft account in your launcher, so long as someone else isn't already using that name.
You don't have to install any mods on your client for the authentication side of things to work, in order to be able to see skins of other players you'll need to install a mod though.
You can grab the mod through the <a href="{{ url('downloads') }}">downloads</a> page and if you're not sure what to do you can follow the <a href="{{ url('guide') }}">guide</a> page!</p>
</div> </div>
{# {#

View file

@ -14,19 +14,19 @@
<a href="/"><img src="/assets/weblogo.png" alt="Flashii Minecraft"></a> <a href="/"><img src="/assets/weblogo.png" alt="Flashii Minecraft"></a>
</div> </div>
<div class="header-menu"> <div class="header-menu">
<a href="/">Home</a> <a href="{{ url('index') }}">Home</a>
<a href="/downloads">Downloads</a> <a href="{{ url('downloads') }}">Downloads</a>
<a href="/guide">Guide</a> <a href="{{ url('guide') }}">Guide</a>
{% if globals.is_authed %} {% if globals.is_authed %}
<a href="/clients">Clients</a> <a href="{{ url('clients:index') }}">Clients</a>
<a href="/skins">Skins</a> <a href="{{ url('skins:index') }}">Skins</a>
{% endif %} {% endif %}
</div> </div>
<div class="header-user"> <div class="header-user">
{% if globals.is_authed %} {% if globals.is_authed %}
Logged in as <span style="color: {{ globals.user.colour }}">{{ globals.user.name }}</span> Logged in as <span style="color: {{ globals.user.colour }}">{{ globals.user.name }}</span>
{% else %} {% else %}
<a href="/login">Log in</a> <a href="{{ url('login') }}">Log in</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>

View file

@ -5,7 +5,7 @@
{% block content %} {% block content %}
<div class="section skins-header"> <div class="section skins-header">
<h1>Skins</h1> <h1>Skins</h1>
<p>Because our servers run in offline mode with our own authentication plugin, skins are downloaded from Mojang's servers. To make up for this we also have a client side mod that substitutes the skin and cape server with our own. You can find the mod on the <a href="/downloads">downloads page</a>. Please keep your textures clean.</p> <p>Because our servers run in offline mode with our own authentication plugin, skins are downloaded from Mojang's servers. To make up for this we also have a client side mod that substitutes the skin and cape server with our own. You can find the mod on the <a href="{{ url('downloads') }}">downloads page</a>. Please keep your textures clean.</p>
</div> </div>
<div class="section skin"> <div class="section skin">
@ -17,7 +17,7 @@
{% endif %} {% endif %}
<div class="skins-form"> <div class="skins-form">
<form method="post" action="/skins/upload-skin" enctype="multipart/form-data"> <form method="post" action="{{ url('skins:skin:upload') }}" enctype="multipart/form-data">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="file" name="texture"> <input type="file" name="texture">
<select name="model"> <select name="model">
@ -28,7 +28,7 @@
<input type="submit" value="Upload Skin" class="skins-form-upload"> <input type="submit" value="Upload Skin" class="skins-form-upload">
</form> </form>
{% if skin is not null %} {% if skin is not null %}
<form method="post" action="/skins/delete-skin"> <form method="post" action="{{ url('skins:skin:delete') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="submit" value="Delete Skin" class="skins-form-delete"> <input type="submit" value="Delete Skin" class="skins-form-delete">
</form> </form>
@ -51,13 +51,13 @@
{% endif %} {% endif %}
<div class="skins-form"> <div class="skins-form">
<form method="post" action="/skins/upload-cape" enctype="multipart/form-data"> <form method="post" action="{{ url('skins:cape:upload') }}" enctype="multipart/form-data">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="file" name="texture"> <input type="file" name="texture">
<input type="submit" value="Upload Cape" class="skins-form-upload"> <input type="submit" value="Upload Cape" class="skins-form-upload">
</form> </form>
{% if cape is not null %} {% if cape is not null %}
<form method="post" action="/skins/delete-cape"> <form method="post" action="{{ url('skins:cape:delete') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="submit" value="Delete Cape" class="skins-form-delete"> <input type="submit" value="Delete Cape" class="skins-form-delete">
</form> </form>
@ -74,7 +74,7 @@
<div class="section skinimport"> <div class="section skinimport">
<h2>Import from Mojang account</h2> <h2>Import from Mojang account</h2>
<p>Import skin and cape textures from a Mojang Minecraft account. If you linked the same username as your actual Minecraft account, you can just press Import without anything.</p> <p>Import skin and cape textures from a Mojang Minecraft account. If you linked the same username as your actual Minecraft account, you can just press Import without anything.</p>
<form method="post" action="/skins/import"> <form method="post" action="{{ url('skins:import') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}"> <input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<label> <label>
<div class="label-header">Minecraft Username</div> <div class="label-header">Minecraft Username</div>

View file

@ -1,7 +1,6 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
use Index\Data\Migration\DbMigrationManager; use Index\Db\Migration\{DbMigrationManager,FsDbMigrationRepo};
use Index\Data\Migration\FsDbMigrationRepo;
require_once __DIR__ . '/../mince.php'; require_once __DIR__ . '/../mince.php';

View file

@ -1,7 +1,6 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
use Index\Data\Migration\DbMigrationManager; use Index\Db\Migration\DbMigrationManager;
use Index\Data\Migration\FsDbMigrationRepo;
require_once __DIR__ . '/../mince.php'; require_once __DIR__ . '/../mince.php';