Fix compilation errors: duplicate imports, feature-gated functions, type mismatch
Some checks failed
BotServer CI / build (push) Failing after 7m28s
Some checks failed
BotServer CI / build (push) Failing after 7m28s
This commit is contained in:
parent
52bccf0551
commit
35af28a041
3 changed files with 17 additions and 3 deletions
|
|
@ -15,7 +15,6 @@ use rcgen::{
|
||||||
BasicConstraints, CertificateParams, DistinguishedName, DnType, IsCa, Issuer, KeyPair,
|
BasicConstraints, CertificateParams, DistinguishedName, DnType, IsCa, Issuer, KeyPair,
|
||||||
};
|
};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::Path;
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
|
||||||
|
|
@ -1076,12 +1076,12 @@ Store credentials in Vault:
|
||||||
let db_password = if let Ok(env_pwd) = std::env::var("BOOTSTRAP_DB_PASSWORD") {
|
let db_password = if let Ok(env_pwd) = std::env::var("BOOTSTRAP_DB_PASSWORD") {
|
||||||
env_pwd
|
env_pwd
|
||||||
} else if !db_password_override.is_empty() {
|
} else if !db_password_override.is_empty() {
|
||||||
db_password_override.clone()
|
db_password_override.to_string()
|
||||||
} else {
|
} else {
|
||||||
match get_database_url_sync() {
|
match get_database_url_sync() {
|
||||||
Ok(url) => {
|
Ok(url) => {
|
||||||
let (_, password, _, _, _) = parse_database_url(&url);
|
let (_, password, _, _, _) = parse_database_url(&url);
|
||||||
password
|
password.to_string()
|
||||||
}
|
}
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
trace!("Vault not available for DB_PASSWORD, using empty string");
|
trace!("Vault not available for DB_PASSWORD, using empty string");
|
||||||
|
|
|
||||||
|
|
@ -134,3 +134,18 @@ pub fn list_embedded_files() -> Vec<String> {
|
||||||
log::debug!("Embedded UI contains {} files", files.len());
|
log::debug!("Embedded UI contains {} files", files.len());
|
||||||
files
|
files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "embed-ui"))]
|
||||||
|
pub fn has_embedded_ui() -> bool {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "embed-ui"))]
|
||||||
|
pub fn list_embedded_files() -> Vec<String> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "embed-ui"))]
|
||||||
|
pub fn embedded_ui_router() -> Router {
|
||||||
|
Router::new()
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue