Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.0.0-beta.358 #3783

Merged
merged 227 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
5262676
feat: Add Supertokens template
marcomaiermm Jun 8, 2024
7d1f760
add optional api key
marcomaiermm Jun 8, 2024
2637afc
add service template for azimutt
tonylyjones Jun 26, 2024
ac887ee
Adding service for paperless
martonsz Jun 29, 2024
3847076
feat: adds forgejo service with runners
DarkGhostHunter Jun 29, 2024
c1612a9
Fixes environment variables
DarkGhostHunter Jun 30, 2024
204aaf5
Fixes file name
DarkGhostHunter Jun 30, 2024
807304c
Adds healthcheck for DID
DarkGhostHunter Jun 30, 2024
793f91e
Adds healthcheck for runner
DarkGhostHunter Jun 30, 2024
ea81d8e
Adds external migration configuration
DarkGhostHunter Jul 4, 2024
cdb146f
Merge branch 'next' into feat-forgejo
DarkGhostHunter Jul 10, 2024
631b709
Merge branch 'coollabsio:main' into feat-forgejo
DarkGhostHunter Jul 14, 2024
e1a585c
Healtcheck done to the process name
DarkGhostHunter Jul 14, 2024
45b4d1b
Merge branch 'next' into feat-forgejo
DarkGhostHunter Jul 17, 2024
fa253b9
Merge branch 'coollabsio:main' into feat-forgejo
DarkGhostHunter Jul 17, 2024
633c825
Adds missing forgejo logo svg
DarkGhostHunter Jul 17, 2024
48886ca
feat: add easyappointments service template
leocabeza Jul 19, 2024
e7d45ac
Merge branch 'next' into next
leocabeza Jul 22, 2024
6b178f8
added bookstack template
cr4zyiw4n Jul 24, 2024
c3e80fb
Merge branch 'next' into next
leocabeza Jul 26, 2024
380f2f4
feat: Add Mautic 4 and 5 to service templates
JuanxCursed Jul 30, 2024
868bbaf
Merge branch 'next' into next
leocabeza Aug 1, 2024
22a58ee
Add Organizr
Telokis Aug 6, 2024
a219942
Fix icon path
Telokis Aug 6, 2024
20acb43
Merge branch 'next' into next
leocabeza Aug 7, 2024
3194570
add joplin compose
nekomi2 Aug 8, 2024
58dcf76
Merge branch 'next' into next
leocabeza Aug 8, 2024
f080a4b
Improve healthcheck
Telokis Aug 11, 2024
b417565
Merge branch 'next' into next
leocabeza Aug 12, 2024
4f23d38
fix: update mattermost image tag and add default port
sroepges Aug 16, 2024
7f59efd
chore: add mattermost logo as svg
sroepges Aug 16, 2024
b8cdb40
chore: add mattermost svg to compose
sroepges Aug 16, 2024
a6f457f
feat: add keycloak template
christiankolbow Aug 17, 2024
2f356b1
feat: add onedev template
christiankolbow Aug 17, 2024
0f7a199
Merge branch 'next' into main
sroepges Aug 18, 2024
1653fcb
feat: add ntfy template
christiankolbow Aug 18, 2024
dfb9081
Add traccar to service templates
Pilpin Aug 18, 2024
fd4316e
Update traccar.yml
Pilpin Aug 18, 2024
58831b8
fix: signup
christiankolbow Aug 18, 2024
d5e6a64
cleanup
christiankolbow Aug 18, 2024
2fc0ce1
remove duplicated env
christiankolbow Aug 18, 2024
e1bcae7
add resend.yaml
8times4 Aug 19, 2024
4b14c7e
remove comments
8times4 Aug 19, 2024
cf99ec7
add svg
8times4 Aug 19, 2024
f3360be
feat: add cloudbeaver template
christiankolbow Aug 22, 2024
c1eb01f
Upgrade Authentik
FranckKe Aug 22, 2024
a4dedb8
Add Nextcloud with Postgres
FranckKe Aug 22, 2024
15733ea
Add freshrss to service templates
Aug 24, 2024
3c72035
Update documentation part of yaml
Pilpin Aug 24, 2024
135eb83
Add Vvveb CMS template
givanz Aug 25, 2024
4647698
audiobookshelf added
Amitind Aug 27, 2024
918d8e7
added libreoffice
Amitind Aug 29, 2024
d53c1f9
fix: remove env, change timezone
christiankolbow Aug 31, 2024
028c41b
fix: postgres healthcheck
christiankolbow Aug 31, 2024
48e4ebd
remove unnecessary variables
christiankolbow Aug 31, 2024
82f96fe
add proxy-headers
christiankolbow Aug 31, 2024
7645047
Merge branch 'next' into next
leocabeza Sep 1, 2024
611e80c
Update Authentik to 2024.8.0
FranckKe Sep 5, 2024
d469f4b
add cryptgeon template
cupcakearmy Sep 5, 2024
44ceb09
fix rabbit-mq
djsisson Sep 5, 2024
14c8023
Merge branch 'next' into next
leocabeza Sep 7, 2024
b8fcdf7
Add kimai template
nizetic Sep 14, 2024
8166163
feat: add immich service
OG-Jons Sep 15, 2024
c5fd7ba
feat: auto generate url
OG-Jons Sep 15, 2024
dd8d0a6
feat: refactored to work with coolify auto env vars
OG-Jons Sep 15, 2024
1b8365d
fix code review reported issues
JuanxCursed Sep 19, 2024
3a352e8
Merge branch 'next' into feat-forgejo
DarkGhostHunter Sep 22, 2024
a6e50ce
Merge branch 'next' into next
leocabeza Sep 23, 2024
6aa7cfc
Merge branch 'next' into next
leocabeza Sep 30, 2024
d6be14c
Merge branch 'coollabsio:main' into main
OG-Jons Oct 1, 2024
b324303
feat: add dozzle template
danielalves96 Oct 3, 2024
dce02c1
feat: add Homebox template
danielalves96 Oct 3, 2024
43e8ab7
feat: add qbittorrent template
statickidz Oct 4, 2024
acd6eed
adding version with auth
Skeyelab Oct 4, 2024
5d7d717
feat: add owncloud service and logo
danielalves96 Oct 4, 2024
36f0874
Added flowise
rennokki Oct 5, 2024
57e646a
feat: affine service template and logo
riazosama Oct 5, 2024
846e451
Merge branch 'next' into next
leocabeza Oct 6, 2024
7665a17
Add soketi coolify
Nathanjms Oct 6, 2024
6d6d6bf
Process coolify.traefik.middlewares label
MarioZet23 Oct 6, 2024
0f5e75f
Update flowise-with-databases.yaml
rennokki Oct 7, 2024
8fd103c
fix reactive resume template
djsisson Oct 7, 2024
c4ee919
Merge pull request #2383 from marcomaiermm/feat-add-supertokens-template
peaklabs-dev Oct 7, 2024
8c503bc
Feat: Supertokens
peaklabs-dev Oct 7, 2024
b31cfd1
Feat: Supertokens json
peaklabs-dev Oct 7, 2024
db8c59e
Merge pull request #3330 from djsisson/fix-rabbitmq
peaklabs-dev Oct 7, 2024
2c89592
Add missing comments
peaklabs-dev Oct 7, 2024
0b08406
Merge branch 'new-services' of https://github.com/coollabsio/coolify …
peaklabs-dev Oct 7, 2024
63f329d
Fix: Rabbitmq
peaklabs-dev Oct 7, 2024
cdedf3b
Merge pull request #2885 from leocabeza/next
peaklabs-dev Oct 7, 2024
a2cfa14
Fix: Easyappointments
peaklabs-dev Oct 7, 2024
7aa60ad
Merge branch 'new-services' into upgrade_authentik
peaklabs-dev Oct 7, 2024
46f226c
Merge pull request #3198 from FranckKe/upgrade_authentik
peaklabs-dev Oct 7, 2024
5c83b57
Merge pull request #3757 from Nathanjms/next
peaklabs-dev Oct 7, 2024
2b81828
Merge pull request #3694 from danielalves96/add-dozzle-template
peaklabs-dev Oct 7, 2024
1681799
Merge pull request #3720 from Skeyelab/dozzle-auth
peaklabs-dev Oct 7, 2024
837796d
Fix: Soketi
peaklabs-dev Oct 7, 2024
5fcd432
fix windmill template
djsisson Oct 7, 2024
09d1ca7
Fix: dozzle
peaklabs-dev Oct 7, 2024
f5ca820
Merge pull request #3766 from djsisson/fix-windmill-template
peaklabs-dev Oct 7, 2024
8d543d4
Merge branch 'new-services' of https://github.com/coollabsio/coolify …
peaklabs-dev Oct 7, 2024
bb8a276
Fix: Windmill
peaklabs-dev Oct 7, 2024
e1168be
fix windmill health checks
peaklabs-dev Oct 7, 2024
8c78e9a
Merge pull request #3249 from Amitind/add-service
peaklabs-dev Oct 7, 2024
1914b50
Delete libreoffice.svg
peaklabs-dev Oct 7, 2024
71d2849
fix libreoffice
peaklabs-dev Oct 7, 2024
c486281
Merge pull request #3008 from Telokis/add-organizr-template-service
peaklabs-dev Oct 7, 2024
30b1d07
Update organizr.yaml
peaklabs-dev Oct 7, 2024
22dc06f
fix dozzel
peaklabs-dev Oct 7, 2024
2805681
Update service-templates.json
peaklabs-dev Oct 7, 2024
e6db0b9
Fix a spelling mistake in French
lucasmichot Oct 8, 2024
b25ef93
chore: Update version to 4.0.0-beta.357
andrasbacsai Oct 8, 2024
4bcfe1c
fix: database descriptions
andrasbacsai Oct 8, 2024
74571d9
Merge pull request #3781 from lucasmichot/fix/langfr
andrasbacsai Oct 8, 2024
4e6bf6b
Merge pull request #3762 from djsisson/fix-reactive-resume-template
andrasbacsai Oct 8, 2024
9c2b24b
Merge pull request #3758 from MarioZet23/custom-traefik-middleware
andrasbacsai Oct 8, 2024
f4c88d3
Merge pull request #3763 from coollabsio/new-services
andrasbacsai Oct 8, 2024
17b852c
fix: update services
andrasbacsai Oct 8, 2024
8af41b5
fix: soketi
andrasbacsai Oct 8, 2024
df152e9
fix posthog template
djsisson Oct 8, 2024
052fcd2
chore: Update service names and volumes in windmill.yaml
andrasbacsai Oct 8, 2024
37bc264
Merge pull request #2695 from tonylyjones/feature/add-azimutt-service
peaklabs-dev Oct 8, 2024
1034d9c
fix azimutt
peaklabs-dev Oct 8, 2024
b8f211e
Merge pull request #2719 from martonsz/service-paperless
peaklabs-dev Oct 8, 2024
2b9b2af
fix paperless
peaklabs-dev Oct 8, 2024
7cb9cb0
Merge pull request #2722 from DarkGhostHunter/feat-forgejo
peaklabs-dev Oct 8, 2024
0cd2ca6
fix forgejo
peaklabs-dev Oct 8, 2024
5c65eb2
Update getoutline.yaml
clho40 Oct 8, 2024
1bed6bf
Merge pull request #3784 from djsisson/fix-posthog-template
peaklabs-dev Oct 8, 2024
a361a86
Merge pull request #3787 from clho40/hotfix/outline
peaklabs-dev Oct 8, 2024
e16ccb2
fix forjo with mariadb
peaklabs-dev Oct 8, 2024
974b4b9
wip: coolify.json
andrasbacsai Oct 8, 2024
ec3916b
fix forjo
peaklabs-dev Oct 8, 2024
bfe9a17
Merge branch 'new-services-2' of https://github.com/coollabsio/coolif…
peaklabs-dev Oct 8, 2024
15b5cbf
ignore azimutt for now (probably needs magic env update)
peaklabs-dev Oct 8, 2024
4e9bafd
Update azimutt.yaml
peaklabs-dev Oct 8, 2024
57a96c2
Merge pull request #2934 from cr4zyiw4n/feat--add-bookstack-template
peaklabs-dev Oct 8, 2024
ce9d430
Merge pull request #2978 from JuanxCursed/main
peaklabs-dev Oct 8, 2024
0143b9b
fix bookstack
peaklabs-dev Oct 8, 2024
a979beb
Merge pull request #3103 from sroepges/main
peaklabs-dev Oct 8, 2024
8d2fef5
fix mattermost
peaklabs-dev Oct 8, 2024
ab8bb8d
fix: select server view
andrasbacsai Oct 8, 2024
d031911
chore: Update version to 4.0.0-beta.358
andrasbacsai Oct 8, 2024
6ac2a1f
fix glitchtip template
djsisson Oct 8, 2024
ef821b2
add healthcheck to azimutt
peaklabs-dev Oct 8, 2024
44f2d52
Merge pull request #3109 from christiankolbow/template-keycloak
peaklabs-dev Oct 8, 2024
f0e6892
Fix: Keycloak
peaklabs-dev Oct 8, 2024
be03e0c
Merge pull request #3033 from nekomi2/main
peaklabs-dev Oct 8, 2024
3000579
fix joplin
peaklabs-dev Oct 8, 2024
b02720a
fix moutic 4 and 5
peaklabs-dev Oct 8, 2024
dee9123
Update service-templates.json
peaklabs-dev Oct 8, 2024
34e7805
Merge pull request #3111 from christiankolbow/template-onedev
peaklabs-dev Oct 8, 2024
dc75e5d
fix onedev
peaklabs-dev Oct 8, 2024
3e5b0d9
Merge pull request #3234 from Amitind/add-service-audiobookshelf
peaklabs-dev Oct 8, 2024
ce352eb
fix audiobookshelf
peaklabs-dev Oct 8, 2024
a95a62b
update community-edition and postgres to latest versions
wkng Oct 9, 2024
c5e6d04
Update forgejo-with-runner.yaml
peaklabs-dev Oct 9, 2024
482016b
Update service-templates.json
peaklabs-dev Oct 9, 2024
a087781
Merge pull request #3194 from christiankolbow/template-cloudbeaver
peaklabs-dev Oct 9, 2024
7c3a9d2
fix cloudbeaver
peaklabs-dev Oct 9, 2024
23a4536
Merge pull request #3214 from Pilpin/freshrss
peaklabs-dev Oct 9, 2024
67b7d15
fix freshrss
peaklabs-dev Oct 9, 2024
1d4dd40
fix joplin healthcheck
peaklabs-dev Oct 9, 2024
aa7d950
fix freshrss logo
peaklabs-dev Oct 9, 2024
de08f67
Feat: Other DB options for freshrss
peaklabs-dev Oct 9, 2024
974325e
disable other DBs for now as login seems broken with them
peaklabs-dev Oct 9, 2024
e583d64
Merge pull request #3213 from Pilpin/traccar
peaklabs-dev Oct 9, 2024
097f243
fix traccar
peaklabs-dev Oct 9, 2024
5d20e45
Merge pull request #3219 from Vvveb/next
peaklabs-dev Oct 9, 2024
689c875
fix vvveb
peaklabs-dev Oct 9, 2024
53dfda9
fix freshrss with other Dbs
peaklabs-dev Oct 9, 2024
764a24b
fix ctrl v terminal
LEstradioto Oct 9, 2024
cd1998e
Merge pull request #3199 from FranckKe/add_nextcloud_with_postgres
peaklabs-dev Oct 9, 2024
3ba76c5
fix nextcloud postgres
peaklabs-dev Oct 9, 2024
28852fd
fix nextcloud sqlite
peaklabs-dev Oct 9, 2024
32aaf95
Update nextcloud-with-postgres.yaml
peaklabs-dev Oct 9, 2024
1ddfbaa
Feat: Nextcloud MariaDB and MySQL versions
peaklabs-dev Oct 9, 2024
6780bd8
Merge pull request #3435 from nizetic/main
peaklabs-dev Oct 9, 2024
8095453
Merge pull request #3123 from 8times4/unsend-template
peaklabs-dev Oct 9, 2024
416e636
fix kimai
peaklabs-dev Oct 9, 2024
aa2e170
fix unsend service
peaklabs-dev Oct 9, 2024
bedf981
Merge pull request #3117 from christiankolbow/ntfy-notify
peaklabs-dev Oct 9, 2024
987b7a9
fix ntfy
peaklabs-dev Oct 9, 2024
f10dea2
Merge pull request #3799 from djsisson/fix-glitchtip-template
peaklabs-dev Oct 9, 2024
a61ced8
fix glitchtip healthchecks
peaklabs-dev Oct 9, 2024
02fbd25
Merge pull request #3715 from statickidz/add-qbittorrent-template
peaklabs-dev Oct 9, 2024
df7494b
fix qbittorrent
peaklabs-dev Oct 9, 2024
826b4b0
Merge pull request #3695 from danielalves96/add_homebox-template
peaklabs-dev Oct 9, 2024
b074307
fix homebox
peaklabs-dev Oct 9, 2024
7c8ebcd
Merge pull request #3328 from cupcakearmy/next
peaklabs-dev Oct 9, 2024
b10a229
fix cryptgeon
peaklabs-dev Oct 9, 2024
751a3dc
fix cryptgeon logo
peaklabs-dev Oct 9, 2024
77b3a3f
Merge pull request #3724 from danielalves96/add_owncloud_service
peaklabs-dev Oct 9, 2024
7da6b01
fix owncloud
peaklabs-dev Oct 9, 2024
d0d791d
Merge branch 'new-services-3' into main
peaklabs-dev Oct 9, 2024
5369108
Merge pull request #3816 from wkng/main
peaklabs-dev Oct 9, 2024
d7199e1
Merge pull request #3446 from OG-Jons/main
peaklabs-dev Oct 9, 2024
e66b455
fix immich service
peaklabs-dev Oct 9, 2024
2a1c1e8
Update immich.yaml
peaklabs-dev Oct 9, 2024
9f1a637
Merge pull request #3727 from rennokki/service/flowise
peaklabs-dev Oct 9, 2024
5946e8c
Merge pull request #3738 from riazosama/service-affine
peaklabs-dev Oct 9, 2024
5ab347d
fix affine
peaklabs-dev Oct 9, 2024
41c20eb
Update affine.yaml
peaklabs-dev Oct 9, 2024
1f44b23
feat: add LibreTranslate template
statickidz Oct 10, 2024
10ca408
fix: is_static settings through API
andrasbacsai Oct 10, 2024
91a1fdc
Improve service-templates.json file readability
lucasmichot Oct 10, 2024
df9b2eb
chore: Ignore .ignition.json files in Docker and Git
andrasbacsai Oct 10, 2024
0e2889b
improvement: Add link to duplicate domain
andrasbacsai Oct 10, 2024
d69164b
Merge pull request #3785 from coollabsio/new-services-2
andrasbacsai Oct 10, 2024
1de5022
Merge pull request #3826 from lucasmichot/feat/template-readability
andrasbacsai Oct 10, 2024
290c287
fix: azimutt template - still not working haha
andrasbacsai Oct 10, 2024
e6566d8
fix: new parser with SERVICE_URL_ envs
andrasbacsai Oct 10, 2024
8b7c34d
fix: Improve service template readability
andrasbacsai Oct 10, 2024
e6ff801
feat: Improve search functionality in project selection
andrasbacsai Oct 10, 2024
1b79f78
fix: Update password variables in Service model
andrasbacsai Oct 10, 2024
7872818
fix: mautic 5
andrasbacsai Oct 10, 2024
fd15c7b
fix: scheduled database server
andrasbacsai Oct 10, 2024
789fc13
Merge branch 'main' into next
andrasbacsai Oct 10, 2024
44c289d
Merge pull request #3823 from statickidz/add-libretranslate-template
peaklabs-dev Oct 10, 2024
202e024
Merge branch 'new-services-3' into next
peaklabs-dev Oct 10, 2024
e329026
Revert "Feat: New services part 3"
peaklabs-dev Oct 10, 2024
9330a3f
feat: add customHelper to stack-form
andrasbacsai Oct 10, 2024
12facc9
add castopod service
andrasbacsai Oct 10, 2024
d450702
Merge pull request #3833 from coollabsio/revert-3811-new-services-3
peaklabs-dev Oct 10, 2024
ee54ecd
Merge branch 'next' of github.com:coollabsio/coolify into next
andrasbacsai Oct 10, 2024
e1ff211
Merge pull request #3812 from LEstradioto/fix-ctrl-v-terminal
andrasbacsai Oct 10, 2024
9943199
disable forgejo for now
andrasbacsai Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ yarn-error.log
/_data
.rnd
/.ssh
.ignition.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ _ide_helper_models.php
.rnd
/.ssh
scripts/load-test/*
.ignition.json
17 changes: 17 additions & 0 deletions app/Actions/Application/GenerateConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace App\Actions\Application;

use App\Models\Application;
use Lorisleiva\Actions\Concerns\AsAction;

class GenerateConfig
{
use AsAction;

public function handle(Application $application, bool $is_json = false)
{
ray()->clearAll();
return $application->generateConfig(is_json: $is_json);
}
}
4 changes: 2 additions & 2 deletions app/Console/Commands/ServicesGenerate.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function handle()
$serviceTemplatesJson[$name] = $parsed;
}
}
$serviceTemplatesJson = json_encode($serviceTemplatesJson);
file_put_contents(base_path('templates/service-templates.json'), $serviceTemplatesJson);
$serviceTemplatesJson = json_encode($serviceTemplatesJson, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
file_put_contents(base_path('templates/service-templates.json'), $serviceTemplatesJson.PHP_EOL);
}

private function process_file($file)
Expand Down
8 changes: 8 additions & 0 deletions app/Enums/StaticImageTypes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace App\Enums;

enum StaticImageTypes: string
{
case NGINX_ALPINE = 'nginx:alpine';
}
78 changes: 47 additions & 31 deletions app/Http/Controllers/Api/ApplicationsController.php

Large diffs are not rendered by default.

58 changes: 41 additions & 17 deletions app/Livewire/Project/Application/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Livewire\Project\Application;

use App\Actions\Application\GenerateConfig;
use App\Models\Application;
use Illuminate\Support\Collection;
use Livewire\Component;
Expand Down Expand Up @@ -243,12 +244,19 @@ public function updatedApplicationBaseDirectory()

public function updatedApplicationFqdn()
{
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->trim()->explode(',')->map(function ($domain) {
return str($domain)->trim()->lower();
});
$this->application->fqdn = $this->application->fqdn->unique()->implode(',');
try {
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->trim()->explode(',')->map(function ($domain) {
return str($domain)->trim()->lower();
});
$this->application->fqdn = $this->application->fqdn->unique()->implode(',');
$this->application->save();
} catch (\Throwable $e) {
$originalFqdn = $this->application->getOriginal('fqdn');
$this->application->fqdn = $originalFqdn;
return handleError($e, $this);
}
$this->resetDefaultLabels();
}

Expand Down Expand Up @@ -287,18 +295,22 @@ public function getWildcardDomain()

public function resetDefaultLabels()
{
if ($this->application->settings->is_container_label_readonly_enabled) {
return;
}
$this->customLabels = str(implode('|coolify|', generateLabelsApplication($this->application)))->replace('|coolify|', "\n");
$this->ports_exposes = $this->application->ports_exposes;
$this->is_container_label_escape_enabled = $this->application->settings->is_container_label_escape_enabled;
$this->application->custom_labels = base64_encode($this->customLabels);
$this->application->save();
if ($this->application->build_pack === 'dockercompose') {
$this->loadComposeFile();
try {
if ($this->application->settings->is_container_label_readonly_enabled) {
return;
}
$this->customLabels = str(implode('|coolify|', generateLabelsApplication($this->application)))->replace('|coolify|', "\n");
$this->ports_exposes = $this->application->ports_exposes;
$this->is_container_label_escape_enabled = $this->application->settings->is_container_label_escape_enabled;
$this->application->custom_labels = base64_encode($this->customLabels);
$this->application->save();
if ($this->application->build_pack === 'dockercompose') {
$this->loadComposeFile();
}
$this->dispatch('configurationChanged');
} catch (\Throwable $e) {
return handleError($e, $this);
}
$this->dispatch('configurationChanged');
}

public function checkFqdns($showToaster = true)
Expand Down Expand Up @@ -413,4 +425,16 @@ public function submit($showToaster = true)
$this->dispatch('configurationChanged');
}
}
public function downloadConfig()
{
$config = GenerateConfig::run($this->application, true);
$fileName = str($this->application->name)->slug()->append('_config.json');

return response()->streamDownload(function () use ($config) {
echo $config;
}, $fileName, [
'Content-Type' => 'application/json',
'Content-Disposition' => 'attachment; filename=' . $fileName,
]);
}
}
15 changes: 12 additions & 3 deletions app/Livewire/Project/New/PublicGitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ class PublicGitRepository extends Component

public bool $isStatic = false;

public bool $checkCoolifyConfig = true;

public ?string $publish_directory = null;

// In case of docker compose
public ?string $base_directory = null;
public string $base_directory = '/';

public ?string $docker_compose_location = '/docker-compose.yaml';
// End of docker compose
Expand Down Expand Up @@ -97,6 +99,7 @@ public function updatedBaseDirectory()
$this->base_directory = '/'.$this->base_directory;
}
}

}

public function updatedDockerComposeLocation()
Expand Down Expand Up @@ -275,6 +278,7 @@ public function submit()
'destination_id' => $destination->id,
'destination_type' => $destination_class,
'build_pack' => $this->build_pack,
'base_directory' => $this->base_directory,
];
} else {
$application_init = [
Expand All @@ -289,6 +293,7 @@ public function submit()
'source_id' => $this->git_source->id,
'source_type' => $this->git_source->getMorphClass(),
'build_pack' => $this->build_pack,
'base_directory' => $this->base_directory,
];
}

Expand All @@ -303,11 +308,15 @@ public function submit()

$application->settings->is_static = $this->isStatic;
$application->settings->save();

$fqdn = generateFqdn($destination->server, $application->uuid);
$application->fqdn = $fqdn;
$application->save();

if ($this->checkCoolifyConfig) {
// $config = loadConfigFromGit($this->repository_url, $this->git_branch, $this->base_directory, $this->query['server_id'], auth()->user()->currentTeam()->id);
// if ($config) {
// $application->setConfig($config);
// }
}
return redirect()->route('project.application.configuration', [
'application_uuid' => $application->uuid,
'environment_name' => $environment->name,
Expand Down
14 changes: 7 additions & 7 deletions app/Livewire/Project/New/Select.php

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions app/Livewire/Project/Service/EditDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ public function mount()

public function updatedApplicationFqdn()
{
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->trim()->explode(',')->map(function ($domain) {
return str($domain)->trim()->lower();
});
$this->application->fqdn = $this->application->fqdn->unique()->implode(',');
$this->application->save();
try {
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
$this->application->fqdn = str($this->application->fqdn)->trim()->explode(',')->map(function ($domain) {
return str($domain)->trim()->lower();
});
$this->application->fqdn = $this->application->fqdn->unique()->implode(',');
$this->application->save();
} catch(\Throwable $e) {
return handleError($e, $this);
}
}

public function submit()
Expand Down
2 changes: 2 additions & 0 deletions app/Livewire/Project/Service/StackForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ public function mount()
$value = data_get($field, 'value');
$rules = data_get($field, 'rules', 'nullable');
$isPassword = data_get($field, 'isPassword', false);
$customHelper = data_get($field, 'customHelper', false);
$this->fields->put($key, [
'serviceName' => $serviceName,
'key' => $key,
'name' => $fieldKey,
'value' => $value,
'isPassword' => $isPassword,
'rules' => $rules,
'customHelper' => $customHelper,
]);

$this->rules["fields.$key.value"] = $rules;
Expand Down
41 changes: 41 additions & 0 deletions app/Livewire/Project/Shared/UploadConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Livewire\Project\Shared;

use App\Models\Application;
use Livewire\Component;

class UploadConfig extends Component
{
public $config;
public $applicationId;
public function mount() {
if (isDev()) {
$this->config = '{
"build_pack": "nixpacks",
"base_directory": "/nodejs",
"publish_directory": "/",
"ports_exposes": "3000",
"settings": {
"is_static": false
}
}';
}
}
public function uploadConfig()
{
try {
$application = Application::findOrFail($this->applicationId);
$application->setConfig($this->config);
$this->dispatch('success', 'Application settings updated');
} catch (\Exception $e) {
$this->dispatch('error', $e->getMessage());
return;
}

}
public function render()
{
return view('livewire.project.shared.upload-config');
}
}
64 changes: 64 additions & 0 deletions app/Models/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Process\InvokedProcess;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Process;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use OpenApi\Attributes as OA;
use RuntimeException;
Expand Down Expand Up @@ -1427,4 +1428,67 @@ public function getMetrics(int $mins = 5)
return $parsedCollection->toArray();
}
}

public function generateConfig($is_json = false)
{
$config = collect([]);
if ($this->build_pack = 'nixpacks') {
$config = collect([
'build_pack' => 'nixpacks',
'docker_registry_image_name' => $this->docker_registry_image_name,
'docker_registry_image_tag' => $this->docker_registry_image_tag,
'install_command' => $this->install_command,
'build_command' => $this->build_command,
'start_command' => $this->start_command,
'base_directory' => $this->base_directory,
'publish_directory' => $this->publish_directory,
'custom_docker_run_options' => $this->custom_docker_run_options,
'ports_exposes' => $this->ports_exposes,
'ports_mappings' => $this->ports_mapping,
'settings' => collect([
'is_static' => $this->settings->is_static,
]),
]);
}
$config = $config->filter(function ($value) {
return str($value)->isNotEmpty();
});
if ($is_json) {
return json_encode($config, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
}

return $config;
}
public function setConfig($config) {

$config = $config;
$validator = Validator::make(['config' => $config], [
'config' => 'required|json',
]);
if ($validator->fails()) {
throw new \Exception('Invalid JSON format');
}
$config = json_decode($config, true);

$deepValidator = Validator::make(['config' => $config], [
'config.build_pack' => 'required|string',
'config.base_directory' => 'required|string',
'config.publish_directory' => 'required|string',
'config.ports_exposes' => 'required|string',
'config.settings.is_static' => 'required|boolean',
]);
if ($deepValidator->fails()) {
throw new \Exception('Invalid data');
}
$config = $deepValidator->validated()['config'];

try {
$settings = data_get($config, 'settings', []);
data_forget($config, 'settings');
$this->update($config);
$this->settings()->update($settings);
} catch (\Exception $e) {
throw new \Exception('Failed to update application settings');
}
}
}
12 changes: 9 additions & 3 deletions app/Models/ScheduledDatabaseBackup.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ public function get_last_days_backup_status($days = 7)
public function server()
{
if ($this->database) {
if ($this->database->destination && $this->database->destination->server) {
$server = $this->database->destination->server;

if ($this->database instanceof ServiceDatabase) {
$destination = data_get($this->database->service, 'destination');
$server = data_get($destination, 'server');
} else {
$destination = data_get($this->database, 'destination');
$server = data_get($destination, 'server');
}
if ($server) {
return $server;
}
}


return null;
}
}
Loading