Skip to content

Rathole config watcher doesn't work with symlinks #359

Open
@yashgorana

Description

@yashgorana

Describe the bug
When config files are symlinks, rathole won't pickup any changes file pointed to by the symlink. This is needed to detect any changes that are made to a Kubernetes ConfigMap mounted to a rathole pod at a path.

To Reproduce
Steps to reproduce the behavior:

  1. Create a test/config.toml
  2. Create a symlink ln -s ./test/config.toml ./config.toml
  3. Run rathole --server ./config.toml
  4. Edit test/config.toml or config.toml to change the server config to bind_addr = "0.0.0.0:1333"
  5. Observe changes are not picked up and rathole doesn't hot reload.

Configuration

[server]
bind_addr = "0.0.0.0:2333"

[server.services.domain]
token = "domain-specific-rathole-secret"
bind_addr = "0.0.0.0:8001"

Logs

No hot reload log even after changing the config

$ RUST_BACKTRACE=1 rathole ./server.toml
2024-05-01T13:34:09.659589Z  INFO rathole::server: Listening at 0.0.0.0:2333
2024-05-01T13:34:09.659660Z  INFO config_watcher{path="./server.toml"}: rathole::config_watcher: Start watching the config

Environment:

  • OS: Linux Container, Kubernetes
  • rathole --version output:
rathole
Build Timestamp:     2023-10-01T10:08:07.162273634Z
Build Version:       0.5.0
Commit SHA:          None
Commit Date:         None
Commit Branch:       None
cargo Target Triple: x86_64-unknown-linux-gnu
cargo Profile:       release
cargo Features:      base64,client,default,futures_core,futures_sink,hot_reload,noise,notify,server,snowstorm,tls,tokio_native_tls,tokio_tungstenite,tokio_util,websocket
  • CPU architecture: amd64
  • rustc version: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions