1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/servers/web-apps/virtlyst/add-admin-password-env.patch
Franz Pletz 1d235be208
virtlyst: init at 1.1.0
Co-authored-by: elseym <elseym@me.com>
2018-06-26 01:18:30 +02:00

15 lines
757 B
Diff

diff --git a/src/virtlyst.cpp b/src/virtlyst.cpp
index acd195d..8809e4f 100644
--- a/src/virtlyst.cpp
+++ b/src/virtlyst.cpp
@@ -340,7 +340,8 @@ bool Virtlyst::createDB()
qCCritical(VIRTLYST) << "Error creating database" << query.lastError().text();
return false;
}
- const QString password = QString::fromLatin1(QUuid::createUuid().toRfc4122().toHex());
+ const QString password = qEnvironmentVariable("VIRTLYST_ADMIN_PASSWORD",
+ QString::fromLatin1(QUuid::createUuid().toRfc4122().toHex()));
query.bindValue(QStringLiteral(":password"), QString::fromLatin1(
CredentialPassword::createPassword(password.toUtf8(), QCryptographicHash::Sha256, 10000, 16, 16)));
if (!query.exec()) {