diff --git a/Cargo.lock b/Cargo.lock index 8c2e303..ce7f24b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -559,32 +559,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "loin" -version = "0.1.0" -dependencies = [ - "base64", - "bip78", - "bitcoin", - "bitcoincore-rpc", - "configure_me", - "configure_me_codegen", - "hyper", - "hyper-tls", - "ln-types", - "rand", - "rcgen", - "serde", - "serde_derive", - "serde_json", - "tempfile", - "tokio", - "tokio-native-tls", - "tonic", - "tonic_lnd", - "url", -] - [[package]] name = "man" version = "0.1.1" @@ -636,6 +610,32 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nolooking" +version = "0.1.0" +dependencies = [ + "base64", + "bip78", + "bitcoin", + "bitcoincore-rpc", + "configure_me", + "configure_me_codegen", + "hyper", + "hyper-tls", + "ln-types", + "rand", + "rcgen", + "serde", + "serde_derive", + "serde_json", + "tempfile", + "tokio", + "tokio-native-tls", + "tonic", + "tonic_lnd", + "url", +] + [[package]] name = "num_cpus" version = "1.13.1" diff --git a/Cargo.toml b/Cargo.toml index 1422cc9..d4c8816 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "loin" +name = "nolooking" version = "0.1.0" authors = ["Dan Gould ", "Martin Habovstiak "] exclude = ["./tests/compose"] diff --git a/README.md b/README.md index dd82e6b..50d454c 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Good luck analyzing that! ### UX implications -All this is possible without loin by [manually exchanging PSBTs](https://github.com/lightningnetwork/lnd/blob/master/docs/psbt.md). +All this is possible without nolooking by [manually exchanging PSBTs](https://github.com/lightningnetwork/lnd/blob/master/docs/psbt.md). BIP78 turns that tedious back and forth into scanning/clicking one link followed by confirmation in the wallet. In other words, your grandmother will be able to somewhat privately open a bunch of channels for you, if she has a BIP78-capable wallet. @@ -62,13 +62,13 @@ In other words, your grandmother will be able to somewhat privately open a bunch 0. You need Rust version 1.48 or higher to compile this. 1. You need LND v14.2 or higher -2. `cargo build [--features=test_paths]`. The test_paths feature will serve the `static/index.html` ui contained in this folder rather than one in `/usr/share/loin/static` in production. +2. `cargo build [--features=test_paths]`. The test_paths feature will serve the `static/index.html` ui contained in this folder rather than one in `/usr/share/nolooking/static` in production. 3. Setup reverse HTTP proxy with HTTPS forwarding to some port - e.g. 3000. You can do this in a few lines using [selfhost in Cryptoanarchy Debian Repository](https://github.com/debian-cryptoanarchy/cryptoanarchy-deb-repo-builder/blob/master/docs/user-level.md#selfhost). or [on MacOS](https://www.storyblok.com/faq/setup-dev-server-https-proxy) -4. create a configuration file based on `config_spec.toml`. This is mine based on a [polar](https://lightningpolar.com/) lightning network simulator setup. `CONFIGURATION_FILE=loin.conf`: +4. create a configuration file based on `config_spec.toml`. This is mine based on a [polar](https://lightningpolar.com/) lightning network simulator setup. `CONFIGURATION_FILE=nolooking.conf`: ```configuration - # loin.conf + # nolooking.conf bind_port=3000 endpoint="https://localhost:3010" @@ -83,7 +83,7 @@ In other words, your grandmother will be able to somewhat privately open a bunch Note: if `CHAIN_WALLET_AMOUNT_SATS` is present a single-sig output will be added to LND's internal wallet. -A minimum internal wallet balance of 10,000 reserve sats per channel up to 100,000 sats is required for anchor commitments. This [can be automated](https://github.com/Kixunil/loin/issues/11) in the future. +A minimum internal wallet balance of 10,000 reserve sats per channel up to 100,000 sats is required for anchor commitments. This [can be automated](https://github.com/Kixunil/loptos/issues/11) in the future. ## License diff --git a/config_spec.toml b/config_spec.toml index bae9a32..8269b3f 100644 --- a/config_spec.toml +++ b/config_spec.toml @@ -1,5 +1,5 @@ [general] -env_prefix = "LOIN" +env_prefix = "NOLOOKING" conf_file_param = "conf" conf_dir_param = "conf_dir" doc = """ @@ -11,7 +11,7 @@ This server optimizes your channel opening from a remote wallet which supports P [[param]] name = "bind_port" type = "u16" -doc = "Loin HTTP port to listen on" +doc = "nolooking HTTP port to listen on" optional = false [[param]] diff --git a/src/http.rs b/src/http.rs index 96941e6..2c5dc3c 100644 --- a/src/http.rs +++ b/src/http.rs @@ -6,7 +6,7 @@ use crate::scheduler::{ScheduledPayJoin, Scheduler, self}; use std::net::SocketAddr; #[cfg(not(feature = "test_paths"))] -const STATIC_DIR: &str = "/usr/share/loin/static"; +const STATIC_DIR: &str = "/usr/share/nolooking/static"; #[cfg(feature = "test_paths")] const STATIC_DIR: &str = "static"; diff --git a/tests/compose/nginx/reverse-https-proxy.conf b/tests/compose/nginx/reverse-https-proxy.conf index 0b669ac..c11d101 100644 --- a/tests/compose/nginx/reverse-https-proxy.conf +++ b/tests/compose/nginx/reverse-https-proxy.conf @@ -1,42 +1,4 @@ -#daemon on; -#user nobody; -#worker_processes 1; - -#error_log logs/error.log; -#error_log logs/error.log notice; -#error_log logs/error.log info; - -#pid logs/nginx.pid; - - -events { - #worker_connections 1024; -} - - http { - #include mime.types; - #default_type application/octet-stream; #mime types missing or this conf belongs in /etc/nginx folder - - #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - # '$status $body_bytes_sent "$http_referer" ' - # '"$http_user_agent" "$http_x_forwarded_for"'; - - #access_log logs/access.log main; - - #sendfile on; - #tcp_nopush on; - - #keepalive_timeout 0; - #keepalive_timeout 65; - - #gzip on; - -# server { -# listen 3000; -# return 301 https://$host$request_uri; -# } - server { listen 3010 ssl; @@ -44,9 +6,6 @@ http { access_log /dev/stdout; error_log /dev/stdout; - - # access_log /var/log/nginx/loin.access.log; - location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -58,7 +17,6 @@ http { proxy_read_timeout 90; proxy_redirect off; - # kill cache add_header Last-Modified $date_gmt; add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; if_modified_since off; @@ -68,12 +26,6 @@ http { ssl_certificate /etc/ssl/localhost.pem; ssl_certificate_key /etc/ssl/localhost-key.pem; - - # ssl_session_cache shared:SSL:1m; - # ssl_session_timeout 5m; - - # ssl_ciphers HIGH:!aNULL:!MD5; - # ssl_prefer_server_ciphers on; } include servers/*; diff --git a/tests/integration.rs b/tests/integration.rs index eaeece7..d31be0e 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -12,8 +12,8 @@ mod integration { use bitcoincore_rpc::{Auth, Client, RpcApi}; use hyper::client::HttpConnector; use ln_types::P2PAddress; - use loin::scheduler; - use loin::{scheduler::{ScheduledChannel, ScheduledPayJoin, Scheduler}, lnd::LndClient, http}; + use nolooking::scheduler; + use nolooking::{scheduler::{ScheduledChannel, ScheduledPayJoin, Scheduler}, lnd::LndClient, http}; use std::collections::HashMap; use std::convert::TryFrom; use tempfile::tempdir; @@ -51,7 +51,7 @@ mod integration { }; - // merchant lnd loin configuration + // merchant lnd nolooking configuration let address_str = "https://localhost:53281"; let cert_file = format!("{}/merchant-tls.cert", &tmp_path).to_string(); let macaroon_file = format!("{}/merchant-admin.macaroon", &tmp_path).to_string(); @@ -98,8 +98,8 @@ mod integration { "bind_port=3000\nendpoint=\"{}\"\nlnd_address=\"{}\"\nlnd_cert_path=\"{}\"\nlnd_macaroon_path=\"{}\"", &endpoint.clone().to_string(), &address_str, &cert_file, &macaroon_file ); - let loin_conf = format!("{}/loin.conf", &tmp_path); - std::fs::write(&loin_conf, conf_string).expect("Unable to write loin.conf"); + let nolooking_conf = format!("{}/nolooking.conf", &tmp_path); + std::fs::write(&nolooking_conf, conf_string).expect("Unable to write nolooking.conf"); Command::new("docker") .arg("cp") @@ -177,10 +177,10 @@ mod integration { }); let bind_addr = ([127, 0, 0, 1], 3000).into(); - let loin_server = http::serve(scheduler, bind_addr, endpoint.clone()); + let nolooking_server = http::serve(scheduler, bind_addr, endpoint.clone()); // trigger payjoin-client let payjoin_channel_open = tokio::spawn(async move { - // if we don't wait for loin server to run we'll make requests to a closed port + // if we don't wait for nolooking server to run we'll make requests to a closed port std::thread::sleep(Duration::from_secs(2)); // TODO loop on ping 3000 until it the server is live @@ -256,7 +256,7 @@ mod integration { tokio::select! { _ = payjoin_channel_open => println!("payjoin-client completed first"), - _ = loin_server => println!("loin server stopped first. This shouldn't happen"), + _ = nolooking_server => println!("nolooking server stopped first. This shouldn't happen"), _ = tokio::time::sleep(Duration::from_secs(20)) => println!("payjoin timed out after 20 seconds"), };