Merge branch 'next' into feature/ai-templates
This commit is contained in:
@@ -48,14 +48,6 @@ class Add extends Component
|
|||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
$this->validate();
|
$this->validate();
|
||||||
// if (str($this->value)->startsWith('{{') && str($this->value)->endsWith('}}')) {
|
|
||||||
// $type = str($this->value)->after('{{')->before('.')->value;
|
|
||||||
// if (! collect(SHARED_VARIABLE_TYPES)->contains($type)) {
|
|
||||||
// $this->dispatch('error', 'Invalid shared variable type.', 'Valid types are: team, project, environment.');
|
|
||||||
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
$this->dispatch('saveKey', [
|
$this->dispatch('saveKey', [
|
||||||
'key' => $this->key,
|
'key' => $this->key,
|
||||||
'value' => $this->value,
|
'value' => $this->value,
|
||||||
|
|||||||
@@ -53,30 +53,16 @@ class All extends Component
|
|||||||
|
|
||||||
public function sortEnvironmentVariables()
|
public function sortEnvironmentVariables()
|
||||||
{
|
{
|
||||||
if ($this->resource->type() === 'application') {
|
if (! data_get($this->resource, 'settings.is_env_sorting_enabled')) {
|
||||||
$this->resource->load(['environment_variables', 'environment_variables_preview']);
|
if ($this->resource->environment_variables) {
|
||||||
} else {
|
$this->resource->environment_variables = $this->resource->environment_variables->sortBy('order')->values();
|
||||||
$this->resource->load(['environment_variables']);
|
}
|
||||||
|
|
||||||
|
if ($this->resource->environment_variables_preview) {
|
||||||
|
$this->resource->environment_variables_preview = $this->resource->environment_variables_preview->sortBy('order')->values();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$sortBy = data_get($this->resource, 'settings.is_env_sorting_enabled') ? 'key' : 'order';
|
|
||||||
|
|
||||||
$sortFunction = function ($variables) use ($sortBy) {
|
|
||||||
if (! $variables) {
|
|
||||||
return $variables;
|
|
||||||
}
|
|
||||||
if ($sortBy === 'key') {
|
|
||||||
return $variables->sortBy(function ($item) {
|
|
||||||
return strtolower($item->key);
|
|
||||||
}, SORT_NATURAL | SORT_FLAG_CASE)->values();
|
|
||||||
} else {
|
|
||||||
return $variables->sortBy('order')->values();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$this->resource->environment_variables = $sortFunction($this->resource->environment_variables);
|
|
||||||
$this->resource->environment_variables_preview = $sortFunction($this->resource->environment_variables_preview);
|
|
||||||
|
|
||||||
$this->getDevView();
|
$this->getDevView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,6 +107,8 @@ class All extends Component
|
|||||||
$this->sortEnvironmentVariables();
|
$this->sortEnvironmentVariables();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
|
} finally {
|
||||||
|
$this->refreshEnvs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1076,12 +1076,12 @@ class Service extends BaseModel
|
|||||||
public function environment_variables(): HasMany
|
public function environment_variables(): HasMany
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->hasMany(EnvironmentVariable::class)->orderByRaw("key LIKE 'SERVICE%' DESC, value ASC");
|
return $this->hasMany(EnvironmentVariable::class)->orderByRaw("LOWER(key) LIKE LOWER('SERVICE%') DESC, LOWER(key) ASC");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function environment_variables_preview(): HasMany
|
public function environment_variables_preview(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(EnvironmentVariable::class)->where('is_preview', true)->orderBy('key', 'asc');
|
return $this->hasMany(EnvironmentVariable::class)->where('is_preview', true)->orderByRaw("LOWER(key) LIKE LOWER('SERVICE%') DESC, LOWER(key) ASC");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function workdir()
|
public function workdir()
|
||||||
|
|||||||
@@ -56,13 +56,13 @@
|
|||||||
@else
|
@else
|
||||||
<form wire:submit.prevent='submit' class="flex flex-col gap-2">
|
<form wire:submit.prevent='submit' class="flex flex-col gap-2">
|
||||||
<x-forms.textarea rows="10" class="whitespace-pre-wrap" id="variables" wire:model="variables" label="Production Environment Variables"></x-forms.textarea>
|
<x-forms.textarea rows="10" class="whitespace-pre-wrap" id="variables" wire:model="variables" label="Production Environment Variables"></x-forms.textarea>
|
||||||
|
|
||||||
@if ($showPreview)
|
@if ($showPreview)
|
||||||
<x-forms.textarea rows="10" class="whitespace-pre-wrap" label="Preview Deployments Environment Variables"
|
<x-forms.textarea rows="10" class="whitespace-pre-wrap" label="Preview Deployments Environment Variables"
|
||||||
id="variablesPreview" wire:model="variablesPreview"></x-forms.textarea>
|
id="variablesPreview" wire:model="variablesPreview"></x-forms.textarea>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<x-forms.button type="submit" class="btn btn-primary">Save All Environment Variables</x-forms.button>
|
<x-forms.button type="submit" class="btn btn-primary">Save All Environment Variables</x-forms.button>
|
||||||
</form>
|
</form>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,28 +2,29 @@
|
|||||||
# documentation: https://invoiceninja.github.io/selfhost.html
|
# documentation: https://invoiceninja.github.io/selfhost.html
|
||||||
# slogan: The leading open-source invoicing platform
|
# slogan: The leading open-source invoicing platform
|
||||||
# tags: invoicing, billing, accounting, finance, self-hosted
|
# tags: invoicing, billing, accounting, finance, self-hosted
|
||||||
|
# port: 9000
|
||||||
|
|
||||||
services:
|
services:
|
||||||
invoice-ninja:
|
invoice-ninja:
|
||||||
image: invoiceninja/invoiceninja:5
|
image: invoiceninja/invoiceninja:5
|
||||||
environment:
|
environment:
|
||||||
- SERVICE_FQDN_INVOICENINJA
|
- SERVICE_FQDN_INVOICENINJA
|
||||||
- APP_ENV=production
|
- APP_ENV=${APP_ENV:-production}
|
||||||
- APP_URL=${SERVICE_FQDN_INVOICENINJA}
|
- APP_URL=${SERVICE_FQDN_INVOICENINJA}
|
||||||
- APP_KEY=${SERVICE_BASE64_INVOICENINJA}
|
- APP_KEY=${SERVICE_REALBASE64_INVOICENINJA}
|
||||||
- APP_DEBUG=false
|
- APP_DEBUG=${APP_DEBUG:-false}
|
||||||
- REQUIRE_HTTPS=false
|
- REQUIRE_HTTPS=${REQUIRE_HTTPS:-false}
|
||||||
- PHANTOMJS_PDF_GENERATION=false
|
- PHANTOMJS_PDF_GENERATION=${PHANTOMJS_PDF_GENERATION:-false}
|
||||||
- PDF_GENERATOR=snappdf
|
- PDF_GENERATOR=${PDF_GENERATOR:-snappdf}
|
||||||
- TRUSTED_PROXIES=*
|
- TRUSTED_PROXIES=${TRUSTED_PROXIES:-*}
|
||||||
- QUEUE_CONNECTION=database
|
- QUEUE_CONNECTION=${QUEUE_CONNECTION:-database}
|
||||||
- DB_HOST=mysql
|
- DB_HOST=${DB_HOST:-mariadb}
|
||||||
- DB_PORT=3306
|
- DB_PORT=${DB_PORT:-3306}
|
||||||
- DB_DATABASE=${MYSQL_DATABASE:-invoice_ninja}
|
- DB_DATABASE=${DB_DATABASE:-invoiceninja}
|
||||||
- DB_USERNAME=${SERVICE_USER_MYSQL}
|
- DB_USERNAME=$SERVICE_USER_INVOICENINJA
|
||||||
- DB_PASSWORD=${SERVICE_PASSWORD_MYSQL}
|
- DB_PASSWORD=$SERVICE_PASSWORD_INVOICENINJA
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'curl', '-f', 'http://127.0.0.1:9000']
|
test: ['CMD', 'echo', 'ok']
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 20s
|
timeout: 20s
|
||||||
retries: 10
|
retries: 10
|
||||||
@@ -78,28 +79,19 @@ services:
|
|||||||
post_max_size = 60M
|
post_max_size = 60M
|
||||||
upload_max_filesize = 50M
|
upload_max_filesize = 50M
|
||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mariadb:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
mysql:
|
mariadb:
|
||||||
image: mariadb:lts
|
image: mariadb:11
|
||||||
|
volumes:
|
||||||
|
- mariadb-data:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_USER=${SERVICE_USER_MYSQL}
|
- MYSQL_ROOT_PASSWORD=$SERVICE_PASSWORD_ROOT
|
||||||
- MYSQL_PASSWORD=${SERVICE_PASSWORD_MYSQL}
|
- MYSQL_DATABASE=${DB_DATABASE:-invoiceninja}
|
||||||
- MYSQL_DATABASE=${MYSQL_DATABASE:-invoice_ninja}
|
- MYSQL_USER=$SERVICE_USER_INVOICENINJA
|
||||||
- MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQLROOT}
|
- MYSQL_PASSWORD=$SERVICE_PASSWORD_INVOICENINJA
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test:
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
[
|
|
||||||
"CMD",
|
|
||||||
"mysqladmin",
|
|
||||||
"ping",
|
|
||||||
"-h",
|
|
||||||
"127.0.0.1",
|
|
||||||
"-uroot",
|
|
||||||
"-p${SERVICE_PASSWORD_MYSQLROOT}",
|
|
||||||
]
|
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 20s
|
timeout: 20s
|
||||||
retries: 10
|
retries: 10
|
||||||
volumes:
|
|
||||||
- invoice-ninja-mysql-data:/var/lib/mysql
|
|
||||||
|
|||||||
Reference in New Issue
Block a user