From 840d99089c1cb06e718707b61f73faabe40cbeab Mon Sep 17 00:00:00 2001 From: C0ffeeCode Date: Wed, 9 Oct 2024 11:47:55 +0200 Subject: [PATCH] CI&Docs: Also build&test Linux, update docs --- .gitlab-ci.yml | 16 +++++++++++++++- .vscode/launch.json | 13 +++++++++++++ README.md | 3 +++ src/sys/redox.rs | 7 +++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82f7bba..82bf126 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: "redoxos/redoxer" +image: "docker.io/redoxos/redoxer" stages: - build @@ -17,3 +17,17 @@ test:redox: dependencies: - build:redox script: redoxer test --verbose + +build:linux: + stage: build + image: docker.io/library/rust:alpine + script: + - apk add musl-dev + - cargo build --verbose + +test:linux: + stage: test + image: docker.io/library/rust:alpine + dependencies: + - build:linux + script: cargo test --verbose \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 482b275..950a6bf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -46,6 +46,19 @@ "-f" ], "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Cargo test", + "cargo": { + "args": [ + "test", + "--no-run", + "--tests" + ] + }, + "args": [] } ] } \ No newline at end of file diff --git a/README.md b/README.md index 0eac241..0ffdeec 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ Currently implemented features, ordered by priority: - [ ] Authentication and executing as a specific user - [ ] Password validation (not hardcoded) - [ ] SSH keys +- Key file formats + - [x] Something custom + - [ ] OpenSSH keys - [ ] Port forwarding - [ ] SCP File Transfers diff --git a/src/sys/redox.rs b/src/sys/redox.rs index 0fdd0c5..a4ad00c 100644 --- a/src/sys/redox.rs +++ b/src/sys/redox.rs @@ -1,5 +1,6 @@ use std::io::Result; use std::os::unix::io::RawFd; +use std::os::fd::AsRawFd; use std::path::PathBuf; pub fn before_exec() -> Result<()> { @@ -32,3 +33,9 @@ pub fn getpty() -> (RawFd, PathBuf) { }), ) } + +/// Sets the file descriptor to non-blocking mode. +/// This uses the **`unsafe`** keyword +pub fn non_blockify_reader(obj: &impl AsRawFd) { + todo!(); +}