Unverified Commit 72ac5ba4 authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 72fb6676 1bace74c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -5177,6 +5177,13 @@
    githubId = 66178592;
    name = "Pavel Zolotarevskiy";
  };
  flexiondotorg = {
    name = "Martin Wimpress";
    email = "martin@wimpress.org";
    matrix = "@wimpress:matrix.org";
    github = "flexiondotorg";
    githubId = 304639;
  };
  fliegendewurst = {
    email = "arne.keller@posteo.de";
    github = "FliegendeWurst";
+2 −0
Original line number Diff line number Diff line
@@ -190,6 +190,8 @@ In addition to numerous new and upgraded packages, this release has the followin

- Calling `makeSetupHook` without passing a `name` argument is deprecated.

- Top-level buildPlatform,hostPlatform,targetPlatform have been deprecated, use stdenv.X instead.

- `lib.systems.examples.ghcjs` and consequently `pkgsCross.ghcjs` now use the target triplet `javascript-unknown-ghcjs` instead of `js-unknown-ghcjs`. This has been done to match an [upstream decision](https://gitlab.haskell.org/ghc/ghc/-/commit/6636b670233522f01d002c9b97827d00289dbf5c) to follow Cabal's platform naming more closely. Nixpkgs will also reject `js` as an architecture name.

- `dokuwiki` has been updated from 2023-07-31a (Igor) to 2023-04-04 (Jack Jackrum), which has [completely removed](https://www.dokuwiki.org/changes#release_2023-04-04_jack_jackrum) the options to embed HTML and PHP for security reasons. The [htmlok plugin](https://www.dokuwiki.org/plugin:htmlok) can be used to regain this functionality.
+1 −0
Original line number Diff line number Diff line
@@ -634,6 +634,7 @@ in {
  smokeping = handleTest ./smokeping.nix {};
  snapcast = handleTest ./snapcast.nix {};
  snapper = handleTest ./snapper.nix {};
  snipe-it = runTest ./web-apps/snipe-it.nix;
  soapui = handleTest ./soapui.nix {};
  sogo = handleTest ./sogo.nix {};
  solanum = handleTest ./solanum.nix {};
+101 −0
Original line number Diff line number Diff line
/*
Snipe-IT NixOS test

It covers the following scenario:
- Installation
- Backup and restore

Scenarios NOT covered by this test (but perhaps in the future):
- Sending and receiving emails
*/
{ pkgs, ... }: let
  siteName = "NixOS Snipe-IT Test Instance";
in {
  name = "snipe-it";

  meta.maintainers = with pkgs.lib.maintainers; [ yayayayaka ];

  nodes = {
    snipeit = { ... }: {
      services.snipe-it = {
        enable = true;
        appKeyFile = toString (pkgs.writeText "snipe-it-app-key" "uTqGUN5GUmUrh/zSAYmhyzRk62pnpXICyXv9eeITI8k=");
        hostName = "localhost";
        database.createLocally = true;
        mail = {
          driver = "smtp";
          encryption = "tls";
          host = "localhost";
          port = 1025;
          from.name = "Snipe-IT NixOS test";
          from.address = "snipe-it@localhost";
          replyTo.address = "snipe-it@localhost";
          user = "snipe-it@localhost";
          passwordFile = toString (pkgs.writeText "snipe-it-mail-pass" "a-secure-mail-password");
        };
      };
    };
  };

  testScript = { nodes }: let
    backupPath = "${nodes.snipeit.services.snipe-it.dataDir}/storage/app/backups";

    # Snipe-IT has been installed successfully if the site name shows up on the login page
    checkLoginPage = { shouldSucceed ? true }: ''
      snipeit.${if shouldSucceed then "succeed" else "fail"}("""curl http://localhost/login | grep '${siteName}'""")
    '';
  in ''
    start_all()

    snipeit.wait_for_unit("nginx.service")
    snipeit.wait_for_unit("snipe-it-setup.service")

    # Create an admin user
    snipeit.succeed(
        """
        snipe-it snipeit:create-admin \
            --username="admin" \
            --email="janedoe@localhost" \
            --password="extremesecurepassword" \
            --first_name="Jane" \
            --last_name="Doe"
        """
    )

    with subtest("Circumvent the pre-flight setup by just writing some settings into the database ourself"):
        snipeit.succeed(
            """
            mysql -D ${nodes.snipeit.services.snipe-it.database.name} -e "INSERT INTO settings (id, user_id, site_name) VALUES ('1', '1', '${siteName}');"
            """
        )

        # Usually these are generated during the pre-flight setup
        snipeit.succeed("snipe-it passport:keys")


    # Login page should now contain the configured site name
    ${checkLoginPage {}}

    with subtest("Test Backup and restore"):
        snipeit.succeed("snipe-it snipeit:backup")

        # One zip file should have been created
        snipeit.succeed("""[ "$(ls -1 "${backupPath}" | wc -l)" -eq 1 ]""")

        # Purge the state
        snipeit.succeed("snipe-it migrate:fresh --force")

        # Login page should disappear
        ${checkLoginPage { shouldSucceed = false; }}

        # Restore the state
        snipeit.succeed(
            """
            snipe-it snipeit:restore --force $(find "${backupPath}/" -type f -name "*.zip")
            """
        )

        # Login page should be back again
        ${checkLoginPage {}}
  '';
}
+3 −11
Original line number Diff line number Diff line
@@ -10,22 +10,14 @@

rustPlatform.buildRustPackage rec {
  pname = "termusic";
  version = "0.7.9";
  version = "0.7.10";

  src = fetchCrate {
    inherit pname version;
    hash = "sha256-ytAKINcZwLyHWbzShxfxRKx4BepM0G2BYdLgwR48g7w=";
    hash = "sha256-m0hi5u4BcRcEDEpg1BoWXc25dfhD6+OJtqSZfSdV0HM=";
  };

  cargoHash = "sha256-yxFF5Yqj+xTB3FAJUtgcIeAEHR44JA1xONxGFdG0yS0=";

  patches = [
    (fetchpatch {
      name = "fix-panic-when-XDG_AUDIO_DIR-not-set.patch";
      url = "https://github.com/tramhao/termusic/commit/b6006b22901f1f865a2e3acf7490fd3fa520ca5e.patch";
      hash = "sha256-1ukQ0y5IRdOndsryuqXI9/zyhCDQ5NIeTan4KCynAv0=";
    })
  ];
  cargoHash = "sha256-A83gLsaPm6t4nm7DJfcp9z1huDU/Sfy9gunP8pzBiCA=";

  nativeBuildInputs = [
    pkg-config
Loading