Update admin diagnostics, add more configuration data to help diagnose potential issues

This commit is contained in:
Daniel Supernault 2022-02-27 01:26:02 -07:00
parent 02cd7059ca
commit eab96fc35c
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -1,6 +1,4 @@
@extends('admin.partial.template') @extends('admin.partial.template-full')
@include('admin.settings.sidebar')
@section('section') @section('section')
<div class="title mb-4"> <div class="title mb-4">
@ -22,16 +20,25 @@
<strong>APP_DOMAIN:</strong> <strong>APP_DOMAIN:</strong>
<span>{{config_cache('pixelfed.domain.app')}}</span> <span>{{config_cache('pixelfed.domain.app')}}</span>
</li> </li>
@if(function_exists('shell_exec'))
<li>
<strong>Version:</strong>
<span>{{config('pixelfed.version')}}-{{ @shell_exec('git log --pretty="%h" -n1 HEAD') ?? 'unknown git commit' }}</span>
</li>
@else
<li> <li>
<strong>Version:</strong> <strong>Version:</strong>
<span>{{config('pixelfed.version')}}</span> <span>{{config('pixelfed.version')}}</span>
</li> </li>
@endif
<li> <li>
<strong>PHP:</strong> <strong>PHP:</strong>
<span>{{phpversion()}}</span> <span>{{phpversion()}}</span>
</li> </li>
@foreach([ @foreach([
'bcmath', 'bcmath',
'gd',
'imagick',
'ctype', 'ctype',
'curl', 'curl',
'intl', 'intl',
@ -40,10 +47,12 @@
'openssl', 'openssl',
'redis' 'redis'
] as $ext) ] as $ext)
@if(!extension_loaded($ext))
<li> <li>
<strong>PHP-{{$ext}}:</strong> <strong>PHP-{{$ext}}:</strong>
<span>{{extension_loaded($ext) ? 'Installed' : 'Not installed'}}</span> <span>Not installed/loaded</span>
</li> </li>
@endif
@endforeach @endforeach
<li> <li>
<strong>Database:</strong> <strong>Database:</strong>
@ -58,6 +67,115 @@
<strong>Storage:</strong> <strong>Storage:</strong>
<span>{{is_writable(base_path('storage/')) ? 'Writable' : 'Not writable'}}</span> <span>{{is_writable(base_path('storage/')) ? 'Writable' : 'Not writable'}}</span>
</li> </li>
<li>
<strong>Image Driver:</strong>
<span>{{ config('image.driver') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">REDIS</span> Ping:</strong>
<span>{{ \Illuminate\Support\Facades\Redis::command('ping') ? '✅' : '❌' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">PHP</span> memory_limit:</strong>
<span>{{ ini_get('memory_limit') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">PHP</span> post_max_size:</strong>
<span>{{ ini_get('post_max_size') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">PHP</span> upload_max_filesize:</strong>
<span>{{ ini_get('upload_max_filesize') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> Cache Driver:</strong>
<span>{{ config_cache('cache.default') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> Mail Driver:</strong>
<span>{{ config_cache('mail.driver') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> Mail Host:</strong>
<span>{{ config_cache('mail.host') ? substr(config_cache('mail.host'), 0, 5) . str_repeat('*', strlen(config_cache('mail.host')) - 5) : 'undefined' }}</span>
</li>
@if(config_cache('mail.driver') == 'mailgun')
<li>
<strong><span class="badge badge-primary">APP</span> Mailgun Domain:</strong>
<span>{{ config_cache('services.mailgun.domain') ?? 'undefined' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> Mailgun Secret:</strong>
<span>{{ config_cache('services.mailgun.secret') ? str_repeat('*', strlen(config_cache('services.mailgun.secret'))) : 'undefined' }}</span>
</li>
@endif
@if(config_cache('mail.driver') == 'ses')
<li>
<strong><span class="badge badge-primary">APP</span> SES Key:</strong>
<span>{{ config_cache('services.ses.key') ? str_repeat('*', strlen(config_cache('services.ses.key'))) : 'undefined' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> SES Secret:</strong>
<span>{{ config_cache('services.ses.secret') ? str_repeat('*', strlen(config_cache('services.ses.secret'))) : 'undefined' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> SES Region:</strong>
<span>{{ config_cache('services.ses.region') ?? 'undefined' }}</span>
</li>
@endif
<li>
<strong><span class="badge badge-primary">APP</span> Queue Driver:</strong>
<span>{{ config_cache('queue.default') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> Session Driver:</strong>
<span>{{ config_cache('session.driver') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> Session Lifetime:</strong>
<span>{{ config_cache('session.lifetime') }}</span>
</li>
<li>
<strong><span class="badge badge-primary">APP</span> Session Domain:</strong>
<span>{{ config_cache('session.domain') }}</span>
</li>
<li>
<div class="tt">
<strong><span class="badge badge-primary">CONFIG</span> pixelfed: </strong>
<span class="text-truncate">{!! json_encode(config_cache('pixelfed'), JSON_UNESCAPED_SLASHES) !!}</span>
</div>
</li>
<li>
<div class="tt">
<strong><span class="badge badge-primary">CONFIG</span> federation: </strong>
<span class="text-truncate">{!! json_encode(config_cache('federation'), JSON_UNESCAPED_SLASHES) !!}</span>
</div>
</li>
<li>
<strong><span class="badge badge-primary">ACTIVITYPUB</span> instance actor created: </strong>
<span>{{ \App\Models\InstanceActor::count() ? '✅' : '❌' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">ACTIVITYPUB</span> instance actor cached: </strong>
<span>{{ Cache::get(\App\Models\InstanceActor::PROFILE_KEY) ? '✅' : '❌' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">OAUTH</span> enabled: </strong>
<span>{{ config_cache('pixelfed.oauth_enabled') ? '✅' : '❌' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">OAUTH</span> token_expiration</strong>
<span>{{ config_cache('instance.oauth.token_expiration') }} days</span>
</li>
<li>
<strong><span class="badge badge-primary">OAUTH</span> public key exists: </strong>
<span>{{ file_exists(storage_path('oauth-public.key')) ? '✅' : '❌' }}</span>
</li>
<li>
<strong><span class="badge badge-primary">OAUTH</span> private key exists: </strong>
<span>{{ file_exists(storage_path('oauth-private.key')) ? '✅' : '❌' }}</span>
</li>
</ul> </ul>
</div> </div>
<div class="pb-3 border-bottom"> <div class="pb-3 border-bottom">
@ -79,6 +197,20 @@
@endsection @endsection
@push('scripts') @push('scripts')
<style type="text/css">
.tt {
display: flex;
}
.information strong {
margin-right: 5px;
}
.information .text-truncate {
overflow: hidden;
max-width: 200px;
}
</style>
<script type="text/javascript" src="{{mix('js/components.js')}}"></script> <script type="text/javascript" src="{{mix('js/components.js')}}"></script>
<script type="text/javascript"> <script type="text/javascript">
$('.decrypt-payload').on('click', function(e) { $('.decrypt-payload').on('click', function(e) {
@ -103,7 +235,7 @@
$('.copy-information').on('click', function(e) { $('.copy-information').on('click', function(e) {
let text = document.querySelector('.information').innerText; let text = document.querySelector('.information').innerText;
let payload = '=======================\n Instance Diagnostic \n=======================\n' + text + '\n========= END =========\n'; let payload = '=======================\n Pixelfed Instance Diagnostic v0.2 \n=======================\n' + text + '\n========= END =========\n';
navigator.clipboard.writeText(payload); navigator.clipboard.writeText(payload);
swal('Copied', 'Successfully copied diagnostic information to clipboard!', 'success'); swal('Copied', 'Successfully copied diagnostic information to clipboard!', 'success');
}); });