warpgate: init at 0.17.0
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
diff --git a/.cargo/config.toml b/.cargo/config.toml
|
||||
index 8ab4225..8e0c812 100644
|
||||
--- a/.cargo/config.toml
|
||||
+++ b/.cargo/config.toml
|
||||
@@ -1,8 +1,5 @@
|
||||
# https://github.com/rust-lang/cargo/issues/5376#issuecomment-2163350032
|
||||
[target.'cfg(all())']
|
||||
rustflags = [
|
||||
- "--cfg", "tokio_unstable",
|
||||
- "-Zremap-cwd-prefix=/reproducible-cwd",
|
||||
- "--remap-path-prefix=$HOME=/reproducible-home",
|
||||
- "--remap-path-prefix=$PWD=/reproducible-pwd",
|
||||
+ "--cfg", "tokio_unstable"
|
||||
]
|
||||
14
pkgs/by-name/wa/warpgate/hardcode-version.patch
Normal file
14
pkgs/by-name/wa/warpgate/hardcode-version.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git a/warpgate-common/src/version.rs b/warpgate-common/src/version.rs
|
||||
index 07db547..2a7967f 100644
|
||||
--- a/warpgate-common/src/version.rs
|
||||
+++ b/warpgate-common/src/version.rs
|
||||
@@ -1,8 +1,3 @@
|
||||
-use git_version::git_version;
|
||||
-
|
||||
pub fn warpgate_version() -> &'static str {
|
||||
- git_version!(
|
||||
- args = ["--tags", "--always", "--dirty=-modified"],
|
||||
- fallback = "unknown"
|
||||
- )
|
||||
+ "v@version@"
|
||||
}
|
||||
78
pkgs/by-name/wa/warpgate/package.nix
Normal file
78
pkgs/by-name/wa/warpgate/package.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
lib,
|
||||
replaceVars,
|
||||
fetchurl,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
buildNpmPackage,
|
||||
openapi-generator-cli,
|
||||
nixosTests,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (
|
||||
finalAttrs:
|
||||
let
|
||||
warpgate-web = buildNpmPackage {
|
||||
pname = "${finalAttrs.pname}-web";
|
||||
version = finalAttrs.version;
|
||||
|
||||
src = finalAttrs.src;
|
||||
sourceRoot = "${finalAttrs.src.name}/warpgate-web";
|
||||
|
||||
patches = [ ./web-ui-package-json.patch ];
|
||||
|
||||
npmDepsHash = "sha256-1zCxKAH2IAKSFdL8Pyd8dJi0i8Y5mgYcWNKVpiQszc0=";
|
||||
|
||||
nativeBuildInputs = [ openapi-generator-cli ];
|
||||
|
||||
preBuild = "rm node_modules/.bin/openapi-generator-cli";
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
cp -R dist $out
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
pname = "warpgate";
|
||||
version = "0.17.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "warp-tech";
|
||||
repo = "warpgate";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-nr0z8c0o5u4Rqs9pFUaxnasRHUhwT3qQe5+JNV+LObg=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-pIr5Z7rp+dYOuKYnlsBdya6MqAdL0U2gUhwXvLfmM34=";
|
||||
|
||||
patches = [
|
||||
(replaceVars ./hardcode-version.patch { inherit (finalAttrs) version; })
|
||||
./disable-rust-reproducible-build.patch
|
||||
];
|
||||
|
||||
buildFeatures = [
|
||||
"postgres"
|
||||
"mysql"
|
||||
"sqlite"
|
||||
];
|
||||
|
||||
preBuild = ''ln -rs "${warpgate-web}" warpgate-web/dist'';
|
||||
|
||||
# skip check, project included tests require python stuff and docker
|
||||
doCheck = false;
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) warpgate;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Smart SSH, HTTPS, MySQL and Postgres bastion that requires no additional client-side software";
|
||||
homepage = "https://warpgate.null.page";
|
||||
license = lib.licenses.asl20;
|
||||
platforms = lib.platforms.linux;
|
||||
mainProgram = "warpgate";
|
||||
maintainers = with lib.maintainers; [ alemonmk ];
|
||||
};
|
||||
}
|
||||
)
|
||||
15
pkgs/by-name/wa/warpgate/web-ui-package-json.patch
Normal file
15
pkgs/by-name/wa/warpgate/web-ui-package-json.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
diff --git a/package.json b/package.json
|
||||
index 54125c3..6942dfb 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -12,8 +12,8 @@
|
||||
"postinstall": "npm run openapi:client:gateway && npm run openapi:client:admin",
|
||||
"openapi:schema:gateway": "cargo run -p warpgate-protocol-http > src/gateway/lib/openapi-schema.json",
|
||||
"openapi:schema:admin": "cargo run -p warpgate-admin > src/admin/lib/openapi-schema.json",
|
||||
- "openapi:client:gateway": "openapi-generator-cli generate -g typescript-fetch -i src/gateway/lib/openapi-schema.json -o src/gateway/lib/api-client -p npmName=warpgate-gateway-api-client -p useSingleRequestParameter=true && cd src/gateway/lib/api-client && npm i typescript@5 && npm i && npx tsc --target esnext --module esnext && rm -rf src tsconfig.json",
|
||||
- "openapi:client:admin": "openapi-generator-cli generate -g typescript-fetch -i src/admin/lib/openapi-schema.json -o src/admin/lib/api-client -p npmName=warpgate-admin-api-client -p useSingleRequestParameter=true && cd src/admin/lib/api-client && npm i typescript@5 && npm i && npx tsc --target esnext --module esnext && rm -rf src tsconfig.json",
|
||||
+ "openapi:client:gateway": "openapi-generator-cli generate -g typescript-fetch -i src/gateway/lib/openapi-schema.json -o src/gateway/lib/api-client -p npmName=warpgate-gateway-api-client -p useSingleRequestParameter=true && ln -sr node_modules src/gateway/lib/api-client/node_modules && cd src/gateway/lib/api-client && npx tsc --target esnext --module esnext && rm -rf src tsconfig.json",
|
||||
+ "openapi:client:admin": "openapi-generator-cli generate -g typescript-fetch -i src/admin/lib/openapi-schema.json -o src/admin/lib/api-client -p npmName=warpgate-admin-api-client -p useSingleRequestParameter=true && ln -sr node_modules src/admin/lib/api-client/node_modules && cd src/admin/lib/api-client && npx tsc --target esnext --module esnext && rm -rf src tsconfig.json",
|
||||
"openapi:tests-sdk": "openapi-generator-cli generate -g python -i src/admin/lib/openapi-schema.json -o ../tests/api_sdk",
|
||||
"openapi": "npm run openapi:schema:admin && npm run openapi:schema:gateway && npm run openapi:client:admin && npm run openapi:client:gateway"
|
||||
},
|
||||
Reference in New Issue
Block a user