mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-23 01:35:21 +00:00
parent
a0a84d91ce
commit
ceae0f5993
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2225,6 +2225,7 @@ dependencies = [
|
|||
"once_cell",
|
||||
"openssl",
|
||||
"parking_lot",
|
||||
"percent-encoding",
|
||||
"rand 0.8.5",
|
||||
"regex",
|
||||
"reqwest-middleware",
|
||||
|
|
|
@ -2,4 +2,8 @@
|
|||
# https://join-lemmy.org/docs/en/administration/configuration.html
|
||||
{
|
||||
hostname: lemmy-alpha
|
||||
database: {
|
||||
# Username to connect to postgres
|
||||
user: "&££%^!£*!:::!"£:!:"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ html2text = "0.4.2"
|
|||
rosetta-i18n = "0.1.2"
|
||||
parking_lot = "0.12.1"
|
||||
typed-builder = "0.10.0"
|
||||
percent-encoding = "2.2.0"
|
||||
|
||||
[build-dependencies]
|
||||
rosetta-build = "0.1.2"
|
||||
|
|
|
@ -6,6 +6,7 @@ use crate::{
|
|||
use anyhow::{anyhow, Context};
|
||||
use deser_hjson::from_str;
|
||||
use once_cell::sync::Lazy;
|
||||
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
|
||||
use regex::Regex;
|
||||
use std::{env, fs, io::Error};
|
||||
|
||||
|
@ -44,7 +45,11 @@ impl Settings {
|
|||
let conf = &self.database;
|
||||
format!(
|
||||
"postgres://{}:{}@{}:{}/{}",
|
||||
conf.user, conf.password, conf.host, conf.port, conf.database,
|
||||
utf8_percent_encode(&conf.user, NON_ALPHANUMERIC),
|
||||
utf8_percent_encode(&conf.password, NON_ALPHANUMERIC),
|
||||
conf.host,
|
||||
conf.port,
|
||||
utf8_percent_encode(&conf.database, NON_ALPHANUMERIC),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue