Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions confconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ def _validip(ifname: str) -> bool:
ip = ifutil.get_ipconf(ifname)[0]
if ip and not ip.startswith("169"):
return True
ip6 = ifutil.get_ipv6conf(ifname)[0]
if ip6:
return True
return False

defifname = conf.Conf().default_nic
Expand Down Expand Up @@ -437,7 +440,11 @@ def _get_ifconftext(self, ifname: str) -> str:
text = f"IP Address: {addr}\n"
text += f"Netmask: {netmask}\n"
text += f"Default Gateway: {gateway}\n"
text += f"Name Server(s): {' '.join(nameservers)}\n\n"
text += f"Name Server(s): {' '.join(nameservers)}\n"
ipv6_addr, ipv6_prefix = ifutil.get_ipv6conf(ifname)
if ipv6_addr:
text += f"IPv6 Address: {ipv6_addr}/{ipv6_prefix}\n"
text += "\n"

ifmethod = ifutil.get_ifmethod(ifname)
if ifmethod:
Expand Down Expand Up @@ -503,15 +510,26 @@ def usage(self) -> str:

hostname = netinfo.get_hostname().upper()

ipv6_addr, ipv6_prefix = ifutil.get_ipv6conf(ifname)
ip6_display = f"{ipv6_addr}/{ipv6_prefix}" if ipv6_addr else "not configured"

try:
with open(conf.path("services.txt")) as fob:
t = fob.read().rstrip()
text = Template(t).substitute(appname=self.appname,
hostname=hostname,
ipaddr=ip_addr)
text = Template(t).safe_substitute(
appname=self.appname,
hostname=hostname,
ipaddr=ip_addr,
)
except conf.ConfconsoleConfError:
t = ""
text = Template(t).substitute(ipaddr=ip_addr)
text = Template(t).safe_substitute(ipaddr=ip_addr)

ipv6_addr, _ipv6_prefix = ifutil.get_ipv6conf(ifname)
if ipv6_addr:
text += f"\n"
text += f"\nIPv6 Web: http://[{ipv6_addr}]"
text += f"\nIPv6 SSH: 'root@[{ipv6_addr}]'"

text += f"\n\n{tklbam_status}\n\n"
text += "\n" * (self.height - len(text.splitlines()) - 7)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
confconsole (2.2.1) stable; urgency=medium

* fix: recognize IPv6 global address as valid network

-- PopSolutions <sysadmin@pop.coop> Tue, 24 Mar 2026 19:03:04 +0000
12 changes: 12 additions & 0 deletions debian/.debhelper/generated/confconsole/installed-by-dh_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
./plugins.d/
./conf.py
./confconsole.py
./ifutil.py
./ipaddr.py
./plugin.py
./conf/confconsole.conf
./conf/services.txt
./share/autostart
./share/letsencrypt
./add-water/add-water.service
./turnkey-lexicon
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
./docs/images
./docs/Lets_encrypt#advanced.rst
./docs/Lets_encrypt.rst
./docs/Mail_relay.rst
./docs/Networking.rst
./docs/Plugins.rst
./docs/Proxy_settings.rst
./docs/README
./docs/Region_config.rst
./docs/RelNotes-0.9.1.txt
./docs/RelNotes-0.9.2.txt
./docs/RelNotes-0.9.3.txt
./docs/RelNotes-0.9.4.txt
./docs/RelNotes-0.9.txt
./docs/RelNotes-1.0.0.txt
./docs/RelNotes-2.1.0.txt
./docs/System_settings.rst
1 change: 1 addition & 0 deletions debian/confconsole.debhelper.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dh_installinit
23 changes: 23 additions & 0 deletions debian/confconsole.postinst.debhelper
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
py3compile -p confconsole /usr/lib/confconsole
fi
if command -v pypy3compile >/dev/null 2>&1; then
pypy3compile -p confconsole /usr/lib/confconsole || true
fi

# End automatically added section
# Automatically added by dh_systemd_start/13.24.2
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
deb-systemd-invoke $_dh_action 'add-water.service' >/dev/null || true
fi
fi
# End automatically added section
5 changes: 5 additions & 0 deletions debian/confconsole.postrm.debhelper
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Automatically added by dh_systemd_start/13.24.2
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
15 changes: 15 additions & 0 deletions debian/confconsole.prerm.debhelper
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Automatically added by dh_systemd_start/13.24.2
if [ -z "$DPKG_ROOT" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
deb-systemd-invoke stop 'add-water.service' >/dev/null || true
fi
# End automatically added section

# Automatically added by dh_python3
if command -v py3clean >/dev/null 2>&1; then
py3clean -p confconsole
else
dpkg -L confconsole | sed -En -e '/^(.*)\/(.+)\.py$/s,,rm "\1/__pycache__/\2".*,e'
find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
fi

# End automatically added section
3 changes: 3 additions & 0 deletions debian/confconsole.substvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python3:Depends=python3:any
misc:Depends=
misc:Pre-Depends=
3 changes: 3 additions & 0 deletions debian/confconsole/DEBIAN/conffiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/etc/confconsole/confconsole.conf
/etc/confconsole/services.txt
/etc/logrotate.d/confconsole
11 changes: 11 additions & 0 deletions debian/confconsole/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: confconsole
Version: 2.2.1
Architecture: all
Maintainer: Stefan Davis <stefan@turnkeylinux.org>
Installed-Size: 469
Depends: python3:any, python3-dialog (>= 3.4), turnkey-netinfo, turnkey-conffile, libsasl2-modules, python3-requests
Recommends: authbind, dehydrated, kbd, python3-bottle, resolvconf
Suggests: di-live
Section: misc
Priority: optional
Description: TurnKey GNU/Linux Configuration Console
65 changes: 65 additions & 0 deletions debian/confconsole/DEBIAN/md5sums
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
a2a435b858602013cd250023ab2bf88e lib/systemd/system/add-water.service
e6c6f46b8154ddc64149592d64ffc2f8 usr/bin/turnkey-lexicon
be10d9f9a800e467a207888a5144fbeb usr/lib/confconsole/conf.py
97d17f2a4fc63a6a72330f25afd753f0 usr/lib/confconsole/confconsole.py
9a8bf227c87211531a1674870c7d3364 usr/lib/confconsole/ifutil.py
9c6653b9b082e15ea6834273c3a93347 usr/lib/confconsole/ipaddr.py
91378615d94b4f0b96e6caf866e40d11 usr/lib/confconsole/plugin.py
d103bb218ddb8f08b9b41ad34ef10af7 usr/lib/confconsole/plugins.d/Lets_Encrypt/add-water-client
a0e4d15a34ed847cfda2fe5335a5ea8c usr/lib/confconsole/plugins.d/Lets_Encrypt/add-water-srv
3f1b243623b6f4738eabc9cf94cf3366 usr/lib/confconsole/plugins.d/Lets_Encrypt/cert_auto_renew.py
5d073db60c03d50fb8cddc323cd03f36 usr/lib/confconsole/plugins.d/Lets_Encrypt/dehydrated-wrapper
5f6f2ddf556f1506a30e0b73314d8100 usr/lib/confconsole/plugins.d/Lets_Encrypt/description
df807162181c62ca071b97e0f3af1e45 usr/lib/confconsole/plugins.d/Lets_Encrypt/dns_01.py
29c1998bfc1bedd46207426ce7fc0cf6 usr/lib/confconsole/plugins.d/Lets_Encrypt/get_certificate.py
fb6a43e3048894d4d465ae8200c1f2f5 usr/lib/confconsole/plugins.d/Mail_Relaying/description
45083377baf7650b395e461bdaa787df usr/lib/confconsole/plugins.d/Mail_Relaying/mail_relay.py
9ff1045794ba0ff0dfd05eececdfd455 usr/lib/confconsole/plugins.d/Mail_Relaying/mail_relay.sh
259f6685a6a000e2269be5a3ec501d02 usr/lib/confconsole/plugins.d/Proxy_Settings/apt.py
e6515a40dc270d8a711727159896f908 usr/lib/confconsole/plugins.d/Proxy_Settings/description
892bd2f92647c1680a5908bbcd221f6e usr/lib/confconsole/plugins.d/Region_Config/description
dd88963e7aba81f49bef3483973896b1 usr/lib/confconsole/plugins.d/Region_Config/keyboard.py
c296bf3cde865f46d98481d63da79517 usr/lib/confconsole/plugins.d/Region_Config/locales.py
dbe696c1ecbc4411c9feac5d0297ec21 usr/lib/confconsole/plugins.d/Region_Config/tzdata.py
74971f785aa0c5a972183f210fcb0462 usr/lib/confconsole/plugins.d/System_Settings/Confconsole_auto_start.py
54b9292db446a05a34465f29d778ab5c usr/lib/confconsole/plugins.d/System_Settings/Secupdates_adv_conf.py
eb22c06d5868f885431ea8582dda08e4 usr/lib/confconsole/plugins.d/System_Settings/Security_Update.py
a295e21705e8a59a9d3506b9a9590f80 usr/lib/confconsole/plugins.d/System_Settings/description
46e67e027b3a236889c0efa062a8b7a0 usr/lib/confconsole/plugins.d/System_Settings/hostname.py
c4b5d3e418a4790689a9ae454bb74749 usr/lib/confconsole/plugins.d/example.py
eb6c611dbaf5afa300d49755b571152a usr/share/confconsole/autostart/confconsole-auto
e031d1f60700e951cf311dc1bb6cf427 usr/share/confconsole/letsencrypt/dehydrated-confconsole.config
dc694e701c15d9c83ed270a7c37c61b3 usr/share/confconsole/letsencrypt/dehydrated-confconsole.cron
80bd968880faf4404eb6cc28bf359593 usr/share/confconsole/letsencrypt/dehydrated-confconsole.domains
ac9137e06d48bdc0ca9a789dc87d06fc usr/share/confconsole/letsencrypt/dehydrated-confconsole.hook-dns-01.sh
57c480ac97601f2b510473bc3aa16ac0 usr/share/confconsole/letsencrypt/dehydrated-confconsole.hook-http-01.sh
a3209b4db7d08de9feca8793c9af1a48 usr/share/confconsole/letsencrypt/index.html
a355092c3bd43623982be816d7791982 usr/share/confconsole/letsencrypt/lexicon-confconsole-provider_cloudflare.yml
96c52a96c85c620b6e2d8ac7ea55e117 usr/share/confconsole/letsencrypt/lexicon-confconsole-provider_example.yml
5b2e8105b7aeae706762aeee82ee7336 usr/share/confconsole/letsencrypt/lexicon-confconsole-provider_route53.yml
e257660aa2cc7b1eaeb6aedf7432ac59 usr/share/doc/confconsole/Lets_encrypt.rst.gz
a3669376af9ba16caa311032d48b7b47 usr/share/doc/confconsole/Mail_relay.rst
32fe69fb884b36498f642170299bdf6e usr/share/doc/confconsole/Networking.rst
97798f774fdb8e41cefa9adda61e9300 usr/share/doc/confconsole/Plugins.rst.gz
36f800426b5187434462f5b06ec7d301 usr/share/doc/confconsole/Proxy_settings.rst
f8388f428723005621023628ac3031f2 usr/share/doc/confconsole/README.gz
c9ea765c96c4bc58062bc7072e0f1524 usr/share/doc/confconsole/Region_config.rst
29a4ba329f4d42eb7b4ffec7949e0c7f usr/share/doc/confconsole/RelNotes-0.9.1.txt
f3f950743532991ade629a836c7380ca usr/share/doc/confconsole/RelNotes-0.9.2.txt
e5a06032b5dc076c13b2823654722d51 usr/share/doc/confconsole/RelNotes-0.9.3.txt
078f02d816e128030c5d8841b02de06b usr/share/doc/confconsole/RelNotes-0.9.4.txt
1fcfab7291c76dd596cc0ac89312a875 usr/share/doc/confconsole/RelNotes-0.9.txt
1450fbe51e3f2ffbe66f679f495d0bbf usr/share/doc/confconsole/RelNotes-1.0.0.txt
4bd4491332687ca48a1d93ace94c6937 usr/share/doc/confconsole/RelNotes-2.1.0.txt
e83bc3e078770ff0233089f407b2cf69 usr/share/doc/confconsole/System_settings.rst
3598cc212de59acaeeb4b4aee07f9974 usr/share/doc/confconsole/changelog.gz
8f8660a6a383b3bcfb47cbe7910af6ed usr/share/doc/confconsole/copyright
72bbf571b07b95bf530cd6941d3b0fcb usr/share/doc/confconsole/images/00_confconsole_core_main.png
24915b1bcb36902de7ee4e345eea920d usr/share/doc/confconsole/images/01_confconsole_core_advanced.png
ff887beec0e146d0ac556d487e16e4f4 usr/share/doc/confconsole/images/02_confconsole_core_networking.png
bc81127718a40bb72247e5005994f825 usr/share/doc/confconsole/images/03_confconsole_lets_encrypt.png
11134981a46654655ec4696c44fba49c usr/share/doc/confconsole/images/04_confconsole_mail_relay.png
02b840ee6a2be899616da5d55cccee03 usr/share/doc/confconsole/images/05_confconsole_proxy_settings.png
bbc3a0b0f1c3f0af2f64cc5e810a3daf usr/share/doc/confconsole/images/06_confconsole_region_config.png
1b11d3ad61cf27538419a8181a0c2859 usr/share/doc/confconsole/images/07_confconsole_system_settings.png
98e0b696b2c13aefd5601d305b414297 usr/share/python3/runtime.d/confconsole.rtupdate
25 changes: 25 additions & 0 deletions debian/confconsole/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
set -e

# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
py3compile -p confconsole /usr/lib/confconsole
fi
if command -v pypy3compile >/dev/null 2>&1; then
pypy3compile -p confconsole /usr/lib/confconsole || true
fi

# End automatically added section
# Automatically added by dh_systemd_start/13.24.2
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
if [ -d /run/systemd/system ]; then
systemctl --system daemon-reload >/dev/null || true
if [ -n "$2" ]; then
_dh_action=restart
else
_dh_action=start
fi
deb-systemd-invoke $_dh_action 'add-water.service' >/dev/null || true
fi
fi
# End automatically added section
7 changes: 7 additions & 0 deletions debian/confconsole/DEBIAN/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
set -e
# Automatically added by dh_systemd_start/13.24.2
if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
17 changes: 17 additions & 0 deletions debian/confconsole/DEBIAN/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -e
# Automatically added by dh_systemd_start/13.24.2
if [ -z "$DPKG_ROOT" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ; then
deb-systemd-invoke stop 'add-water.service' >/dev/null || true
fi
# End automatically added section

# Automatically added by dh_python3
if command -v py3clean >/dev/null 2>&1; then
py3clean -p confconsole
else
dpkg -L confconsole | sed -En -e '/^(.*)\/(.+)\.py$/s,,rm "\1/__pycache__/\2".*,e'
find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
fi

# End automatically added section
20 changes: 20 additions & 0 deletions debian/confconsole/etc/confconsole/confconsole.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Confconsole config file
#
# Commented lines are ignored and default values used.
# If value declared multiple times, the last one will be applied.

# default network interface to display in usage
#default_nic eth0

# disable Networking config in Advanced menu
#networking false

# command to get public ipaddress to display in usage
#publicip_cmd curl -s https://api.ipify.org
#publicip_cmd ec2metadata --public-ipv4

# autostart on login - one of true|once|false
#autostart once

# enable copy/paste
#copy_paste true
5 changes: 5 additions & 0 deletions debian/confconsole/etc/confconsole/services.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Web: http://$ipaddr
https://$ipaddr
Web shell: https://$ipaddr:12320
Webmin: https://$ipaddr:12321
SSH/SFTP: root@$ipaddr (port 22)
11 changes: 11 additions & 0 deletions debian/confconsole/etc/logrotate.d/confconsole
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/var/log/confconsole/*.log {
monthly
missingok
rotate 6
compress
delaycompress
notifempty
create 640 root root

}

7 changes: 7 additions & 0 deletions debian/confconsole/lib/systemd/system/add-water.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Add Water
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/lib/confconsole/plugins.d/Lets_Encrypt/add-water-srv -l /var/log/confconsole/letsencrypt.log
1 change: 1 addition & 0 deletions debian/confconsole/usr/bin/confconsole
Loading