This commit is contained in:
Robin Appelman 2026-03-26 16:45:18 +01:00
commit fbb10546a9
9 changed files with 778 additions and 413 deletions

1098
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -2,26 +2,27 @@
name = "tasproxy" name = "tasproxy"
version = "0.1.0" version = "0.1.0"
authors = ["Robin Appelman <robin@icewind.nl>"] authors = ["Robin Appelman <robin@icewind.nl>"]
edition = "2018" edition = "2024"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
repository = "https://codeberg.org/icewind/tasproxy" repository = "https://codeberg.org/icewind/tasproxy"
rust-version = "1.85.0"
[dependencies] [dependencies]
rumqttc = "0.24.0" rumqttc = "0.25.1"
tokio = { version = "1.41.0", features = ["macros", "rt-multi-thread", "signal"] } tokio = { version = "1.50.0", features = ["macros", "rt-multi-thread", "signal"] }
futures-util = "0.3.31" futures-util = "0.3.32"
dashmap = "6.1.0" dashmap = "6.1.0"
json = "0.12.4" json = "0.12.4"
warp = "0.3.7" warp = "0.3.7"
dotenv = "0.15.0" dotenv = "0.15.0"
color-eyre = "0.6.3" color-eyre = "0.6.5"
async-stream = "0.3.6" async-stream = "0.3.6"
pin-utils = "0.1.0" pin-utils = "0.1.0"
hostname = "0.4.0" hostname = "0.4.2"
warp-reverse-proxy = { version = "1.0.0", default-features = false, features = ["rustls-tls"] } warp-reverse-proxy = { version = "1.0.0", default-features = false, features = ["rustls-tls"] }
tokio-stream = { version = "0.1.16", features = ["net"] } tokio-stream = { version = "0.1.18", features = ["net"] }
base64 = "0.22.1" base64 = "0.22.1"
secretfile = "0.1.0" secretfile = "0.1.1"
serde = { version = "1.0.213", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] }
toml = "0.8.19" toml = "1.1.0"
clap = { version = "4.5.20", features = ["derive"] } clap = { version = "4.6.0", features = ["derive"] }

34
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"crane": { "crane": {
"locked": { "locked": {
"lastModified": 1742394900, "lastModified": 1774313767,
"narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", "narHash": "sha256-hy0XTQND6avzGEUFrJtYBBpFa/POiiaGBr2vpU6Y9tY=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", "rev": "3d9df76e29656c679c744968b17fbaf28f0e923d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748868585, "lastModified": 1774271954,
"narHash": "sha256-DrrbahOQAwvNM8l5EuGxxkVS7X5/S59zcG0N9ZWQFhk=", "narHash": "sha256-FbvMOykx7f7uEPdRVzUSABnLjqCdEp22wa0nDkuEd3s=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flakelight", "repo": "flakelight",
"rev": "dfbecd12d99c1bf82906521a6a7d5b75d2aa1ca2", "rev": "c90878b309508083094f465d6aa11b3963f48b9f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -44,11 +44,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1748205441, "lastModified": 1774538603,
"narHash": "sha256-W+UUBT/l1DSTZo5G43494mRNNspJ2i9jW2QELC9JuMQ=", "narHash": "sha256-IG0fOFNUjselW61zc/jOZU3abmt7FjcRdES9SXeHun4=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "dac3b74a89cebbeb21cc6602e4a346604adbee8b", "rev": "0ef9ce3384617243e1b9e94a7057f879f621f014",
"revCount": 49, "revCount": 69,
"type": "git", "type": "git",
"url": "https://codeberg.org/icewind/mill-scale" "url": "https://codeberg.org/icewind/mill-scale"
}, },
@ -59,16 +59,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1748708770, "lastModified": 1774388614,
"narHash": "sha256-q8jG2HJWgooWa9H0iatZqBPF3bp0504e05MevFmnFLY=", "narHash": "sha256-tFwzTI0DdDzovdE9+Ras6CUss0yn8P9XV4Ja6RjA+nU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a59eb7800787c926045d51b70982ae285faa2346", "rev": "1073dad219cb244572b74da2b20c7fe39cb3fa9e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-25.05", "ref": "nixos-25.11",
"type": "indirect" "type": "indirect"
} }
}, },
@ -88,11 +88,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742697269, "lastModified": 1774535687,
"narHash": "sha256-Lpp0XyAtIl1oGJzNmTiTGLhTkcUjwSkEb0gOiNzYFGM=", "narHash": "sha256-dpKS/8+uB0EoI4mCrpio+xs8Xxry6ZhLLwV8VIbbfrs=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "01973c84732f9275c50c5f075dd1f54cc04b3316", "rev": "75900435aa883f84b038316864b3f60956681523",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,6 +1,6 @@
{ {
inputs = { inputs = {
nixpkgs.url = "nixpkgs/nixos-25.05"; nixpkgs.url = "nixpkgs/nixos-25.11";
flakelight = { flakelight = {
url = "github:nix-community/flakelight"; url = "github:nix-community/flakelight";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -13,11 +13,13 @@
outputs = {mill-scale, ...}: outputs = {mill-scale, ...}:
mill-scale ./. { mill-scale ./. {
packages = { packages = {
tasproxy = import ./package.nix; tasproxy = pkgs: pkgs.tasproxy;
docker = import ./docker.nix; docker = pkgs: pkgs.docker;
}; };
withOverlays = import ./overlay.nix; withOverlays = [
(import ./nix/overlay.nix)
];
nixosModules = {outputs, ...}: { nixosModules = {outputs, ...}: {
default = { default = {
@ -26,9 +28,9 @@
lib, lib,
... ...
}: { }: {
imports = [./module.nix]; imports = [./nix/module.nix];
config = lib.mkIf config.services.tasproxy.enable { config = lib.mkIf config.services.tasproxy.enable {
nixpkgs.overlays = [(import ./overlay.nix)]; nixpkgs.overlays = [(import ./nix/overlay.nix)];
services.tasproxy.package = lib.mkDefault pkgs.tasproxy; services.tasproxy.package = lib.mkDefault pkgs.tasproxy;
}; };
}; };

20
nix/package.nix Normal file
View file

@ -0,0 +1,20 @@
{
rustPlatform,
lib,
}: let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?"];
version = (fromTOML (readFile ../Cargo.toml)).package.version;
in
rustPlatform.buildRustPackage rec {
pname = "tasproxy";
inherit src version;
cargoLock = {
lockFile = ../Cargo.lock;
};
meta.mainProgram = "tasproxy";
}

View file

@ -1,18 +0,0 @@
{
stdenv,
rustPlatform,
lib,
}: let
inherit (lib.sources) sourceByRegex;
src = sourceByRegex ./. ["Cargo.*" "(src)(/.*)?"];
in
rustPlatform.buildRustPackage rec {
pname = "tasproxy";
version = "0.1.0";
inherit src;
cargoLock = {
lockFile = ./Cargo.lock;
};
}