Commit graph

39 commits

Author SHA1 Message Date
1b35f1099e Add -s/--shell flag and bash default for inline code execution
Matches un.c CLI behavior:
- If -s/--shell LANG is specified, treat argument as inline code
- If argument doesn't exist as a file, default to bash for inline execution
- Normal file execution unchanged
2026-01-09 09:43:44 -05:00
1cb7e2895f Revert "Add egress shielding docs with redsocks + microsocks"
This reverts commit eea492dd64.
2026-01-08 04:52:58 -05:00
623be29fb0 Revert "Add egress shielding with Makefile and systemd services"
This reverts commit 22c2a1fb8a.
2026-01-08 04:52:50 -05:00
22c2a1fb8a Add egress shielding with Makefile and systemd services 2026-01-08 04:39:18 -05:00
eea492dd64 Add egress shielding docs with redsocks + microsocks 2026-01-08 04:36:09 -05:00
50ee84be6f Fix HMAC auth for key validation in un.sh
The validate_key function was calling /keys/validate without HMAC auth
headers (X-Timestamp, X-Signature), causing auth failures.

Also updated cmd_key to accept UNSANDBOX_PUBLIC_KEY as fallback.
2026-01-07 07:51:40 -05:00
96c9813e38 Fix V shell variable escaping - use \$ for literal $
In V strings:
- \$ produces a literal $ (correct for shell variables)
- $$ is interpreted as $ + $var causing undefined ident errors

Changed all shell variable references from $$ to \$ to properly
escape for shell command execution.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 10:08:38 -05:00
a46bf88a3e Fix V result redefinition and Crystal nil type error
- V: Rename result variables in cmd_key to avoid redefinition (xdg_result, mac_result, win_result)
- Crystal: Fix Bool | Nil type by explicitly checking stdout.nil? before string check

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 10:04:06 -05:00
9329d9365f Fix Crystal test class variables and V implementation syntax
- Crystal: Wrap class variables in TestCounter class (top-level @@ not allowed)
- V: Fix deprecated const() syntax to individual const declarations
- V: Fix os.execute or-blocks to use exit_code checks
- V: Fix shell variable escaping (use $ for literal $ in shell strings)
- README: Add unit test documentation and CI badge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 09:57:49 -05:00
160740e1ea Fix Elixir warning and Go cache warnings
- Elixir: Remove unused module attributes @passed/@failed
- Go: Add cache: false to all setup-go actions (no go.sum file)
2026-01-06 09:46:48 -05:00
6a431abd07 Fix Julia HMAC tests - convert secret to Vector{UInt8} 2026-01-06 09:43:40 -05:00
dc29e64196 Fix Julia, Lua, and OCaml test failures
- Julia: Rename test() to run_test() to avoid name collision
- Julia: Use lambda syntax instead of do-block for cleaner execution
- Lua: Fix signature format test - verify structure instead of counting colons
- OCaml: Use apt-get instead of failing setup-ocaml@v2 action
2026-01-06 09:40:05 -05:00
a1eedc55ea Fix failing unit tests in GitHub Actions matrix
- Clojure: Use 'clojure' instead of 'clj -M' for standalone script
- Dart: Add proper pubspec.yaml with SDK environment constraint
- Julia: Install SHA package before running tests
- Lua: Use lua5.4 explicitly, add awk for portable HMAC output parsing
- Perl: Install libjson-perl and libwww-perl dependencies
- Bash: Make un.sh executable before test
- OCaml: Add str.cma and unix.cma for Str module support
- OCaml unit test: Remove Str dependency with pure string search
2026-01-06 09:20:41 -05:00
d095008e8c Add UN CLI download links and quick install instructions 2026-01-06 09:05:50 -05:00
0b7c6fd08d Add unit tests for all 42 language implementations
Unit tests for extension mapping, signature format, language detection,
argument parsing, file operations, and API constants for:

Systems: C, C++, Rust, Go, Zig, Nim, D, V, Crystal
JVM: Java, Kotlin, Groovy, Clojure
.NET: C#, F#
Functional: Haskell, OCaml, Scheme, Common Lisp, Erlang, Elixir
Scripting: Python, Ruby, JavaScript, TypeScript, Lua, Perl, PHP, Tcl, Bash, AWK, PowerShell
Scientific: Julia, R, Fortran
Legacy/Exotic: COBOL, Prolog, Forth, Raku, Objective-C, Dart

All tests validate internal functions without API calls.
2026-01-05 22:07:13 -05:00
1e46faef8b Add unit tests for 18 languages 2026-01-05 21:35:41 -05:00
a379e061fc Add unit and integration tests for all major implementations 2026-01-05 21:29:44 -05:00
ad074c1b91 Remove unnecessary comments 2026-01-05 21:14:19 -05:00
bdcb6ec97d Add epic GitHub Actions inception matrix for all 42 implementations 2026-01-05 21:13:30 -05:00
18fdf94ace Add GitHub mirror with multi-push URL technique 2026-01-05 19:59:58 -05:00
ccd723db99 Fix restore CLI syntax - take snapshot ID directly
Changed --restore to take snapshot ID directly and call /snapshots/:id/restore
instead of requiring --from SNAPSHOT_ID and calling /sessions/:id/restore or
/services/:id/restore.

Updated session and service restore in all implementations:
- un.py, un.go, un.rb, un.sh, un.ex, un.erl, un.fs, un.hs
- un.groovy, un.r, un.m, un.awk

Also added snapshot management features where missing.
2026-01-04 19:02:06 -05:00
09ec15aa62 Fix: catch unknown flags in all remaining implementations
Added unknown flag validation to session command in:
awk, clj, cob, erl, ex, f90, forth, fs, lisp, ml, pro, r, scm, tcl, Java

Now all 42+ implementations properly reject unknown flags with
'Unknown option' error instead of making confusing API requests.
2026-01-04 09:01:39 -05:00
35b3ab615a Fix: catch unknown flags in session command before API request
Previously, invalid flags like --invalid-flag were silently ignored,
causing the CLI to make API requests that returned confusing
'timestamp expired' errors. Now prints 'Unknown option' and exits.

Fixed in 21 implementations: rb, pl, php, lua, sh, cpp, d, rs, zig,
v, kt, groovy, dart, cr, raku, ps1, m, nim, hs
2026-01-03 12:26:38 -05:00
c6813e5a18 Add -f FILE flag support for session and service commands
All 38+ implementations now support:
- session -f FILE: Upload files to /tmp/ in session container
- service -f FILE: Upload files to /tmp/ in service container
- service --bootstrap-file FILE: Read bootstrap script from file
2026-01-02 14:06:36 -05:00
a5a4f23594 Add clock drift error messages to remaining 18 implementations
When timestamp auth fails (401 with timestamp in error), show helpful message:
- Error: Request timestamp expired (must be within 5 minutes of server time)
- Your computer's clock may have drifted.
- NTP sync commands for Linux/macOS/Windows

Updated: Un.cs, Un.java, un.clj, un.cob, un.erl, un.ex, un.f90, un.forth,
un.fs, un.hs, un.lisp, un.m, un.ml, un.pro, un.r, un.raku, un.scm, un.zig

All 42 implementations now have clock drift detection.
2025-12-28 15:22:06 -05:00
bc0da08a08 Add clock drift error messages to 14 more implementations
When timestamp auth fails (401 with timestamp in error), show helpful message:
- Error: Request timestamp expired (must be within 5 minutes of server time)
- Your computer's clock may have drifted.
- NTP sync commands for Linux/macOS/Windows

Updated: un.awk, un.cpp, un.cr, un.d, un.dart, un.groovy, un.jl, un.kt, un.nim, un.ps1, un.rs, un.tcl, un.ts, un.v
2025-12-28 14:45:57 -05:00
ae8f9ee8c8 Add helpful clock drift message for timestamp auth errors 2025-12-28 14:36:00 -05:00
a4f9bfa377 Add HMAC authentication to all 42 implementations
- Update all un.* implementations to use HMAC-SHA256 signing
- Headers: Authorization (Bearer public_key), X-Timestamp, X-Signature
- Signature: HMAC-SHA256(secret_key, "timestamp:METHOD:path:body")
- Fix test suite issues (bash arithmetic, ES module compat, TCL shebang)
- Add CLAUDE.md with inception testing documentation
- Update README.md with HMAC auth and dependency table
- All 38 implementations pass inception test via un2
2025-12-28 14:24:03 -05:00
dba8ffeedc Add --dump-bootstrap command to remaining 28 un-inception implementations 2025-12-27 17:14:36 -05:00
ee15bc8a5f Add --dump-bootstrap command to all un-inception implementations 2025-12-27 16:40:49 -05:00
fa40b3bc78 Add key subcommand to remaining 25 implementations
Complete key command across all 42 CLI implementations:
- un.go, un.v, un.fs, un.groovy (systems/JVM)
- un.dart, un_inception.c, un_deno.ts, un.ps1 (mixed)
- un.hs, un.ml, un.clj, un.scm (functional)
- un.lisp, un.erl, un.ex, un.f90 (functional/scientific)
- un.cob, un.pro, un.forth, un.raku (exotic)
- un.m, un.awk (other)
- un.js, un.ts, un.pl (fixes to existing)

All implementations now support:
- key: Validate API key and show status
- key --extend: Open browser to renew key
2025-12-27 12:06:50 -05:00
5380af54cb Add key subcommand to all 31 implementations
- Validate API keys via portal endpoint
- Show key status, tier, expiration with color-coded output
- Add --extend flag to open browser for key renewal
- Update .gitignore for compiled binaries
- Update README with key command documentation
2025-12-27 11:50:34 -05:00
eb5d4ca8bf Add --type option for services across all 42 implementations
Support service_type for SRV records (minecraft, mumble, teamspeak, source, tcp, udp).
Each implementation now parses --type and sends service_type in the JSON payload.
2025-12-26 08:39:34 -05:00
564e9e7075 Improve README formatting and structure 2025-12-24 08:08:31 -05:00
e31c988dab Update license values in all 42 inception source files 2025-12-23 22:03:31 -05:00
12ade239bd Update README to use un instead of un2 2025-12-23 20:38:05 -05:00
aa43dbea43 Add public domain license to README, remove MIT reference 2025-12-23 11:24:59 -05:00
fd2268e11b Fix license comment syntax for JS/TS/Lua/Elixir
- JavaScript/TypeScript: Use // comments after shebang (not # which is invalid)
- Lua: Use -- comments after shebang (not # which is invalid)
- Elixir: Use # comments after shebang (not %% which is Erlang)

All 42 implementations validated passing after fixes.
2025-12-23 11:18:14 -05:00
2b35819393 Initial commit: 42 UN CLI implementations
Unsandbox CLI implementations in 42 programming languages for the
permacomputer project. Public domain software for code execution
across all ecosystems.

Languages: Python, JavaScript, Ruby, Go, Rust, C, C++, Java, Kotlin,
C#, F#, Haskell, OCaml, Clojure, Scheme, Common Lisp, Erlang, Elixir,
D, Nim, Zig, V, Dart, Groovy, Scala, Julia, R, Crystal, Fortran,
COBOL, Prolog, Forth, Tcl, Raku, Lua, PHP, Perl, Bash, TypeScript,
Objective-C, PowerShell, AWK

Includes test suites and service lifecycle tests.
2025-12-23 09:57:08 -05:00