migrate nevmes -> neveko

This commit is contained in:
creating2morrow 2023-06-03 10:17:58 -04:00
parent 8cf7337e8c
commit 01a629d46b
283 changed files with 214 additions and 213 deletions

View file

@ -23,5 +23,5 @@ jobs:
- run: ./scripts/build_release.sh ${{ steps.extract_branch.outputs.branch }} - run: ./scripts/build_release.sh ${{ steps.extract_branch.outputs.branch }}
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: nevmes-x86_64-linux-gnu-${{ steps.extract_branch.outputs.branch }} name: neveko-x86_64-linux-gnu-${{ steps.extract_branch.outputs.branch }}
path: nevmes-x86_64-linux-gnu-${{ steps.extract_branch.outputs.branch }}.tar.bz2 path: neveko-x86_64-linux-gnu-${{ steps.extract_branch.outputs.branch }}.tar.bz2

View file

@ -25,4 +25,4 @@ jobs:
- name: Build - name: Build
run: cargo build --verbose run: cargo build --verbose
- name: Run tests - name: Run tests
run: cd nevmes-core && RUST_TEST_THREADS=1 cargo test --verbose run: cd neveko-core && RUST_TEST_THREADS=1 cargo test --verbose

36
Cargo.lock generated
View file

@ -1926,41 +1926,41 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes" name = "neveko"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"nevmes_auth", "neveko_auth",
"nevmes_contact", "neveko_contact",
"nevmes_core", "neveko_core",
"nevmes_gui", "neveko_gui",
"nevmes_market", "neveko_market",
"nevmes_message", "neveko_message",
"rocket", "rocket",
] ]
[[package]] [[package]]
name = "nevmes_auth" name = "neveko_auth"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"rocket", "rocket",
] ]
[[package]] [[package]]
name = "nevmes_contact" name = "neveko_contact"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"rocket", "rocket",
] ]
[[package]] [[package]]
name = "nevmes_core" name = "neveko_core"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",
@ -1985,7 +1985,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes_gui" name = "neveko_gui"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",
@ -1996,7 +1996,7 @@ dependencies = [
"hex", "hex",
"image", "image",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"qrcode", "qrcode",
"reqwest", "reqwest",
"serde", "serde",
@ -2009,23 +2009,23 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes_market" name = "neveko_market"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",
"env_logger", "env_logger",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"rocket", "rocket",
] ]
[[package]] [[package]]
name = "nevmes_message" name = "neveko_message"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"rocket", "rocket",
] ]

View file

@ -1,5 +1,5 @@
[package] [package]
name = "nevmes" name = "neveko"
version = "0.5.0-alpha" version = "0.5.0-alpha"
edition = "2021" edition = "2021"
@ -7,10 +7,10 @@ edition = "2021"
[dependencies] [dependencies]
env_logger = "0.10.0" env_logger = "0.10.0"
nevmes_auth = { path = "./nevmes-auth" } neveko_auth = { path = "./neveko-auth" }
nevmes_contact = { path = "./nevmes-contact" } neveko_contact = { path = "./neveko-contact" }
nevmes_core = { path = "./nevmes-core" } neveko_core = { path = "./neveko-core" }
nevmes_gui = { path = "./nevmes-gui" } neveko_gui = { path = "./neveko-gui" }
nevmes_market = { path = "./nevmes-market" } neveko_market = { path = "./neveko-market" }
nevmes_message = { path = "./nevmes-message" } neveko_message = { path = "./neveko-message" }
rocket = { version = "0.5.0-rc.2", features = ["json"] } rocket = { version = "0.5.0-rc.2", features = ["json"] }

View file

@ -1,18 +1,19 @@
# NEVMES # NEVEKO
NEVidebla-MESago (invisible message) NEVidebla-EKOnomia (invisible economy)
[![cargo-build](https://github.com/creating2morrow/nevmes/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/creating2morrow/nevmes/actions/workflows/rust.yml) [![cargo-build](https://github.com/creating2morrow/neveko/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/creating2morrow/neveko/actions/workflows/rust.yml)
[![cargo-audit](https://github.com/creating2morrow/nevmes/actions/workflows/audit.yml/badge.svg?branch=main)](https://github.com/creating2morrow/nevmes/actions/workflows/audit.yml) [![cargo-audit](https://github.com/creating2morrow/neveko/actions/workflows/audit.yml/badge.svg?branch=main)](https://github.com/creating2morrow/neveko/actions/workflows/audit.yml)
### gpg and i2p made simple for end-to-end encrypted, secure comms ### gpg and i2p made simple for end-to-end encrypted, secure marketplace, messaging and more
## About ## About
* send messages over the invisible internet * send messages over the invisible internet
* vanity base32 addresses (advanced) * vanity base32 addresses (advanced)
* automated mandatory gpg key encryption * automated mandatory gpg key encryption
* xmr payment integration * self-hosted i2p marketplace
* xmr multisig / payment integration
## Dev ## Dev
@ -20,14 +21,14 @@ NEVidebla-MESago (invisible message)
* install dependencies * install dependencies
* ubuntu example: `sudo apt update -y && sudo apt upgrade -y` * ubuntu example: `sudo apt update -y && sudo apt upgrade -y`
* `sudo apt install -y libssl-dev build-essential libgpgme-dev` * `sudo apt install -y libssl-dev build-essential libgpgme-dev`
* `git clone https://github.com/creating2morrow/nevmes` * `git clone https://github.com/creating2morrow/neveko`
* `cd nevmes && ./scripts/build_all_and_run.sh "-- -h"` * `cd neveko && ./scripts/build_all_and_run.sh "-- -h"`
* gui built with rust [egui](https://docs.rs/egui/latest/egui/) * gui built with rust [egui](https://docs.rs/egui/latest/egui/)
## Installation Mananger ## Installation Mananger
* additional required software can be downloaded from the gui home or `Binaries` links below * additional required software can be downloaded from the gui home or `Binaries` links below
* hashes are in core [lib.rs](./nevmes-core/src/lib.rs) * hashes are in core [lib.rs](./neveko-core/src/lib.rs)
* download i2p-zero, put the path in the connection manager or cli `--i2p-zero-dir` flag * download i2p-zero, put the path in the connection manager or cli `--i2p-zero-dir` flag
* download monero, update connection manager or cli * download monero, update connection manager or cli
* `--monero-blockchain-dir`, where to put lmdb for monero (e.g. path/to/ssd) * `--monero-blockchain-dir`, where to put lmdb for monero (e.g. path/to/ssd)
@ -72,19 +73,19 @@ NEVidebla-MESago (invisible message)
## Binaries ## Binaries
* nevmes-auth - `internal` auth server * neveko-auth - `internal` auth server
* nevmes-contact - `internal` add contacts server * neveko-contact - `internal` add contacts server
* nevmes-gui - primary user interface * neveko-gui - primary user interface
* nevmes-market - `internal` marketplace admin server * neveko-market - `internal` marketplace admin server
* nevmes-message - `internal` message tx/read etc. server * neveko-message - `internal` message tx/read etc. server
* nevmes - `external` primary server for contact share, payment, market, message rx etc. * neveko - `external` primary server for contact share, payment, market, message rx etc.
* [monerod](https://www.getmonero.org/downloads/#cli) - (not included) monero-wallet-rpc needs this * [monerod](https://www.getmonero.org/downloads/#cli) - (not included) monero-wallet-rpc needs this
* can be overriden with remote node * can be overriden with remote node
* use the `--remote-node` flag * use the `--remote-node` flag
* [monero-wallet-rpc](https://www.getmonero.org/downloads/#cli) - (not included) interface for xmr wallet ops * [monero-wallet-rpc](https://www.getmonero.org/downloads/#cli) - (not included) interface for xmr wallet ops
* [i2p-zero](https://github.com/creating2morrow/i2p-zero/releases/tag/v1.21-nevmes) - (not included) tunnel creation and http proxy * [i2p-zero](https://github.com/creating2morrow/i2p-zero/releases/tag/v1.21-neveko) - (not included) tunnel creation and http proxy
most of the complex logic stays in nevmes-core, exported from [lib.rs](./nevmes-core/src/lib.rs) most of the complex logic stays in neveko-core, exported from [lib.rs](./neveko-core/src/lib.rs)
## Manual ## Manual

View file

@ -10,10 +10,10 @@
### JWP (JSON Web Proof) ### JWP (JSON Web Proof)
* utilizes some external blockchain (nevmes uses monero) for authorization of auth tokens * utilizes some external blockchain (neveko uses monero) for authorization of auth tokens
* 32 byte random signing keys generated on app start-up * 32 byte random signing keys generated on app start-up
* `Hmac<Sha384>` internal, `Hmac<Sha512>` external (jwp) * `Hmac<Sha384>` internal, `Hmac<Sha512>` external (jwp)
* see [proof.rs](../nevmes-core/src/proof.rs) * see [proof.rs](../neveko-core/src/proof.rs)
`eyJhbGciOiJIUzUxMiJ9.eyJhZGRyZXNzIjoiNThvaUJMQUtBQ3JaeTRqVnRYdUFXMzlCOW1zR3dlbVVkSm9HVlozcGdSY1RoWHZqWjZ0RERqRGpuOE1mTUZ5cEtZMlU1U1B6SkE3NnFHeHhDdjJzd1Y0NjhFYkI2dEsiLCJoYXNoIjoiNzRhOTM5NTU1Y2EyMWJmY2MxYzlhMjhlYjFkN2M5MWZiMjRhYzRiOTY4MDk2Yzg4ODU1ODA3ODcwMDA1NmQ2NiIsIm1lc3NhZ2UiOiIiLCJzaWduYXR1cmUiOiJPdXRQcm9vZlYyWHdYTEJYV0VtbXlWd3YyOHFQRWQ0Mk14bm1FNTU3aUFEVHFGNjZDWG9LQ1ZFeFBqTVU4NFNIeWprZmdLd01WZEI4OUZkTkJ5QUxyeU1ZamVxQlY1U0VtU0V4MUJWWE1ITVJNWHVuMzh5aWVtcWhCcmVSWUdpRGdMN1lmRmVmemJSTnhlIn0.gH4RlLrxu3xqxNvsHv7lX1yYomg07yTlv6VEKpDfXwbDV4O267CXzm30G4YBQOfuDf3xpegUmeVXOScPvIZVRw` `eyJhbGciOiJIUzUxMiJ9.eyJhZGRyZXNzIjoiNThvaUJMQUtBQ3JaeTRqVnRYdUFXMzlCOW1zR3dlbVVkSm9HVlozcGdSY1RoWHZqWjZ0RERqRGpuOE1mTUZ5cEtZMlU1U1B6SkE3NnFHeHhDdjJzd1Y0NjhFYkI2dEsiLCJoYXNoIjoiNzRhOTM5NTU1Y2EyMWJmY2MxYzlhMjhlYjFkN2M5MWZiMjRhYzRiOTY4MDk2Yzg4ODU1ODA3ODcwMDA1NmQ2NiIsIm1lc3NhZ2UiOiIiLCJzaWduYXR1cmUiOiJPdXRQcm9vZlYyWHdYTEJYV0VtbXlWd3YyOHFQRWQ0Mk14bm1FNTU3aUFEVHFGNjZDWG9LQ1ZFeFBqTVU4NFNIeWprZmdLd01WZEI4OUZkTkJ5QUxyeU1ZamVxQlY1U0VtU0V4MUJWWE1ITVJNWHVuMzh5aWVtcWhCcmVSWUdpRGdMN1lmRmVmemJSTnhlIn0.gH4RlLrxu3xqxNvsHv7lX1yYomg07yTlv6VEKpDfXwbDV4O267CXzm30G4YBQOfuDf3xpegUmeVXOScPvIZVRw`
* contents be decoded by 3rd parties but only the owner of the signing key can finalize the validation * contents be decoded by 3rd parties but only the owner of the signing key can finalize the validation
* should be kept secret * should be kept secret
@ -24,7 +24,7 @@
* go to `AddressBook` in the gui * go to `AddressBook` in the gui
* enter .b32.i2p address of contact and click add * enter .b32.i2p address of contact and click add
* if all goes well you will have imported their public nevmes gpg app key * if all goes well you will have imported their public neveko gpg app key
* dont reuse the app gpg keys anywhere else! * dont reuse the app gpg keys anywhere else!
* don't forget to trust the contact with `sign key` in the `check status` window * don't forget to trust the contact with `sign key` in the `check status` window
@ -32,7 +32,7 @@
* getting started the app will automatically generate an account and associated monero PRIMARY address. Only use it here to maintain privacy * getting started the app will automatically generate an account and associated monero PRIMARY address. Only use it here to maintain privacy
* deposit some stagenet monero in your xmr account (address at top of gui screen) * deposit some stagenet monero in your xmr account (address at top of gui screen)
* once unlocked nevmes xmr balance will display * once unlocked neveko xmr balance will display
* click `check status` and `Create JWP` * click `check status` and `Create JWP`
* when authorizing to send to contact an invoice will be generated * when authorizing to send to contact an invoice will be generated
* authorize payment and tx proof generation in the prompt * authorize payment and tx proof generation in the prompt
@ -46,7 +46,7 @@
* the `check status` button will show current jwp for each contact * the `check status` button will show current jwp for each contact
* `clear stale jwp` will purge data in case of timeout issues * `clear stale jwp` will purge data in case of timeout issues
* don't keep large amounts in nevmes just enough for fees and jwps * don't keep large amounts in neveko just enough for fees and jwps
* once a valid jwp is created (takes a few minutes) the `compose` button will be visible * once a valid jwp is created (takes a few minutes) the `compose` button will be visible
* you need to click `check status` on contacts before sending to refresh jwp expiration check * you need to click `check status` on contacts before sending to refresh jwp expiration check
* draft a plain text message, dont be shy * draft a plain text message, dont be shy

View file

@ -1188,17 +1188,17 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes_auth" name = "neveko_auth"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"rocket", "rocket",
] ]
[[package]] [[package]]
name = "nevmes_core" name = "neveko_core"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",

View file

@ -1,5 +1,5 @@
[package] [package]
name = "nevmes_auth" name = "neveko_auth"
version = "0.5.0-alpha" version = "0.5.0-alpha"
edition = "2021" edition = "2021"
@ -7,6 +7,6 @@ edition = "2021"
[dependencies] [dependencies]
env_logger = "0.10.0" env_logger = "0.10.0"
nevmes_core = { path = "../nevmes-core" } neveko_core = { path = "../neveko-core" }
log = "0.4" log = "0.4"
rocket = { version = "0.5.0-rc.2", features = ["json"] } rocket = { version = "0.5.0-rc.2", features = ["json"] }

View file

@ -5,7 +5,7 @@ use rocket::{
serde::json::Json, serde::json::Json,
}; };
use nevmes_core::{ use neveko_core::{
auth, auth,
models::*, models::*,
}; };

View file

@ -1,8 +1,8 @@
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
use nevmes_auth::*; use neveko_auth::*;
use nevmes_core::*; use neveko_core::*;
// The only changes in here should be mounting new controller methods // The only changes in here should be mounting new controller methods
@ -13,6 +13,6 @@ async fn rocket() -> _ {
..rocket::Config::debug_default() ..rocket::Config::debug_default()
}; };
env_logger::init(); env_logger::init();
log::info!("nevmes-auth is online"); log::info!("neveko-auth is online");
rocket::custom(&config).mount("/", routes![controller::login]) rocket::custom(&config).mount("/", routes![controller::login])
} }

View file

@ -1188,17 +1188,17 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes_contact" name = "neveko_contact"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"rocket", "rocket",
] ]
[[package]] [[package]]
name = "nevmes_core" name = "neveko_core"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",

View file

@ -1,5 +1,5 @@
[package] [package]
name = "nevmes_contact" name = "neveko_contact"
version = "0.5.0-alpha" version = "0.5.0-alpha"
edition = "2021" edition = "2021"
@ -7,6 +7,6 @@ edition = "2021"
[dependencies] [dependencies]
env_logger = "0.10.0" env_logger = "0.10.0"
nevmes_core = { path = "../nevmes-core" } neveko_core = { path = "../neveko-core" }
log = "0.4" log = "0.4"
rocket = { version = "0.5.0-rc.2", features = ["json"] } rocket = { version = "0.5.0-rc.2", features = ["json"] }

View file

@ -6,7 +6,7 @@ use rocket::{
serde::json::Json, serde::json::Json,
}; };
use nevmes_core::{ use neveko_core::{
auth, auth,
contact, contact,
models::*, models::*,

View file

@ -1,8 +1,8 @@
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
use nevmes_contact::*; use neveko_contact::*;
use nevmes_core::*; use neveko_core::*;
// The only changes in here should be mounting new controller methods // The only changes in here should be mounting new controller methods
@ -13,7 +13,7 @@ async fn rocket() -> _ {
..rocket::Config::debug_default() ..rocket::Config::debug_default()
}; };
env_logger::init(); env_logger::init();
log::info!("nevmes-contact is online"); log::info!("neveko-contact is online");
rocket::custom(&config) rocket::custom(&config)
.mount("/trust", routes![controller::trust_contact]) .mount("/trust", routes![controller::trust_contact])
.mount("/prove", routes![controller::prove_payment]) .mount("/prove", routes![controller::prove_payment])

View file

@ -1188,7 +1188,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes_core" name = "neveko_core"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",

View file

@ -1,5 +1,5 @@
[package] [package]
name = "nevmes_core" name = "neveko_core"
version = "0.5.0-alpha" version = "0.5.0-alpha"
edition = "2021" edition = "2021"

View file

@ -17,7 +17,7 @@ use rocket::serde::json::Json;
use std::error::Error; use std::error::Error;
/// Environment variable for activating vendor functionality /// Environment variable for activating vendor functionality
pub const NEVMES_VENDOR_ENABLED: &str = "NEVMES_VENDOR_ENABLED"; pub const NEVEKO_VENDOR_ENABLED: &str = "NEVEKO_VENDOR_ENABLED";
/// Create a new contact /// Create a new contact
pub async fn create(c: &Json<Contact>) -> Contact { pub async fn create(c: &Json<Contact>) -> Contact {
@ -99,7 +99,7 @@ async fn validate_contact(j: &Json<Contact>) -> bool {
/// Send our information /// Send our information
pub async fn share() -> Contact { pub async fn share() -> Contact {
let vendor_env = std::env::var(NEVMES_VENDOR_ENABLED).unwrap_or(String::from("0")); let vendor_env = std::env::var(NEVEKO_VENDOR_ENABLED).unwrap_or(String::from("0"));
let is_vendor = vendor_env == String::from("1"); let is_vendor = vendor_env == String::from("1");
let m_address: reqres::XmrRpcAddressResponse = monero::get_address().await; let m_address: reqres::XmrRpcAddressResponse = monero::get_address().await;
let gpg_key = gpg::export_key().unwrap_or(Vec::new()); let gpg_key = gpg::export_key().unwrap_or(Vec::new());
@ -123,11 +123,11 @@ pub fn exists(from: &String) -> bool {
return addresses.contains(from); return addresses.contains(from);
} }
/// Sign for trusted nevmes contacts /// Sign for trusted neveko contacts
/// ///
/// UI/UX should have some prompt about the implication of trusting keys /// UI/UX should have some prompt about the implication of trusting keys
/// ///
/// however that is beyond the scope of this app. nevmes assumes contacts /// however that is beyond the scope of this app. neveko assumes contacts
/// ///
/// using the app already have some level of knowledge about each other. /// using the app already have some level of knowledge about each other.
/// ///

View file

@ -29,7 +29,7 @@ impl Interface {
pub fn open() -> Self { pub fn open() -> Self {
let release_env = utils::get_release_env(); let release_env = utils::get_release_env();
let file_path = format!( let file_path = format!(
"/home/{}/.nevmes/", "/home/{}/.neveko/",
std::env::var("USER").unwrap_or(String::from("user")) std::env::var("USER").unwrap_or(String::from("user"))
); );
let mut env_str: &str = "test-lmdb"; let mut env_str: &str = "test-lmdb";
@ -46,7 +46,7 @@ impl Interface {
tokio::time::sleep(std::time::Duration::from_micros(1)).await; tokio::time::sleep(std::time::Duration::from_micros(1)).await;
self::Interface::open() self::Interface::open()
} }
/// Write a key-value to LMDB. NEVMES does not currently support /// Write a key-value to LMDB. NEVEKO does not currently support
/// ///
/// writing multiple key value pairs. /// writing multiple key value pairs.
pub fn write(e: &Environment, h: &DbHandle, k: &str, v: &str) { pub fn write(e: &Environment, h: &DbHandle, k: &str, v: &str) {
@ -72,7 +72,7 @@ impl Interface {
/// ///
/// string. If the value does not exist an empty string is /// string. If the value does not exist an empty string is
/// ///
/// returned. NEVMES does not currently support duplicate keys. /// returned. NEVEKO does not currently support duplicate keys.
pub fn read(e: &Environment, h: &DbHandle, k: &str) -> String { pub fn read(e: &Environment, h: &DbHandle, k: &str) -> String {
let reader = e.get_reader().unwrap(); let reader = e.get_reader().unwrap();
let db = reader.bind(&h); let db = reader.bind(&h);

View file

@ -75,7 +75,7 @@ pub fn export_key() -> Result<Vec<u8>, Box<dyn Error>> {
/// Import gpg keys from contacts /// Import gpg keys from contacts
pub fn import_key(cid: String, key: Vec<u8>) -> Result<(), Box<dyn Error>> { pub fn import_key(cid: String, key: Vec<u8>) -> Result<(), Box<dyn Error>> {
info!("importing key: {}", hex::encode(&key)); info!("importing key: {}", hex::encode(&key));
let filename = format!("{}.nevmes", &cid); let filename = format!("{}.neveko", &cid);
let mut f = File::create(&filename)?; let mut f = File::create(&filename)?;
f.write_all(&key)?; f.write_all(&key)?;
let mut ctx = Context::from_protocol(gpgme::Protocol::OpenPgp)?; let mut ctx = Context::from_protocol(gpgme::Protocol::OpenPgp)?;
@ -99,7 +99,7 @@ pub fn encrypt(name: String, body: &Vec<u8>) -> Result<Vec<u8>, Box<dyn Error>>
.filter_map(|x| x.ok()) .filter_map(|x| x.ok())
.filter(|k| k.can_encrypt()) .filter(|k| k.can_encrypt())
.collect(); .collect();
let filename = format!("{}.nevmes", name); let filename = format!("{}.neveko", name);
let mut f = File::create(&filename)?; let mut f = File::create(&filename)?;
f.write_all(body)?; f.write_all(body)?;
let mut input = let mut input =
@ -119,7 +119,7 @@ pub fn decrypt(mid: &String, body: &Vec<u8>) -> Result<Vec<u8>, Box<dyn Error>>
let proto = Protocol::OpenPgp; let proto = Protocol::OpenPgp;
let mut ctx = Context::from_protocol(proto)?; let mut ctx = Context::from_protocol(proto)?;
ctx.set_armor(true); ctx.set_armor(true);
let filename = format!("{}.nevmes", mid); let filename = format!("{}.neveko", mid);
let mut f = File::create(&filename)?; let mut f = File::create(&filename)?;
f.write_all(&body)?; f.write_all(&body)?;
let mut input = let mut input =

View file

@ -113,7 +113,7 @@ pub async fn start() {
} }
} }
/// Create an i2p tunnel for the NEVMES application /// Create an i2p tunnel for the NEVEKO application
fn create_tunnel() { fn create_tunnel() {
info!("creating tunnel"); info!("creating tunnel");
let args = args::Args::parse(); let args = args::Args::parse();

View file

@ -12,8 +12,8 @@ pub mod reqres; // http request/responses
pub mod user; // misc. pub mod user; // misc.
pub mod utils; // user rep/service layer pub mod utils; // user rep/service layer
pub const NEVMES_JWP_SECRET_KEY: &str = "NEVMES_JWP_SECRET_KEY"; pub const NEVEKO_JWP_SECRET_KEY: &str = "NEVEKO_JWP_SECRET_KEY";
pub const NEVMES_JWT_SECRET_KEY: &str = "NEVMES_JWT_SECRET_KEY"; pub const NEVEKO_JWT_SECRET_KEY: &str = "NEVEKO_JWT_SECRET_KEY";
// TODO(c2m): better handling of setting initial wallet password // TODO(c2m): better handling of setting initial wallet password
/// Environment variable for injecting wallet password /// Environment variable for injecting wallet password

View file

@ -148,7 +148,7 @@ fn parse_multisig_message(mid: String) -> MultisigMessageData {
/// ///
/// ```rust /// ```rust
/// // lookup prepare info for vendor /// // lookup prepare info for vendor
/// use nevmes_core::db; /// use neveko_core::db;
/// let s = db::Interface::open(); /// let s = db::Interface::open();
/// let key = "prepare-o123-test.b32.i2p"; /// let key = "prepare-o123-test.b32.i2p";
/// db::Interface::read(&s.env, &s.handle, &key); /// db::Interface::read(&s.env, &s.handle, &key);

View file

@ -143,7 +143,7 @@ pub fn start_rpc() {
let daemon_address = get_rpc_daemon(); let daemon_address = get_rpc_daemon();
let rpc_login = format!("{}:{}", &login.username, &login.credential); let rpc_login = format!("{}:{}", &login.username, &login.credential);
let mut wallet_dir = format!( let mut wallet_dir = format!(
"/home/{}/.nevmes/stagenet/wallet/", "/home/{}/.neveko/stagenet/wallet/",
std::env::var("USER").unwrap_or(String::from("user")), std::env::var("USER").unwrap_or(String::from("user")),
); );
let release_env = utils::get_release_env(); let release_env = utils::get_release_env();
@ -166,7 +166,7 @@ pub fn start_rpc() {
debug!("{:?}", output.stdout); debug!("{:?}", output.stdout);
} else { } else {
wallet_dir = format!( wallet_dir = format!(
"/home/{}/.nevmes/wallet/", "/home/{}/.neveko/wallet/",
std::env::var("USER").unwrap_or(String::from("user")), std::env::var("USER").unwrap_or(String::from("user")),
); );
let args = [ let args = [

View file

@ -147,7 +147,7 @@ pub async fn prove_payment(contact: String, txp: &TxProof) -> Result<reqres::Jwp
/// ///
/// is a JWP (JSON Web Proof) with the contents: /// is a JWP (JSON Web Proof) with the contents:
/// ///
/// `subaddress`: a subaddress belonging to this nevmes instance /// `subaddress`: a subaddress belonging to this neveko instance
/// ///
/// `created`: UTC timestamp the proof was created. /// `created`: UTC timestamp the proof was created.
/// <i>Future use</i> Potential offline payments. /// <i>Future use</i> Potential offline payments.

View file

@ -120,7 +120,7 @@ pub fn start_core(conn: &Connections) {
"-r", "-r",
env, env,
]; ];
let output = std::process::Command::new("./nevmes") let output = std::process::Command::new("./neveko")
.args(args) .args(args)
.spawn() .spawn()
.expect("core module failed to start"); .expect("core module failed to start");
@ -248,7 +248,7 @@ pub const fn message_limit() -> usize {
async fn gen_app_gpg() { async fn gen_app_gpg() {
let mut gpg_key = gpg::find_key().unwrap_or(utils::empty_string()); let mut gpg_key = gpg::find_key().unwrap_or(utils::empty_string());
if gpg_key == utils::empty_string() { if gpg_key == utils::empty_string() {
info!("no gpg key found for nevmes, creating it..."); info!("no gpg key found for neveko, creating it...");
// wait for key gen // wait for key gen
gpg::write_gen_batch().unwrap(); gpg::write_gen_batch().unwrap();
gpg::gen_key(); gpg::gen_key();
@ -261,7 +261,7 @@ async fn gen_app_gpg() {
/// Handles panic! for missing wallet directory /// Handles panic! for missing wallet directory
fn create_wallet_dir() { fn create_wallet_dir() {
let file_path = format!( let file_path = format!(
"/home/{}/.nevmes", "/home/{}/.neveko",
std::env::var("USER").unwrap_or(String::from("user")) std::env::var("USER").unwrap_or(String::from("user"))
); );
let s_output = std::process::Command::new("mkdir") let s_output = std::process::Command::new("mkdir")
@ -279,7 +279,7 @@ fn create_wallet_dir() {
/// Generate application wallet at startup if none exist /// Generate application wallet at startup if none exist
async fn gen_app_wallet(password: &String) { async fn gen_app_wallet(password: &String) {
info!("fetching application wallet"); info!("fetching application wallet");
let filename = "nevmes"; let filename = "neveko";
let mut m_wallet = monero::open_wallet(String::from(filename), password).await; let mut m_wallet = monero::open_wallet(String::from(filename), password).await;
if !m_wallet { if !m_wallet {
m_wallet = monero::create_wallet(String::from(filename), password).await; m_wallet = monero::create_wallet(String::from(filename), password).await;
@ -304,11 +304,11 @@ fn gen_signing_keys() {
let s = db::Interface::open(); let s = db::Interface::open();
if jwp == utils::empty_string() { if jwp == utils::empty_string() {
let rnd_jwp = generate_rnd(); let rnd_jwp = generate_rnd();
db::Interface::write(&s.env, &s.handle, crate::NEVMES_JWP_SECRET_KEY, &rnd_jwp); db::Interface::write(&s.env, &s.handle, crate::NEVEKO_JWP_SECRET_KEY, &rnd_jwp);
} }
if jwt == utils::empty_string() { if jwt == utils::empty_string() {
let rnd_jwt = generate_rnd(); let rnd_jwt = generate_rnd();
db::Interface::write(&s.env, &s.handle, crate::NEVMES_JWT_SECRET_KEY, &rnd_jwt); db::Interface::write(&s.env, &s.handle, crate::NEVEKO_JWT_SECRET_KEY, &rnd_jwt);
} }
} }
@ -317,13 +317,13 @@ fn gen_signing_keys() {
/// dont' forget to generate new keys as well /// dont' forget to generate new keys as well
pub fn revoke_signing_keys() { pub fn revoke_signing_keys() {
let s = db::Interface::open(); let s = db::Interface::open();
db::Interface::delete(&s.env, &s.handle, crate::NEVMES_JWT_SECRET_KEY); db::Interface::delete(&s.env, &s.handle, crate::NEVEKO_JWT_SECRET_KEY);
db::Interface::delete(&s.env, &s.handle, crate::NEVMES_JWP_SECRET_KEY); db::Interface::delete(&s.env, &s.handle, crate::NEVEKO_JWP_SECRET_KEY);
} }
pub fn get_jwt_secret_key() -> String { pub fn get_jwt_secret_key() -> String {
let s = db::Interface::open(); let s = db::Interface::open();
let r = db::Interface::read(&s.env, &s.handle, crate::NEVMES_JWT_SECRET_KEY); let r = db::Interface::read(&s.env, &s.handle, crate::NEVEKO_JWT_SECRET_KEY);
if r == utils::empty_string() { if r == utils::empty_string() {
error!("JWT key not found"); error!("JWT key not found");
return Default::default(); return Default::default();
@ -333,7 +333,7 @@ pub fn get_jwt_secret_key() -> String {
pub fn get_jwp_secret_key() -> String { pub fn get_jwp_secret_key() -> String {
let s = db::Interface::open(); let s = db::Interface::open();
let r = db::Interface::read(&s.env, &s.handle, crate::NEVMES_JWP_SECRET_KEY); let r = db::Interface::read(&s.env, &s.handle, crate::NEVEKO_JWP_SECRET_KEY);
if r == utils::empty_string() { if r == utils::empty_string() {
error!("JWP key not found"); error!("JWP key not found");
return Default::default(); return Default::default();
@ -344,37 +344,37 @@ pub fn get_jwp_secret_key() -> String {
/// Start the remote access microservers `--remote-access` flag /// Start the remote access microservers `--remote-access` flag
fn start_micro_servers() { fn start_micro_servers() {
info!("starting auth server"); info!("starting auth server");
let mut auth_path = "nevmes-auth/target/debug/nevmes_auth"; let mut auth_path = "neveko-auth/target/debug/neveko_auth";
let env = get_release_env(); let env = get_release_env();
if env == ReleaseEnvironment::Production { if env == ReleaseEnvironment::Production {
auth_path = "nevmes_auth"; auth_path = "neveko_auth";
} }
let a_output = std::process::Command::new(auth_path) let a_output = std::process::Command::new(auth_path)
.spawn() .spawn()
.expect("failed to start auth server"); .expect("failed to start auth server");
debug!("{:?}", a_output.stdout); debug!("{:?}", a_output.stdout);
info!("starting contact server"); info!("starting contact server");
let mut contact_path = "nevmes-contact/target/debug/nevmes_contact"; let mut contact_path = "neveko-contact/target/debug/neveko_contact";
if env == ReleaseEnvironment::Production { if env == ReleaseEnvironment::Production {
contact_path = "nevmes_contact"; contact_path = "neveko_contact";
} }
let c_output = std::process::Command::new(contact_path) let c_output = std::process::Command::new(contact_path)
.spawn() .spawn()
.expect("failed to start contact server"); .expect("failed to start contact server");
debug!("{:?}", c_output.stdout); debug!("{:?}", c_output.stdout);
info!("starting marketplace admin server"); info!("starting marketplace admin server");
let mut market_path = "nevmes-contact/target/debug/nevmes_market"; let mut market_path = "neveko-contact/target/debug/neveko_market";
if env == ReleaseEnvironment::Production { if env == ReleaseEnvironment::Production {
market_path = "nevmes_market"; market_path = "neveko_market";
} }
let market_output = std::process::Command::new(market_path) let market_output = std::process::Command::new(market_path)
.spawn() .spawn()
.expect("failed to start marketplace server"); .expect("failed to start marketplace server");
debug!("{:?}", market_output.stdout); debug!("{:?}", market_output.stdout);
info!("starting message server"); info!("starting message server");
let mut message_path = "nevmes-message/target/debug/nevmes_message"; let mut message_path = "neveko-message/target/debug/neveko_message";
if env == ReleaseEnvironment::Production { if env == ReleaseEnvironment::Production {
message_path = "nevmes_message"; message_path = "neveko_message";
} }
let m_output = std::process::Command::new(message_path) let m_output = std::process::Command::new(message_path)
.spawn() .spawn()
@ -382,15 +382,15 @@ fn start_micro_servers() {
debug!("{:?}", m_output.stdout); debug!("{:?}", m_output.stdout);
} }
/// open gui from nevmes core launch /// open gui from neveko core launch
fn start_gui() { fn start_gui() {
let args = args::Args::parse(); let args = args::Args::parse();
if args.gui { if args.gui {
info!("starting gui"); info!("starting gui");
let mut gui_path = "nevmes-gui/target/debug/nevmes_gui"; let mut gui_path = "neveko-gui/target/debug/neveko_gui";
let env = get_release_env(); let env = get_release_env();
if env == ReleaseEnvironment::Production { if env == ReleaseEnvironment::Production {
gui_path = "nevmes-gui"; gui_path = "neveko-gui";
} }
let g_output = std::process::Command::new(gui_path) let g_output = std::process::Command::new(gui_path)
.spawn() .spawn()
@ -401,7 +401,7 @@ fn start_gui() {
/// Put all app pre-checks here /// Put all app pre-checks here
pub async fn start_up() { pub async fn start_up() {
info!("nevmes is starting up"); info!("neveko is starting up");
let args = args::Args::parse(); let args = args::Args::parse();
if args.remote_access { if args.remote_access {
start_micro_servers(); start_micro_servers();
@ -432,12 +432,12 @@ pub async fn start_up() {
message::retry_fts().await; message::retry_fts().await;
}); });
} }
info!("{} - nevmes is online", env); info!("{} - neveko is online", env);
} }
/// Called by gui for cleaning up monerod, rpc, etc. /// Called by gui for cleaning up monerod, rpc, etc.
/// ///
/// pass true from gui connection manager so not to kill nevmes /// pass true from gui connection manager so not to kill neveko
pub fn kill_child_processes(cm: bool) { pub fn kill_child_processes(cm: bool) {
info!("stopping child processes"); info!("stopping child processes");
// TODO(c2m): prompt on gui letting user determine what background // TODO(c2m): prompt on gui letting user determine what background
@ -450,11 +450,11 @@ pub fn kill_child_processes(cm: bool) {
debug!("{:?}", xmrd_output.stdout); debug!("{:?}", xmrd_output.stdout);
} }
if !cm { if !cm {
let nevmes_output = std::process::Command::new("pkill") let neveko_output = std::process::Command::new("pkill")
.arg("nevmes") .arg("neveko")
.spawn() .spawn()
.expect("nevmes failed to stop"); .expect("neveko failed to stop");
debug!("{:?}", nevmes_output.stdout); debug!("{:?}", neveko_output.stdout);
} }
let rpc_output = std::process::Command::new("killall") let rpc_output = std::process::Command::new("killall")
.arg("monero-wallet-rpc") .arg("monero-wallet-rpc")
@ -507,7 +507,7 @@ pub async fn install_software(installations: Installations) -> bool {
let i2p_version = crate::I2P_ZERO_RELEASE_VERSION; let i2p_version = crate::I2P_ZERO_RELEASE_VERSION;
let i2p_zero_zip = format!("i2p-zero-linux.{}.zip", i2p_version); let i2p_zero_zip = format!("i2p-zero-linux.{}.zip", i2p_version);
let link = format!( let link = format!(
"https://github.com/creating2morrow/i2p-zero/releases/download/{}-nevmes/{}", "https://github.com/creating2morrow/i2p-zero/releases/download/{}-neveko/{}",
i2p_version, i2p_zero_zip i2p_version, i2p_zero_zip
); );
let curl = std::process::Command::new("curl") let curl = std::process::Command::new("curl")

View file

@ -2,4 +2,4 @@
/core /core
notes.txt notes.txt
.env .env
nevmes neveko

View file

@ -2408,7 +2408,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes_core" name = "neveko_core"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"chrono", "chrono",
@ -2433,7 +2433,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "nevmes_gui" name = "neveko_gui"
version = "0.5.0-alpha" version = "0.5.0-alpha"
dependencies = [ dependencies = [
"bytemuck", "bytemuck",
@ -2445,7 +2445,7 @@ dependencies = [
"hex", "hex",
"image", "image",
"log 0.4.17", "log 0.4.17",
"nevmes_core", "neveko_core",
"poll-promise", "poll-promise",
"qrcode", "qrcode",
"reqwest", "reqwest",

View file

@ -1,12 +1,12 @@
[package] [package]
name = "nevmes_gui" name = "neveko_gui"
version = "0.5.0-alpha" version = "0.5.0-alpha"
authors = ["emilk", "creating2morrow"] authors = ["emilk", "creating2morrow"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.65" rust-version = "1.65"
publish = false publish = false
default-run = "nevmes_gui" default-run = "neveko_gui"
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true
@ -32,7 +32,7 @@ egui = { version = "0.21.0", path = "./crates/egui", features = [
"extra_debug_asserts", "extra_debug_asserts",
] } ] }
hex = "0.4.3" hex = "0.4.3"
nevmes_core = { path = "../nevmes-core" } neveko_core = { path = "../neveko-core" }
log = "0.4" log = "0.4"
qrcode = "0.12" qrcode = "0.12"
image = "0.23.14" image = "0.23.14"

7
neveko-gui/README.md Normal file
View file

@ -0,0 +1,7 @@
## Dev
Note: gui depends on the binary if starting core from gui
otherwise run neveko core on your own
`cd ../ && cargo build && cp target/debug/neveko neveko-gui/ && cd neveko-gui && RUST_LOG=debug cargo run`

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -2,6 +2,6 @@ There are no stand-alone egui examples, because egui is not stand-alone!
See the top-level [examples](https://github.com/emilk/egui/tree/master/examples/) folder instead. See the top-level [examples](https://github.com/emilk/egui/tree/master/examples/) folder instead.
There are also plenty of examples in [the online demo](https://www.egui.rs/#demo). You can find the source code for it at <https://github.com/emilk/egui/tree/master/crates/nevmes_gui_lib>. There are also plenty of examples in [the online demo](https://www.egui.rs/#demo). You can find the source code for it at <https://github.com/emilk/egui/tree/master/crates/neveko_gui_lib>.
To learn how to set up `eframe` for web and native, go to <https://github.com/emilk/eframe_template/> and follow the instructions there! To learn how to set up `eframe` for web and native, go to <https://github.com/emilk/eframe_template/> and follow the instructions there!

Some files were not shown because too many files have changed in this diff Show more