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

Release branch v1.3.1 #93

Merged
merged 26 commits into from
Oct 11, 2023
Merged

Release branch v1.3.1 #93

merged 26 commits into from
Oct 11, 2023

Commits on Sep 22, 2023

  1. Configuration menu
    Copy the full SHA
    d5c1717 View commit details
    Browse the repository at this point in the history
  2. Upgrading quic-go to v0.38.0

    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    e355fd7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    82e44b0 View commit details
    Browse the repository at this point in the history
  4. Generating working default config in non-cd mode

    Using the same approach as in cd mode, but do it only once when running
    ctrld the first time, then the config will be re-used then.
    
    While at it, also adding Dockerfile.debug for better troubleshooting
    with alpine base image.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    13391fd View commit details
    Browse the repository at this point in the history
  5. all: do not depend on vyatta-dhcpd service on EdgeOS

    The only reason that forces ctrld to depend on vyatta-dhcpd service on
    EdgeOS is allowing ctrld to watch lease files properly, because those
    files may not be created at the time client info table initialized.
    
    However, on some EdgeOS version, vyatta-dhcpd could not start with an
    empty config file, causing restart loop itself, flooding systemd log,
    making the router run out of memory.
    
    To fix this, instead of depending on vyatta-dhcpd, we should just watch
    for lease files creation, then adding them to watch list.
    
    While at it, also making ctrld starts after nss-lookup, ensuring we have
    a working DNS before starting ctrld.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    126477e View commit details
    Browse the repository at this point in the history
  6. internal/router/edgeos: use /etc/version for checking USG

    Since mca-cli-op may not be available during boot time.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    6028b8f View commit details
    Browse the repository at this point in the history
  7. Always use ctrld bootstrap nameserver for ResolverTypeOS

    So in case no nameservers can be found, default OS resolver could still
    resolve queries.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    073af0f View commit details
    Browse the repository at this point in the history
  8. cmd/cli: fix default route IP with public interface

    For reporting router queries, ctrld uses private IP of the default route
    interface. However, when the default route is conntected directly to
    ISP, the interface will have a public IP, and another interface with the
    same MAC address will be created for LAN ip. So when no private IP found
    for default route interface, ctrld must look at the other interface to
    find the corret LAN ip.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    94a0530 View commit details
    Browse the repository at this point in the history
  9. internal/clientinfo: use jaytaylor/go-hostsfile for parsing hosts file

    txn2/txeh lower the hostname, which is not suitable for ctrld use case.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    d58d807 View commit details
    Browse the repository at this point in the history
  10. cmd/cli: another fix for finding default route IP

    The current approach to get default route IP is finding the LAN
    interface with the same MAC address. However, there could be multiple
    interfaces like that, making ctrld confused.
    
    This commit fixes this issue, by listing all possible private IPs, then
    sorting them and use the smallest one for router self queries.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    ee5eb4f View commit details
    Browse the repository at this point in the history
  11. all: include client IP if ctrld is dnsmasq upstream

    So ctrld can record the raw/original client IP instead of looking up
    from MAC to IP, which may not the right choice in some network setup
    like using wireguard/vpn on Merlin router.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    0f3e8c7 View commit details
    Browse the repository at this point in the history
  12. internal/clientinfo: monitor nameserver health

    In case the resolver could not reach nameserver, ptr discover should
    only print error message once, then stop doing the query until the
    nameserver is reachable. This would prevent ptr discover from flooding
    ctrld log with a lot of duplicated messages.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    823195c View commit details
    Browse the repository at this point in the history
  13. cmd/cli: restart systemd-resolved after setting DNS

    So the current selected DNS server will be reset, and the new one will
    be used by systemd-resolved after first query made.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    80a8881 View commit details
    Browse the repository at this point in the history
  14. cmd/cli: use better approach for detecting NetworkManager

    Currently, ctrld assumes that NetworkManager is not available if writing
    to /etc/NetworkManager/conf.d return directory not exist error. That
    would work on most Linux distros. However, cloud provider may do some
    hacks, causing ctrld confusion and think that NetworkManager is
    available.
    
    Fixing this by checking whether NetworkManager binary presents first.
    
    While at it, also fixing a bug when restarting NetworkManager failed
    causing ctrld hangs. The go-systemd library is not clear about this, but
    the waitCh channel won't never be closed if error occurred, so we must
    return immediately instead of receiving from it blindly.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    2765487 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    507c1af View commit details
    Browse the repository at this point in the history
  16. cmd: refactoring Run function

    So it's easier, more clear, more isolation between code on non-mobile
    and mobile platforms.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    bed7435 View commit details
    Browse the repository at this point in the history
  17. cmd/cli: add upstream monitor

    Some users mentioned that when there is an Internet outage, ctrld fails
    to recover, crashing or locks up the router. When requests start
    failing, this results in the clients emitting more queries, creating a
    resource spiral of death that can brick the device entirely.
    
    To guard against this case, this commit implement an upstream monitor
    approach:
    
     - Marking upstream as down after 100 consecutive failed queries.
     - Start a goroutine to check when the upstream is back again.
     - When upstream is down, answer all queries with SERVFAIL.
     - The checking process uses backoff retry to reduce high requests rate.
     - As long as the query succeeded, marking the upstream as alive then
       start operate normally.
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    511c4e6 View commit details
    Browse the repository at this point in the history
  18. all: guarding against DNS forwarding loop

    Based on how dnsmasq "--dns-loop-detect" mechanism.
    
    See: https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
    cuonglm committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    a9959a6 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    34758f6 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2023

  1. Fix windows config/socket dir location

    RMM uses non-user account which results in config + socket file being
    written to a random directory, which is not a real directory that can be
    accessed.
    
    Fix this by using directory of ctrld binary as user home dir.
    Connie Lukawski authored and cuonglm committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    c58516c View commit details
    Browse the repository at this point in the history
  2. Sync quic transport code with DOH transport

    Otherwise, the old code will leave un-used connections open-ed, causing
    ports leaking and prevent others from creating UDP conn.
    cuonglm committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    8ddbf88 View commit details
    Browse the repository at this point in the history
  3. all: generalize vpn client info

    VPN clients often have empty MAC address, because they come from virtual
    network interface. However, there's other setup/devices also create
    virtual interface, but is not VPN.
    
    Changing source of those clients to empty to prevent confustion in
    clients list command output.
    cuonglm committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    6e28517 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e03ad4c View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2023

  1. Excluding nameservers from /etc/resolv.conf for private resolver

    Since these ones are either ctrld itself or direct listener that ctrld
    is being upstream for, which makes health check query always succeed.
    cuonglm committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    77c1113 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. internal/clientinfo: ignoring localhost entry for hostsfile mapping

    Otherwise, actual hostname will be overriden with "localhost", which is
    rather confusing/bad for UX.
    cuonglm committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    9d2ea15 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    79076bd View commit details
    Browse the repository at this point in the history