refactor a lot of things
fix: postgres_passwords could be longer feat: able to define postgresql databases from the ui
This commit is contained in:
@@ -150,7 +150,7 @@ class StartPostgresql
|
||||
|
||||
private function generate_init_scripts()
|
||||
{
|
||||
if (count($this->database->init_scripts) === 0) {
|
||||
if (is_null($this->database->init_scripts) || count($this->database->init_scripts) === 0) {
|
||||
return;
|
||||
}
|
||||
foreach ($this->database->init_scripts as $init_script) {
|
||||
|
||||
@@ -18,7 +18,7 @@ class CheckResaleLicense
|
||||
return;
|
||||
}
|
||||
$base_url = config('coolify.license_url');
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$base_url = 'http://host.docker.internal:8787';
|
||||
}
|
||||
$instance_id = config('app.id');
|
||||
|
||||
@@ -17,7 +17,7 @@ class UpdateCoolify
|
||||
$settings = InstanceSettings::get();
|
||||
ray('Running InstanceAutoUpdateJob');
|
||||
$localhost_name = 'localhost';
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$localhost_name = 'testing-local-docker-container';
|
||||
}
|
||||
$this->server = Server::where('name', $localhost_name)->firstOrFail();
|
||||
@@ -52,7 +52,7 @@ class UpdateCoolify
|
||||
|
||||
private function update()
|
||||
{
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
ray("Running update on local docker container. Updating to $this->latest_version");
|
||||
remote_process([
|
||||
"sleep 10"
|
||||
|
||||
@@ -18,7 +18,7 @@ class Kernel extends ConsoleKernel
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
// $schedule->call(fn() => $this->check_scheduled_backups($schedule))->everyTenSeconds();
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$schedule->command('horizon:snapshot')->everyMinute();
|
||||
$schedule->job(new InstanceApplicationsStatusJob)->everyMinute();
|
||||
$schedule->job(new ProxyCheckJob)->everyFiveMinutes();
|
||||
|
||||
@@ -45,7 +45,7 @@ class Handler extends ExceptionHandler
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
$this->settings = InstanceSettings::get();
|
||||
if ($this->settings->do_not_track || isDev()) {
|
||||
if ($this->settings->do_not_track || is_dev()) {
|
||||
return;
|
||||
}
|
||||
Integration::captureUnhandledException($e);
|
||||
|
||||
@@ -19,7 +19,7 @@ class Controller extends BaseController
|
||||
|
||||
public function subscription()
|
||||
{
|
||||
if (!isCloud()) {
|
||||
if (!is_cloud()) {
|
||||
abort(404);
|
||||
}
|
||||
return view('subscription', [
|
||||
@@ -29,7 +29,7 @@ class Controller extends BaseController
|
||||
|
||||
public function license()
|
||||
{
|
||||
if (!isCloud()) {
|
||||
if (!is_cloud()) {
|
||||
abort(404);
|
||||
}
|
||||
return view('settings.license', [
|
||||
|
||||
@@ -41,6 +41,9 @@ class ProjectController extends Controller
|
||||
|
||||
public function new()
|
||||
{
|
||||
$type = request()->query('type');
|
||||
$destination_uuid = request()->query('destination');
|
||||
|
||||
$project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
|
||||
if (!$project) {
|
||||
return redirect()->route('dashboard');
|
||||
@@ -49,9 +52,14 @@ class ProjectController extends Controller
|
||||
if (!$environment) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
|
||||
$type = request()->query('type');
|
||||
|
||||
if (in_array($type, DATABASE_TYPES)) {
|
||||
$standalone_postgresql = create_standalone_postgresql($environment->id, $destination_uuid);
|
||||
return redirect()->route('project.database.configuration', [
|
||||
'project_uuid' => $project->uuid,
|
||||
'environment_name' => $environment->name,
|
||||
'database_uuid' => $standalone_postgresql->uuid,
|
||||
]);
|
||||
}
|
||||
return view('project.new', [
|
||||
'type' => $type
|
||||
]);
|
||||
|
||||
@@ -17,7 +17,7 @@ class Heading extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function check_status()
|
||||
|
||||
@@ -20,7 +20,7 @@ class Previews extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->pull_requests = collect();
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function loadStatus($pull_request_id)
|
||||
|
||||
@@ -16,7 +16,7 @@ class Rollback extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function rollbackImage($commit)
|
||||
|
||||
@@ -34,7 +34,7 @@ class Heading extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function stop()
|
||||
|
||||
@@ -12,7 +12,7 @@ class DeleteEnvironment extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
|
||||
@@ -12,7 +12,7 @@ class DeleteProject extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
|
||||
@@ -38,7 +38,7 @@ class GithubPrivateRepository extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
$this->query = request()->query();
|
||||
$this->repositories = $this->branches = collect();
|
||||
$this->github_apps = GithubApp::private();
|
||||
|
||||
@@ -50,10 +50,10 @@ class GithubPrivateRepositoryDeployKey extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$this->repository_url = 'https://github.com/coollabsio/coolify-examples';
|
||||
}
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
$this->query = request()->query();
|
||||
$this->private_keys = PrivateKey::where('team_id', session('currentTeam')->id)->where('id', '!=', 0)->get();
|
||||
}
|
||||
|
||||
@@ -45,11 +45,11 @@ class PublicGitRepository extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$this->repository_url = 'https://github.com/coollabsio/coolify-examples';
|
||||
$this->port = 3000;
|
||||
}
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
$this->query = request()->query();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class Select extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function set_type(string $type)
|
||||
|
||||
@@ -14,7 +14,7 @@ class Danger extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->modalId = new Cuid2(7);
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
|
||||
@@ -26,7 +26,7 @@ class Add extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function submit()
|
||||
|
||||
@@ -25,7 +25,7 @@ class Show extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->modalId = new Cuid2(7);
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function submit()
|
||||
|
||||
@@ -25,7 +25,7 @@ class Add extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
|
||||
public function submit()
|
||||
|
||||
@@ -39,6 +39,6 @@ class PrivateKey extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class Change extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->webhook_endpoint = $this->ipv4;
|
||||
$this->parameters = getRouteParameters();
|
||||
$this->parameters = get_route_parameters();
|
||||
$this->is_system_wide = $this->github_app->is_system_wide;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class InviteLink extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->email = isDev() ? 'test3@example.com' : '';
|
||||
$this->email = is_dev() ? 'test3@example.com' : '';
|
||||
}
|
||||
|
||||
public function viaEmail()
|
||||
|
||||
@@ -36,7 +36,7 @@ class Create extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$this->name = 'Local MinIO';
|
||||
$this->description = 'Local MinIO';
|
||||
$this->key = 'minioadmin';
|
||||
|
||||
@@ -18,7 +18,7 @@ class Upgrade extends Component
|
||||
$this->latestVersion = get_latest_version_of_coolify();
|
||||
$currentVersion = config('version');
|
||||
version_compare($currentVersion, $this->latestVersion, '<') ? $this->isUpgradeAvailable = true : $this->isUpgradeAvailable = false;
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$this->isUpgradeAvailable = true;
|
||||
}
|
||||
$settings = InstanceSettings::get();
|
||||
|
||||
@@ -12,7 +12,7 @@ class SubscriptionValid
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
if (auth()->user()) {
|
||||
if (isCloud() && !isSubscribed()) {
|
||||
if (is_cloud() && !isSubscribed()) {
|
||||
ray('SubscriptionValid Middleware');
|
||||
|
||||
$allowed_paths = [
|
||||
|
||||
@@ -32,7 +32,7 @@ class DockerCleanupJob implements ShouldQueue
|
||||
try {
|
||||
$servers = Server::all();
|
||||
foreach ($servers as $server) {
|
||||
if (isDev()) {
|
||||
if (is_dev()) {
|
||||
$docker_root_filesystem = "/";
|
||||
} else {
|
||||
$docker_root_filesystem = instant_remote_process(['stat --printf=%m $(docker info --format "{{json .DockerRootDir}}" |sed \'s/"//g\')'], $server);
|
||||
|
||||
Reference in New Issue
Block a user