mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-15 06:31:39 +03:00
nixosTests.bookstack: init
This commit is contained in:
parent
c75204d911
commit
84a86b6041
2 changed files with 46 additions and 0 deletions
45
nixos/tests/bookstack.nix
Normal file
45
nixos/tests/bookstack.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
db-pass = "Test2Test2";
|
||||
app-key = "TestTestTestTestTestTestTestTest";
|
||||
in
|
||||
{
|
||||
name = "bookstack";
|
||||
meta.maintainers = [ pkgs.lib.maintainers.savyajha ];
|
||||
|
||||
nodes.bookstackMysql = {
|
||||
services.bookstack = {
|
||||
enable = true;
|
||||
hostname = "localhost";
|
||||
nginx.onlySSL = false;
|
||||
settings = {
|
||||
APP_KEY_FILE = pkgs.writeText "bookstack-appkey" app-key;
|
||||
LOG_CHANNEL = "stdout";
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
bookstackMysql.wait_for_unit("phpfpm-bookstack.service")
|
||||
bookstackMysql.wait_for_unit("nginx.service")
|
||||
bookstackMysql.wait_for_unit("mysql.service")
|
||||
bookstackMysql.succeed("curl -fvvv -Ls http://localhost/ | grep 'Log In'")
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue