From 77fbcb9b31636401dc2770faa9c0e5f194b47fd3 Mon Sep 17 00:00:00 2001 From: Nova Date: Sat, 23 Nov 2024 13:22:49 +0100 Subject: [PATCH] #1 fix and #3 fix for edge --- README.md | 12 ++++++++++++ kverinfo.txt | 2 +- main.py | 8 ++++---- sh.py | 6 +++--- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 337cc60..f59af45 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,26 @@ Linux only scripts. ### The 4 branches Which branch works best for you? + + Well, that's pretty simple. We have 4 branches (`main`, `next`, `edge` and `no-posix`). + + If you want the most stable experience, then the `main` branch is for you. + + If you want the lastest features, but also a more stable experience (compared to `edge`), then the `next` branch is for you + + If you want the bleeding-edge and don't care about stability, then `edge` is for you. + + If you only need simple jailing and no POSIX compatibility, then `no-posix` is for you. ### Issues Please report issues [over here](https://git.novacow.ch/Nova/PyJail/issues/) + + And please check if your issue isn't a duplicate before reporting. diff --git a/kverinfo.txt b/kverinfo.txt index 9c1a8f2..5ce660f 100644 --- a/kverinfo.txt +++ b/kverinfo.txt @@ -1 +1 @@ -edge0004-base0.2.1 +edge0005-base0.2.1 diff --git a/main.py b/main.py index 1179310..b03e55c 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ """ This is the PyJail, a jailing tool for running Python apps in a sandboxed environment. -Version: edge0004-base0.2.1 +Version: edge0005-base0.2.1 """ import os import time @@ -58,10 +58,10 @@ class PyJail: msg = f"[{time.time}] [{caller}] [{log_level}] {message}" with open(self.fs("/proc/klog"), "a+") as f: f.write(msg) - if emit is True and (log_level.upper() == "ERROR" or log_level.upper() == "CRITICAL"): + if emit is True and log_level.upper() == "CRITICAL": print(msg) elif emit is True: - + print(message) return 0 def fs(self, check_path=None, resolve_symlinks=True): @@ -137,7 +137,7 @@ class PyJail: """ Returns the kernel version """ - return "edge0004-base0.2.1" + return "edge0005-base0.2.1" def netsock(self, ip, port, mode, msg): """ diff --git a/sh.py b/sh.py index 034f2a4..ae068a2 100644 --- a/sh.py +++ b/sh.py @@ -1,6 +1,6 @@ """ The shell for PyNVOS -Version: 0.2.0.0400 +Version: 0.2.0.0401 """ import importlib import os @@ -13,7 +13,7 @@ class shell(cmd.Cmd): jail_mgr = importlib.import_module(".jail_mgr", "vfs.sys") jailmgr = jail_mgr.PyJail() kver = jailmgr.kver() - intro = f"Shell started, PyNVOS {kver}" + intro = f"Shell started, PyJail {kver}" prompt = "shell-0.2$ " file = None @@ -47,7 +47,7 @@ class shell(cmd.Cmd): with open(self.jailmgr.fs(f"/usr/pkgs/metacache/{pkg}.pmd"), "r") as f: package_meta = f.read() f.close() - print(package_meta) + self.jailmgr.msg("shell.do_pkg", package_meta, True, "INFO") y_n_confirmation = input("Do you want to install this package? [y/N] ") if y_n_confirmation.lower() != "y": print("Aborted.")