Skip to content

Commit 6b7188a

Browse files
committed
feat(menu): allow overriding admin console URL via TAILRAY_ADMIN_URL
1 parent 4186e69 commit 6b7188a

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

README.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,35 @@
22

33
A modern and fast implementation of tailscale-systray in Rust.
44

5-
> [!NOTE] Tailray is a work in progress. Most things don't work, or work in a
6-
> degraded state. If you find bugs that are not aggressed in the issues tab,
7-
> feel free to create a new issue or a pull request! You are advi
5+
<!-- deno-fmt-ignore-start -->
6+
7+
## Usage
8+
9+
> [!NOTE]
10+
> Tailray is a work in progress. Most things don't work, or work in a
11+
> degraded state. If you find bugs that are not addressed in the issues tab,
12+
> feel free to create a new issue or a pull request!
13+
14+
<!-- deno-fmt-ignore-end -->
15+
16+
Tailray requires Tailscaled to be up and running. On Linux systems, you can
17+
check its status with `systemctl status tailscaled`.
18+
19+
After you confirm that Tailscale is running, and that you are authenticated run
20+
`tailray` from a terminal or consider writing a systemd service for it.
21+
22+
### Overriding Admin Console URL
23+
24+
Tailray will assume `https://login.tailscale.com/admin/machines` to be the Admin
25+
Console URL by default. You may override this URL by setting `TAILRAY_ADMIN_URL`
26+
to an URL of your choice.
827

928
## Hacking
1029

11-
Simply run `nix develop` in the project root.
30+
The recommended way of building Tailray is with the Nix build tool. You may run
31+
`nix develop` in the repository to enter a devShell with the necessary
32+
dependencies. Direnv users may also use `direnv allow` to let direnv handle
33+
their shell environment.
1234

1335
## License
1436

src/tray/menu.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ impl Tray for SysTray {
220220
StandardItem {
221221
label: "Admin Console…".into(),
222222
activate: Box::new(|_| {
223-
if let Err(e) = open::that("https://login.tailscale.com/admin/machines") {
223+
let admin_url = std::env::var("TAILRAY_ADMIN_URL").unwrap_or_else(|_| {
224+
"https://login.tailscale.com/admin/machines".to_string()
225+
});
226+
if let Err(e) = open::that(admin_url.as_str()) {
224227
eprintln!("failed to open admin console: {}", e);
225228
}
226229
}),

0 commit comments

Comments
 (0)