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

feat: paid tunnels v1 #97

Merged
merged 1 commit into from
Jun 10, 2024
Merged

feat: paid tunnels v1 #97

merged 1 commit into from
Jun 10, 2024

Conversation

charlottea98
Copy link
Contributor

@charlottea98 charlottea98 commented Jun 4, 2024

Tested going from paid to free tunnel, and vice versa. Works smoothly for me at least 🤞

Some extra logging added that shows up when running RUST_LOG=info cargo run -- start. There is more that can be done with logging but will leave that for the linear card DO-1495 "linkup: logger".

Part of DO-1495
Resolves DO-1496

@charlottea98 charlottea98 force-pushed the lotta/dns-paid branch 6 times, most recently from ed70484 to 4c13e94 Compare June 5, 2024 11:33

let parsed: GetTunnelApiResponse = send_request(&client, &query_url, headers, None, "GET")?;
if parsed.result.is_empty() {
Ok(None)
} else {
Ok(Some(parsed.result[0].id.clone()))
// Check if there exists a tunnel with this name that hasn't been deleted
Copy link
Contributor Author

@charlottea98 charlottea98 Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted tunnels still show up in the response but has "deleted_at" set. Instead, it needs to find the tunnel name and where "deleted_at" is null

@charlottea98 charlottea98 force-pushed the lotta/dns-paid branch 3 times, most recently from e407642 to eb7a4bb Compare June 5, 2024 12:49
@charlottea98 charlottea98 changed the title feat: paid tunnels feat: paid tunnels v1 Jun 5, 2024
@charlottea98 charlottea98 marked this pull request as ready for review June 5, 2024 13:05
@@ -61,6 +54,13 @@ impl TunnelManager for RealTunnelManager {
}
}
}
fn is_tunnel_running(&self) -> Result<(), CheckErr> {
if !linkup_file_path(LINKUP_CLOUDFLARED_PID).exists() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condition can be reversed

Copy link
Contributor

@ostenbom ostenbom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can bump linkup-cli version in it's cargo.toml version too!

console.error(
"Please set CLOUDFLARE_API_KEY and CLOUDFLARE_EMAIL environment variables"
"Run `menti localsecrets` to set the required environment variables"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't make sense in an open-source repo - but maybe we leave it / it's ok?

@charlottea98 charlottea98 merged commit 00f9f2c into main Jun 10, 2024
4 checks passed
@charlottea98 charlottea98 deleted the lotta/dns-paid branch June 10, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants