updates
This commit is contained in:
		| @@ -13,7 +13,8 @@ return new class extends Migration | |||||||
|     { |     { | ||||||
|         Schema::create('instance_settings', function (Blueprint $table) { |         Schema::create('instance_settings', function (Blueprint $table) { | ||||||
|             $table->id(); |             $table->id(); | ||||||
|             $table->string('public_ip_address')->nullable(); |             $table->string('public_ipv4')->nullable(); | ||||||
|  |             $table->string('public_ipv6')->nullable(); | ||||||
|             $table->string('fqdn')->nullable(); |             $table->string('fqdn')->nullable(); | ||||||
|             $table->string('wildcard_domain')->nullable(); |             $table->string('wildcard_domain')->nullable(); | ||||||
|             $table->string('default_redirect_404')->nullable(); |             $table->string('default_redirect_404')->nullable(); | ||||||
|   | |||||||
| @@ -107,12 +107,19 @@ class ProductionSeeder extends Seeder | |||||||
|             ]); |             ]); | ||||||
|         } |         } | ||||||
|         try { |         try { | ||||||
|             $ip = Process::run('curl -4s https://ifconfig.io')->output; |             $ipv4 = Process::run('curl -4s https://ifconfig.io')->output; | ||||||
|             $ip = trim($ip); |             $ipv4 = trim($ipv4); | ||||||
|             $ip = filter_var($ip, FILTER_VALIDATE_IP); |             $ipv4 = filter_var($ipv4, FILTER_VALIDATE_IP); | ||||||
|             $settings = InstanceSettings::get(); |             $settings = InstanceSettings::get(); | ||||||
|             if ($settings->public_ip_address !== $ip) { |             if (is_null($settings->public_ipv4)) { | ||||||
|                 $settings->update(['public_ip_address' => $ip]); |                 $settings->update(['public_ipv4' => $ipv4]); | ||||||
|  |             } | ||||||
|  |             $ipv6 = Process::run('curl -6s https://ifconfig.io')->output; | ||||||
|  |             $ipv6 = trim($ipv6); | ||||||
|  |             $ipv6 = filter_var($ipv6, FILTER_VALIDATE_IP); | ||||||
|  |             $settings = InstanceSettings::get(); | ||||||
|  |             if (is_null($settings->public_ipv6)) { | ||||||
|  |                 $settings->update(['public_ipv6' => $ipv6]); | ||||||
|             } |             } | ||||||
|         } catch (\Exception $e) { |         } catch (\Exception $e) { | ||||||
|             echo "Error: {$e->getMessage()}\n"; |             echo "Error: {$e->getMessage()}\n"; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Andras Bacsai
					Andras Bacsai