fileport-gateway 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +57 -0
- package/THIRD_PARTY_NOTICES.md +12 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +87 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +22 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +30 -0
- package/dist/config.js.map +1 -0
- package/dist/duration.d.ts +1 -0
- package/dist/duration.js +14 -0
- package/dist/duration.js.map +1 -0
- package/dist/gateway.d.ts +20 -0
- package/dist/gateway.js +188 -0
- package/dist/gateway.js.map +1 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.js +88 -0
- package/dist/paths.js.map +1 -0
- package/dist/proxy.d.ts +2 -0
- package/dist/proxy.js +29 -0
- package/dist/proxy.js.map +1 -0
- package/dist/registry.d.ts +19 -0
- package/dist/registry.js +93 -0
- package/dist/registry.js.map +1 -0
- package/dist/save.d.ts +36 -0
- package/dist/save.js +165 -0
- package/dist/save.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ui.d.ts +2 -0
- package/dist/ui.js +20 -0
- package/dist/ui.js.map +1 -0
- package/dist/workers.d.ts +23 -0
- package/dist/workers.js +110 -0
- package/dist/workers.js.map +1 -0
- package/docs/CURRENT_ARCHITECTURE.md +69 -0
- package/docs/DUFS_COMPATIBILITY.md +38 -0
- package/docs/MIGRATION_PLAN.md +53 -0
- package/package.json +69 -0
- package/scripts/dufs-compatibility.mjs +32 -0
- package/scripts/install-dufs.sh +15 -0
- package/vendor/LICENSE-DUFS-APACHE +201 -0
- package/vendor/LICENSE-DUFS-MIT +21 -0
- package/vendor/dufs +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Current Architecture
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
This document describes the clean-room Phase 0/1 implementation in this repository. The historical portable kit is reference material only and is not present in this Git history.
|
|
6
|
+
|
|
7
|
+
## Historical implementation observed (reference only)
|
|
8
|
+
|
|
9
|
+
The supplied 2026-08-21 portable snapshot was inspected outside this repository. Its implementation combined filesystem serving and product behavior in one Node process:
|
|
10
|
+
|
|
11
|
+
- `src/cli.ts` owned config, root registration, single TCP server reuse and absolute-path URL generation;
|
|
12
|
+
- `src/server.ts` (~1,500 lines) owned root registry, listing/search, raw file reads, atomic save, PlantUML and routing under `/fileport/api/*`;
|
|
13
|
+
- `src/web/fileport-browser.tsx` (~2,800 lines) owned the artifact UI, editing, Monaco-style source views and renderer integrations;
|
|
14
|
+
- URLs encoded full local absolute paths, while minimum scope depended on registered public roots;
|
|
15
|
+
- no capability token, expiry or revoke lifecycle existed.
|
|
16
|
+
|
|
17
|
+
No historical source or commit was imported. The new architecture below replaces the filesystem backend with Dufs and introduces an opaque capability boundary. Renderer parity is intentionally staged after the secure Phase 1 transport.
|
|
18
|
+
|
|
19
|
+
## Runtime topology
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Agent CLI
|
|
23
|
+
└─ HTTP over $STATE/control.sock (0600)
|
|
24
|
+
└─ Fileport Gateway :7892
|
|
25
|
+
├─ ShareRegistry ($STATE/shares.json, 0600)
|
|
26
|
+
├─ capability URL + scope guard
|
|
27
|
+
├─ minimal read-only preview shell
|
|
28
|
+
└─ reverse proxy
|
|
29
|
+
└─ official Dufs 0.46.0 worker per canonical root
|
|
30
|
+
└─ Unix socket (0600), no TCP listener
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Modules
|
|
34
|
+
|
|
35
|
+
| Module | Responsibility |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `src/cli.ts` | `serve`, `share`, `ls`, `revoke`; auto-starts Gateway through the local control socket |
|
|
38
|
+
| `src/registry.ts` | persistent capability IDs, canonical targets, expiry filtering, atomic 0600 registry writes |
|
|
39
|
+
| `src/workers.ts` | `canonical root -> Dufs child`, concurrent start deduplication, stale socket recovery, readiness probe and crash restart |
|
|
40
|
+
| `src/paths.ts` | URL decoding, traversal rejection, realpath scope check, symlink escape rejection and sensitive-target guard |
|
|
41
|
+
| `src/proxy.ts` | streaming HTTP/HEAD/Range reverse proxy over Unix sockets |
|
|
42
|
+
| `src/gateway.ts` | public capability routes, local control API, read-only policy and Gateway health |
|
|
43
|
+
| `src/ui.ts` | intentionally small Phase 1 read-only preview shell; no historical UI source was imported |
|
|
44
|
+
|
|
45
|
+
## URL model
|
|
46
|
+
|
|
47
|
+
- Public URL: `/s/<192-bit-capability>/`
|
|
48
|
+
- Filesystem path: `/s/<capability>/fs/<relative-path>`
|
|
49
|
+
- Absolute filesystem paths never appear in the URL.
|
|
50
|
+
- A file share permits exactly its one basename.
|
|
51
|
+
- A directory share permits only canonical descendants of that directory.
|
|
52
|
+
- Dufs's root is never trusted as the authorization boundary: every request passes the Gateway scope guard before proxying.
|
|
53
|
+
|
|
54
|
+
## Security properties in Phase 1
|
|
55
|
+
|
|
56
|
+
- Dufs has no network listener; each worker binds only a Unix socket.
|
|
57
|
+
- No Dufs upload/delete/allow-all/symlink flags are enabled.
|
|
58
|
+
- Gateway permits only `GET` and `HEAD` for filesystem routes.
|
|
59
|
+
- Traversal, encoded separators, double encoding and symlink escape fail closed.
|
|
60
|
+
- Home, filesystem root and common credential paths/names cannot be shared.
|
|
61
|
+
- Registry, control socket and worker sockets are mode 0600; state directory is 0700.
|
|
62
|
+
- Worker listings hide common credential/VCS patterns as defense in depth.
|
|
63
|
+
- Revoked, expired and unknown capabilities are denied.
|
|
64
|
+
|
|
65
|
+
## Phase 2 strict RW extension
|
|
66
|
+
|
|
67
|
+
Phase 2 adds explicit `ro | rw` share permission and optional expiry. Dufs remains read-only. An RW share may use only Fileport's `/api/edit` snapshot endpoint and `/api/save` endpoint for an existing, scoped, allowlisted text file. Saves require an optimistic version, serialize per target, preserve mode, use same-directory fsync + atomic rename, and reject stale/external changes. RO and legacy shares fail closed.
|
|
68
|
+
|
|
69
|
+
The full Monaco/Graphviz/PlantUML UI, `--line`, VSCode Remote links, and production systemd installation remain later phases.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Dufs Compatibility Report
|
|
2
|
+
|
|
3
|
+
## Pinned dependency
|
|
4
|
+
|
|
5
|
+
- Project: [sigoden/dufs](https://github.com/sigoden/dufs)
|
|
6
|
+
- Version: `0.46.0`
|
|
7
|
+
- Git tag commit: `b69946df232ceca5d24d0067f2beb6b5ed1c292c`
|
|
8
|
+
- Linux x86_64 musl archive SHA256: `817769f726613194bcff9d0e3e481eaccc86ac11208857614f36a8c02f410977`
|
|
9
|
+
- Installation: `scripts/install-dufs.sh`
|
|
10
|
+
- Reproducible contract: `FILEPORT_DUFS_BIN=/path/to/dufs node scripts/dufs-compatibility.mjs`
|
|
11
|
+
|
|
12
|
+
## Observed contract
|
|
13
|
+
|
|
14
|
+
| Capability | Result | Evidence/notes |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| Unix socket bind | PASS | `dufs --bind <socket> <root>` |
|
|
17
|
+
| GET file | PASS | body and status validated |
|
|
18
|
+
| HEAD file | PASS | no body; correct Content-Length |
|
|
19
|
+
| Range | PASS | `bytes=0-4` -> HTTP 206 and exact bytes |
|
|
20
|
+
| directory JSON | PASS | `?json`; response is an object with `paths[]` |
|
|
21
|
+
| filename search JSON | PASS | `?q=<name>&json`; nested match names are relative paths such as `sub/needle.log` |
|
|
22
|
+
| Unicode/space filename | PASS | percent-encoded Chinese filename |
|
|
23
|
+
| 3 MiB file | PASS | exact length |
|
|
24
|
+
| missing/deleted/renamed | PASS | dynamic filesystem state reflected correctly |
|
|
25
|
+
| outside-root symlink | PASS | denied (404) without `--allow-symlink` |
|
|
26
|
+
| unreadable file | GAP | Dufs returns 500; Gateway preflight maps unreadable targets to 403 |
|
|
27
|
+
| write disabled | PASS | PUT returns 403 |
|
|
28
|
+
| dedicated health endpoint | GAP | `/healthz` returns 404 in Dufs 0.46.0 |
|
|
29
|
+
|
|
30
|
+
Machine-readable evidence is written by the task run to `workfile/fileport-dufs/artifacts/output/dufs-compatibility-v0.46.0.json`.
|
|
31
|
+
|
|
32
|
+
## Integration decisions
|
|
33
|
+
|
|
34
|
+
1. Dufs is launched without `--allow-all`, upload, delete, archive or symlink access.
|
|
35
|
+
2. Search is enabled because it is part of Phase 1 compatibility, but all requests still pass Gateway share-scope authorization.
|
|
36
|
+
3. Worker readiness is socket existence plus a real `HEAD /?json` request; no nonexistent Dufs health endpoint is assumed.
|
|
37
|
+
4. Gateway exposes its own `/healthz` including active worker count.
|
|
38
|
+
5. Upgrades require rerunning this exact contract and the Gateway end-to-end suite before changing the pin.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Migration Plan
|
|
2
|
+
|
|
3
|
+
## Principle
|
|
4
|
+
|
|
5
|
+
This repository is a clean-room implementation. The historical Fileport package is behavioral reference only. Dufs stays an original, pinned, replaceable binary; it is not forked.
|
|
6
|
+
|
|
7
|
+
## Phase 0 — complete
|
|
8
|
+
|
|
9
|
+
- Pin and checksum official Dufs 0.46.0.
|
|
10
|
+
- Validate Unix socket, GET, HEAD, Range, JSON listing/search, Unicode, large file, symlink behavior, mutation denial and filesystem changes.
|
|
11
|
+
- Record the missing Dufs health endpoint and exact JSON response shape.
|
|
12
|
+
|
|
13
|
+
## Phase 1 — delivered by this change
|
|
14
|
+
|
|
15
|
+
- Persistent capability `ShareRegistry`.
|
|
16
|
+
- One read-only Dufs Unix Socket worker per canonical root.
|
|
17
|
+
- Concurrent worker-start deduplication, stale socket recovery and crash restart.
|
|
18
|
+
- Reverse proxy for GET/HEAD/Range.
|
|
19
|
+
- Gateway scope guard independent of Dufs root.
|
|
20
|
+
- Minimal browser preview shell and CLI (`share`, `ls`, `revoke`, `serve`).
|
|
21
|
+
- Gateway health endpoint.
|
|
22
|
+
|
|
23
|
+
Acceptance invariants:
|
|
24
|
+
|
|
25
|
+
- no Dufs TCP listener;
|
|
26
|
+
- URL does not contain absolute paths;
|
|
27
|
+
- file share cannot read sibling;
|
|
28
|
+
- directory share cannot escape via traversal, encoding or symlink;
|
|
29
|
+
- same root reuses worker;
|
|
30
|
+
- writes are denied;
|
|
31
|
+
- revoked/expired/unknown shares are denied.
|
|
32
|
+
|
|
33
|
+
## Phase 2 — strict RW (delivered)
|
|
34
|
+
|
|
35
|
+
- Explicit `--rw` / `--readonly` and `--expire <Nm|Nh|Nd|Nw>`.
|
|
36
|
+
- Dufs remains read-only.
|
|
37
|
+
- `/api/edit` returns content + optimistic version from one open file handle.
|
|
38
|
+
- `/api/save` updates only an existing allowlisted text file inside share scope.
|
|
39
|
+
- Per-target serialization, stale-version rejection, same-directory temp file, fsync, atomic rename, directory fsync and mode preservation.
|
|
40
|
+
- No create/delete/rename/full filesystem RW.
|
|
41
|
+
- Preview UI exposes Edit/Save only for eligible RW files and requires an explicit browser confirmation.
|
|
42
|
+
|
|
43
|
+
## Phase 3 — lifecycle and product UI
|
|
44
|
+
|
|
45
|
+
Add expiry CLI parsing, share inspection, cleanup/reaping, richer artifact renderers, Markdown/source views, `--line`, VSCode Remote link and PlantUML sandbox. Restore behaviors from contracts, not copied historical source.
|
|
46
|
+
|
|
47
|
+
## Phase 4 — operations
|
|
48
|
+
|
|
49
|
+
Add user-service packaging, structured logs/metrics, worker idle reclamation, startup reconciliation, release artifacts and signed/checksummed Dufs acquisition. Run compatibility and security tests for every Dufs upgrade.
|
|
50
|
+
|
|
51
|
+
## Rollback
|
|
52
|
+
|
|
53
|
+
Phase 1 does not modify or restart any pre-existing Fileport service. It uses an isolated state directory and configurable port. Rollback is stopping this Gateway and removing its task-scoped state; source rollback is a normal Git revert.
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fileport-gateway",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Secure Agent Artifact Gateway with capability URLs, strict saves, and Dufs-backed file serving.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"fileport": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "npm run clean && tsc",
|
|
11
|
+
"typecheck": "tsc --noEmit",
|
|
12
|
+
"test": "node --test --import tsx test/*.test.ts",
|
|
13
|
+
"start": "node dist/cli.js serve",
|
|
14
|
+
"clean": "node scripts/clean.mjs",
|
|
15
|
+
"prepack": "npm run build && npm run vendor:dufs",
|
|
16
|
+
"vendor:dufs": "node scripts/prepare-dufs.mjs",
|
|
17
|
+
"verify:release": "npm run typecheck && FILEPORT_TEST_DUFS=vendor/dufs npm test && FILEPORT_DUFS_BIN=vendor/dufs node scripts/dufs-compatibility.mjs"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22.14.0",
|
|
21
|
+
"npm": ">=11.5.1"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^22.15.0",
|
|
25
|
+
"tsx": "^4.20.0",
|
|
26
|
+
"typescript": "^5.8.0"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/",
|
|
31
|
+
"docs/",
|
|
32
|
+
"vendor/dufs",
|
|
33
|
+
"vendor/LICENSE-DUFS-APACHE",
|
|
34
|
+
"vendor/LICENSE-DUFS-MIT",
|
|
35
|
+
"scripts/install-dufs.sh",
|
|
36
|
+
"scripts/dufs-compatibility.mjs",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE",
|
|
39
|
+
"THIRD_PARTY_NOTICES.md"
|
|
40
|
+
],
|
|
41
|
+
"author": "not_nil <hanyi.me@foxmail.com>",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/nil-err/fileport.git"
|
|
45
|
+
},
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/nil-err/fileport/issues"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/nil-err/fileport#readme",
|
|
50
|
+
"keywords": [
|
|
51
|
+
"file-sharing",
|
|
52
|
+
"artifact-preview",
|
|
53
|
+
"developer-tools",
|
|
54
|
+
"agent",
|
|
55
|
+
"dufs",
|
|
56
|
+
"capability-security",
|
|
57
|
+
"devbox"
|
|
58
|
+
],
|
|
59
|
+
"os": [
|
|
60
|
+
"linux"
|
|
61
|
+
],
|
|
62
|
+
"cpu": [
|
|
63
|
+
"x64"
|
|
64
|
+
],
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public",
|
|
67
|
+
"provenance": true
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import fs from "node:fs/promises";
|
|
5
|
+
import http from "node:http";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
|
|
9
|
+
const dufs=process.env.FILEPORT_DUFS_BIN; if(!dufs) throw new Error("FILEPORT_DUFS_BIN is required");
|
|
10
|
+
const temp=await fs.mkdtemp(path.join(os.tmpdir(),"dufs-contract-")); const root=path.join(temp,"root"); const socket=path.join(temp,"dufs.sock"); await fs.mkdir(path.join(root,"sub"),{recursive:true}); await fs.writeFile(path.join(root,"hello.txt"),"hello world\n"); await fs.writeFile(path.join(root,"中文 文件.txt"),"你好\n"); await fs.writeFile(path.join(root,"sub","needle.log"),"x"); await fs.writeFile(path.join(root,"large.bin"),Buffer.alloc(3*1024*1024,7)); await fs.symlink("/etc/passwd",path.join(root,"outside")); await fs.writeFile(path.join(root,"denied"),"secret",{mode:0o000});
|
|
11
|
+
const child=spawn(dufs,["--bind",socket,"--allow-search",root],{stdio:["ignore","ignore","pipe"]}); let stderr="";child.stderr.on("data",c=>stderr+=c);
|
|
12
|
+
async function waitSocket(){for(let i=0;i<100;i++){try{if((await fs.stat(socket)).isSocket())return;}catch{}await new Promise(r=>setTimeout(r,25));}throw new Error(`socket timeout ${stderr}`)}
|
|
13
|
+
function req(url,method="GET",headers={}){return new Promise((resolve,reject)=>{const q=http.request({socketPath:socket,path:url,method,headers},r=>{const chunks=[];r.on("data",c=>chunks.push(c));r.on("end",()=>resolve({status:r.statusCode,headers:r.headers,body:Buffer.concat(chunks)}));});q.on("error",reject);q.end();});}
|
|
14
|
+
const results=[];async function check(name,fn){try{await fn();results.push({name,status:"PASS"});}catch(error){results.push({name,status:"FAIL",detail:String(error)});}}
|
|
15
|
+
try{await waitSocket();
|
|
16
|
+
await check("unix socket startup",async()=>assert.ok((await fs.stat(socket)).isSocket()));
|
|
17
|
+
await check("GET file",async()=>{const x=await req("/hello.txt");assert.equal(x.status,200);assert.equal(x.body.toString(),"hello world\n")});
|
|
18
|
+
await check("HEAD file",async()=>{const x=await req("/hello.txt","HEAD");assert.equal(x.status,200);assert.equal(x.body.length,0);assert.equal(x.headers["content-length"],"12")});
|
|
19
|
+
await check("Range",async()=>{const x=await req("/hello.txt","GET",{range:"bytes=0-4"});assert.equal(x.status,206);assert.equal(x.body.toString(),"hello")});
|
|
20
|
+
await check("directory JSON",async()=>{const x=await req("/?json");assert.equal(x.status,200);const d=JSON.parse(x.body.toString());assert.ok(d.paths.some(v=>v.name==="hello.txt"))});
|
|
21
|
+
await check("search JSON",async()=>{const x=await req("/?q=needle&json");assert.equal(x.status,200);const d=JSON.parse(x.body.toString());assert.ok(d.paths.some(v=>v.name.endsWith("needle.log")))});
|
|
22
|
+
await check("unicode filename",async()=>assert.equal((await req("/%E4%B8%AD%E6%96%87%20%E6%96%87%E4%BB%B6.txt")).status,200));
|
|
23
|
+
await check("large file",async()=>{const x=await req("/large.bin");assert.equal(x.status,200);assert.equal(x.body.length,3*1024*1024)});
|
|
24
|
+
await check("404",async()=>assert.equal((await req("/missing")).status,404));
|
|
25
|
+
await check("symlink outside denied",async()=>assert.equal((await req("/outside")).status,404));
|
|
26
|
+
const denied=await req("/denied"); results.push({name:"permission denied",status:denied.status===403?"PASS":"GAP",detail:`unreadable file returned ${denied.status}; Gateway preflight maps unreadable targets to 403`});
|
|
27
|
+
await check("write denied",async()=>assert.equal((await req("/new.txt","PUT")).status,403));
|
|
28
|
+
await check("deleted file",async()=>{await fs.writeFile(path.join(root,"gone"),"x");await fs.unlink(path.join(root,"gone"));assert.equal((await req("/gone")).status,404)});
|
|
29
|
+
await check("renamed file",async()=>{await fs.writeFile(path.join(root,"old"),"x");await fs.rename(path.join(root,"old"),path.join(root,"new"));assert.equal((await req("/old")).status,404);assert.equal((await req("/new")).status,200)});
|
|
30
|
+
const health=await req("/healthz");results.push({name:"dedicated health endpoint",status:health.status===200?"PASS":"GAP",detail:`/healthz returned ${health.status}; use socket + GET/HEAD readiness`});
|
|
31
|
+
}finally{child.kill("SIGTERM");await new Promise(r=>child.once("exit",r));await fs.rm(temp,{recursive:true,force:true});}
|
|
32
|
+
console.log(JSON.stringify({dufsVersion:"0.46.0",results},null,2));if(results.some(x=>x.status==="FAIL"))process.exitCode=1;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
version="0.46.0"
|
|
4
|
+
archive="dufs-v${version}-x86_64-unknown-linux-musl.tar.gz"
|
|
5
|
+
expected="817769f726613194bcff9d0e3e481eaccc86ac11208857614f36a8c02f410977"
|
|
6
|
+
state_home="${XDG_STATE_HOME:-$HOME/.local/state}"
|
|
7
|
+
target="${FILEPORT_DUFS_DIR:-$state_home/fileport/tools}"
|
|
8
|
+
mkdir -p "$target"
|
|
9
|
+
umask 077
|
|
10
|
+
curl -fL "https://github.com/sigoden/dufs/releases/download/v${version}/${archive}" -o "$target/$archive"
|
|
11
|
+
actual="$(sha256sum "$target/$archive" | cut -d' ' -f1)"
|
|
12
|
+
[[ "$actual" == "$expected" ]] || { echo "checksum mismatch: $actual" >&2; exit 1; }
|
|
13
|
+
tar -xzf "$target/$archive" -C "$target" dufs
|
|
14
|
+
chmod 700 "$target/dufs"
|
|
15
|
+
"$target/dufs" --version
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) sigoden(2022)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/vendor/dufs
ADDED
|
Binary file
|