+
+ placeholder="1.2.3.4" autocomplete="new-password" />
+ placeholder="2001:db8::1" autocomplete="new-password" />
DNS Validation
@@ -92,6 +90,8 @@
API
+
For API documentation, please visit
/docs/api
@@ -131,34 +131,42 @@
Confirmation Settings
-
-
diff --git a/routes/web.php b/routes/web.php
index afe392052..5df0edca1 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -4,6 +4,7 @@ use App\Http\Controllers\Controller;
use App\Http\Controllers\MagicController;
use App\Http\Controllers\OauthController;
use App\Http\Controllers\UploadController;
+use App\Http\Middleware\ApiAllowed;
use App\Livewire\Admin\Index as AdminIndex;
use App\Livewire\Boarding\Index as BoardingIndex;
use App\Livewire\Dashboard;
@@ -72,13 +73,18 @@ use App\Livewire\Team\Member\Index as TeamMemberIndex;
use App\Livewire\Terminal\Index as TerminalIndex;
use App\Models\GitlabApp;
use App\Models\ScheduledDatabaseBackupExecution;
-use App\Models\Server;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\StreamedResponse;
+use ThreeSidedCube\LaravelRedoc\Http\Controllers\DefinitionController;
+use ThreeSidedCube\LaravelRedoc\Http\Controllers\DocumentationController;
+Route::group(['middleware' => ['auth:sanctum', ApiAllowed::class]], function () {
+ Route::get('/docs/api', DocumentationController::class)->name('redoc.documentation');
+ Route::get('/docs/api/definition', DefinitionController::class)->name('redoc.definition');
+});
if (isDev()) {
Route::get('/dev/compose', Compose::class)->name('dev.compose');
}
diff --git a/scripts/run b/scripts/run
index f7e7b5264..9d3c4f1f4 100755
--- a/scripts/run
+++ b/scripts/run
@@ -24,7 +24,7 @@ function logs {
docker exec -t coolify tail -f storage/logs/laravel.log
}
function test {
- docker exec -t coolify php artisan test --testsuite=Feature
+ docker exec -t coolify php artisan test --testsuite=Feature -p
}
function sync:bunny {
diff --git a/tests/Feature/ConvertingGitUrlsTest.php b/tests/Feature/ConvertingGitUrlsTest.php
new file mode 100644
index 000000000..5bcdea1a1
--- /dev/null
+++ b/tests/Feature/ConvertingGitUrlsTest.php
@@ -0,0 +1,62 @@
+toBe([
+ 'repository' => 'git@github.com:andrasbacsai/coolify-examples.git',
+ 'port' => 22,
+ ]);
+
+});
+
+test('convertGitUrlsForDeployKeyAndGithubAppAndSshUrl', function () {
+ $githubApp = GithubApp::find(0);
+ $result = convertGitUrl('git@github.com:andrasbacsai/coolify-examples.git', 'deploy_key', $githubApp);
+ expect($result)->toBe([
+ 'repository' => 'git@github.com:andrasbacsai/coolify-examples.git',
+ 'port' => 22,
+ ]);
+});
+
+test('convertGitUrlsForDeployKeyAndHttpUrl', function () {
+ $result = convertGitUrl('andrasbacsai/coolify-examples.git', 'deploy_key', null);
+ expect($result)->toBe([
+ 'repository' => 'andrasbacsai/coolify-examples.git',
+ 'port' => 22,
+ ]);
+});
+
+test('convertGitUrlsForDeployKeyAndSshUrl', function () {
+ $result = convertGitUrl('git@github.com:andrasbacsai/coolify-examples.git', 'deploy_key', null);
+ expect($result)->toBe([
+ 'repository' => 'git@github.com:andrasbacsai/coolify-examples.git',
+ 'port' => 22,
+ ]);
+});
+
+test('convertGitUrlsForSourceAndSshUrl', function () {
+ $result = convertGitUrl('git@github.com:andrasbacsai/coolify-examples.git', 'source', null);
+ expect($result)->toBe([
+ 'repository' => 'git@github.com:andrasbacsai/coolify-examples.git',
+ 'port' => 22,
+ ]);
+});
+
+test('convertGitUrlsForSourceAndHttpUrl', function () {
+ $result = convertGitUrl('andrasbacsai/coolify-examples.git', 'source', null);
+ expect($result)->toBe([
+ 'repository' => 'andrasbacsai/coolify-examples.git',
+ 'port' => 22,
+ ]);
+});
+
+test('convertGitUrlsForSourceAndSshUrlWithCustomPort', function () {
+ $result = convertGitUrl('git@git.domain.com:766/group/project.git', 'source', null);
+ expect($result)->toBe([
+ 'repository' => 'git@git.domain.com:group/project.git',
+ 'port' => '766',
+ ]);
+});
diff --git a/tests/Feature/DockerComposeParseTest.php b/tests/Feature/DockerComposeParseTest.php
index 8810280dc..d21adac8e 100644
--- a/tests/Feature/DockerComposeParseTest.php
+++ b/tests/Feature/DockerComposeParseTest.php
@@ -9,171 +9,171 @@ use App\Models\StandaloneDocker;
use Illuminate\Support\Collection;
use Symfony\Component\Yaml\Yaml;
-beforeEach(function () {
- $this->applicationYaml = '
-version: "3.8"
-services:
- app:
- image: nginx
- environment:
- SERVICE_FQDN_APP: /app
- APP_KEY: base64
- APP_DEBUG: "${APP_DEBUG:-false}"
- APP_URL: $SERVICE_FQDN_APP
- DB_URL: postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@db:5432/postgres?schema=public
- volumes:
- - "./nginx:/etc/nginx"
- - "data:/var/www/html"
- depends_on:
- - db
- db:
- image: postgres
- environment:
- POSTGRES_USER: "${SERVICE_USER_POSTGRES}"
- POSTGRES_PASSWORD: "${SERVICE_PASSWORD_POSTGRES}"
- volumes:
- - "dbdata:/var/lib/postgresql/data"
- healthcheck:
- test:
- - CMD
- - pg_isready
- - "-U"
- - "postgres"
- interval: 2s
- timeout: 10s
- retries: 10
- depends_on:
- app:
- condition: service_healthy
-networks:
- default:
- name: something
- external: true
- noinet:
- driver: bridge
- internal: true';
+// beforeEach(function () {
+// $this->applicationYaml = '
+// version: "3.8"
+// services:
+// app:
+// image: nginx
+// environment:
+// SERVICE_FQDN_APP: /app
+// APP_KEY: base64
+// APP_DEBUG: "${APP_DEBUG:-false}"
+// APP_URL: $SERVICE_FQDN_APP
+// DB_URL: postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@db:5432/postgres?schema=public
+// volumes:
+// - "./nginx:/etc/nginx"
+// - "data:/var/www/html"
+// depends_on:
+// - db
+// db:
+// image: postgres
+// environment:
+// POSTGRES_USER: "${SERVICE_USER_POSTGRES}"
+// POSTGRES_PASSWORD: "${SERVICE_PASSWORD_POSTGRES}"
+// volumes:
+// - "dbdata:/var/lib/postgresql/data"
+// healthcheck:
+// test:
+// - CMD
+// - pg_isready
+// - "-U"
+// - "postgres"
+// interval: 2s
+// timeout: 10s
+// retries: 10
+// depends_on:
+// app:
+// condition: service_healthy
+// networks:
+// default:
+// name: something
+// external: true
+// noinet:
+// driver: bridge
+// internal: true';
- $this->applicationComposeFileString = Yaml::parse($this->applicationYaml);
+// $this->applicationComposeFileString = Yaml::parse($this->applicationYaml);
- $this->application = Application::create([
- 'name' => 'Application for tests',
- 'docker_compose_domains' => json_encode([
- 'app' => [
- 'domain' => 'http://bcoowoookw0co4cok4sgc4k8.127.0.0.1.sslip.io',
- ],
- ]),
- 'preview_url_template' => '{{pr_id}}.{{domain}}',
- 'uuid' => 'bcoowoookw0co4cok4sgc4k8s',
- 'repository_project_id' => 603035348,
- 'git_repository' => 'coollabsio/coolify-examples',
- 'git_branch' => 'main',
- 'base_directory' => '/docker-compose-test',
- 'docker_compose_location' => 'docker-compose.yml',
- 'docker_compose_raw' => $this->applicationYaml,
- 'build_pack' => 'dockercompose',
- 'ports_exposes' => '3000',
- 'environment_id' => 1,
- 'destination_id' => 0,
- 'destination_type' => StandaloneDocker::class,
- 'source_id' => 1,
- 'source_type' => GithubApp::class,
- ]);
- $this->application->environment_variables_preview()->where('key', 'APP_DEBUG')->update(['value' => 'true']);
- $this->applicationPreview = ApplicationPreview::create([
- 'git_type' => 'github',
- 'application_id' => $this->application->id,
- 'pull_request_id' => 1,
- 'pull_request_html_url' => 'https://github.com/coollabsio/coolify-examples/pull/1',
- ]);
- $this->serviceYaml = '
-services:
- activepieces:
- image: "ghcr.io/activepieces/activepieces:latest"
- environment:
- - SERVICE_FQDN_ACTIVEPIECES
- - AP_API_KEY=$SERVICE_PASSWORD_64_APIKEY
- - AP_URL=$SERVICE_URL_ACTIVEPIECES
- - AP_ENCRYPTION_KEY=$SERVICE_PASSWORD_ENCRYPTIONKEY
- - AP_ENGINE_EXECUTABLE_PATH=dist/packages/engine/main.js
- - AP_ENVIRONMENT=prod
- - AP_EXECUTION_MODE=${AP_EXECUTION_MODE}
- - AP_FRONTEND_URL=$SERVICE_FQDN_ACTIVEPIECES
- - AP_JWT_SECRET=$SERVICE_PASSWORD_64_JWT
- - AP_POSTGRES_DATABASE=activepieces
- - AP_POSTGRES_HOST=postgres
- - AP_POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
- - AP_POSTGRES_PORT=5432
- - AP_POSTGRES_USERNAME=$SERVICE_USER_POSTGRES
- - AP_REDIS_HOST=redis
- - AP_REDIS_PORT=6379
- - AP_SANDBOX_RUN_TIME_SECONDS=600
- - AP_TELEMETRY_ENABLED=true
- - "AP_TEMPLATES_SOURCE_URL=https://cloud.activepieces.com/api/v1/flow-templates"
- - AP_TRIGGER_DEFAULT_POLL_INTERVAL=5
- - AP_WEBHOOK_TIMEOUT_SECONDS=30
- depends_on:
- postgres:
- condition: service_healthy
- redis:
- condition: service_started
- healthcheck:
- test: ["CMD", "curl", "-f", "http://127.0.0.1:80"]
- interval: 5s
- timeout: 20s
- retries: 10
- postgres:
- image: "nginx"
- environment:
- - SERVICE_FQDN_ACTIVEPIECES=/api
- - POSTGRES_DB=activepieces
- - PASSW=$AP_POSTGRES_PASSWORD
- - AP_FRONTEND_URL=$SERVICE_FQDN_ACTIVEPIECES
- - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
- - POSTGRES_USER=$SERVICE_USER_POSTGRES
- volumes:
- - "pg-data:/var/lib/postgresql/data"
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
- interval: 5s
- timeout: 20s
- retries: 10
- redis:
- image: "redis:latest"
- volumes:
- - "redis_data:/data"
- healthcheck:
- test: ["CMD", "redis-cli", "ping"]
- interval: 5s
- timeout: 20s
- retries: 10
+// $this->application = Application::create([
+// 'name' => 'Application for tests',
+// 'docker_compose_domains' => json_encode([
+// 'app' => [
+// 'domain' => 'http://bcoowoookw0co4cok4sgc4k8.127.0.0.1.sslip.io',
+// ],
+// ]),
+// 'preview_url_template' => '{{pr_id}}.{{domain}}',
+// 'uuid' => 'bcoowoookw0co4cok4sgc4k8s',
+// 'repository_project_id' => 603035348,
+// 'git_repository' => 'coollabsio/coolify-examples',
+// 'git_branch' => 'main',
+// 'base_directory' => '/docker-compose-test',
+// 'docker_compose_location' => 'docker-compose.yml',
+// 'docker_compose_raw' => $this->applicationYaml,
+// 'build_pack' => 'dockercompose',
+// 'ports_exposes' => '3000',
+// 'environment_id' => 1,
+// 'destination_id' => 0,
+// 'destination_type' => StandaloneDocker::class,
+// 'source_id' => 1,
+// 'source_type' => GithubApp::class,
+// ]);
+// $this->application->environment_variables_preview()->where('key', 'APP_DEBUG')->update(['value' => 'true']);
+// $this->applicationPreview = ApplicationPreview::create([
+// 'git_type' => 'github',
+// 'application_id' => $this->application->id,
+// 'pull_request_id' => 1,
+// 'pull_request_html_url' => 'https://github.com/coollabsio/coolify-examples/pull/1',
+// ]);
+// $this->serviceYaml = '
+// services:
+// activepieces:
+// image: "ghcr.io/activepieces/activepieces:latest"
+// environment:
+// - SERVICE_FQDN_ACTIVEPIECES
+// - AP_API_KEY=$SERVICE_PASSWORD_64_APIKEY
+// - AP_URL=$SERVICE_URL_ACTIVEPIECES
+// - AP_ENCRYPTION_KEY=$SERVICE_PASSWORD_ENCRYPTIONKEY
+// - AP_ENGINE_EXECUTABLE_PATH=dist/packages/engine/main.js
+// - AP_ENVIRONMENT=prod
+// - AP_EXECUTION_MODE=${AP_EXECUTION_MODE}
+// - AP_FRONTEND_URL=$SERVICE_FQDN_ACTIVEPIECES
+// - AP_JWT_SECRET=$SERVICE_PASSWORD_64_JWT
+// - AP_POSTGRES_DATABASE=activepieces
+// - AP_POSTGRES_HOST=postgres
+// - AP_POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
+// - AP_POSTGRES_PORT=5432
+// - AP_POSTGRES_USERNAME=$SERVICE_USER_POSTGRES
+// - AP_REDIS_HOST=redis
+// - AP_REDIS_PORT=6379
+// - AP_SANDBOX_RUN_TIME_SECONDS=600
+// - AP_TELEMETRY_ENABLED=true
+// - "AP_TEMPLATES_SOURCE_URL=https://cloud.activepieces.com/api/v1/flow-templates"
+// - AP_TRIGGER_DEFAULT_POLL_INTERVAL=5
+// - AP_WEBHOOK_TIMEOUT_SECONDS=30
+// depends_on:
+// postgres:
+// condition: service_healthy
+// redis:
+// condition: service_started
+// healthcheck:
+// test: ["CMD", "curl", "-f", "http://127.0.0.1:80"]
+// interval: 5s
+// timeout: 20s
+// retries: 10
+// postgres:
+// image: "nginx"
+// environment:
+// - SERVICE_FQDN_ACTIVEPIECES=/api
+// - POSTGRES_DB=activepieces
+// - PASSW=$AP_POSTGRES_PASSWORD
+// - AP_FRONTEND_URL=$SERVICE_FQDN_ACTIVEPIECES
+// - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
+// - POSTGRES_USER=$SERVICE_USER_POSTGRES
+// volumes:
+// - "pg-data:/var/lib/postgresql/data"
+// healthcheck:
+// test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
+// interval: 5s
+// timeout: 20s
+// retries: 10
+// redis:
+// image: "redis:latest"
+// volumes:
+// - "redis_data:/data"
+// healthcheck:
+// test: ["CMD", "redis-cli", "ping"]
+// interval: 5s
+// timeout: 20s
+// retries: 10
-';
+// ';
- $this->serviceComposeFileString = Yaml::parse($this->serviceYaml);
+// $this->serviceComposeFileString = Yaml::parse($this->serviceYaml);
- $this->service = Service::create([
- 'name' => 'Service for tests',
- 'uuid' => 'tgwcg8w4s844wkog8kskw44g',
- 'docker_compose_raw' => $this->serviceYaml,
- 'environment_id' => 1,
- 'server_id' => 0,
- 'destination_id' => 0,
- 'destination_type' => StandaloneDocker::class,
- ]);
-});
+// $this->service = Service::create([
+// 'name' => 'Service for tests',
+// 'uuid' => 'tgwcg8w4s844wkog8kskw44g',
+// 'docker_compose_raw' => $this->serviceYaml,
+// 'environment_id' => 1,
+// 'server_id' => 0,
+// 'destination_id' => 0,
+// 'destination_type' => StandaloneDocker::class,
+// ]);
+// });
-afterEach(function () {
- // $this->applicationPreview->forceDelete();
- $this->application->forceDelete();
- DeleteResourceJob::dispatchSync($this->service);
- $this->service->forceDelete();
-});
+// afterEach(function () {
+// // $this->applicationPreview->forceDelete();
+// $this->application->forceDelete();
+// DeleteResourceJob::dispatchSync($this->service);
+// $this->service->forceDelete();
+// });
-test('ServiceComposeParseNew', function () {
- $output = newParser($this->service);
- $this->service->saveComposeConfigs();
- expect($output)->toBeInstanceOf(Collection::class);
-});
+// test('ServiceComposeParseNew', function () {
+// $output = newParser($this->service);
+// $this->service->saveComposeConfigs();
+// expect($output)->toBeInstanceOf(Collection::class);
+// });
// test('ApplicationComposeParse', function () {
// expect($this->jsonapplicationComposeFile)->toBeJson()->ray();
diff --git a/versions.json b/versions.json
index 8b10875d0..daf0da74b 100644
--- a/versions.json
+++ b/versions.json
@@ -1,10 +1,10 @@
{
"coolify": {
"v4": {
- "version": "4.0.0-beta.367"
+ "version": "4.0.0-beta.368"
},
"nightly": {
- "version": "4.0.0-beta.368"
+ "version": "4.0.0-beta.369"
},
"helper": {
"version": "1.0.3"
@@ -16,4 +16,4 @@
"version": "0.0.15"
}
}
-}
\ No newline at end of file
+}