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

Added env vars for cloud functions

This commit is contained in:
Eldad Fux 2020-07-19 17:42:46 +03:00
parent 6948d6cb25
commit 4e7580f1a8
5 changed files with 17 additions and 7 deletions

4
.env
View file

@ -17,4 +17,6 @@ _APP_INFLUXDB_PORT=8086
_APP_STATSD_HOST=telegraf
_APP_STATSD_PORT=8125
_APP_SMTP_HOST=maildev
_APP_SMTP_PORT=25
_APP_SMTP_PORT=25
_APP_FUNCTIONS_TIMEOUT=900
_APP_FUNCTIONS_CONTAINERS=10

View file

@ -92,6 +92,8 @@ ENV TZ=Asia/Tel_Aviv \
_APP_STATSD_PORT=8125 \
_APP_SMTP_HOST=smtp \
_APP_SMTP_PORT=25 \
_APP_FUNCTIONS_TIMEOUT=900 \
_APP_FUNCTIONS_CONTAINERS=10 \
_APP_SETUP=self-hosted \
_APP_VERSION=$VERSION
#ENV _APP_SMTP_SECURE ''

View file

@ -368,6 +368,7 @@ App::get('/console/functions/function')
->setParam('events', Config::getParam('events', []))
->setParam('fileLimit', App::getEnv('_APP_STORAGE_LIMIT', 0))
->setParam('fileLimitHuman', Storage::human(App::getEnv('_APP_STORAGE_LIMIT', 0)))
->setParam('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900))
;
$layout

View file

@ -2,6 +2,7 @@
$fileLimit = $this->getParam('fileLimit', 0);
$fileLimitHuman = $this->getParam('fileLimitHuman', 0);
$events = array_keys($this->getParam('events', []));
$timeout = $this->getParam('timeout', 900);
?>
<div
@ -112,9 +113,9 @@ $events = array_keys($this->getParam('events', []));
<b data-ls-bind="{{tag.$id}}"></b> &nbsp;
<span class="text-fade" data-ls-bind="{{tag.command}}"></span>
<div class="text-size-small margin-top-small clear">
<span class="pull-start" data-ls-bind="Created {{tag.dateCreated|timeSince}} &nbsp; | &nbsp; {{tag.codeSize|humanFileSize}} &nbsp; | &nbsp; "></span>
<span class="pull-start" data-ls-bind="Created {{tag.dateCreated|timeSince}} &nbsp; | &nbsp; {{tag.codeSize|humanFileSize}}"></span>
<form name="functions.deleteTag" class="pull-start"
<form data-ls-if="{{tag.$id}} !== {{project-function.tag}}" name="functions.deleteTag" class="pull-start"
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Function Tag"
@ -130,7 +131,7 @@ $events = array_keys($this->getParam('events', []));
data-failure-param-alert-classname="error">
<input type="hidden" name="tagId" data-ls-bind="{{tag.$id}}" />
<button type="submit" class="link text-danger text-size-small">Delete</button>
&nbsp; | &nbsp;<button type="submit" class="link text-danger text-size-small">Delete</button>
</form>
</div>
</li>
@ -164,7 +165,7 @@ $events = array_keys($this->getParam('events', []));
<label for="tag-command">Command</label>
<input type="text" id="tag-command" name="command" required autocomplete="off" class="margin-bottom" placeholder="node main.js" />
<label for="tag-code">Gzipped Code</label>
<label for="tag-code">Gzipped Code (tar.gz file)</label>
<input type="file" name="code" id="tag-code" size="1" required accept="application/x-gzip">
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom-large">(Max file size allowed: <?php echo $fileLimitHuman; ?>)</div>
@ -407,8 +408,8 @@ $events = array_keys($this->getParam('events', []));
<input name="name" id="function-name" type="text" autocomplete="off" data-ls-bind="{{project-function.name}}" data-forms-text-direction required placeholder="Function Name" />
<label for="timeout">Timeout (seconds) <span class="tooltip small" data-tooltip="Limit the execution time of your function."><i class="icon-info-circled"></i></span></label>
<input name="timeout" id="function-timeout" type="number" autocomplete="off" data-ls-bind="{{project-function.timeout}}" min="1" max="900" />
<div class="text-size-small text-fade margin-bottom margin-top-negative-small">Max value is 900 seconds (15 minutes)</div>
<input name="timeout" id="function-timeout" type="number" autocomplete="off" data-ls-bind="{{project-function.timeout}}" min="1" max="<?php echo $this->escape($timeout); ?>" />
<div class="text-size-small text-fade margin-bottom margin-top-negative-small">Max value is <?php echo $this->escape(number_format($timeout)); ?> seconds (<?php echo $this->escape((int) ($timeout / 60)); ?> minutes)</div>
</section>
<section class="margin-bottom">

View file

@ -80,6 +80,8 @@ services:
- _APP_DB_PASS
- _APP_INFLUXDB_HOST
- _APP_INFLUXDB_PORT
- _APP_FUNCTIONS_TIMEOUT
- _APP_FUNCTIONS_CONTAINERS
appwrite-worker-usage:
entrypoint: worker-usage
@ -234,6 +236,8 @@ services:
- _APP_DB_SCHEMA
- _APP_DB_USER
- _APP_DB_PASS
- _APP_FUNCTIONS_TIMEOUT
- _APP_FUNCTIONS_CONTAINERS
appwrite-worker-mails:
entrypoint: worker-mails