mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 07:20:50 +00:00
fix(settings): fix 404 on /settings for root user on cloud instance
- Make Server property nullable in Settings components (Index, Advanced, Updates) - Add conditional server loading: only load when not on cloud - Add null checks before using server for DNS validation and proxy configuration - Fix isInstanceAdmin() to check root team's pivot role directly instead of current team - Make root team (id=0) bypass subscription check on cloud - Remove isInstanceAdmin() from main middleware bypass: only settings/admin routes are exempted - Update isSubscribed() to only check isSubscriptionActive() for navbar consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,8 +10,7 @@ use Livewire\Component;
|
||||
|
||||
class Advanced extends Component
|
||||
{
|
||||
#[Validate('required')]
|
||||
public Server $server;
|
||||
public ?Server $server = null;
|
||||
|
||||
public InstanceSettings $settings;
|
||||
|
||||
@@ -44,7 +43,6 @@ class Advanced extends Component
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'server' => 'required',
|
||||
'is_registration_enabled' => 'boolean',
|
||||
'do_not_track' => 'boolean',
|
||||
'is_dns_validation_enabled' => 'boolean',
|
||||
@@ -62,7 +60,9 @@ class Advanced extends Component
|
||||
if (! isInstanceAdmin()) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
$this->server = Server::findOrFail(0);
|
||||
if (! isCloud()) {
|
||||
$this->server = Server::findOrFail(0);
|
||||
}
|
||||
$this->settings = instanceSettings();
|
||||
$this->custom_dns_servers = $this->settings->custom_dns_servers;
|
||||
$this->allowed_ips = $this->settings->allowed_ips;
|
||||
|
||||
Reference in New Issue
Block a user