Posts by mjd_tech

    Actually, I abandoned the idea of encrypted cron emails.


    However, it's fairly simple to implement.

    Copy your gpg public key to your home directory on OMV

    modify /etc/cron.d/openmediavault-userdefined - something like this:

    Code
    GPG_CMD = "ifne /usr/bin/gpg --batch --armor --trust-model always --no-default-keyring --keyring /home/YOURPUBLICKEY.asc.gpg --recipient you@example.de --encrypt"
    
    @daily root /var/lib/openmediavault/cron.d/userdefined-blah-blah 2>&1 | $GPG_CMD | mail -E -s "Cron - Scheduled system backup." -a "From: Cron Daemon <root>" root >/dev/null 2>&1

    Of course there's a big problem with this:

    # WARNING: Do not edit this file, your changes will get lost.


    So it would be nice if you could put your own stuff in the crontab without it getting overwritten.


    But I took another approach:

    Rather than trying to get OMV to send encrypted mail to my gmail account,

    send it a mail server that I have control over. And don't worry about encryption


    So I grabbed a postfix/dovecot Docker image off Github and modified to my needs.

    I stripped out anything that involves relaying mail over the internet. This is local only.


    So now, I just configure OMV to send cron mail to the Docker container.

    To read the mail, Thunderbird.

    Yes Thunderbird complains about a self-signed certificate. I just "add exception" and it works fine.


    I also have several other Linux boxes here at home that send cron mail to the Container.

    So now, I don't worry about encrypting cron mail anymore.


    For my needs this is exactly what I want.

    But, it's kind of specialized, not sure many people would want this.


    Sure it would be nice if OMV did this. But it's easy enough to do with Docker.

    You guys have your hands full with far more important stuff.


    If anyone is interested, I'll gladly send them my Dockerfile and stuff.

    Warning, this is the 3rd Docker image I've ever built, and the first one was "hello world".

    I gave up on the idea of OMV sending encrypted mail to my gmail account.


    Instead, I created a very basic Docker image with Postfix and Dovecot.

    Its job is to receive cron email from all my local hosts, including OMV.

    No internet access, no sending, no relaying, strictly receive only on my local Lan.

    So I set OMV notifications to localhost.


    I use Thunderbird to read the mail, any IMAP email client should work.


    This gets the job done.

    Kind of a shame to run another instance of Postfix, when it's already running by default.

    Some thoughts...

    1. I like to create another account for docker containers. Put this new user in these groups: users sudo ssh docker.
      This user will probably be uid 1000 and gid 100, use those in your portainer stacks.
      Use this account for ssh login instead of root.
    2. Just add a "union filesystem" with your local drive and your remote mount webdav. The union will be /srv/some-long-uuid
      Make sure your new user account can read/write to the union.
    3. The "plex" directory owner/perms should be root:users 2775.
      Try connecting to \\OMVMINI\plex with Linux or Mac.
      Windows 10 is notorious for pushing updates that mess up SMB file sharing.
      If SMB gets too frustrating, there's always WinSCP or Filezilla.
    4. An easier way to do this is avahi-publish. see https://pi3g.com/2019/04/10/av…l-local-names-to-same-ip/.
    5. I'm not familiar with Premiumizer, but it looks like the usual docker stuff.
    6. See #1

    Notes:

    Do yourself a favor and install the Symlinks plugin.

    Make symlinks like /mnt/movies that points to /srv/dev-disk-by-uuid-blah-blah-blah/movies

    Use the symlinks in your Portainer "Stacks" instead of those ugly paths.


    I create a "shared folder" called appdata, to keep all the Docker "config" stuff.

    Naturally, I make a symlink to it.


    For example Plex. (I run Jellyfin, but same idea):

    Code
    volumes:
      - /mnt/appdata/plex:/config
      - /mnt/tv:/tv
      - /mnt/movies:/movies

    The idea is "no ugly paths in Portainer"

    If you move stuff around, just change a symlink or 2 rather than edit a bunch of Portainer stacks.


    I always install mc (midnight commander) and htop on every Linux box. Can't live without.


    If you want a Gui file manager, try the djaydev/krusader container...

    Code
    volumes:
      - /mnt/appdata/krusader:/config
      - /srv:/host

    Make bookmarks in Krusader to the things you use most.

    I want OMV email notifications to be encrypted with a gpg public key before sending.


    On other (non OMV) servers I have used this method:

    https://dev.to/philippmayrth/e…-cron-emails-with-gpg-15j


    This involves modifying crontab files to pipe the command output into gpg


    But when I look at the crontab files in OMV, there is a warning.

    # WARNING: Do not edit this file, your changes will get lost.


    I looked at config.xml and didn't see anything obvious.


    Is there an "approved" way to do this,

    Thanks.