Skip to content

Commit 95835fa

Browse files
committed
chore: rebrand to indradb.net, update default API URL
- Update CLI help text: indra.dev → indradb.net - Update default API URL to api.indradb.net - Support legacy domain (indra.dev) for backwards compatibility
1 parent cdd19a9 commit 95835fa

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ enum RemoteCommands {
256256
Add {
257257
/// Name for the remote (e.g., origin)
258258
name: String,
259-
/// URL of the remote (e.g., username/repo or https://indra.dev/username/repo)
259+
/// URL of the remote (e.g., username/repo or https://indradb.net/username/repo)
260260
url: String,
261261
},
262262

src/remote/mod.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub use sync::{
2222
pub struct Remote {
2323
/// Name of the remote (e.g., "origin")
2424
pub name: String,
25-
/// URL of the remote (e.g., "username/repo" or "https://indra.dev/username/repo")
25+
/// URL of the remote (e.g., "username/repo" or "https://indradb.net/username/repo")
2626
pub url: String,
2727
/// Last known HEAD commit hash on the remote
2828
#[serde(default)]
@@ -46,11 +46,16 @@ impl Remote {
4646
pub fn parse_url(&self) -> Option<(String, String)> {
4747
let url = self.url.trim();
4848

49-
// Handle full URLs: https://indra.dev/username/repo
49+
// Handle full URLs: https://indradb.net/username/repo
5050
if url.starts_with("https://") || url.starts_with("http://") {
5151
let path = url
5252
.trim_start_matches("https://")
5353
.trim_start_matches("http://")
54+
.trim_start_matches("indradb.net/")
55+
.trim_start_matches("api.indradb.net/")
56+
// Legacy domain support
57+
.trim_start_matches("indra.net/")
58+
.trim_start_matches("api.indra.net/")
5459
.trim_start_matches("indra.dev/")
5560
.trim_start_matches("api.indra.dev/");
5661
return Self::parse_path(path);
@@ -232,13 +237,20 @@ mod tests {
232237
Some(("username".to_string(), "repo".to_string()))
233238
);
234239

235-
let remote = Remote::new("origin", "https://indra.dev/username/repo");
240+
let remote = Remote::new("origin", "https://indradb.net/username/repo");
236241
assert_eq!(
237242
remote.parse_url(),
238243
Some(("username".to_string(), "repo".to_string()))
239244
);
240245

241-
let remote = Remote::new("origin", "https://api.indra.dev/username/repo");
246+
let remote = Remote::new("origin", "https://api.indradb.net/username/repo");
247+
assert_eq!(
248+
remote.parse_url(),
249+
Some(("username".to_string(), "repo".to_string()))
250+
);
251+
252+
// Legacy domains should still work
253+
let remote = Remote::new("origin", "https://indra.dev/username/repo");
242254
assert_eq!(
243255
remote.parse_url(),
244256
Some(("username".to_string(), "repo".to_string()))

src/remote/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use crate::remote::{CredentialStore, Remote};
66
use crate::{Error, Result};
77
use std::path::Path;
88

9-
/// Default API base URL
10-
pub const DEFAULT_API_URL: &str = "https://indra-net-api.moonstripe.workers.dev";
9+
/// Default API base URL (production)
10+
pub const DEFAULT_API_URL: &str = "https://api.indradb.net";
1111

1212
/// Authentication credentials
1313
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)