mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-01 12:33:45 +00:00
Compare commits
19 Commits
v4.0.0-bet
...
v4.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf01d32237 | ||
|
|
5ec553f68d | ||
|
|
d95e5a169d | ||
|
|
8debefddad | ||
|
|
bd25860ccf | ||
|
|
b21cb5c0e9 | ||
|
|
ff79a2d3f4 | ||
|
|
9ae3743a58 | ||
|
|
ffcdbcc802 | ||
|
|
3ff78a3a47 | ||
|
|
4d78ac4789 | ||
|
|
be24f2d520 | ||
|
|
ff7fccb6a2 | ||
|
|
ee5a2b3c38 | ||
|
|
72b9001447 | ||
|
|
353245bb7d | ||
|
|
f9411bf0ed | ||
|
|
0eedbd2aa1 | ||
|
|
5e36c37838 |
16
SECURITY.md
Normal file
16
SECURITY.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Use this section to tell people about which versions of your project are
|
||||||
|
currently being supported with security updates.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| > 4 | :white_check_mark: |
|
||||||
|
| 3 | :x: |
|
||||||
|
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
If you have any vulnerability please report at hi@coollabs.io
|
||||||
@@ -121,6 +121,9 @@ class Kernel extends ConsoleKernel
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach ($scheduled_tasks as $scheduled_task) {
|
foreach ($scheduled_tasks as $scheduled_task) {
|
||||||
|
if ($scheduled_task->enabled === false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$service = $scheduled_task->service;
|
$service = $scheduled_task->service;
|
||||||
$application = $scheduled_task->application;
|
$application = $scheduled_task->application;
|
||||||
|
|
||||||
|
|||||||
@@ -177,6 +177,9 @@ class General extends Component
|
|||||||
$this->loadComposeFile();
|
$this->loadComposeFile();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public function updatedApplicationFqdn() {
|
||||||
|
$this->resetDefaultLabels();
|
||||||
|
}
|
||||||
public function updatedApplicationBuildPack()
|
public function updatedApplicationBuildPack()
|
||||||
{
|
{
|
||||||
if ($this->application->build_pack !== 'nixpacks') {
|
if ($this->application->build_pack !== 'nixpacks') {
|
||||||
@@ -204,11 +207,13 @@ class General extends Component
|
|||||||
$fqdn = generateFqdn($server, $this->application->uuid);
|
$fqdn = generateFqdn($server, $this->application->uuid);
|
||||||
$this->application->fqdn = $fqdn;
|
$this->application->fqdn = $fqdn;
|
||||||
$this->application->save();
|
$this->application->save();
|
||||||
|
$this->resetDefaultLabels();
|
||||||
$this->dispatch('success', 'Wildcard domain generated.');
|
$this->dispatch('success', 'Wildcard domain generated.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function resetDefaultLabels()
|
public function resetDefaultLabels()
|
||||||
{
|
{
|
||||||
|
ray('resetDefaultLabels');
|
||||||
$this->customLabels = str(implode("|", generateLabelsApplication($this->application)))->replace("|", "\n");
|
$this->customLabels = str(implode("|", generateLabelsApplication($this->application)))->replace("|", "\n");
|
||||||
$this->ports_exposes = $this->application->ports_exposes;
|
$this->ports_exposes = $this->application->ports_exposes;
|
||||||
|
|
||||||
|
|||||||
@@ -41,35 +41,39 @@ class Backup extends Component
|
|||||||
}
|
}
|
||||||
public function add_coolify_database()
|
public function add_coolify_database()
|
||||||
{
|
{
|
||||||
$server = Server::find(0);
|
try {
|
||||||
$out = instant_remote_process(['docker inspect coolify-db'], $server);
|
$server = Server::findOrFail(0);
|
||||||
$envs = format_docker_envs_to_json($out);
|
$out = instant_remote_process(['docker inspect coolify-db'], $server);
|
||||||
$postgres_password = $envs['POSTGRES_PASSWORD'];
|
$envs = format_docker_envs_to_json($out);
|
||||||
$postgres_user = $envs['POSTGRES_USER'];
|
$postgres_password = $envs['POSTGRES_PASSWORD'];
|
||||||
$postgres_db = $envs['POSTGRES_DB'];
|
$postgres_user = $envs['POSTGRES_USER'];
|
||||||
$this->database = StandalonePostgresql::create([
|
$postgres_db = $envs['POSTGRES_DB'];
|
||||||
'id' => 0,
|
$this->database = StandalonePostgresql::create([
|
||||||
'name' => 'coolify-db',
|
'id' => 0,
|
||||||
'description' => 'Coolify database',
|
'name' => 'coolify-db',
|
||||||
'postgres_user' => $postgres_user,
|
'description' => 'Coolify database',
|
||||||
'postgres_password' => $postgres_password,
|
'postgres_user' => $postgres_user,
|
||||||
'postgres_db' => $postgres_db,
|
'postgres_password' => $postgres_password,
|
||||||
'status' => 'running',
|
'postgres_db' => $postgres_db,
|
||||||
'destination_type' => 'App\Models\StandaloneDocker',
|
'status' => 'running',
|
||||||
'destination_id' => 0,
|
'destination_type' => 'App\Models\StandaloneDocker',
|
||||||
]);
|
'destination_id' => 0,
|
||||||
$this->backup = ScheduledDatabaseBackup::create([
|
]);
|
||||||
'id' => 0,
|
$this->backup = ScheduledDatabaseBackup::create([
|
||||||
'enabled' => true,
|
'id' => 0,
|
||||||
'save_s3' => false,
|
'enabled' => true,
|
||||||
'frequency' => '0 0 * * *',
|
'save_s3' => false,
|
||||||
'database_id' => $this->database->id,
|
'frequency' => '0 0 * * *',
|
||||||
'database_type' => 'App\Models\StandalonePostgresql',
|
'database_id' => $this->database->id,
|
||||||
'team_id' => currentTeam()->id,
|
'database_type' => 'App\Models\StandalonePostgresql',
|
||||||
]);
|
'team_id' => currentTeam()->id,
|
||||||
$this->database->refresh();
|
]);
|
||||||
$this->backup->refresh();
|
$this->database->refresh();
|
||||||
$this->s3s = S3Storage::whereTeamId(0)->get();
|
$this->backup->refresh();
|
||||||
|
$this->s3s = S3Storage::whereTeamId(0)->get();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return handleError($e, $this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function backup_now()
|
public function backup_now()
|
||||||
|
|||||||
@@ -621,7 +621,6 @@ class Application extends BaseModel
|
|||||||
$commands->push("cd {$baseDir} && git fetch origin {$branch} && $git_checkout_command");
|
$commands->push("cd {$baseDir} && git fetch origin {$branch} && $git_checkout_command");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ray($commands);
|
|
||||||
return [
|
return [
|
||||||
'commands' => $commands->implode(' && '),
|
'commands' => $commands->implode(' && '),
|
||||||
'branch' => $branch,
|
'branch' => $branch,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function generate_github_installation_token(GithubApp $source)
|
|||||||
'Accept' => 'application/vnd.github.machine-man-preview+json'
|
'Accept' => 'application/vnd.github.machine-man-preview+json'
|
||||||
])->post("{$source->api_url}/app/installations/{$source->installation_id}/access_tokens");
|
])->post("{$source->api_url}/app/installations/{$source->installation_id}/access_tokens");
|
||||||
if ($token->failed()) {
|
if ($token->failed()) {
|
||||||
throw new RuntimeException("Failed to get access token for " . $source->name . " with error: " . $token->json()['message']);
|
throw new RuntimeException("Failed to get access token for " . $source->name . " with error: " . data_get($token->json(),'message','no error message found'));
|
||||||
}
|
}
|
||||||
return $token->json()['token'];
|
return $token->json()['token'];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ use App\Models\Application;
|
|||||||
use App\Models\ApplicationDeploymentQueue;
|
use App\Models\ApplicationDeploymentQueue;
|
||||||
use App\Models\PrivateKey;
|
use App\Models\PrivateKey;
|
||||||
use App\Models\Server;
|
use App\Models\Server;
|
||||||
use App\Notifications\Server\Revived;
|
|
||||||
use App\Notifications\Server\Unreachable;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Process;
|
use Illuminate\Support\Facades\Process;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
@@ -135,7 +134,6 @@ function generateSshCommand(Server $server, string $command)
|
|||||||
$connectionTimeout = config('constants.ssh.connection_timeout');
|
$connectionTimeout = config('constants.ssh.connection_timeout');
|
||||||
$serverInterval = config('constants.ssh.server_interval');
|
$serverInterval = config('constants.ssh.server_interval');
|
||||||
|
|
||||||
$delimiter = 'EOF-COOLIFY-SSH';
|
|
||||||
$ssh_command = "timeout $timeout ssh ";
|
$ssh_command = "timeout $timeout ssh ";
|
||||||
|
|
||||||
if (config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false) {
|
if (config('coolify.mux_enabled') && config('coolify.is_windows_docker_desktop') == false) {
|
||||||
@@ -145,6 +143,9 @@ function generateSshCommand(Server $server, string $command)
|
|||||||
$ssh_command .= '-o ProxyCommand="/usr/local/bin/cloudflared access ssh --hostname %h" ';
|
$ssh_command .= '-o ProxyCommand="/usr/local/bin/cloudflared access ssh --hostname %h" ';
|
||||||
}
|
}
|
||||||
$command = "PATH=\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/host/usr/local/sbin:/host/usr/local/bin:/host/usr/sbin:/host/usr/bin:/host/sbin:/host/bin && $command";
|
$command = "PATH=\$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/host/usr/local/sbin:/host/usr/local/bin:/host/usr/sbin:/host/usr/bin:/host/sbin:/host/bin && $command";
|
||||||
|
|
||||||
|
$delimiter = Hash::make($command);
|
||||||
|
$command = str_replace($delimiter, '', $command);
|
||||||
$ssh_command .= "-i {$privateKeyLocation} "
|
$ssh_command .= "-i {$privateKeyLocation} "
|
||||||
. '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '
|
. '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null '
|
||||||
. '-o PasswordAuthentication=no '
|
. '-o PasswordAuthentication=no '
|
||||||
@@ -158,6 +159,7 @@ function generateSshCommand(Server $server, string $command)
|
|||||||
. $command . PHP_EOL
|
. $command . PHP_EOL
|
||||||
. $delimiter;
|
. $delimiter;
|
||||||
// ray($ssh_command);
|
// ray($ssh_command);
|
||||||
|
// ray($delimiter);
|
||||||
return $ssh_command;
|
return $ssh_command;
|
||||||
}
|
}
|
||||||
function instant_remote_process(Collection|array $command, Server $server, $throwError = true)
|
function instant_remote_process(Collection|array $command, Server $server, $throwError = true)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ return [
|
|||||||
|
|
||||||
// The release version of your application
|
// The release version of your application
|
||||||
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
||||||
'release' => '4.0.0-beta.252',
|
'release' => '4.0.0-beta.255',
|
||||||
// When left empty or `null` the Laravel environment will be used
|
// When left empty or `null` the Laravel environment will be used
|
||||||
'environment' => config('app.env'),
|
'environment' => config('app.env'),
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.252';
|
return '4.0.0-beta.255';
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('applications', function (Blueprint $table) {
|
||||||
|
$table->text('custom_docker_run_options')->nullable()->change();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('applications', function (Blueprint $table) {
|
||||||
|
$table->string('custom_docker_run_options')->nullable()->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -6,7 +6,7 @@ set -e # Exit immediately if a command exits with a non-zero status
|
|||||||
#set -u # Treat unset variables as an error and exit
|
#set -u # Treat unset variables as an error and exit
|
||||||
set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status
|
set -o pipefail # Cause a pipeline to return the status of the last command that exited with a non-zero status
|
||||||
|
|
||||||
VERSION="1.3.0"
|
VERSION="1.3.1"
|
||||||
DOCKER_VERSION="24.0"
|
DOCKER_VERSION="24.0"
|
||||||
|
|
||||||
CDN="https://cdn.coollabs.io/coolify"
|
CDN="https://cdn.coollabs.io/coolify"
|
||||||
@@ -23,7 +23,7 @@ if [ "$OS_TYPE" = 'amzn' ]; then
|
|||||||
dnf install -y findutils >/dev/null 2>&1
|
dnf install -y findutils >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LATEST_VERSION=$(curl --silent $CDN/versions.json | grep -i version | sed -n '2p' | xargs | awk '{print $2}' | tr -d ',')
|
LATEST_VERSION=$(curl --silent $CDN/versions.json | grep -i version | xargs | awk '{print $2}' | tr -d ',')
|
||||||
DATE=$(date +"%Y%m%d-%H%M%S")
|
DATE=$(date +"%Y%m%d-%H%M%S")
|
||||||
|
|
||||||
if [ $EUID != 0 ]; then
|
if [ $EUID != 0 ]; then
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"coolify": {
|
"coolify": {
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.252"
|
"version": "4.0.0-beta.255"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user