You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a simple script to enable SSL redirect for my domains, but I noticed that resets some settings and cause an inconsistent state in DB:
This request gives no error but, resets many settings such as HTTP2 and so on (see lib/Froxlor/Api/Commands/Domains.php lines 458:477), i think is because it checks for ssl_ipandport in the request, even if is correctly configured before.
Furthermore, if I try to fix with another request:
$ipports_ssl = array('HERE IS MY IP ID');
$data = [
'domainname' => $domainname,
'ssl_ipandport' => $ipports_ssl,
'ssl_redirect' => TRUE,
'http2' => TRUE,
'include_specialsettings' => TRUE,
];
$fapi->request('Domains.update', $data);
it gives me error 1 Error: [500] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '14-2' for key 'PRIMARY', because the table panel_domaintoip weren't update when it wrongly removes SSL settings.
The text was updated successfully, but these errors were encountered:
when setting ssl_redirect to true and no ssl-ip/port is given, it's set to -1 leading to ssl_redirect and letsencrypt (if set) being set to 0 - hence your integrity contraint violation, the ip/port is still connected to the domain.
I understand that this is not a good way to handle this, the update() method should default to the already defined IPs - but then again, we need something to distinguish the cases "i want to fallback to the current values if nothing is set" and "i set this to an empty value on purpose to remove (ssl)ips"
I reported this in a hurry, I'll try to find a way to manage this situations (i.e.: enable just ssl_redirect, remove ips,... ) and if I find something useful, I'll make a PR.
I thought it was better to report the problem as soon as possible :)
I'm trying to write a simple script to enable SSL redirect for my domains, but I noticed that resets some settings and cause an inconsistent state in DB:
Here an example:
This request gives no error but, resets many settings such as HTTP2 and so on (see lib/Froxlor/Api/Commands/Domains.php lines 458:477), i think is because it checks for ssl_ipandport in the request, even if is correctly configured before.
Furthermore, if I try to fix with another request:
it gives me error
1 Error: [500] SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '14-2' for key 'PRIMARY'
, because the tablepanel_domaintoip
weren't update when it wrongly removes SSL settings.The text was updated successfully, but these errors were encountered: