Compare commits

..

2 Commits

Author SHA1 Message Date
9144f48000 adapt to modern ntp.conf file used by ntpsec 2025-09-16 12:10:30 +02:00
a0889fe3ee add ntpsec specific configuration 2025-09-16 12:06:13 +02:00
2 changed files with 58 additions and 1 deletions

View File

@@ -39,7 +39,11 @@ conf_ntp()
prnt I "Installing NTP configuration file..." prnt I "Installing NTP configuration file..."
local dest="${conf_file}.work" local dest="${conf_file}.work"
backup_dist "$conf_file" backup_dist "$conf_file"
if [[ -s $NTP_SERV ]]; then
install_file ${NTP_SERV}.conf "$dest"
else
install_file ntp.conf "$dest" install_file ntp.conf "$dest"
fi
tag_file "$dest" tag_file "$dest"
local line="" local line=""
for srv in $NTP_SERVERS; do for srv in $NTP_SERVERS; do

53
repo/common/ntpsec.conf Normal file
View File

@@ -0,0 +1,53 @@
# /etc/ntpsec/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntpsec/ntp.drift
leapfile /usr/share/zoneinfo/leap-seconds.list
# To enable Network Time Security support as a server, obtain a certificate
# (e.g., with Let's Encrypt), place the cert and key in the paths below, and
# uncomment:
# nts cert /etc/ntpsec/cert-chain.pem
# nts key /etc/ntpsec/key.pem
# nts enable
# You must create /var/log/ntpsec (owned by ntpsec:ntpsec) to enable logging.
#statsdir /var/log/ntpsec/
#statistics loopstats peerstats clockstats
#filegen loopstats file loopstats type day enable
#filegen peerstats file peerstats type day enable
#filegen clockstats file clockstats type day enable
# This should be maxclock 7, but the pool entries count towards maxclock.
tos maxclock 11
# Comment this out if you have a refclock and want it to be able to discipline
# the clock by itself (e.g. if the system is not connected to the network).
tos minclock 4 minsane 3
# Specify one or more NTP servers.
# Public NTP servers supporting Network Time Security:
# server time.cloudflare.com nts
@SERVERLIST@
# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will
# pick a different set every time it starts up. Please consider joining the
# pool: <https://www.pool.ntp.org/join.html>
#pool 0.debian.pool.ntp.org iburst
#pool 1.debian.pool.ntp.org iburst
#pool 2.debian.pool.ntp.org iburst
#pool 3.debian.pool.ntp.org iburst
# Access control configuration; see /usr/share/doc/ntpsec-doc/html/accopt.html
# for details.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict default kod nomodify noquery limited
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1