alpha
Login
or
Join now
microcosm.blue
/
microcosm-rs
Star
0
Fork
3
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
Star
0
Fork
3
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
https note instead of 404
author
phil
date
4 months ago
(Feb 12, 2026, 5:30 PM -0500)
commit
5a7a0c32
5a7a0c32a4b4d152b150fe1f645263d25bbd0338
parent
4c502e90
4c502e901197581ba54b5469c6ac8e21ef876d00
+135
-13
2 changed files
Expand all
Collapse all
Unified
Split
Cargo.lock
slingshot
src
server.rs
+126
-9
Cargo.lock
Reviewed
···
3900
3900
"clap",
3901
3901
"jwt-compact",
3902
3902
"log",
3903
3903
-
"poem",
3904
3904
-
"poem-openapi",
3903
3903
+
"poem 3.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
3904
3904
+
"poem-openapi 5.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
3905
3905
"reqwest",
3906
3906
"rusqlite",
3907
3907
"serde",
···
3934
3934
"parking_lot",
3935
3935
"percent-encoding",
3936
3936
"pin-project-lite",
3937
3937
-
"poem-derive",
3937
3937
+
"poem-derive 3.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
3938
3938
"quick-xml",
3939
3939
"rcgen",
3940
3940
"regex",
···
3956
3956
"tokio-util",
3957
3957
"tracing",
3958
3958
"wildmatch",
3959
3959
-
"x509-parser",
3959
3959
+
"x509-parser 0.17.0",
3960
3960
+
]
3961
3961
+
3962
3962
+
[[package]]
3963
3963
+
name = "poem"
3964
3964
+
version = "3.1.12"
3965
3965
+
source = "git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async#aa0067f0880c9e0a7b043bbf5f78f21c58b303f2"
3966
3966
+
dependencies = [
3967
3967
+
"base64 0.22.1",
3968
3968
+
"bytes",
3969
3969
+
"chrono",
3970
3970
+
"futures-util",
3971
3971
+
"headers",
3972
3972
+
"http",
3973
3973
+
"http-body-util",
3974
3974
+
"httpdate",
3975
3975
+
"hyper",
3976
3976
+
"hyper-util",
3977
3977
+
"mime",
3978
3978
+
"mime_guess",
3979
3979
+
"multer",
3980
3980
+
"nix",
3981
3981
+
"parking_lot",
3982
3982
+
"percent-encoding",
3983
3983
+
"pin-project-lite",
3984
3984
+
"poem-derive 3.1.12 (git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async)",
3985
3985
+
"quick-xml",
3986
3986
+
"rcgen",
3987
3987
+
"regex",
3988
3988
+
"reqwest",
3989
3989
+
"rfc7239",
3990
3990
+
"ring",
3991
3991
+
"rustls-pemfile",
3992
3992
+
"serde",
3993
3993
+
"serde_json",
3994
3994
+
"serde_urlencoded",
3995
3995
+
"serde_yaml",
3996
3996
+
"smallvec",
3997
3997
+
"sync_wrapper",
3998
3998
+
"tempfile",
3999
3999
+
"thiserror 2.0.16",
4000
4000
+
"tokio",
4001
4001
+
"tokio-rustls 0.26.2",
4002
4002
+
"tokio-stream",
4003
4003
+
"tokio-util",
4004
4004
+
"tracing",
4005
4005
+
"wildmatch",
4006
4006
+
"x509-parser 0.18.1",
3960
4007
]
3961
4008
3962
4009
[[package]]
···
3972
4019
]
3973
4020
3974
4021
[[package]]
4022
4022
+
name = "poem-derive"
4023
4023
+
version = "3.1.12"
4024
4024
+
source = "git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async#aa0067f0880c9e0a7b043bbf5f78f21c58b303f2"
4025
4025
+
dependencies = [
4026
4026
+
"proc-macro-crate",
4027
4027
+
"proc-macro2",
4028
4028
+
"quote",
4029
4029
+
"syn",
4030
4030
+
]
4031
4031
+
4032
4032
+
[[package]]
3975
4033
name = "poem-openapi"
3976
4034
version = "5.1.16"
3977
4035
source = "registry+https://github.com/rust-lang/crates.io-index"
···
3985
4043
"itertools 0.14.0",
3986
4044
"mime",
3987
4045
"num-traits",
3988
3988
-
"poem",
3989
3989
-
"poem-openapi-derive",
4046
4046
+
"poem 3.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
4047
4047
+
"poem-openapi-derive 5.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
4048
4048
+
"quick-xml",
4049
4049
+
"regex",
4050
4050
+
"serde",
4051
4051
+
"serde_json",
4052
4052
+
"serde_urlencoded",
4053
4053
+
"serde_yaml",
4054
4054
+
"thiserror 2.0.16",
4055
4055
+
"tokio",
4056
4056
+
]
4057
4057
+
4058
4058
+
[[package]]
4059
4059
+
name = "poem-openapi"
4060
4060
+
version = "5.1.16"
4061
4061
+
source = "git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async#aa0067f0880c9e0a7b043bbf5f78f21c58b303f2"
4062
4062
+
dependencies = [
4063
4063
+
"base64 0.22.1",
4064
4064
+
"bytes",
4065
4065
+
"derive_more",
4066
4066
+
"futures-util",
4067
4067
+
"indexmap 2.11.4",
4068
4068
+
"itertools 0.14.0",
4069
4069
+
"mime",
4070
4070
+
"num-traits",
4071
4071
+
"poem 3.1.12 (git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async)",
4072
4072
+
"poem-openapi-derive 5.1.16 (git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async)",
3990
4073
"quick-xml",
3991
4074
"regex",
3992
4075
"serde",
···
4002
4085
version = "5.1.16"
4003
4086
source = "registry+https://github.com/rust-lang/crates.io-index"
4004
4087
checksum = "41273b691a3d467a8c44d05506afba9f7b6bd56c9cdf80123de13fe52d7ec587"
4088
4088
+
dependencies = [
4089
4089
+
"darling",
4090
4090
+
"http",
4091
4091
+
"indexmap 2.11.4",
4092
4092
+
"mime",
4093
4093
+
"proc-macro-crate",
4094
4094
+
"proc-macro2",
4095
4095
+
"quote",
4096
4096
+
"regex",
4097
4097
+
"syn",
4098
4098
+
"thiserror 2.0.16",
4099
4099
+
]
4100
4100
+
4101
4101
+
[[package]]
4102
4102
+
name = "poem-openapi-derive"
4103
4103
+
version = "5.1.16"
4104
4104
+
source = "git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async#aa0067f0880c9e0a7b043bbf5f78f21c58b303f2"
4005
4105
dependencies = [
4006
4106
"darling",
4007
4107
"http",
···
4372
4472
dependencies = [
4373
4473
"clap",
4374
4474
"log",
4375
4375
-
"poem",
4475
4475
+
"poem 3.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
4376
4476
"serde",
4377
4477
"tokio",
4378
4478
"tracing-subscriber",
···
5115
5215
"log",
5116
5216
"metrics",
5117
5217
"metrics-exporter-prometheus 0.17.2",
5118
5118
-
"poem",
5119
5119
-
"poem-openapi",
5218
5218
+
"poem 3.1.12 (git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async)",
5219
5219
+
"poem-openapi 5.1.16 (git+https://github.com/uniphil/poem.git?branch=acme%2Fissue-async)",
5120
5220
"reqwest",
5121
5221
"rustls 0.23.31",
5122
5222
"serde",
···
6575
6675
version = "0.17.0"
6576
6676
source = "registry+https://github.com/rust-lang/crates.io-index"
6577
6677
checksum = "4569f339c0c402346d4a75a9e39cf8dad310e287eef1ff56d4c68e5067f53460"
6678
6678
+
dependencies = [
6679
6679
+
"asn1-rs",
6680
6680
+
"data-encoding",
6681
6681
+
"der-parser",
6682
6682
+
"lazy_static",
6683
6683
+
"nom",
6684
6684
+
"oid-registry",
6685
6685
+
"rusticata-macros",
6686
6686
+
"thiserror 2.0.16",
6687
6687
+
"time",
6688
6688
+
]
6689
6689
+
6690
6690
+
[[package]]
6691
6691
+
name = "x509-parser"
6692
6692
+
version = "0.18.1"
6693
6693
+
source = "registry+https://github.com/rust-lang/crates.io-index"
6694
6694
+
checksum = "d43b0f71ce057da06bc0851b23ee24f3f86190b07203dd8f567d0b706a185202"
6578
6695
dependencies = [
6579
6696
"asn1-rs",
6580
6697
"data-encoding",
+9
-4
slingshot/src/server.rs
Reviewed
···
1466
1466
"0.0.0.0:80"
1467
1467
}));
1468
1468
1469
1469
+
let https_plz = "this service must be accessed with https (port 443).";
1470
1470
+
1469
1471
let app = if let Some(redir) = acme_challenge_redirect {
1470
1472
use poem::web;
1471
1473
···
1475
1477
web::Redirect::temporary(format!("{redir}{token}"))
1476
1478
});
1477
1479
1480
1480
+
RouteScheme::new().https(app).http(
1481
1481
+
Route::new()
1482
1482
+
.nest("/", make_sync(move |_| https_plz))
1483
1483
+
.at("/.well-known/acme-challenge/:token", redirect),
1484
1484
+
)
1485
1485
+
} else {
1478
1486
RouteScheme::new()
1479
1487
.https(app)
1480
1480
-
.http(Route::new().at("/.well-known/acme-challenge/:token", redirect))
1481
1481
-
} else {
1482
1482
-
// just uh... 404 for port 80? should probably reply with something.
1483
1483
-
RouteScheme::new().https(app).http(Route::new())
1488
1488
+
.http(Route::new().nest("/", make_sync(move |_| https_plz)))
1484
1489
};
1485
1490
1486
1491
Ok((listener, app))