Roundcube testing on bekkalokk now working. #14
@ -13,6 +13,7 @@
|
||||
# ./services/website.nix
|
||||
./services/nginx.nix
|
||||
./services/gitea/default.nix
|
||||
./services/webmail
|
||||
danio marked this conversation as resolved
Outdated
|
||||
# ./services/mediawiki.nix
|
||||
];
|
||||
|
||||
|
15
hosts/bekkalokk/services/webmail/default.nix
Normal file
15
hosts/bekkalokk/services/webmail/default.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ config, values, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./roundcube.nix
|
||||
];
|
||||
|
||||
services.nginx.virtualHosts."webmail2.pvv.ntnu.no" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
#locations."/" = lib.mkForce { };
|
||||
locations."= /" = {
|
||||
return = "301 https://www.pvv.ntnu.no/mail/";
|
||||
};
|
||||
};
|
||||
}
|
74
hosts/bekkalokk/services/webmail/roundcube.nix
Normal file
74
hosts/bekkalokk/services/webmail/roundcube.nix
Normal file
@ -0,0 +1,74 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.roundcube;
|
||||
domain = "webmail2.pvv.ntnu.no";
|
||||
danio marked this conversation as resolved
Outdated
danio
commented
We can set up a redirect on Alternatively you could override the nginx config to listen on the subdirectory `webmail` is currently a directory of multiple email clients, but the roundcube module in nixos listens on `/` path on this host so this should probably be a service domain like `roundcube.pvv.ntnu.no`
We can set up a redirect on `webmail.pvv.ntnu.no/roundcube` later to keep old links/bookmarks working
Alternatively you could override the nginx config to listen on the subdirectory
|
||||
in
|
||||
{
|
||||
services.roundcube = {
|
||||
enable = true;
|
||||
|
||||
package = pkgs.roundcube.withPlugins (plugins: with plugins; [
|
||||
persistent_login
|
||||
thunderbird_labels
|
||||
contextmenu
|
||||
custom_from
|
||||
]);
|
||||
|
||||
dicts = with pkgs.aspellDicts; [ en en-science en-computers nb nn fr de it ];
|
||||
danio
commented
We are no longer using starttls We are no longer using starttls
|
||||
maxAttachmentSize = 20;
|
||||
hostName = "roundcubeplaceholder.example.com";
|
||||
|
||||
extraConfig = ''
|
||||
$config['enable_installer'] = false;
|
||||
danio
commented
nit: comments should be dropped nit: comments should be dropped
|
||||
$config['default_host'] = "ssl://imap.pvv.ntnu.no";
|
||||
danio marked this conversation as resolved
Outdated
danio
commented
We have SSL smtp which we should probably use over STARTTLS on 25 We have SSL smtp which we should probably use over STARTTLS on 25
adriangl
commented
Sure. I only copied our current roundcube config and worked a bit on it to work. Sure. I only copied our current roundcube config and worked a bit on it to work.
|
||||
$config['default_port'] = 993;
|
||||
$config['smtp_server'] = "ssl://smtp.pvv.ntnu.no";
|
||||
$config['smtp_port'] = 465;
|
||||
$config['mail_domain'] = "pvv.ntnu.no";
|
||||
$config['smtp_user'] = "%u";
|
||||
$config['support_url'] = "";
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."roundcubeplaceholder.example.com" = lib.mkForce { };
|
||||
danio marked this conversation as resolved
Outdated
danio
commented
nginx is what listens on these ports, and that is managed somewhere else so this should be removed nginx is what listens on these ports, and that is managed somewhere else so this should be removed
|
||||
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
locations."/roundcube" = {
|
||||
tryFiles = "$uri $uri/ =404";
|
||||
index = "index.php";
|
||||
root = pkgs.runCommandLocal "roundcube-dir" { } ''
|
||||
mkdir -p $out
|
||||
ln -s ${cfg.package} $out/roundcube
|
||||
'';
|
||||
extraConfig = ''
|
||||
location ~ ^/roundcube/(${builtins.concatStringsSep "|" [
|
||||
# https://wiki.archlinux.org/title/Roundcube
|
||||
"README"
|
||||
"INSTALL"
|
||||
"LICENSE"
|
||||
"CHANGELOG"
|
||||
"UPGRADING"
|
||||
"bin"
|
||||
"SQL"
|
||||
".+\\.md"
|
||||
"\\."
|
||||
"config"
|
||||
"temp"
|
||||
"logs"
|
||||
]})/? {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location ~ ^/roundcube/(.+\.php)(/?.*)$ {
|
||||
fastcgi_split_path_info ^/roundcube(/.+\.php)(/.+)$;
|
||||
include ${config.services.nginx.package}/conf/fastcgi_params;
|
||||
include ${config.services.nginx.package}/conf/fastcgi.conf;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools.roundcube.socket};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user
praise: Thanks for putting it in a folder like this!