diff --git a/crates/tranquil-api/src/lib.rs b/crates/tranquil-api/src/lib.rs index 6852e73..9419f2f 100644 --- a/crates/tranquil-api/src/lib.rs +++ b/crates/tranquil-api/src/lib.rs @@ -489,9 +489,15 @@ pub fn webhook_routes() -> axum::Router { pub fn misc_routes() -> axum::Router { use axum::routing::get; - axum::Router::new() + let router = axum::Router::new() .route("/health", get(server::health)) .route("/robots.txt", get(server::robots_txt)) .route("/favicon.ico", get(server::get_logo)) - .route("/u/{handle}/did.json", get(identity::user_did_doc)) + .route("/u/{handle}/did.json", get(identity::user_did_doc)); + + if tranquil_config::get().server.rfc_moo_compliance { + router.route("/cow.txt", get(server::cow_txt)) + } else { + router + } } diff --git a/crates/tranquil-api/src/server/cow.txt b/crates/tranquil-api/src/server/cow.txt new file mode 100644 index 0000000..add2f00 --- /dev/null +++ b/crates/tranquil-api/src/server/cow.txt @@ -0,0 +1,57 @@ + + + + + + + .......................... + ....*o|||||||8#@@@@@@@@@@@@@@@@@@@@@@@###&|o:_.. + ..*:o|||&8##@###8888888######@#@###########################|*... + .:o|||8#####8888|:::**. *&########################@@################&o_ + .*o&8###@#8&o*_. :###@##############@########################@@##&o_ + .*o8########& :##@#@##############@############################@###|_ + .*o|8##########8o .#######################################################&o_ + *&##|_ ..*&##8&o*|88888|_ _#######################################@##################|. + *#####& *&######&o_..*o|o:_ .&##o _###########################################################&_ + _##8*##8 .|88|:::|#######8###8|*:_ .&#@@8 _##@@@########################################################&_ + _#@8_##8_ *8#8|*_ _:|#####&&####8 .&##############################################################| + _#@8.|##8_ _::o###8&##8 .|##@############################8###########################@@#|_ + *###o.|88o ..*&####|..##& _|##########################8|_ .|#############################8 + *|###|_ ._&####8|*_ _*_ _::&8888888888888888|::*_ .|##@####@@@##################| + *&###|_ _:_ .&88###8|*_ ..... .|#####@@@##################8 + .##@#& _##& .|##o _#@@#@#| .|#######&:_ _|###@####################8 + .:8##8o _o:*&##| *##8_.&@@##@#| _::o8#8|::|#####|_ _|#################88###8 + .&##&*_ *###o_###| .|##8*&##|*###o _###8####8|_ _:|###|_ .*o|||o:_ _:::&8888888888|_ _##8 + .###|_. _###o *###|*&#######8 *##8 .##8_ _:|###|_ _|###|_ .&########o _##& + _|####8|&##8:_ _|#########88o .##8 *##& _|###o .|###o .#########| .o##o + o#8|*:#@@###o _:::*__*_ _##8_ _##8_ _&##|_ *##8_ *8#####8|_ .*oo:_ o##| + *###o.&#####& _oo* .8##& .8##8_ .|##& o##& _::::_.*o|8######|_ .##8. + _###&o&##8_:*_ .###& .###|_&#####| _##8 :###o *ooo&#########@#@#& ....:##& + .|8||###&. _**_ .###88##|*&###|*._&##& *|##8_ *o&####@@####@@######& .*o||||||&#######8_ + *&###o _|88##8_ _:8######|*:###|_ _##################88|_ *&#################& + *#####o *&8o *##& _:::*_.&##|_ _#@##############8_ :##################8* + .###&##8_.|88o *&8o _@@& .###| .&####@#########|_ .####@###@@########8* + _##&.|###|_.... .|88o _##8* *&###|_ *###o _:&88######8|_ .*o|||##################o + _##8_ _|########|_ .*o8####&#@@#@##o *#@8 _*:*. .&###@###################| + .|##& _:::::&##& .*&##############@#8_ .###o _#@####################|_ + .&##|_ .&##8_ *o&####################8_ *##& .&#####@@############8* + .|##8_.&###&####8_ _########################8**##& _##################|_ + .&###&##888888##8_ .|88######@###########|*######o _|8###############|_ + .&#####o *###|_ _::::::*o##8**o##8 .|###8o .&##@#############&* + .|####o _|###|_ _##8.*&##& _*_ .#################| + _*_ _|###|_.. .|#####8|_ *&#@#########8###& + *#######&|o:_... ..*:::*. ......._:o&8####888&o:#####8_ + _###|&888#####@#####&|||o:_........................._:o||||8##@@@@####8|:*_ _:::*_ + .|#@###o _:::o#@#888######@@@@@@@@@@@@@@@@@@@@@@@@#####888|::::::**_ + _::*_ :##& *&8|_:::::::::::::::::::::::::**_ + .###8||&##8o + _|888888|_ + + + + + + + + + diff --git a/crates/tranquil-api/src/server/meta.rs b/crates/tranquil-api/src/server/meta.rs index bc7f2ad..0f07c4a 100644 --- a/crates/tranquil-api/src/server/meta.rs +++ b/crates/tranquil-api/src/server/meta.rs @@ -29,6 +29,10 @@ pub async fn robots_txt() -> impl IntoResponse { "# Hello!\n\n# Crawling the public API is allowed\nUser-agent: *\nAllow: /\n", ) } + +pub async fn cow_txt() -> &'static str { + include_str!("cow.txt") +} pub fn is_self_hosted_did_web_enabled() -> bool { tranquil_config::get().server.enable_pds_hosted_did_web } diff --git a/crates/tranquil-api/src/server/mod.rs b/crates/tranquil-api/src/server/mod.rs index 4c01aae..0bf8b55 100644 --- a/crates/tranquil-api/src/server/mod.rs +++ b/crates/tranquil-api/src/server/mod.rs @@ -28,7 +28,7 @@ pub use email::{ }; pub use invite::{create_invite_code, create_invite_codes, get_account_invite_codes}; pub use logo::get_logo; -pub use meta::{describe_server, health, robots_txt}; +pub use meta::{cow_txt, describe_server, health, robots_txt}; pub use migration::{get_did_document, update_did_document}; pub use passkey_account::{ complete_passkey_setup, create_passkey_account, recover_passkey_account, diff --git a/crates/tranquil-config/src/lib.rs b/crates/tranquil-config/src/lib.rs index e1a5ce3..3a0185e 100644 --- a/crates/tranquil-config/src/lib.rs +++ b/crates/tranquil-config/src/lib.rs @@ -445,6 +445,10 @@ pub struct ServerConfig { #[config(env = "ENABLE_PDS_HOSTED_DID_WEB", default = false)] pub enable_pds_hosted_did_web: bool, + /// iykyk! + #[config(env = "RFC_MOO_COMPLIANCE", default = false)] + pub rfc_moo_compliance: bool, + /// When set to true, skip age-assurance birthday prompt for all accounts. #[config(env = "PDS_AGE_ASSURANCE_OVERRIDE", default = false)] pub age_assurance_override: bool, diff --git a/example.toml b/example.toml index aeceade..22b97b0 100644 --- a/example.toml +++ b/example.toml @@ -34,6 +34,13 @@ # Default value: false #enable_pds_hosted_did_web = false +# iykyk! +# +# Can also be specified via environment variable `RFC_MOO_COMPLIANCE`. +# +# Default value: false +#rfc_moo_compliance = false + # When set to true, skip age-assurance birthday prompt for all accounts. # # Can also be specified via environment variable `PDS_AGE_ASSURANCE_OVERRIDE`. @@ -416,7 +423,9 @@ # List of relay / crawler notification URLs. # # Can also be specified via environment variable `CRAWLERS`. -#crawlers = +# +# Default value: ["https://relay.fire.hose.cam", "https://relay3.fr.hose.cam", "https://bsky.network", "https://northamerica.firehose.network", "https://europe.firehose.network", "https://asia.firehose.network", "https://atproto.africa", "https://relay.upcloud.world"] +#crawlers = ["https://relay.fire.hose.cam", "https://relay3.fr.hose.cam", "https://bsky.network", "https://northamerica.firehose.network", "https://europe.firehose.network", "https://asia.firehose.network", "https://atproto.africa", "https://relay.upcloud.world"] [email] # Sender email address. When unset, email sending is disabled.