add env var to set go-sbot port
This commit is contained in:
parent
0f91fd8b2c
commit
29237bcf12
|
@ -1,5 +1,7 @@
|
|||
//! Scuttlebutt functionality.
|
||||
|
||||
use std::env;
|
||||
|
||||
use async_std::stream::StreamExt;
|
||||
use chrono::NaiveDateTime;
|
||||
use golgi::{
|
||||
|
@ -15,8 +17,12 @@ use crate::db::Post;
|
|||
|
||||
/// Initialise a connection to a Scuttlebutt server.
|
||||
async fn init_sbot() -> Result<Sbot, String> {
|
||||
// Define the port on which the go-sbot is running.
|
||||
// Defaults to 8021 if the environment variable is not set.
|
||||
let go_sbot_port = env::var("GO_SBOT_PORT").unwrap_or("8021".to_string());
|
||||
|
||||
let keystore = Keystore::GoSbot;
|
||||
let ip_port = Some("127.0.0.1:8021".to_string());
|
||||
let ip_port = Some(format!("127.0.0.1:{}", go_sbot_port));
|
||||
let net_id = None;
|
||||
|
||||
debug!("Initialising the sbot connection");
|
||||
|
|
Loading…
Reference in New Issue