Merge pull request 'waypipe: mark only supported on Linux' (#2573) from sandbox into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/2573
This commit is contained in:
5
docs/README.md
Normal file
5
docs/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Serve documentation locally
|
||||||
|
|
||||||
|
```
|
||||||
|
$ nix develop .#docs -c mkdocs serve
|
||||||
|
```
|
||||||
@@ -11,8 +11,11 @@
|
|||||||
treefmt.programs.nixfmt.enable = true;
|
treefmt.programs.nixfmt.enable = true;
|
||||||
treefmt.programs.nixfmt.package = pkgs.nixfmt-rfc-style;
|
treefmt.programs.nixfmt.package = pkgs.nixfmt-rfc-style;
|
||||||
treefmt.programs.deadnix.enable = true;
|
treefmt.programs.deadnix.enable = true;
|
||||||
|
treefmt.programs.clang-format.enable = true;
|
||||||
treefmt.settings.global.excludes = [
|
treefmt.settings.global.excludes = [
|
||||||
"*.png"
|
"*.png"
|
||||||
|
"*.svg"
|
||||||
|
"package-lock.json"
|
||||||
"*.jpeg"
|
"*.jpeg"
|
||||||
"*.gitignore"
|
"*.gitignore"
|
||||||
".vscode/*"
|
".vscode/*"
|
||||||
@@ -24,6 +27,44 @@
|
|||||||
"*.age"
|
"*.age"
|
||||||
"*.list"
|
"*.list"
|
||||||
"*.desktop"
|
"*.desktop"
|
||||||
|
# ignore symlink
|
||||||
|
"docs/site/manual/contribute.md"
|
||||||
|
"*_test_cert"
|
||||||
|
"*_test_key"
|
||||||
|
"*/gnupg-home/*"
|
||||||
|
"*/sops/secrets/*"
|
||||||
|
"vars/*"
|
||||||
|
# prettier messes up our mkdocs flavoured markdown
|
||||||
|
"*.md"
|
||||||
|
|
||||||
|
"checks/lib/ssh/privkey"
|
||||||
|
"checks/lib/ssh/pubkey"
|
||||||
|
"checks/matrix-synapse/synapse-registration_shared_secret"
|
||||||
|
"checks/mumble/machines/peer1/facts/mumble-cert"
|
||||||
|
"checks/mumble/machines/peer2/facts/mumble-cert"
|
||||||
|
"checks/secrets/clan-secrets"
|
||||||
|
"checks/secrets/sops/groups/group/machines/machine"
|
||||||
|
"checks/syncthing/introducer/introducer_device_id"
|
||||||
|
"checks/syncthing/introducer/introducer_test_api"
|
||||||
|
"docs/site/static/asciinema-player/asciinema-player.css"
|
||||||
|
"docs/site/static/asciinema-player/asciinema-player.min.js"
|
||||||
|
"nixosModules/clanCore/vars/secret/sops/eval-tests/populated/vars/my_machine/my_generator/my_secret"
|
||||||
|
"pkgs/clan-cli/tests/data/gnupg.conf"
|
||||||
|
"pkgs/clan-cli/tests/data/password-store/.gpg-id"
|
||||||
|
"pkgs/clan-cli/tests/data/ssh_host_ed25519_key"
|
||||||
|
"pkgs/clan-cli/tests/data/sshd_config"
|
||||||
|
"pkgs/clan-vm-manager/.vscode/lhebendanz.weaudit"
|
||||||
|
"pkgs/clan-vm-manager/bin/clan-vm-manager"
|
||||||
|
"pkgs/distro-packages/vagrant_insecure_key"
|
||||||
|
"sops/secrets/test-backup-age.key/secret"
|
||||||
|
];
|
||||||
|
treefmt.settings.formatter.ruff-format.includes = [
|
||||||
|
"*/bin/clan"
|
||||||
|
"*/bin/clan-app"
|
||||||
|
"*/bin/clan-config"
|
||||||
|
];
|
||||||
|
treefmt.settings.formatter.shellcheck.includes = [
|
||||||
|
"scripts/pre-commit"
|
||||||
];
|
];
|
||||||
treefmt.programs.prettier = {
|
treefmt.programs.prettier = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -32,6 +73,7 @@
|
|||||||
"*.css"
|
"*.css"
|
||||||
"*.html"
|
"*.html"
|
||||||
"*.js"
|
"*.js"
|
||||||
|
"*.json"
|
||||||
"*.json5"
|
"*.json5"
|
||||||
"*.jsx"
|
"*.jsx"
|
||||||
"*.mdx"
|
"*.mdx"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import contextlib
|
import contextlib
|
||||||
|
import platform
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
@@ -11,6 +12,9 @@ VMADDR_CID_HYPERVISOR = 2
|
|||||||
|
|
||||||
|
|
||||||
def test_vsock_port(port: int) -> bool:
|
def test_vsock_port(port: int) -> bool:
|
||||||
|
if platform.system() != "Linux":
|
||||||
|
msg = "vsock is only supported on Linux"
|
||||||
|
raise NotImplementedError(msg)
|
||||||
try:
|
try:
|
||||||
s = socket.socket(socket.AF_VSOCK, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_VSOCK, socket.SOCK_STREAM)
|
||||||
s.connect((VMADDR_CID_HYPERVISOR, port))
|
s.connect((VMADDR_CID_HYPERVISOR, port))
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#include <pwd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pwd.h>
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
typedef struct passwd *(*getpwnam_type)(const char *name);
|
typedef struct passwd *(*getpwnam_type)(const char *name);
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,7 @@
|
|||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"nixos": {
|
"nixos": {
|
||||||
"expr": "(let pkgs = import <nixpkgs> { }; in (pkgs.lib.evalModules { modules
|
"expr": "(let pkgs = import <nixpkgs> { }; in (pkgs.lib.evalModules { modules = (import <nixpkgs/nixos/modules/module-list.nix>) ++ [ ({...}: { nixpkgs.hostPlatform = builtins.currentSystem;} ) ] ; })).options"
|
||||||
= (import <nixpkgs/nixos/modules/module-list.nix>) ++ [ ({...}: {
|
|
||||||
nixpkgs.hostPlatform = builtins.currentSystem;} ) ] ; })).options"
|
|
||||||
},
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"expr": "(builtins.getFlake \"github:nix-community/home-manager\").homeConfigurations.<name>.options"
|
"expr": "(builtins.getFlake \"github:nix-community/home-manager\").homeConfigurations.<name>.options"
|
||||||
|
|||||||
@@ -12,21 +12,21 @@ typedef uint32_t uid_t;
|
|||||||
};
|
};
|
||||||
#define WRAPPER(ret, name) static ret _fakeroot_wrapper_##name
|
#define WRAPPER(ret, name) static ret _fakeroot_wrapper_##name
|
||||||
#define WRAPPER_DEF(name) \
|
#define WRAPPER_DEF(name) \
|
||||||
__attribute__((used)) static struct dyld_interpose _fakeroot_interpose_##name \
|
__attribute__(( \
|
||||||
__attribute__((section("__DATA,__interpose"))) = { &_fakeroot_wrapper_##name, &name };
|
used)) static struct dyld_interpose _fakeroot_interpose_##name \
|
||||||
|
__attribute__((section("__DATA,__interpose"))) = { \
|
||||||
|
&_fakeroot_wrapper_##name, &name};
|
||||||
#else
|
#else
|
||||||
#define WRAPPER(ret, name) ret name
|
#define WRAPPER(ret, name) ret name
|
||||||
#define WRAPPER_DEF(name)
|
#define WRAPPER_DEF(name)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WRAPPER(uid_t, geteuid)(const char * path, int flags, ...)
|
WRAPPER(uid_t, geteuid)(const char *path, int flags, ...) {
|
||||||
{
|
|
||||||
return 0; // Fake root
|
return 0; // Fake root
|
||||||
}
|
}
|
||||||
WRAPPER_DEF(geteuid)
|
WRAPPER_DEF(geteuid)
|
||||||
|
|
||||||
WRAPPER(uid_t, getuid)(const char * path, int flags, ...)
|
WRAPPER(uid_t, getuid)(const char *path, int flags, ...) {
|
||||||
{
|
|
||||||
return 0; // Fake root
|
return 0; // Fake root
|
||||||
}
|
}
|
||||||
WRAPPER_DEF(getuid)
|
WRAPPER_DEF(getuid)
|
||||||
|
|||||||
Reference in New Issue
Block a user