mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixosTests.bookstack: Updated to also test passwordless login for mysql
This commit is contained in:
parent
cab8025470
commit
5fba2ce2a9
1 changed files with 15 additions and 8 deletions
|
|
@ -1,12 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
db-pass = "Test2Test2";
|
||||
app-key = "TestTestTestTestTestTestTestTest";
|
||||
in
|
||||
{
|
||||
name = "bookstack";
|
||||
meta.maintainers = [ pkgs.lib.maintainers.savyajha ];
|
||||
meta = {
|
||||
maintainers = [ pkgs.lib.maintainers.savyajha ];
|
||||
platforms = pkgs.lib.platforms.linux;
|
||||
};
|
||||
|
||||
nodes.bookstackMysql = {
|
||||
services.bookstack = {
|
||||
|
|
@ -19,7 +21,6 @@ in
|
|||
SITE_OWNER = "mail@example.com";
|
||||
DB_DATABASE = "bookstack";
|
||||
DB_USERNAME = "bookstack";
|
||||
DB_PASSWORD_FILE = pkgs.writeText "mysql-pass" db-pass;
|
||||
DB_SOCKET = "/run/mysqld/mysqld.sock";
|
||||
};
|
||||
};
|
||||
|
|
@ -27,12 +28,18 @@ in
|
|||
services.mysql = {
|
||||
enable = true;
|
||||
package = pkgs.mariadb;
|
||||
initialScript = pkgs.writeText "bookstack-init.sql" ''
|
||||
create database bookstack DEFAULT CHARACTER SET utf8mb4;
|
||||
create user 'bookstack'@'localhost' identified by '${db-pass}';
|
||||
grant all on bookstack.* to 'bookstack'@'localhost';
|
||||
'';
|
||||
settings.mysqld.character-set-server = "utf8mb4";
|
||||
ensureDatabases = [
|
||||
"bookstack"
|
||||
];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "bookstack";
|
||||
ensurePermissions = {
|
||||
"bookstack.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue