Configuring your workstation at loria

univ-lorraine
loria
Author

Emmanuel Jeandel

Published

February 25, 2023

This post will explain how I configure my workstation at loria to use all services I deem necessary (printer, mail, etc).

There are multiple ways to configure all of these, and this is just the workflow I currently use.

Note

Many of the configuration below needs to know your inria password. I personally use secret-tools to connect with keepassxc

The line

secret-tool lookup pass zimbra

is how I obtain my zimbra password kept in keepassxc for instance.

Replace this with your preferred method to obtain passwords.

Mail user Agent (mutt)

My preferred MUA is mutt

Here is the configuration I use.

Common configuration:

mailboxes 'imaps://zimbra.inria.fr:993/' 'imaps://imap.univ-lorraine.fr:993/'

For Loria:

set my_pw_inria=`secret-tool lookup pass zimbra`
account-hook imaps://zimbra.inria.fr:993/ 'set imap_user=mynickname imap_pass=$my_pw_inria'
folder-hook imaps://zimbra.inria.fr:993/ my_hdr From: myfirstname.mylastname@loria.fr
folder-hook imaps://zimbra.inria.fr:993/ 'set record=imaps://zimbra.inria.fr:993/Sent'

And for UL:

set my_pw_ul=`secret-tool lookup pass ul`
account-hook imaps://imap.univ-lorraine.fr:993/ 'set imap_user=mynickname imap_pass=$my_pw_ul'
folder-hook imaps://imap.univ-lorraine.fr:993/ my_hdr From: myfirstname.mylastname@univ-lorraine.fr
folder-hook imaps://imap.univ-lorraine.fr:993/ 'set record=imaps://imap.univ-lorraine.fr:993/Sent'

Mail Transfer Agent (msmtp)

My preferred MTA is msmtp

Here is the configuration for loria:

account default
host smtp.inria.fr
from myfirstname.mylastname@loria.fr
port 587
auth on
user mynickname
passwordeval "/usr/bin/secret-tool lookup pass zimbra"
tls on

and for UL:

account ul
host smtp.univ-lorraine.fr
from firstname.lastname@univ-lorraine.fr
port 587
auth on
user mynickname@univ-lorraine.fr
passwordeval "/usr/bin/secret-tool lookup pass ul"
tls on

and of course the mutt-msmtp interaction in the mutt configuration file:

set sendmail="/usr/bin/msmtp"

Calendar

My software of choice for calendars is khal. It essentially pilots a local directory of icalendars, so configuring it to work with the Loria calendar essentially amounts to explain how to synchronize the local directories with the zimbra calendar, which is done with vdirsyncer.

There is nothing specific in khal about my setup, everything happens in vdirsyncer.

Configuration is split into three parts: the Loria zimbra calendar, the UL zimbra calendar, and the ADE calendar.

For the Loria zimbra calendar:

[storage zimbra]
type = "caldav"
url = "https://zimbra.inria.fr/dav/firstname.lastname@loria.fr"
username = "nick"
auth = "basic"
password.fetch = ["command", "secret-tool", "lookup", "pass", "zimbra"]

[storage zimbra_local]
type = "filesystem"
path = "~/.calendars/zimbra"
fileext = ".ics"

[pair zimbra_pair]
a = "zimbra"
b = "zimbra_local"
conflict_resolution = "a wins"
collections = ["Calendar"]

For the UL zimbra calendar, replace all instances of zimbra by ul and the url is now: https://mail.univ-lorraine.fr/dav/firstname.lastname@univ-lorraine.fr

Finally, for the ADE calendar, you first need to know its address:

  • Click on monade
  • Click on the “Export Agenda button” on the top right
  • Click on “Generate URL”
  • Change the dates in the URL to be from early september to late august.

Now you can configure the calendar:

[storage ade_remote]
type = "http"
url = "https://adeical.univ-lorraine.fr/..."

[storage ade_local]
type = "filesystem"
path = "~/.calendars/ade"
fileext = ".ics"

[pair ade_pair]
a = "ade_remote"
b = "ade_local"
conflict_resolution = "a wins"
collections = null

Note that you usually need to change the URL every year.

The usage of vdirsyncer is simple: just vdirsyncer discover the first time, then vdirsyncer sync everytime you want so sync.

NextCloud (UL)

You can use the official nextcloud server to connect to the University Nextcloud of course. You can also use rclone

  • First launch BUL. In Sécurité, you can add an “application password” that will be specific to rclone

  • Then you can launch rclone config:

    • Select WebDav then nextcloud
    • The URL to enter is https://bul.univ-lorraine.fr/remote.php/webdav

Printer

Two notes:

  • You don’t need to install a cups server (but you need a cups client)
  • You don’t need cups-browsed

The easiest way to make printing works is to create a file ~/.cups/client.conf with the following line

ServerName cups-nge.inria.fr:631/version=1.1

And that’s it. It’s also useful (but not mandatory) to configure ~/.cups/lpoptions with:

Default printer-bw-nge

so you don’t have to specify the printer each time.