WVHXYKCVPKAFVMXBEMD3IHG54RKOIDSOCVNR3OIPEZQG36IGYJZQC
QPHRMBEPXKK3VDJKMRV2XAKYMNMNPWNXDMS26NWPQL65AGJRZJSAC
QEK76JYTPKWAN3OIY3U24HMVEIX2GYTEWHII7AD7TUIGTY36DIAAC
WW3KRXX63EYWW4563QM3VSEN4PGCPR76KJQBYIKCKOCNMDG6JW4QC
EVP2FSBHQUCAXQ6IIMBD6IS24ODKHP6HFWYCHIMYG6KOFRQG3RVQC
BCXEUKX6RVE4UQE46ITSQY2NXYK3MJT7HHL7CJOM7T4OOOCADMIAC
4MZ4VIR7FU3PQ3WKJI6TJIKYOIIBODFEPKLMQ32S4AKPZSDFO6AQC
65A3LIWUS7UNMIHACC7ED6SSSSGQMKW4SAHQLXMT2YT6PFJ7KVUQC
OJO4B4QO2JQLMZTGTJJIXEUNDIN45RFLEJBUZBYA7IS34XDPUAVAC
7R6HAATP4CKWKNOFWAVCZFJVF6LADPHHIINR37PYNGAWGCTBJSJQC
IM5ZPD4NEWQ67NSRP3M4R6FBET5HLY5YCX6WOTGGVWIMRGFD3L3AC
OWZ67OECVVLVFN2Z7XWITYBU6YUIU42E3SIJDCRKF7M4XDX5XKHAC
XMUKNMKYXU7IGJFZ7JEYTLGQK34KBECXEPPZ7HAKKUHMUOMVFSJAC
pub async fn get_reset_game_pwd(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
let body = match hb.render("reset-game-pwd", &()) {
#[actix_web::get("/reset-game-pwd-{token}.html")]
pub async fn get_reset_game_pwd(
_token: web::Path<String>,
data: web::Data<WebData<'_>>,
) -> HttpResponse {
let body = match data.handlebars.render("reset-game-pwd", &()) {
pub struct WebData<'a> {
pub handlebars: Handlebars<'a>,
pub pool_ro: deadpool_postgres::Pool,
pub pool_rw: deadpool_postgres::Pool,
}
#[cfg(not(feature = "actix-files"))]
let Config { http } = config;
let pg_ro_config = read_dsn(dsn_ro_path)?;
let pg_rw_config = read_dsn(dsn_rw_path)?;
let mgr_ro = deadpool_postgres::Manager::from_config(
pg_ro_config,
tokio_postgres::NoTls,
deadpool_postgres::ManagerConfig {
recycling_method: deadpool_postgres::RecyclingMethod::Fast,
},
);
let mgr_rw = deadpool_postgres::Manager::from_config(
pg_rw_config,
tokio_postgres::NoTls,
deadpool_postgres::ManagerConfig {
recycling_method: deadpool_postgres::RecyclingMethod::Fast,
},
);
let pool_ro = deadpool_postgres::Pool::builder(mgr_ro)
.max_size(dsn_conn)
.build()
.expect("Postgresql RO pool");
pub fn read_dsn<P: AsRef<Path>>(path: P) -> io::Result<tokio_postgres::config::Config> {
let mut f = File::open(path)?;
let mut buffer = String::new();
use std::io::Read;
f.read_to_string(&mut buffer)?;
use std::str::FromStr;
tokio_postgres::config::Config::from_str(&buffer)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
}
name = "deadpool"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bf0c5365c0925c80a838a6810a1bf38d3304ca6b4eb25829e29e33da12de786"
dependencies = [
"async-trait",
"deadpool-runtime",
"num_cpus",
"tokio",
]
[[package]]
name = "deadpool-postgres"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46ff1451a33b8b31b15eedcf5401dbbb28606caed4fa94d20487eb3fac2ebd04"
dependencies = [
"deadpool",
"log",
"tokio",
"tokio-postgres",
]
[[package]]
name = "deadpool-runtime"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1"
dependencies = [
"tokio",
]
[[package]]
"uuid",
]
[[package]]
name = "futures"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
"futures-util",
name = "futures-executor"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2"
[[package]]
name = "futures-macro"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
[[package]]
name = "openssl"
version = "0.10.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95"
dependencies = [
"bitflags",
"cfg-if",
"foreign-types",
"libc",
"once_cell",
"openssl-sys",
]
name = "phf"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
dependencies = [
"phf_shared",
]
[[package]]
name = "phf_shared"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
dependencies = [
"siphasher",
]
[[package]]
checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
checksum = "79ec03bce71f18b4a27c4c64c6ba2ddf74686d69b91d8714fb32ead3adaed713"
dependencies = [
"base64",
"byteorder",
"bytes",
"fallible-iterator",
"hmac",
"md-5",
"memchr",
"rand",
"sha2",
"stringprep",
]
[[package]]
name = "postgres-types"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04619f94ba0cc80999f4fc7073607cb825bc739a883cb6d20900fc5e009d6b0d"
dependencies = [
"bytes",
"fallible-iterator",
"postgres-protocol",
"uuid",
]
]
[[package]]
name = "tokio-postgres"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b6c8b33df661b548dcd8f9bf87debb8c56c05657ed291122e1188698c2ece95"
dependencies = [
"async-trait",
"byteorder",
"bytes",
"fallible-iterator",
"futures",
"log",
"parking_lot",
"percent-encoding",
"phf",
"pin-project-lite",
"postgres-protocol",
"postgres-types",
"socket2",
"tokio",
"tokio-util",