Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/roundcube: add roundcube module #48049

Merged
merged 5 commits into from Nov 30, 2018
Merged

Conversation

Vskilet
Copy link
Contributor

@Vskilet Vskilet commented Oct 8, 2018

Motivation for this change

After failing me on my local repo, I suggest this module for roundcube, and I closed the #47655. I try to take in account @globin remarks.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Vskilet Vskilet changed the title Roundcube module nixos/roundcube : add rouncube module Oct 8, 2018
@Vskilet
Copy link
Contributor Author

Vskilet commented Oct 8, 2018

@globin I try to make test like this :

import ./make-test.nix ({ ... }:

{
  name = "roundcube";
  machine = { config, pkgs, ... }: {
    services.roundcube = {
      enable = true;
      listenAddress = "127.0.0.1";
      subDomain = "roundcube";
    };
  };

  testScript = ''
    $machine->start;
    $machine->waitForUnit("phpfpm-roundcube.service");
    $machine->succeed("curl -sSfL http://127.0.0.1:80/");
  '';
})

but I have a problem when I test it with nix-build roundcube.nix :

machine# The file /dev/vda does not exist and no size was specified.
machine# waiting for device /dev/vda to appear...[    3.759705] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[    5.065448] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[    6.362673] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[    7.701075] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[    9.018160] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[   10.321447] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[   11.639259] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[   12.941977] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[   14.272200] random: lvm: uninitialized urandom read (4 bytes read)
machine# .[   14.887991] random: crng init done
machine# ...........
machine# Timed out waiting for device /dev/vda, trying to mount anyway.
machine# mounting /dev/vda on /...
machine# mount: mounting /dev/vda on /mnt-root/ failed: No such file or directory
machine# [   29.675011] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
machine# [   29.675011]
machine# [   29.677947] CPU: 0 PID: 1 Comm: init Not tainted 4.14.74 #1-NixOS
machine# [   29.679931] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626ccb91-prebuilt.qemu-project.org 04/01/2014
machine# [   29.683607] Call Trace:
machine# [   29.684734]  dump_stack+0x5c/0x85
machine# [   29.685843]  panic+0xd5/0x232
machine# [   29.686975]  do_exit+0xad0/0xad0
machine# [   29.688164]  ? handle_mm_fault+0xaa/0x1e0
machine# [   29.689399]  do_group_exit+0x3a/0xa0
machine# [   29.690484]  SyS_exit_group+0x10/0x10
machine# [   29.691608]  do_syscall_64+0x67/0x120
machine# [   29.692750]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
machine# [   29.694364] RIP: 0033:0x7f57ce27b676
machine# [   29.700126] RSP: 002b:00007fffcb0e01b8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
machine# [   29.703028] RAX: ffffffffffffffda RBX: 0000000001d78704 RCX: 00007f57ce27b676
machine# [   29.705709] RDX: 0000000000000001 RSI: 000000000000003c RDI: 0000000000000001
machine# [   29.708000] RBP: 0000000000000001 R08: 00000000000000e7 R09: ffffffffffffff80
machine# [   29.710271] R10: 0000000000000000 R11: 0000000000000202 R12: 00007fffcb0e0548
machine# [   29.712538] R13: 00007fffcb0e0540 R14: 0000000000000000 R15: 0000000000000000
machine# [   29.714982] Kernel Offset: 0xe800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
machine# [   29.718431] Rebooting in 1 seconds..
vde_switch: EOF data port: Interrupted system call
error: the VM quit before connecting
the VM quit before connecting
cleaning up
killing machine (pid 8089)
vde_switch: EOF on stdin, cleaning up and exiting
builder for '/nix/store/a16cp2x7pwambkzmvch020qmnlmqk775-vm-test-run-roundcube.drv' failed with exit code 255
error: build of '/nix/store/a16cp2x7pwambkzmvch020qmnlmqk775-vm-test-run-roundcube.drv' failed

Maybe can you help me ?
Regards

@globin globin self-assigned this Oct 10, 2018
@globin
Copy link
Member

globin commented Oct 21, 2018

I'm working on finishing this up, will probably be ready tomorrow.

@Vskilet
Copy link
Contributor Author

Vskilet commented Oct 21, 2018

I'm working on finishing this up, will probably be ready tomorrow.

Thanks :)

@Ma27
Copy link
Member

Ma27 commented Oct 22, 2018

@globin I'm currently setting up a mailing environment and managed to get roundcube running, so in case I can help with review/test/whatever feel free to ping me :)

@Vskilet
Copy link
Contributor Author

Vskilet commented Nov 8, 2018

@globin @Ma27 @Mic92 Is someone have modifications, suggestions to give me or another one to move forward on this ?

@Ma27
Copy link
Member

Ma27 commented Nov 8, 2018

There's a work-in-progress: https://github.com/mayflower/nixpkgs/commits/roundcube-module

I privately hacked something together to get this working on my personal setup, but this is certainly not suitable for NixOS upstream and I don't want to duplicate efforts now :)

Copy link
Contributor

@flokli flokli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments, but looks quite good so far 👍

Can you also add some basic module documentation, like done in #51053 for nextcloud?

nixos/modules/services/mail/roundcube.nix Outdated Show resolved Hide resolved
nixos/tests/roundcube.nix Show resolved Hide resolved
nixos/modules/services/mail/roundcube.nix Show resolved Hide resolved
nixos/modules/services/mail/roundcube.nix Show resolved Hide resolved
nixos/modules/services/mail/roundcube.nix Show resolved Hide resolved
nixos/modules/services/mail/roundcube.nix Outdated Show resolved Hide resolved
@globin
Copy link
Member

globin commented Nov 28, 2018

@GrahamcOfBorg test roundcube

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: tests.roundcube

Partial log (click to expand)

Cannot nix-instantiate `tests.roundcube' because:
error: attribute 'roundcube' in selection path 'tests.roundcube' not found

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: tests.roundcube

Partial log (click to expand)

Cannot nix-instantiate `tests.roundcube' because:
error: attribute 'roundcube' in selection path 'tests.roundcube' not found

@globin
Copy link
Member

globin commented Nov 28, 2018

@GrahamcOfBorg test roundcube

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: tests.roundcube

Partial log (click to expand)

Cannot nix-instantiate `tests.roundcube' because:
error: while evaluating 'recursiveUpdate' at /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:415:26, called from /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:148:28:
while evaluating 'recursiveUpdateUntil' at /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:384:37, called from /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:416:5:
while evaluating 'zipAttrsWith' at /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:347:21, called from /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:394:8:
while evaluating 'zipAttrsWithNames' at /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:332:33, called from /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/lib/attrsets.nix:347:27:
while evaluating the attribute 'roundcube' at /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/nixos/tests/all-tests.nix:181:3:
while evaluating 'handleTest' at /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/nixos/tests/all-tests.nix:17:22, called from /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/nixos/tests/all-tests.nix:181:15:
while evaluating 'discoverTests' at /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/nixos/tests/all-tests.nix:13:19, called from /var/lib/gc-of-borg/nix-test-rs-18/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-18/nixos/tests/all-tests.nix:18:5:
access to path '/nix/store/72srfyn5kd1f4cln2xjapg7c675wwjxy-grahamc-aarch64-community-18' is forbidden in restricted mode

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: tests.roundcube

Partial log (click to expand)

error: while evaluating 'recursiveUpdate' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:415:26, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:148:28:
while evaluating 'recursiveUpdateUntil' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:384:37, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:416:5:
while evaluating 'zipAttrsWith' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:347:21, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:394:8:
while evaluating 'zipAttrsWithNames' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:332:33, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:347:27:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/lists.nix:113:41, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/attrsets.nix:347:46:
while evaluating the attribute 'roundcube' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/tests/all-tests.nix:181:3:
while evaluating 'handleTest' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/tests/all-tests.nix:17:22, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/tests/all-tests.nix:181:15:
while evaluating 'discoverTests' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/tests/all-tests.nix:13:19, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/nixos/tests/all-tests.nix:18:5:
access to path '/nix/store/lvc7kpsscacrmgp8zkykx77lwf1w93xy-gleber-bastion' is forbidden in restricted mode

@globin globin changed the title nixos/roundcube : add rouncube module nixos/roundcube: add roundcube module Nov 29, 2018
@flokli
Copy link
Contributor

flokli commented Nov 29, 2018

I'll do a manual test of the database migration functionality today, but looking quite good so far!

@flokli
Copy link
Contributor

flokli commented Nov 30, 2018

I downgraded roundcube to 1.2.2 with that module, created a container with it inside, then reverted the downgrade. Due to the current flakyness of declarative containers and reload not working properly, I had to restart the container. On bootup, roundcube-setup.service performed migrations:

-- Logs begin at Fri 2018-11-30 12:15:36 UTC. --
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: What version are you upgrading from? Type '?' if you don't know.
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: WARNING: Mimetype to file extension mapping doesn't work properly!
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: Please check the 'mime_types' config option and run this script again.
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: Executing database schema update.
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: Updating database schema (2016081200)... [OK]
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: Updating database schema (2016100900)... [OK]
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: Updating database schema (2016112200)... [OK]
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: This instance of Roundcube is up-to-date.
Nov 30 12:23:27 roundcube pcbwh312xsm6gnxlwijq2f82s42amlwa-unit-script-roundcube-setup-start[577]: Have fun!
Nov 30 12:23:27 roundcube systemd[1]: Started roundcube-setup.service.

@flokli flokli merged commit aa490a5 into NixOS:master Nov 30, 2018
@Vskilet Vskilet deleted the roundcube-module branch May 1, 2020 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants