Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] TITLE of CP using /etc/hosts instead of /etc/hostname #4260

Open
ww7 opened this issue Jan 24, 2024 · 3 comments
Open

[Bug] TITLE of CP using /etc/hosts instead of /etc/hostname #4260

ww7 opened this issue Jan 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ww7
Copy link

ww7 commented Jan 24, 2024

Describe the bug

I added to /etc/hosts line with current server IP and some custom domain

Then the title of CP panel started showing that custom domain instead of /etc/hostname

hestia.conf is default:

TITLE='{{page}} - {{hostname}} - {{appname}}'

And absent 127.0.0.1 <hostname> line at /etc/hosts/

Tell us how to replicate the bug

Add in /etc/hosts line with current server IP and some custom domain

Which components are affected by this bug?

Control Panel Web Interface

Hestia Control Panel Version

1.8.11

Operating system

Ubuntu 20.04.6 LTS

Log capture

No response

@ww7 ww7 added the bug Something isn't working label Jan 24, 2024
@jaapmarcus
Copy link
Member

It is using the

function display_title($tab) {
$array1 = ["{{page}}", "{{hostname}}", "{{ip}}", "{{appname}}"];
$array2 = [$tab, get_hostname(), $_SERVER["REMOTE_ADDR"], $_SESSION["APP_NAME"]];
return str_replace($array1, $array2, $_SESSION["TITLE"]);
}

And the gethostname() php function.

@ww7
Copy link
Author

ww7 commented Jan 24, 2024

Or gethostbyaddr() ?

$ret2 = gethostbyname($ret);
if (in_array($ret2, $badValues, true)) {
return $ret;
}
$ret3 = gethostbyaddr($ret2);
if (in_array($ret3, $badValues, true)) {
return $ret2;
}

@ww7
Copy link
Author

ww7 commented Jan 24, 2024

I replicated this behavior only if absent 127.0.0.1 <hostname> line at /etc/hosts/
Is it required for HestiaCP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants