forked from ordinals/ord
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Serve HTTPS with ACME certs (ordinals#256)
- Loading branch information
Showing
10 changed files
with
1,339 additions
and
55 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,14 @@ WorkingDirectory=/var/lib/ord | |
Environment=RUST_BACKTRACE=1 | ||
Environment=RUST_LOG=info | ||
ExecStart=/usr/local/bin/ord \ | ||
--index-size 1TiB \ | ||
--rpc-url 127.0.0.1:38332 \ | ||
--cookie-file /var/lib/bitcoind/signet/.cookie \ | ||
server | ||
--max-index-size 1TiB \ | ||
--rpc-url 127.0.0.1:38332 \ | ||
server \ | ||
--acme-cache /var/lib/ord/acme-cache \ | ||
--acme-contact mailto:[email protected] \ | ||
--acme-domain signet.ordinals.com \ | ||
--https-port 443 | ||
|
||
# Process management | ||
#################### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,9 @@ deploy branch='master': | |
rsync -avz deploy/checkout [email protected]:deploy/checkout | ||
ssh [email protected] 'cd deploy && ./checkout {{branch}}' | ||
|
||
log: | ||
ssh [email protected] 'journalctl -fu ord' | ||
|
||
test-deploy: | ||
ssh-keygen -f ~/.ssh/known_hosts -R 192.168.56.4 | ||
vagrant up | ||
|
@@ -65,6 +68,9 @@ print-paper-wallet path: | |
wkhtmltopdf -L 25mm -R 25mm -T 50mm -B 25mm {{path}} wallet.pdf | ||
lp -o sides=two-sided-long-edge wallet.pdf | ||
|
||
doc: | ||
cargo doc --all --open | ||
|
||
# publish current GitHub master branch | ||
publish: | ||
#!/usr/bin/env bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use super::*; | ||
|
||
use { | ||
async_rustls::rustls::Session, | ||
futures::future::{BoxFuture, FutureExt, TryFutureExt}, | ||
std::marker::Unpin, | ||
tokio::io::{AsyncRead, AsyncWrite}, | ||
tokio_util::compat::{Compat, FuturesAsyncReadCompatExt, TokioAsyncReadCompatExt}, | ||
}; | ||
|
||
#[derive(Clone)] | ||
pub(crate) struct TlsAcceptor(pub(crate) async_rustls::TlsAcceptor); | ||
|
||
impl<I: AsyncRead + AsyncWrite + Unpin + Send + 'static, S: Send + 'static> | ||
axum_server::accept::Accept<I, S> for TlsAcceptor | ||
{ | ||
type Stream = Compat<async_rustls::server::TlsStream<Compat<I>>>; | ||
type Service = S; | ||
type Future = BoxFuture<'static, io::Result<(Self::Stream, Self::Service)>>; | ||
|
||
fn accept(&self, stream: I, service: S) -> Self::Future { | ||
self | ||
.0 | ||
.accept(stream.compat()) | ||
.map_ok(move |tls| { | ||
let tls = tls.compat(); | ||
if let Some(ACME_TLS_ALPN_NAME) = tls.get_ref().get_ref().1.get_alpn_protocol() { | ||
log::info!("received TLS-ALPN-01 validation request"); | ||
} | ||
(tls, service) | ||
}) | ||
.boxed() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.