This prepares for an eventual DNS implementation where certain TLD's are
redirected to an alternative backend
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
When macos app distributed on appstore, it can't create the TUN device
from Rust code.
It has to create the TUN device from Swift then pass the FD to the
mycelium Rust code.
Also add timeout to the send/recv channel.
The mobile API returns `Vec<String>` instead of `Result<T, Error>`
because the current rust bridge method can't support `Result<T,
Error>`.
For it to be supported, we need to change the bridging method, which may
not worth it for now.
* fix(android): handle second tracing init.
ignore error when register the tracing subscriber as global default
because it is harmless.
* fix(mobile): call tracing init only once.
Call it once with lazy_static
This reverts commit f2caf4f515.
Upon inspection tracing_subscriber, by default, attempts to install a
tracing_log subscriber (this is gated by a feature gate, which is
enabled by default). Thus, manually doing that actually causes a crash
at startup since the global logger is attempted to be initialized twice.
This switches:
- from android_logger to tracing-android
- from oslog to tracing-oslog
- from log to the default tracing log infrastructure
Most of the noise in here is changing the imports from
`log::{…}` to `tracing::{…}`.
In terms of log setup, for now this tries to stick with the existing
behaviour:
- myceliumd now uses `EnvFilter` and the `compact()` default formatter,
instead of `prety_env_logger`.
Its CLI args are kept as-is. `RUST_LOG` env var still works, too.
- The `setup_the_logger` function in the `mobile` crate is renamed to
`setup_logging`.
* feat(ios): add support for iOS
- add oslog as iOS logger
- add ios TUN device
- temporary disable QUIC for android
- change 'acquired route' logging level to debug. It is very noisy to
use info
* undo unnessary changes
Allow the peer manager to run without quic socket, even in public mode.
This will not create the socket, and prevent connections to quic peers.
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
- use tokio Mutex, to avoid holding a synchronous mutex across an await
point.
- Ignore type complexity on the global channel which governs shutdown
for now, as it's pretty clear what it does.
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
Start & stop implemented by adding a global channel.
Upon startup `Node` listens to ctrl-c and channel receiver.
On stop, we send message to that channel and Node can exit..