From d2772bd09c313c306632186825f907b9c05d3f0d Mon Sep 17 00:00:00 2001 From: Per Stark Date: Fri, 30 May 2025 07:44:26 +0200 Subject: [PATCH] feat: port selection --- Cargo.lock | 2 +- README.md | 19 +++---------------- common/src/utils/config.rs | 1 + main/src/main.rs | 5 +++-- main/src/server.rs | 5 +++-- todo.md | 1 - 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 94819d8..5ff8637 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3126,7 +3126,7 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" [[package]] name = "main" -version = "0.1.1" +version = "0.1.2" dependencies = [ "anyhow", "api-router", diff --git a/README.md b/README.md index fa50e80..5f4d53c 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ For a while I've been fascinated by Zettelkasten-style PKM systems. While tools like Logseq and Obsidian are excellent, I found the manual linking process to be a hindrance for me. I also wanted a centralized storage and easy access across devices. -While developing Minne, I discovered [KaraKeep](https://karakeep.com/) (formerly Hoarder), which is an excellent application in a similar space – you probably want to check it out! However, if you're specifically interested in a PKM that leverages a **SurrealDB as its backend, utilizing both vector and graph retrieval**, offers the **possibility to chat with your knowledge resource**, and provides a blend of manual and AI-driven organization, then Minne might be for you. +While developing Minne, I discovered [KaraKeep](https://karakeep.com/) (formerly Hoarder), which is an excellent application in a similar space – you probably want to check it out! However, if you're interested in a PKM that builds an automatic network between related concepts using AI, offers search and the **possibility to chat with your knowledge resource**, and provides a blend of manual and AI-driven organization, then Minne might be worth testing. ## Core Philosophy & Features -Minne is designed to make it incredibly easy to save snippets of text, URLs, and other content (limited, pending demand). Simply send content along with a category tag. Minne then ingests this, leveraging AI to create relevant nodes and relationships within its graph database, alongside your manual categorization. This graph backend, powered by SurrealDB, allows for discoverable connections between your pieces of knowledge. +Minne is designed to make it incredibly easy to save snippets of text, URLs, and other content (limited, pending demand). Simply send content along with a category tag. Minne then ingests this, leveraging AI to create relevant nodes and relationships within its graph database, alongside your manual categorization. This graph backend allows for discoverable connections between your pieces of knowledge. You can converse with your knowledge base through an LLM-powered chat interface (via OpenAI API). For those who like to see the bigger picture, Minne also includes an **experimental feature to visually explore your knowledge graph.** @@ -130,18 +130,6 @@ This is a great way to manage Minne and its SurrealDB dependency together. driver: bridge ``` -1. Create a `.env` file in the same directory as your `docker-compose.yml` (recommended for sensitive data): - - ```env - OPENAI_API_KEY="your_openai_api_key_here" - # You can override other environment variables here if needed - # e.g., if you want to expose SurrealDB differently or use different credentials. - # SURREALDB_USERNAME_MINNE="custom_user" # If changing Minne's access credentials - # SURREALDB_PASSWORD_MINNE="custom_pass" - ``` - - *(If using a `.env` file, ensure variables in `docker-compose.yml`'s `environment` section reference them like `${OPENAI_API_KEY}` or are directly set if not sensitive and common across setups)* - 1. Run: ```bash @@ -201,7 +189,6 @@ Minne can be configured using environment variables or a `config.yaml` file plac - `RUST_LOG`: Controls logging level (e.g., `minne=info,tower_http=debug`). - `HTTP_PORT`: Port for the Minne server to listen on (Default: `3000`). -- `CHROME_ADDRESS`: Address of a remote Chrome DevTools Protocol endpoint (e.g., `http://localhost:9222`, if not using local Chromium managed by Minne/Docker/Nix). **Example `config.yaml`:** @@ -243,7 +230,7 @@ I've developed Minne primarily for my own use, but having been in the selfhosted The roadmap as of now is: - Handle uploaded images wisely. -- An updated explorer of the graph database, and potentially the vector space. +- An updated explorer of the graph database. - A TUI frontend which opens your system default editor for improved writing and document management. ## Contributing diff --git a/common/src/utils/config.rs b/common/src/utils/config.rs index ec8b1b8..04b3450 100644 --- a/common/src/utils/config.rs +++ b/common/src/utils/config.rs @@ -11,6 +11,7 @@ pub struct AppConfig { pub surrealdb_database: String, #[serde(default = "default_data_dir")] pub data_dir: String, + pub http_port: u16, } fn default_data_dir() -> String { diff --git a/main/src/main.rs b/main/src/main.rs index fa76592..990fc9d 100644 --- a/main/src/main.rs +++ b/main/src/main.rs @@ -58,8 +58,9 @@ async fn main() -> Result<(), Box> { html_state, }); - info!("Starting server listening on 0.0.0.0:3000"); - let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?; + info!("Starting server listening on 0.0.0.0:{}", config.http_port); + let serve_address = format!("0.0.0.0:{}", config.http_port); + let listener = tokio::net::TcpListener::bind(serve_address).await?; // Start the server in a separate OS thread with its own runtime let server_handle = std::thread::spawn(move || { diff --git a/main/src/server.rs b/main/src/server.rs index fb7e99a..4bdf879 100644 --- a/main/src/server.rs +++ b/main/src/server.rs @@ -56,8 +56,9 @@ async fn main() -> Result<(), Box> { html_state, }); - info!("Listening on 0.0.0.0:3000"); - let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?; + info!("Starting server listening on 0.0.0.0:{}", config.http_port); + let serve_address = format!("0.0.0.0:{}", config.http_port); + let listener = tokio::net::TcpListener::bind(serve_address).await?; axum::serve(listener, app).await?; Ok(()) diff --git a/todo.md b/todo.md index 66b7b56..4afcc99 100644 --- a/todo.md +++ b/todo.md @@ -3,7 +3,6 @@ [] archive ingressed webpage, pdf would be easy [] embed surrealdb for the main binary [] three js graph explorer -[] three js vector explorer [x] add user_id to ingress objects [x] admin controls re registration [x] allow setting of data storage folder, via envs and config