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
Show Nethserver web interface URLs on login via /etc/issue #7
Conversation
in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /etc/issue
file is overwritten by a template, defined in nethserver-release
package. This "kickstart" version set up it temporarily: it's visible while the system-init
event is running.
While system-init
is running the web UI could be still not ready.
Is there a way to reset VT1 so that it shows the newly expanded /etc/issue
?
As alternative approach, you could also try to write directly to the system console. Indeed , if this information is required only at the end of the install procedure, it could be sent to the console/VT1 just once.
src/lib/ks/interactive
Outdated
@@ -134,6 +134,9 @@ if [ -f /etc/nethserver-release ]; then | |||
echo "Fix /etc/issue..." | |||
cp -f /etc/nethserver-release /etc/issue | |||
echo -e 'Kernel \\r on an \\m\n' >> /etc/issue | |||
echo 'To login to NethServer please use following URL(s):' >> /etc/issue | |||
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' | sed 's/.*/https:\/\/&:980/' >> /etc/issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use the ip
command: it's output is more parsable than ifconfig
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two alternatives for you, maybe they could be more optimized but they should work. What do you think?
ip addr | grep -oP '(?<=inet\s)\d+(.\d+){3}' | grep -v 127.0.0.1 | sed 's/.*/https://&:980/'
hostname -I | sed -E -e 's/[[:blank:]]+/\n/g' | sed 's/.*/https://&:980/' | grep -v 'https://:980'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the ip addr
one! With -o
(oneline) option it's easier to parse:
ip -o -4 addr | tr -s ' /' $'\t' | cut -f 4 | grep -vF 127.0.0.1 | xargs -I IP -- echo https://IP:980
src/lib/ks/interactive
Outdated
@@ -134,6 +134,9 @@ if [ -f /etc/nethserver-release ]; then | |||
echo "Fix /etc/issue..." | |||
cp -f /etc/nethserver-release /etc/issue | |||
echo -e 'Kernel \\r on an \\m\n' >> /etc/issue | |||
echo 'To login to NethServer please use following URL(s):' >> /etc/issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fixed NethServer
string could not suit rebranded products (i.e. NethServer Enterprise). I'd rather write
Access the web interface at the following URLs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was intended to work only on first boot so no need for templating or writing directly to console as far as I understand.
I'll change the text to be neutral as you suggested.
in |
After first reboot after base install the login URLs should be shown. This may be helpful when using DHCP or VMs.
Feature request:
https://community.nethserver.org/t/show-nethserver-web-interface-urls-on-login-via-issue/8560