Skip to content

Commit

Permalink
Merge branch 'master' into css-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko authored Jul 10, 2023
2 parents a2036bc + 9696ca9 commit dfe0acc
Show file tree
Hide file tree
Showing 49 changed files with 2,866 additions and 2,403 deletions.
2 changes: 1 addition & 1 deletion SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ At this point you should be able to access the site via whatever webserver you c
- Clone this repository.
- Set `GITHUB_TOKEN` environment variable (usually by `export GITHUB_TOKEN=ghs_...`).
- It'll be recorded to composer and app config so it doesn't need to be set again next time.
- Run `bin/docker_dev.sh`. Make sure the repository folder is owned by the user executing this command (must be non-root).
- Run `bin/docker_dev.sh`. Make sure the repository folder is owned by the user executing this command (must be non-root). The site will be hosted at http://localhost:8080/.
- Due to the nature of Docker (a container is killed when the command running in it finishes), the Yarn container will be run in watch mode.
- Do note that the supplied Elasticsearch container uses a high (1+ GB) amount of RAM. Ensure that your system (or virtual machine, if running on Windows/macOS) has a necessary amount of memory allocated (at least 2 GB). If you can't (or don't want to), you can comment out the relevant elasticsearch lines in `docker-compose.yml`.
- To run any of the below commands, make sure you are using the docker container: `docker compose run --rm php`.
Expand Down
5 changes: 4 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class Kernel extends HttpKernel
],
];

// TODO: check if laravel builtin order makes sense
protected $middlewarePriority = [];

/**
* The application's route middleware.
*
Expand All @@ -54,8 +57,8 @@ class Kernel extends HttpKernel
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'check-user-restricted' => Middleware\CheckUserRestricted::class,
'guest' => Middleware\RedirectIfAuthenticated::class,
'require-scopes' => Middleware\RequireScopes::class,
'request-cost' => Middleware\RequestCost::class,
'require-scopes' => Middleware\RequireScopes::class,
'throttle' => Middleware\ThrottleRequests::class,
'verify-user' => Middleware\VerifyUser::class,
];
Expand Down
2 changes: 1 addition & 1 deletion app/Libraries/Markdown/Indexing/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private function renderers()
CustomContainerInline::class => new Renderers\InlineRenderer(),
ExtensionBlock\BlockQuote::class => new Renderers\BlockRenderer(),
ExtensionBlock\FencedCode::class => new Renderers\NoopRenderer(),
ExtensionBlock\Heading::class => new Renderers\NoopRenderer(),
ExtensionBlock\Heading::class => new Renderers\BlockRenderer(),
ExtensionBlock\HtmlBlock::class => new Renderers\NoopRenderer(),
ExtensionBlock\IndentedCode::class => new Renderers\BlockRenderer(),
ExtensionBlock\ListBlock::class => new Renderers\ListBlockRenderer(),
Expand Down
4 changes: 4 additions & 0 deletions app/Libraries/OsuAuthorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,10 @@ public function checkScorePin(?User $user, ScoreBest|Solo\Score $score): string
return $prefix.'not_owner';
}

if ($score instanceof Solo\Score && config('osu.user.hide_pinned_solo_scores')) {
return $prefix.'disabled_type';
}

$pinned = $user->scorePins()->forRuleset($score->getMode())->withVisibleScore()->count();

if ($pinned >= $user->maxScorePins()) {
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Forum/Topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ public function setIssueTag($tag)
$this->topic_title = "[{$tag}] {$this->topic_title}";
}

$this->save();
$this->saveOrExplode();
}

public function unsetIssueTag($tag)
Expand All @@ -806,7 +806,7 @@ public function unsetIssueTag($tag)
trim(str_replace("[{$tag}]", '', $this->topic_title))
);

$this->save();
$this->saveOrExplode();
}

public function hasIssueTag($tag)
Expand Down
9 changes: 9 additions & 0 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
use App\Http\Controllers\Passport\AuthorizationController;
use App\Models\OAuth\Client;
use App\Models\OAuth\Token;
use Auth;
use Carbon\Carbon;
use Illuminate\Contracts\Auth\StatefulGuard;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Laravel\Passport\Http\Controllers\ApproveAuthorizationController;
use Laravel\Passport\Http\Controllers\DenyAuthorizationController;
Expand All @@ -25,6 +27,13 @@ class AuthServiceProvider extends ServiceProvider
public function register()
{
Passport::ignoreMigrations();
Passport::ignoreRoutes();

// Copied from PassportServiceProvider with the correct
// AuthorizationController class.
$this->app->when(AuthorizationController::class)
->needs(StatefulGuard::class)
->give(fn () => Auth::guard(config('passport.guard', null)));
}

public function boot()
Expand Down
10 changes: 5 additions & 5 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ function wiki_image_url(string $path, bool $fullUrl = true)

function wiki_url($path = null, $locale = null, $api = null, $fullUrl = true)
{
$path = $path === null ? 'Main_Page' : str_replace(['%2F', '%23'], ['/', '#'], rawurlencode($path));
$path = $path === null ? 'Main_page' : str_replace(['%2F', '%23'], ['/', '#'], rawurlencode($path));

$params = [
'path' => 'WIKI_PATH',
Expand Down Expand Up @@ -1121,11 +1121,11 @@ function nav_links()
'layout.header.store.orders' => route('store.orders.index'),
];
$links['help'] = [
'page_title.main.wiki_controller._' => wiki_url('Main_Page'),
'page_title.main.wiki_controller._' => wiki_url('Main_page'),
'layout.menu.help.getFaq' => wiki_url('FAQ'),
'layout.menu.help.getRules' => wiki_url('Rules'),
'layout.menu.help.getAbuse' => wiki_url('Reporting_Bad_Behaviour/Abuse'),
'layout.menu.help.getSupport' => wiki_url('Help_Centre'),
'layout.menu.help.getAbuse' => wiki_url('Reporting_bad_behaviour/Abuse'),
'layout.menu.help.getSupport' => wiki_url('Help_centre'),
];

return $links;
Expand All @@ -1144,7 +1144,7 @@ function footer_landing_links()
'faq' => wiki_url('FAQ'),
'forum' => route('forum.forums.index'),
'livestreams' => route('livestreams.index'),
'wiki' => wiki_url('Main_Page'),
'wiki' => wiki_url('Main_page'),
],
'legal' => footer_legal_links(),
];
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
"egulias/email-validator": "*",
"elasticsearch/elasticsearch": "^7.12.0",
"ezyang/htmlpurifier": "*",
"firebase/php-jwt": "^5.2",
"firebase/php-jwt": "*",
"graham-campbell/github": "*",
"guzzlehttp/guzzle": "*",
"itsgoingd/clockwork": "^5.1",
"jenssegers/agent": "*",
"knuckleswtf/scribe": "^4.0",
"laravel/framework": "^8.58",
"laravel/helpers": "^1.1",
"laravel/octane": "^1.3",
"laravel/framework": "^10.0",
"laravel/helpers": "*",
"laravel/octane": "*",
"laravel/passport": "*",
"laravel/slack-notification-channel": "^2.0",
"laravel/slack-notification-channel": "*",
"laravel/tinker": "*",
"laravelcollective/html": "*",
"league/commonmark": "^2.0",
Expand All @@ -42,7 +42,7 @@
"mariuzzo/laravel-js-localization": "*",
"paypal/paypal-checkout-sdk": "*",
"php-ds/php-ds": "^1.3",
"sentry/sentry-laravel": "^2.8",
"sentry/sentry-laravel": "*",
"symfony/yaml": "*",
"tightenco/ziggy": ">=0.8.1",
"xsolla/xsolla-sdk-php": "dev-php81"
Expand All @@ -51,12 +51,12 @@
"beyondcode/laravel-query-detector": "*",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"dms/phpunit-arraysubset-asserts": "^0.3.0",
"facade/ignition": "^2.10",
"laravel/dusk": "*",
"mockery/mockery": "*",
"nunomaduro/collision": "^5.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": ">=9.5",
"slevomat/coding-standard": "^8.7",
"spatie/laravel-ignition": "^2.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/css-selector": "*",
"symfony/dom-crawler": "*"
Expand Down
Loading

0 comments on commit dfe0acc

Please sign in to comment.