Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-25 05:40:29 +01:00
Add WEBSOCKET_ADDRESS config option (Fixes #199)
Dieser Commit ist enthalten in:
Ursprung
8ee681c4a3
Commit
9eaa9c1a17
3 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen
3
.env
3
.env
|
@ -14,7 +14,8 @@
|
||||||
# WEB_VAULT_FOLDER=web-vault/
|
# WEB_VAULT_FOLDER=web-vault/
|
||||||
# WEB_VAULT_ENABLED=true
|
# WEB_VAULT_ENABLED=true
|
||||||
|
|
||||||
## Controls the WebSocket server port
|
## Controls the WebSocket server address and port
|
||||||
|
# WEBSOCKET_ADDRESS=0.0.0.0
|
||||||
# WEBSOCKET_PORT=3012
|
# WEBSOCKET_PORT=3012
|
||||||
|
|
||||||
## Controls if new users can register
|
## Controls if new users can register
|
||||||
|
|
|
@ -250,6 +250,7 @@ impl WebSocketUsers {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: The last modified date needs to be updated before calling these methods
|
// NOTE: The last modified date needs to be updated before calling these methods
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn send_user_update(&self, ut: UpdateType, user: &User) {
|
pub fn send_user_update(&self, ut: UpdateType, user: &User) {
|
||||||
let data = create_update(
|
let data = create_update(
|
||||||
vec![
|
vec![
|
||||||
|
@ -358,7 +359,7 @@ pub fn start_notification_server() -> WebSocketUsers {
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
WebSocket::new(factory)
|
WebSocket::new(factory)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.listen(format!("0.0.0.0:{}", CONFIG.websocket_port))
|
.listen(&CONFIG.websocket_url)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ pub struct Config {
|
||||||
web_vault_folder: String,
|
web_vault_folder: String,
|
||||||
web_vault_enabled: bool,
|
web_vault_enabled: bool,
|
||||||
|
|
||||||
websocket_port: i32,
|
websocket_url: String,
|
||||||
|
|
||||||
local_icon_extractor: bool,
|
local_icon_extractor: bool,
|
||||||
signups_allowed: bool,
|
signups_allowed: bool,
|
||||||
|
@ -268,7 +268,7 @@ impl Config {
|
||||||
web_vault_folder: get_env_or("WEB_VAULT_FOLDER", "web-vault/".into()),
|
web_vault_folder: get_env_or("WEB_VAULT_FOLDER", "web-vault/".into()),
|
||||||
web_vault_enabled: get_env_or("WEB_VAULT_ENABLED", true),
|
web_vault_enabled: get_env_or("WEB_VAULT_ENABLED", true),
|
||||||
|
|
||||||
websocket_port: get_env_or("WEBSOCKET_PORT", 3012),
|
websocket_url: format!("{}:{}", get_env_or("WEBSOCKET_ADDRESS", "0.0.0.0".to_string()), get_env_or("WEBSOCKET_PORT", 3012)),
|
||||||
|
|
||||||
local_icon_extractor: get_env_or("LOCAL_ICON_EXTRACTOR", false),
|
local_icon_extractor: get_env_or("LOCAL_ICON_EXTRACTOR", false),
|
||||||
signups_allowed: get_env_or("SIGNUPS_ALLOWED", true),
|
signups_allowed: get_env_or("SIGNUPS_ALLOWED", true),
|
||||||
|
|
Laden …
In neuem Issue referenzieren