Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 13, 2022
2 parents 477cc94 + 1976810 commit bcb22e9
Show file tree
Hide file tree
Showing 108 changed files with 3,182 additions and 673 deletions.
47 changes: 47 additions & 0 deletions nixos/doc/manual/from_md/release-notes/rl-2205.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@
<link linkend="opt-services.tetrd.enable">services.tetrd</link>.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://upterm.dev">uptermd</link>, an
open-source solution for sharing terminal sessions instantly
over the public internet via secure tunnels. Available at
<link linkend="opt-services.uptermd.enable">services.uptermd</link>.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/mbrubeck/agate">agate</link>,
Expand Down Expand Up @@ -1879,6 +1887,37 @@
during the time when the timer was inactive.
</para>
</listitem>
<listitem>
<para>
Mastodon now uses <literal>services.redis.servers</literal> to
start a new redis server, instead of using a global redis
server. This improves compatibility with other services that
use redis.
</para>
<para>
Note that this will recreate the redis database, although
according to the
<link xlink:href="https://docs.joinmastodon.org/admin/backups/">Mastodon
docs</link>, this is almost harmless:
</para>
<blockquote>
<para>
Losing the Redis database is almost harmless: The only
irrecoverable data will be the contents of the Sidekiq
queues and scheduled retries of previously failed jobs. The
home and list feeds are stored in Redis, but can be
regenerated with tootctl.
</para>
</blockquote>
<para>
If you do want to save the redis database, you can use the
following commands:
</para>
<programlisting language="bash">
redis-cli save
cp /var/lib/redis/dump.rdb &quot;/var/lib/redis-mastodon/dump.rdb&quot;
</programlisting>
</listitem>
<listitem>
<para>
If you are using Wayland you can choose to use the Ozone
Expand Down Expand Up @@ -2413,6 +2452,14 @@
desktop environments as needed.
</para>
</listitem>
<listitem>
<para>
<literal>mercury</literal> was updated to 22.01.1, which has
some breaking changes
(<link xlink:href="https://dl.mercurylang.org/release/release-notes-22.01.html">Mercury
22.01 news</link>).
</para>
</listitem>
<listitem>
<para>
xfsprogs was update to version 5.15, which enables inobtcount
Expand Down
18 changes: 18 additions & 0 deletions nixos/doc/manual/release-notes/rl-2205.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ In addition to numerous new and upgraded packages, this release has the followin

- [tetrd](https://tetrd.app), share your internet connection from your device to your PC and vice versa through a USB cable. Available at [services.tetrd](#opt-services.tetrd.enable).

- [uptermd](https://upterm.dev), an open-source solution for sharing terminal sessions instantly over the public internet via secure tunnels. Available at [services.uptermd](#opt-services.uptermd.enable).

- [agate](https://github.com/mbrubeck/agate), a very simple server for the Gemini hypertext protocol. Available as [services.agate](options.html#opt-services.agate.enable).

- [ArchiSteamFarm](https://github.com/JustArchiNET/ArchiSteamFarm), a C# application with primary purpose of idling Steam cards from multiple accounts simultaneously. Available as [services.archisteamfarm](options.html#opt-services.archisteamfarm.enable).
Expand Down Expand Up @@ -699,6 +701,20 @@ In addition to numerous new and upgraded packages, this release has the followin
By default auto-upgrade will now run immediately if it would have been triggered at least
once during the time when the timer was inactive.

- Mastodon now uses `services.redis.servers` to start a new redis server, instead of using a global redis server.
This improves compatibility with other services that use redis.

Note that this will recreate the redis database, although according to the [Mastodon docs](https://docs.joinmastodon.org/admin/backups/),
this is almost harmless:
> Losing the Redis database is almost harmless: The only irrecoverable data will be the contents of the Sidekiq queues and scheduled retries of previously failed jobs.
> The home and list feeds are stored in Redis, but can be regenerated with tootctl.
If you do want to save the redis database, you can use the following commands:
```bash
redis-cli save
cp /var/lib/redis/dump.rdb "/var/lib/redis-mastodon/dump.rdb"
```

- If you are using Wayland you can choose to use the Ozone Wayland support
in Chrome and several Electron apps by setting the environment variable
`NIXOS_OZONE_WL=1` (for example via
Expand Down Expand Up @@ -860,6 +876,8 @@ In addition to numerous new and upgraded packages, this release has the followin

- The polkit service, available at `security.polkit.enable`, is now disabled by default. It will automatically be enabled through services and desktop environments as needed.

- `mercury` was updated to 22.01.1, which has some breaking changes ([Mercury 22.01 news](https://dl.mercurylang.org/release/release-notes-22.01.html)).

- xfsprogs was update to version 5.15, which enables inobtcount and bigtime by default on filesystem creation. Support for these features was added in kernel 5.10 and deemed stable in kernel 5.15.
If you want to be able to mount XFS filesystems created with this release of xfsprogs on kernel releases older than 5.10, you need to format them with `mkfs.xfs -m bigtime=0 -m inobtcount=0`.

Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@
./services/networking/unifi.nix
./services/video/unifi-video.nix
./services/video/rtsp-simple-server.nix
./services/networking/uptermd.nix
./services/networking/v2ray.nix
./services/networking/vsftpd.nix
./services/networking/wasabibackend.nix
Expand Down
106 changes: 106 additions & 0 deletions nixos/modules/services/networking/uptermd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.uptermd;
in
{
options = {
services.uptermd = {
enable = mkEnableOption "uptermd";

openFirewall = mkOption {
type = types.bool;
default = false;
description = ''
Whether to open the firewall for the port in <option>services.uptermd.port</option>.
'';
};

port = mkOption {
type = types.port;
default = 2222;
description = ''
Port the server will listen on.
'';
};

listenAddress = mkOption {
type = types.str;
default = "[::]";
example = "127.0.0.1";
description = ''
Address the server will listen on.
'';
};

hostKey = mkOption {
type = types.nullOr types.path;
default = null;
example = "/run/keys/upterm_host_ed25519_key";
description = ''
Path to SSH host key. If not defined, an ed25519 keypair is generated automatically.
'';
};

extraFlags = mkOption {
type = types.listOf types.str;
default = [];
example = [ "--debug" ];
description = ''
Extra flags passed to the uptermd command.
'';
};
};
};

config = mkIf cfg.enable {
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
};

systemd.services.uptermd = {
description = "Upterm Daemon";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];

path = [ pkgs.openssh ];

preStart = mkIf (cfg.hostKey == null) ''
if ! [ -f ssh_host_ed25519_key ]; then
ssh-keygen \
-t ed25519 \
-f ssh_host_ed25519_key \
-N ""
fi
'';

serviceConfig = {
StateDirectory = "uptermd";
WorkingDirectory = "/var/lib/uptermd";
ExecStart = "${pkgs.upterm}/bin/uptermd --ssh-addr ${cfg.listenAddress}:${toString cfg.port} --private-key ${if cfg.hostKey == null then "ssh_host_ed25519_key" else cfg.hostKey} ${concatStringsSep " " cfg.extraFlags}";

# Hardening
AmbientCapabilities = mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
CapabilityBoundingSet = mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
PrivateUsers = cfg.port >= 1024;
LockPersonality = true;
MemoryDenyWriteExecute = true;
PrivateDevices = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
RestrictRealtime = true;
SystemCallArchitectures = "native";
SystemCallFilter = "@system-service";
};
};
};
}
2 changes: 2 additions & 0 deletions nixos/modules/services/web-apps/atlassian/confluence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ in
User = cfg.user;
Group = cfg.group;
PrivateTmp = true;
Restart = "on-failure";
RestartSec = "10";
ExecStart = "${pkg}/bin/start-confluence.sh -fg";
ExecStop = "${pkg}/bin/stop-confluence.sh";
};
Expand Down
2 changes: 2 additions & 0 deletions nixos/modules/services/web-apps/atlassian/crowd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ in
User = cfg.user;
Group = cfg.group;
PrivateTmp = true;
Restart = "on-failure";
RestartSec = "10";
ExecStart = "${pkg}/start_crowd.sh -fg";
};
};
Expand Down
2 changes: 2 additions & 0 deletions nixos/modules/services/web-apps/atlassian/jira.nix
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ in
User = cfg.user;
Group = cfg.group;
PrivateTmp = true;
Restart = "on-failure";
RestartSec = "10";
ExecStart = "${pkg}/bin/start-jira.sh -fg";
ExecStop = "${pkg}/bin/stop-jira.sh";
};
Expand Down
6 changes: 4 additions & 2 deletions nixos/modules/services/web-apps/mastodon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ in {
port = lib.mkOption {
description = "Redis port.";
type = lib.types.port;
default = 6379;
default = 31637;
};
};

Expand Down Expand Up @@ -605,8 +605,10 @@ in {
enable = true;
hostname = lib.mkDefault "${cfg.localDomain}";
};
services.redis = lib.mkIf (cfg.redis.createLocally && cfg.redis.host == "127.0.0.1") {
services.redis.servers.mastodon = lib.mkIf (cfg.redis.createLocally && cfg.redis.host == "127.0.0.1") {
enable = true;
port = cfg.redis.port;
bind = "127.0.0.1";
};
services.postgresql = lib.mkIf databaseActuallyCreateLocally {
enable = true;
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ in
unifi = handleTest ./unifi.nix {};
unit-php = handleTest ./web-servers/unit-php.nix {};
upnp = handleTest ./upnp.nix {};
uptermd = handleTest ./uptermd.nix {};
usbguard = handleTest ./usbguard.nix {};
user-activation-scripts = handleTest ./user-activation-scripts.nix {};
uwsgi = handleTest ./uwsgi.nix {};
Expand Down
62 changes: 62 additions & 0 deletions nixos/tests/uptermd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import ./make-test-python.nix ({ pkgs, ...}:

let
client = {pkgs, ...}:{
environment.systemPackages = [ pkgs.upterm ];
};
in
{
name = "uptermd";
meta = with pkgs.lib.maintainers; {
maintainers = [ fleaz ];
};

nodes = {
server = {config, ...}: {
services.uptermd = {
enable = true;
openFirewall = true;
port = 1337;
};
};
client1 = client;
client2 = client;
};


testScript = ''
start_all()
server.wait_for_unit("uptermd.service")
server.wait_for_unit("network-online.target")
# Add SSH hostkeys from the server to both clients
# uptermd needs an '@cert-authority entry so we need to modify the known_hosts file
client1.execute("sleep 3; mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls")
client1.execute("echo @cert-authority $(cat ~/.ssh/known_hosts) > ~/.ssh/known_hosts")
client2.execute("sleep 3; mkdir -p ~/.ssh && ssh -o StrictHostKeyChecking=no -p 1337 server ls")
client2.execute("echo @cert-authority $(cat ~/.ssh/known_hosts) > ~/.ssh/known_hosts")
client1.wait_for_unit("multi-user.target")
client1.wait_until_succeeds("pgrep -f 'agetty.*tty1'")
client1.wait_until_tty_matches(1, "login: ")
client1.send_chars("root\n")
client1.wait_until_succeeds("pgrep -u root bash")
client1.execute("ssh-keygen -t ed25519 -N \"\" -f /root/.ssh/id_ed25519")
client1.send_chars("TERM=xterm upterm host --server ssh://server:1337 --force-command hostname -- bash > /tmp/session-details\n")
client1.wait_for_file("/tmp/session-details")
client1.send_key("q")
# uptermd can't connect if we don't have a keypair
client2.execute("ssh-keygen -t ed25519 -N \"\" -f /root/.ssh/id_ed25519")
# Grep the ssh connect command from the output of 'upterm host'
ssh_command = client1.succeed("grep 'SSH Session' /tmp/session-details | cut -d':' -f2-").strip()
# Connect with client2. Because we used '--force-command hostname' we should get "client1" as the output
output = client2.succeed(ssh_command)
assert output.strip() == "client1"
'';
})
1 change: 1 addition & 0 deletions pkgs/applications/audio/clementine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ let
gettext
glew
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-bad
gst_all_1.gstreamer
gvfs
libechonest
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/noisetorch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

buildGoModule rec {
pname = "NoiseTorch";
version = "0.11.4";
version = "0.11.5";

src = fetchFromGitHub {
owner = "lawl";
repo = "NoiseTorch";
rev = version;
sha256 = "sha256-3+Yk7dqD7eyvd1I5CMmrg085ZtFxD2EnGqL5ttwx8eM=";
sha256 = "sha256-j/6XB3vA5LvTuCxmeB0HONqEDzYg210AWW/h3nCGOD8=";
};

vendorSha256 = null;
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/backup/vorta/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

python3Packages.buildPythonApplication rec {
pname = "vorta";
version = "0.8.3";
version = "0.8.4";

src = fetchFromGitHub {
owner = "borgbase";
repo = "vorta";
rev = "v${version}";
sha256 = "06sb24pimq9ckdkp9hzp4r9d3i21kxacsx5b7x9q99qcwf7h6372";
rev = "refs/tags/v${version}";
sha256 = "sha256-eS/+7s9KgGCEhA6NgIzPlGM1daP+Ir2d1mmqse4YbIE=";
};

nativeBuildInputs = [ wrapQtAppsHook ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/pinegrow/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
version = "6.5";

src = fetchurl {
url = "https://github.com/Pinegrow/PinegrowReleases/releases/download/pg${version}/PinegrowLinux64.${version}.zip";
url = "https://download.pinegrow.com/PinegrowLinux64.${version}.zip";
sha256 = "1l7cf5jgidpykaf68mzf92kywl1vxwl3fg43ibgr2rg4cnl1g82b";
};

Expand Down
Loading

0 comments on commit bcb22e9

Please sign in to comment.