1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

Updated tests

This commit is contained in:
Eldad Fux 2020-05-01 13:24:36 +03:00
parent 9f9cc2692b
commit f77a6a4814
3 changed files with 34 additions and 18 deletions

View file

@ -126,8 +126,12 @@ COPY --from=builder /usr/local/src/vendor /usr/share/nginx/html/vendor
RUN mkdir -p /storage/uploads && \
mkdir -p /storage/cache && \
mkdir -p /storage/config && \
mkdir -p /storage/certificates && \
chown -Rf www-data.www-data /storage/uploads && chmod -Rf 0755 /storage/uploads && \
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache
chown -Rf www-data.www-data /storage/cache && chmod -Rf 0755 /storage/cache && \
chown -Rf www-data.www-data /storage/config && chmod -Rf 0755 /storage/config && \
chown -Rf www-data.www-data /storage/certificates && chmod -Rf 0755 /storage/certificates
# Supervisord Conf
COPY ./docker/supervisord.conf /etc/supervisord.conf

View file

@ -23,7 +23,7 @@ $utopia->get('/v1/health')
$utopia->get('/v1/health/db')
->desc('Check DB Health')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getDB')
@ -39,7 +39,7 @@ $utopia->get('/v1/health/db')
$utopia->get('/v1/health/cache')
->desc('Check Cache Health')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getCache')
@ -55,7 +55,7 @@ $utopia->get('/v1/health/cache')
$utopia->get('/v1/health/time')
->desc('Check Time Health')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getTime')
@ -103,7 +103,7 @@ $utopia->get('/v1/health/time')
$utopia->get('/v1/health/queue/webhooks')
->desc('Check number of pending webhook messages')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueWebhooks')
@ -117,7 +117,7 @@ $utopia->get('/v1/health/queue/webhooks')
$utopia->get('/v1/health/queue/tasks')
->desc('Check the number of pending task messages')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueTasks')
@ -131,7 +131,7 @@ $utopia->get('/v1/health/queue/tasks')
$utopia->get('/v1/health/queue/logs')
->desc('Check the number of pending log messages')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueLogs')
@ -145,7 +145,7 @@ $utopia->get('/v1/health/queue/logs')
$utopia->get('/v1/health/queue/usage')
->desc('Check the number of pending usage messages')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueUsage')
@ -159,7 +159,7 @@ $utopia->get('/v1/health/queue/usage')
$utopia->get('/v1/health/queue/certificates')
->desc('Check the number of pending certificate messages')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getQueueCertificates')
@ -173,7 +173,7 @@ $utopia->get('/v1/health/queue/certificates')
$utopia->get('/v1/health/storage/local')
->desc('Check File System Health')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getStorageLocal')
@ -186,9 +186,21 @@ $utopia->get('/v1/health/storage/local')
if (!is_readable($device->getRoot().'/..')) {
throw new Exception('Device is not readable');
}
if (!is_writable($device->getRoot().'/../uploads')) {
throw new Exception('Device uploads dir is not writable');
}
if (!is_writable($device->getRoot().'/../cache')) {
throw new Exception('Device cache dir is not writable');
}
if (!is_writable($device->getRoot().'/..')) {
throw new Exception('Device is not writable');
if (!is_writable($device->getRoot().'/../config')) {
throw new Exception('Device config dir is not writable');
}
if (!is_writable($device->getRoot().'/../certificates')) {
throw new Exception('Device certificates dir is not writable');
}
$response->json(['status' => 'OK']);
@ -197,7 +209,7 @@ $utopia->get('/v1/health/storage/local')
$utopia->get('/v1/health/storage/anti-virus')
->desc('Check Anti virus Health')
->label('scope', 'health.read')
->label('scope', 'public')
->label('sdk.platform', [APP_PLATFORM_SERVER])
->label('sdk.namespace', 'health')
->label('sdk.method', 'getStorageAntiVirus')

View file

@ -95,7 +95,7 @@ trait HealthBase
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/health/quque/webhooks', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/health/queue/webhooks', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), []);
@ -116,7 +116,7 @@ trait HealthBase
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/health/quque/tasks', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/health/queue/tasks', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), []);
@ -137,7 +137,7 @@ trait HealthBase
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/health/quque/logs', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/health/queue/logs', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), []);
@ -158,7 +158,7 @@ trait HealthBase
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/health/quque/usage', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/health/queue/usage', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), []);
@ -179,7 +179,7 @@ trait HealthBase
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/health/quque/certificates', array_merge([
$response = $this->client->call(Client::METHOD_GET, '/health/queue/certificates', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), []);