diff --git a/routes/build.rs b/routes/build.rs
index 6610daa..1875ad3 100644
--- a/routes/build.rs
+++ b/routes/build.rs
@@ -75,6 +75,7 @@ fn main() {
 	}
 }
 
+#[cfg(feature = "web")]
 fn if_matches_set_env_path(var: &str, f: &std::fs::DirEntry, fname: &str, first: &str, last: &str) -> bool {
 	if fname.starts_with(first) && fname.ends_with(last) {
 		match f.path().canonicalize() {
diff --git a/routes/src/activitypub/auth.rs b/routes/src/activitypub/auth.rs
index a9298b1..e7c7fb1 100644
--- a/routes/src/activitypub/auth.rs
+++ b/routes/src/activitypub/auth.rs
@@ -19,8 +19,8 @@ pub struct AuthSuccess {
 
 fn token() -> String {
 	// TODO should probably use crypto-safe rng
-	rand::thread_rng()
-		.sample_iter(&rand::distributions::Alphanumeric)
+	rand::rng()
+		.sample_iter(&rand::distr::Alphanumeric)
 		.take(128)
 		.map(char::from)
 		.collect()