ma share: proxy hetzner via gum

This commit is contained in:
makefu 2022-09-23 23:01:58 +02:00
parent 0c334ea99c
commit f66a4cb237
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
4 changed files with 26 additions and 17 deletions

View File

@ -2,21 +2,28 @@
let let
automount_opts = automount_opts =
[ "x-systemd.automount" [ "x-systemd.automount" "noauto"
"noauto" "x-systemd.idle-timeout=600" "x-systemd.idle-timeout=300"
"x-systemd.device-timeout=5s" "x-systemd.mount-timeout=60s"
"x-systemd.mount-timeout=5s"
]; ];
host = "nextgum"; #TODO host = "gum"; #TODO
in { in {
fileSystems."/media/download" = { boot.extraModprobeConfig = ''
device = "//${host}/download"; options cifs CIFSMaxBufSize=130048
'';
fileSystems."/media/cloud" = {
device = "//${host}/cloud-proxy";
fsType = "cifs"; fsType = "cifs";
options = automount_opts ++ options = automount_opts ++
[ "credentials=/var/src/secrets/download.smb" [ "credentials=/var/src/secrets/download.smb"
"file_mode=0775" "file_mode=0775"
"dir_mode=0775" "dir_mode=0775"
"uid=9001" "bsize=8388608"
"fsc"
"rsize=130048"
"cache=loose"
"uid=${toString config.users.users.download.uid}"
"gid=${toString config.users.groups.download.gid}"
"vers=3" "vers=3"
]; ];
}; };

View File

@ -1,6 +1,5 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with import <stockholm/lib>;
let let
hostname = config.krebs.build.host.name; hostname = config.krebs.build.host.name;
in { in {
@ -11,15 +10,11 @@ in {
# home = "/var/empty"; # home = "/var/empty";
# }; # };
environment.systemPackages = [ pkgs.samba ]; environment.systemPackages = [ pkgs.samba ];
users.users.download = {
uid = genid "download";
isNormalUser = true;
};
services.samba = { services.samba = {
enable = true; enable = true;
shares = { shares = {
download = { cloud-proxy = {
path = "/var/download"; path = "/media/cloud";
"read only" = "no"; "read only" = "no";
browseable = "yes"; browseable = "yes";
"guest ok" = "no"; "guest ok" = "no";

View File

@ -21,11 +21,12 @@ in {
"dir_mode=0770" "dir_mode=0770"
"uid=${toString config.users.users.download.uid}" "uid=${toString config.users.users.download.uid}"
"gid=${toString config.users.groups.download.gid}" "gid=${toString config.users.groups.download.gid}"
#"vers=3" "vers=3"
"vers=2.1" #"vers=2.1"
"rsize=65536" "rsize=65536"
"wsize=130048" "wsize=130048"
"iocharset=utf8" "iocharset=utf8"
"cache=loose"
]; ];
}; };
} }

View File

@ -87,6 +87,12 @@ in {
"guest ok" = "no"; "guest ok" = "no";
"valid users" = "makefu"; "valid users" = "makefu";
}; };
#cloud = {
# path = "/media/cloud/download/finished";
# "read only" = "no";
# browseable = "yes";
# "guest ok" = "yes";
#};
}; };
extraConfig = '' extraConfig = ''
guest account = smbguest guest account = smbguest