Merge pull request #4953 from pixelfed/staging

Staging
pull/4956/head
daniel 2024-02-22 03:51:39 -07:00 zatwierdzone przez GitHub
commit 36f84db03b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
6 zmienionych plików z 34 dodań i 16 usunięć

Wyświetl plik

@ -15,6 +15,7 @@
- Update api v1/v2 instance endpoints, bump mastoapi version from 2.7.2 to 3.5.3 ([545f7d5e](https://github.com/pixelfed/pixelfed/commit/545f7d5e))
- Update ApiV1Controller, implement better limit logic to gracefully handle requests with limits that exceed the max ([1f74a95d](https://github.com/pixelfed/pixelfed/commit/1f74a95d))
- Update AdminCuratedRegisterController, show oldest applications first ([c4dde641](https://github.com/pixelfed/pixelfed/commit/c4dde641))
- Update Directory logic, add curated onboarding support ([59c70239](https://github.com/pixelfed/pixelfed/commit/59c70239))
- ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.12 (2024-02-16)](https://github.com/pixelfed/pixelfed/compare/v0.11.11...v0.11.12)

Wyświetl plik

@ -75,6 +75,7 @@ trait AdminDirectoryController
}
$res['community_guidelines'] = config_cache('app.rules') ? json_decode(config_cache('app.rules'), true) : [];
$res['curated_onboarding'] = (bool) config_cache('instance.curated_registration.enabled');
$res['open_registration'] = (bool) config_cache('pixelfed.open_registration');
$res['oauth_enabled'] = (bool) config_cache('pixelfed.oauth_enabled') && file_exists(storage_path('oauth-public.key')) && file_exists(storage_path('oauth-private.key'));
@ -124,7 +125,7 @@ trait AdminDirectoryController
$res['requirements_validator'] = $validator->errors();
$res['is_eligible'] = $res['open_registration'] &&
$res['is_eligible'] = ($res['open_registration'] || $res['curated_onboarding']) &&
$res['oauth_enabled'] &&
$res['activitypub_enabled'] &&
count($res['requirements_validator']) === 0 &&
@ -227,7 +228,7 @@ trait AdminDirectoryController
->each(function($name) {
Storage::delete($name);
});
$path = $request->file('banner_image')->store('public/headers');
$path = $request->file('banner_image')->storePublicly('public/headers');
$res['banner_image'] = $path;
ConfigCacheService::put('app.banner_image', url(Storage::url($path)));
@ -249,7 +250,8 @@ trait AdminDirectoryController
{
$reqs = [];
$reqs['feature_config'] = [
'open_registration' => config_cache('pixelfed.open_registration'),
'open_registration' => (bool) config_cache('pixelfed.open_registration'),
'curated_onboarding' => (bool) config_cache('instance.curated_registration.enabled'),
'activitypub_enabled' => config_cache('federation.activitypub.enabled'),
'oauth_enabled' => config_cache('pixelfed.oauth_enabled'),
'media_types' => Str::of(config_cache('pixelfed.media_types'))->explode(','),
@ -265,7 +267,8 @@ trait AdminDirectoryController
];
$validator = Validator::make($reqs['feature_config'], [
'open_registration' => 'required|accepted',
'open_registration' => 'required_unless:curated_onboarding,true',
'curated_onboarding' => 'required_unless:open_registration,true',
'activitypub_enabled' => 'required|accepted',
'oauth_enabled' => 'required|accepted',
'media_types' => [

Wyświetl plik

@ -78,10 +78,11 @@ class PixelfedDirectoryController extends Controller
$res['community_guidelines'] = json_decode($guidelines->v, true);
}
$openRegistration = ConfigCache::whereK('pixelfed.open_registration')->first();
if($openRegistration) {
$res['open_registration'] = (bool) $openRegistration;
}
$openRegistration = (bool) config_cache('pixelfed.open_registration');
$res['open_registration'] = $openRegistration;
$curatedOnboarding = (bool) config_cache('instance.curated_registration.enabled');
$res['curated_onboarding'] = $curatedOnboarding;
$oauthEnabled = ConfigCache::whereK('pixelfed.oauth_enabled')->first();
if($oauthEnabled) {

2
public/js/admin.js vendored

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -16,7 +16,7 @@
"/js/profile-directory.js": "/js/profile-directory.js?id=1615064235d2acf08d84c3e3d1232d7e",
"/js/story-compose.js": "/js/story-compose.js?id=50d723634d8d22db14d630a02774e5b7",
"/js/direct.js": "/js/direct.js?id=2f7df211df1b62a0637ed87f2457e918",
"/js/admin.js": "/js/admin.js?id=94f0f2d3055589bba0cf1a10634eb848",
"/js/admin.js": "/js/admin.js?id=82824fd5f308431811c9e7bbd0f22163",
"/js/spa.js": "/js/spa.js?id=01593ff06a001a670545ede671e2027e",
"/js/stories.js": "/js/stories.js?id=f3d502fa937e5fa90d173d5d7aa64e2c",
"/js/portfolio.js": "/js/portfolio.js?id=e8a1f57ef2c7c9ff40265502da5b84ac",

Wyświetl plik

@ -109,12 +109,20 @@
<div class="card text-left">
<div class="list-group list-group-flush">
<div class="list-group-item">
<i
class="far"
:class="[ requirements.open_registration ? 'fa-check-circle text-success' : 'fa-exclamation-circle text-danger']"></i>
<span class="ml-2 font-weight-bold">
{{ requirements.open_registration ? 'Open' : 'Closed' }} account registration
</span>
<template v-if="requirements.curated_onboarding === true">
<i class="far fa-exclamation-circle text-success"></i>
<span class="ml-2 font-weight-bold">
Curated account registration
</span>
</template>
<template v-else>
<i
class="far"
:class="[ requirements.open_registration ? 'fa-check-circle text-success' : 'fa-exclamation-circle text-danger']"></i>
<span class="ml-2 font-weight-bold">
{{ requirements.open_registration ? 'Open' : 'Closed' }} account registration
</span>
</template>
</div>
<div class="list-group-item">
@ -895,6 +903,7 @@
activitypub_enabled: undefined,
open_registration: undefined,
oauth_enabled: undefined,
curated_onboarding: undefined,
},
feature_config: [],
requirements_validator: [],
@ -951,6 +960,10 @@
this.requirements.open_registration = res.data.open_registration;
}
if(res.data.curated_onboarding) {
this.requirements.curated_onboarding = res.data.curated_onboarding;
}
if(res.data.oauth_enabled) {
this.requirements.oauth_enabled = res.data.oauth_enabled;
}