Commit graph

10 commits

Author SHA1 Message Date
Miroslav Lichvar
6562287c49 chrony: fix uci NTP access configuration
The chrony interface hotplug script reuses the handle_allow function
from the init script to allow NTP access on interfaces specified in uci.
The function requires /lib/functions/network.sh. Include the file in the
hotplug script to make the function work as expected.

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2021-06-19 13:30:09 +02:00
Miroslav Lichvar
21c0f580f1 chrony: improve configuration
Extend configuration of NTP sources in UCI:
- Add nts option to enable NTS
- Add disabled option to allow inactive sources

Add nts section to UCI with:
- rtccheck option to disable certificate time checks on systems that
  don't have an RTC to avoid the chicken-and-egg problem (it is less
  secure, but still should be better than no NTS at all)
- systemcerts option to disable system certificates
- trustedcerts option to specify path to trusted certificates

Save NTS keys and cookies by default to avoid unnecessary NTS-KE
sessions when restarted or switching back to an already used NTS source.
Also, save the drift to stabilize the clock after chronyd restart.

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2020-10-30 20:57:35 +01:00
Miroslav Lichvar
b9d6d6cdd0 chrony: improve hotplug script
- Use the chronyc onoffline command to update state of all sources
  per current routing configuration
- Don't ignore the "ifupdate" action
- Add NTP servers from DHCP for the interface that went up instead of
  the wan4+wan6 interfaces
- Save the servers to files loaded by the sourcedir directive to not
  lose them when chronyd is restarted, and remove them when the
  interface goes down

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2020-10-30 20:02:48 +01:00
Miroslav Lichvar
1dc8c501a6 chrony: rework loading of configuration
Instead of loading /etc/chrony/chrony.conf from the file generated from
the chrony UCI configuration, use the confdir directive in the main
config to load the generated file. This should make it obvious that
chrony is configured in UCI and it can also be easily disabled.

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2020-10-30 20:02:11 +01:00
Miroslav Lichvar
c9164a4d8a chrony: fix configuration of IPv6 client access
Fix the init script to allow access from IPv6 subnets of the interface
specified in allow section in /etc/config/chrony.

Fixes issue #7039.

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2018-09-17 17:14:30 +02:00
Metafly
fd4449e1de chrony: set rtcsync config option
Else the system will always stay in UNSYNC state.
Even if there is no real RTC.
See chrony minimal config:
http://chrony.tuxfamily.org/faq.html#_what_is_the_minimum_recommended_configuration_for_an_ntp_client

Signed-off-by: Stefan Sydow <st@metafly.info>
2017-02-10 18:13:31 +01:00
Miroslav Lichvar
9b9c34e47d chrony: improve hotplug and init scripts
- fix the init script to read the right config
- rework the init script to allow reusing its code in the hotplug script
- find wan interfaces in the hotplug script instead of using hardcoded
  name and set the online/offline status separately for IPv4/IPv6
- allow NTP access on interfaces that are configured after chronyd start
- add NTP servers obtained from DHCP, options are specified in a new
  dhcp_ntp_server config section
- start chronyd before the network service, include a patch to always
  have IP_FREEBIND defined, which seems to be missing with uclibc

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2015-11-14 13:36:52 +01:00
Miroslav Lichvar
116daf94e6 chrony: update to 2.2
Support for authentication with command key was replaced with
communication over Unix domain socket.

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2015-10-20 07:56:22 +02:00
Miroslav Lichvar
c75e456e25 chrony: remove old files
Remove files that were accidentally included in the previous merge
(pull request #1802). The obsolete patches are breaking the build now.

Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2015-10-17 14:22:46 +02:00
Miroslav Lichvar
71559ae85f chrony: import from oldpackages
Signed-off-by: Miroslav Lichvar <mlichvar0@gmail.com>
2015-10-13 10:10:53 +02:00