Add file permissions to health check
This commit is contained in:
parent
5103d973a6
commit
44e89f34e9
|
|
@ -37,6 +37,9 @@ abstract class HealthCheckResponse
|
||||||
@BuiltValueField(wireName: 'open_basedir')
|
@BuiltValueField(wireName: 'open_basedir')
|
||||||
bool get openBasedir;
|
bool get openBasedir;
|
||||||
|
|
||||||
|
@BuiltValueField(wireName: 'file_permissions')
|
||||||
|
String get filePermissions;
|
||||||
|
|
||||||
@BuiltValueField(wireName: 'exec')
|
@BuiltValueField(wireName: 'exec')
|
||||||
bool get execEnabled;
|
bool get execEnabled;
|
||||||
|
|
||||||
|
|
@ -55,8 +58,9 @@ abstract class HealthCheckResponse
|
||||||
String get queue;
|
String get queue;
|
||||||
|
|
||||||
// ignore: unused_element
|
// ignore: unused_element
|
||||||
static void _initializeBuilder(HealthCheckResponseBuilder builder) =>
|
static void _initializeBuilder(HealthCheckResponseBuilder builder) => builder
|
||||||
builder..trailingSlash = false;
|
..trailingSlash = false
|
||||||
|
..filePermissions = '';
|
||||||
|
|
||||||
static Serializer<HealthCheckResponse> get serializer =>
|
static Serializer<HealthCheckResponse> get serializer =>
|
||||||
_$healthCheckResponseSerializer;
|
_$healthCheckResponseSerializer;
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,9 @@ class _$HealthCheckResponseSerializer
|
||||||
'open_basedir',
|
'open_basedir',
|
||||||
serializers.serialize(object.openBasedir,
|
serializers.serialize(object.openBasedir,
|
||||||
specifiedType: const FullType(bool)),
|
specifiedType: const FullType(bool)),
|
||||||
|
'file_permissions',
|
||||||
|
serializers.serialize(object.filePermissions,
|
||||||
|
specifiedType: const FullType(String)),
|
||||||
'exec',
|
'exec',
|
||||||
serializers.serialize(object.execEnabled,
|
serializers.serialize(object.execEnabled,
|
||||||
specifiedType: const FullType(bool)),
|
specifiedType: const FullType(bool)),
|
||||||
|
|
@ -111,6 +114,10 @@ class _$HealthCheckResponseSerializer
|
||||||
result.openBasedir = serializers.deserialize(value,
|
result.openBasedir = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(bool)) as bool;
|
specifiedType: const FullType(bool)) as bool;
|
||||||
break;
|
break;
|
||||||
|
case 'file_permissions':
|
||||||
|
result.filePermissions = serializers.deserialize(value,
|
||||||
|
specifiedType: const FullType(String)) as String;
|
||||||
|
break;
|
||||||
case 'exec':
|
case 'exec':
|
||||||
result.execEnabled = serializers.deserialize(value,
|
result.execEnabled = serializers.deserialize(value,
|
||||||
specifiedType: const FullType(bool)) as bool;
|
specifiedType: const FullType(bool)) as bool;
|
||||||
|
|
@ -224,6 +231,8 @@ class _$HealthCheckResponse extends HealthCheckResponse {
|
||||||
@override
|
@override
|
||||||
final bool openBasedir;
|
final bool openBasedir;
|
||||||
@override
|
@override
|
||||||
|
final String filePermissions;
|
||||||
|
@override
|
||||||
final bool execEnabled;
|
final bool execEnabled;
|
||||||
@override
|
@override
|
||||||
final String emailDriver;
|
final String emailDriver;
|
||||||
|
|
@ -248,6 +257,7 @@ class _$HealthCheckResponse extends HealthCheckResponse {
|
||||||
this.cacheEnabled,
|
this.cacheEnabled,
|
||||||
this.phantomEnabled,
|
this.phantomEnabled,
|
||||||
this.openBasedir,
|
this.openBasedir,
|
||||||
|
this.filePermissions,
|
||||||
this.execEnabled,
|
this.execEnabled,
|
||||||
this.emailDriver,
|
this.emailDriver,
|
||||||
this.pendingJobs,
|
this.pendingJobs,
|
||||||
|
|
@ -269,6 +279,8 @@ class _$HealthCheckResponse extends HealthCheckResponse {
|
||||||
phantomEnabled, 'HealthCheckResponse', 'phantomEnabled');
|
phantomEnabled, 'HealthCheckResponse', 'phantomEnabled');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
openBasedir, 'HealthCheckResponse', 'openBasedir');
|
openBasedir, 'HealthCheckResponse', 'openBasedir');
|
||||||
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
|
filePermissions, 'HealthCheckResponse', 'filePermissions');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
execEnabled, 'HealthCheckResponse', 'execEnabled');
|
execEnabled, 'HealthCheckResponse', 'execEnabled');
|
||||||
BuiltValueNullFieldError.checkNotNull(
|
BuiltValueNullFieldError.checkNotNull(
|
||||||
|
|
@ -303,6 +315,7 @@ class _$HealthCheckResponse extends HealthCheckResponse {
|
||||||
cacheEnabled == other.cacheEnabled &&
|
cacheEnabled == other.cacheEnabled &&
|
||||||
phantomEnabled == other.phantomEnabled &&
|
phantomEnabled == other.phantomEnabled &&
|
||||||
openBasedir == other.openBasedir &&
|
openBasedir == other.openBasedir &&
|
||||||
|
filePermissions == other.filePermissions &&
|
||||||
execEnabled == other.execEnabled &&
|
execEnabled == other.execEnabled &&
|
||||||
emailDriver == other.emailDriver &&
|
emailDriver == other.emailDriver &&
|
||||||
pendingJobs == other.pendingJobs &&
|
pendingJobs == other.pendingJobs &&
|
||||||
|
|
@ -326,14 +339,18 @@ class _$HealthCheckResponse extends HealthCheckResponse {
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
$jc(
|
$jc(
|
||||||
$jc(0,
|
$jc(
|
||||||
systemHealth.hashCode),
|
$jc(
|
||||||
phpVersion.hashCode),
|
0,
|
||||||
envWritable.hashCode),
|
systemHealth
|
||||||
dbCheck.hashCode),
|
.hashCode),
|
||||||
cacheEnabled.hashCode),
|
phpVersion.hashCode),
|
||||||
phantomEnabled.hashCode),
|
envWritable.hashCode),
|
||||||
openBasedir.hashCode),
|
dbCheck.hashCode),
|
||||||
|
cacheEnabled.hashCode),
|
||||||
|
phantomEnabled.hashCode),
|
||||||
|
openBasedir.hashCode),
|
||||||
|
filePermissions.hashCode),
|
||||||
execEnabled.hashCode),
|
execEnabled.hashCode),
|
||||||
emailDriver.hashCode),
|
emailDriver.hashCode),
|
||||||
pendingJobs.hashCode),
|
pendingJobs.hashCode),
|
||||||
|
|
@ -352,6 +369,7 @@ class _$HealthCheckResponse extends HealthCheckResponse {
|
||||||
..add('cacheEnabled', cacheEnabled)
|
..add('cacheEnabled', cacheEnabled)
|
||||||
..add('phantomEnabled', phantomEnabled)
|
..add('phantomEnabled', phantomEnabled)
|
||||||
..add('openBasedir', openBasedir)
|
..add('openBasedir', openBasedir)
|
||||||
|
..add('filePermissions', filePermissions)
|
||||||
..add('execEnabled', execEnabled)
|
..add('execEnabled', execEnabled)
|
||||||
..add('emailDriver', emailDriver)
|
..add('emailDriver', emailDriver)
|
||||||
..add('pendingJobs', pendingJobs)
|
..add('pendingJobs', pendingJobs)
|
||||||
|
|
@ -397,6 +415,11 @@ class HealthCheckResponseBuilder
|
||||||
bool get openBasedir => _$this._openBasedir;
|
bool get openBasedir => _$this._openBasedir;
|
||||||
set openBasedir(bool openBasedir) => _$this._openBasedir = openBasedir;
|
set openBasedir(bool openBasedir) => _$this._openBasedir = openBasedir;
|
||||||
|
|
||||||
|
String _filePermissions;
|
||||||
|
String get filePermissions => _$this._filePermissions;
|
||||||
|
set filePermissions(String filePermissions) =>
|
||||||
|
_$this._filePermissions = filePermissions;
|
||||||
|
|
||||||
bool _execEnabled;
|
bool _execEnabled;
|
||||||
bool get execEnabled => _$this._execEnabled;
|
bool get execEnabled => _$this._execEnabled;
|
||||||
set execEnabled(bool execEnabled) => _$this._execEnabled = execEnabled;
|
set execEnabled(bool execEnabled) => _$this._execEnabled = execEnabled;
|
||||||
|
|
@ -436,6 +459,7 @@ class HealthCheckResponseBuilder
|
||||||
_cacheEnabled = $v.cacheEnabled;
|
_cacheEnabled = $v.cacheEnabled;
|
||||||
_phantomEnabled = $v.phantomEnabled;
|
_phantomEnabled = $v.phantomEnabled;
|
||||||
_openBasedir = $v.openBasedir;
|
_openBasedir = $v.openBasedir;
|
||||||
|
_filePermissions = $v.filePermissions;
|
||||||
_execEnabled = $v.execEnabled;
|
_execEnabled = $v.execEnabled;
|
||||||
_emailDriver = $v.emailDriver;
|
_emailDriver = $v.emailDriver;
|
||||||
_pendingJobs = $v.pendingJobs;
|
_pendingJobs = $v.pendingJobs;
|
||||||
|
|
@ -477,10 +501,11 @@ class HealthCheckResponseBuilder
|
||||||
phantomEnabled, 'HealthCheckResponse', 'phantomEnabled'),
|
phantomEnabled, 'HealthCheckResponse', 'phantomEnabled'),
|
||||||
openBasedir: BuiltValueNullFieldError.checkNotNull(
|
openBasedir: BuiltValueNullFieldError.checkNotNull(
|
||||||
openBasedir, 'HealthCheckResponse', 'openBasedir'),
|
openBasedir, 'HealthCheckResponse', 'openBasedir'),
|
||||||
|
filePermissions: BuiltValueNullFieldError.checkNotNull(
|
||||||
|
filePermissions, 'HealthCheckResponse', 'filePermissions'),
|
||||||
execEnabled: BuiltValueNullFieldError.checkNotNull(
|
execEnabled: BuiltValueNullFieldError.checkNotNull(
|
||||||
execEnabled, 'HealthCheckResponse', 'execEnabled'),
|
execEnabled, 'HealthCheckResponse', 'execEnabled'),
|
||||||
emailDriver: BuiltValueNullFieldError.checkNotNull(
|
emailDriver: BuiltValueNullFieldError.checkNotNull(emailDriver, 'HealthCheckResponse', 'emailDriver'),
|
||||||
emailDriver, 'HealthCheckResponse', 'emailDriver'),
|
|
||||||
pendingJobs: BuiltValueNullFieldError.checkNotNull(pendingJobs, 'HealthCheckResponse', 'pendingJobs'),
|
pendingJobs: BuiltValueNullFieldError.checkNotNull(pendingJobs, 'HealthCheckResponse', 'pendingJobs'),
|
||||||
pdfEngine: BuiltValueNullFieldError.checkNotNull(pdfEngine, 'HealthCheckResponse', 'pdfEngine'),
|
pdfEngine: BuiltValueNullFieldError.checkNotNull(pdfEngine, 'HealthCheckResponse', 'pdfEngine'),
|
||||||
trailingSlash: BuiltValueNullFieldError.checkNotNull(trailingSlash, 'HealthCheckResponse', 'trailingSlash'),
|
trailingSlash: BuiltValueNullFieldError.checkNotNull(trailingSlash, 'HealthCheckResponse', 'trailingSlash'),
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class WebClient {
|
||||||
url += '?';
|
url += '?';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!url.contains('per_page')) {
|
if (url.contains('/api/') && !url.contains('per_page')) {
|
||||||
url += '&per_page=999999';
|
url += '&per_page=999999';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class _HealthCheckDialogState extends State<HealthCheckDialog> {
|
||||||
final state = StoreProvider.of<AppState>(context).state;
|
final state = StoreProvider.of<AppState>(context).state;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await webClient.get('${state.account.defaultUrl}/update', '',
|
await webClient.get('${state.account.defaultUrl}/update?secret=', '',
|
||||||
rawResponse: true);
|
rawResponse: true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|
@ -145,6 +145,14 @@ class _HealthCheckDialogState extends State<HealthCheckDialog> {
|
||||||
isWarning: true,
|
isWarning: true,
|
||||||
),
|
),
|
||||||
*/
|
*/
|
||||||
|
if (_response.filePermissions != 'Ok')
|
||||||
|
_HealthListTile(
|
||||||
|
title: 'Invalid File Permissions',
|
||||||
|
isValid: false,
|
||||||
|
subtitle: _response.filePermissions,
|
||||||
|
url:
|
||||||
|
'https://invoiceninja.github.io/docs/self-host-installation',
|
||||||
|
),
|
||||||
if (!state.account.isDocker) ...[
|
if (!state.account.isDocker) ...[
|
||||||
if (!_response.openBasedir)
|
if (!_response.openBasedir)
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue