braidfs 0.0.12 → 0.0.13
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/README.md +65 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,2 +1,67 @@
|
|
|
1
1
|
# braidfs
|
|
2
2
|
braid technology synchronizing files and webpages
|
|
3
|
+
|
|
4
|
+
## Features
|
|
5
|
+
|
|
6
|
+
- Proxies web resources as collaborative text using the Braid protocol
|
|
7
|
+
- Caches proxied content locally
|
|
8
|
+
- Monitors local files for changes and syncs them back to the origin
|
|
9
|
+
- Supports pinning specific URLs
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Clone the repository:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://github.com/braid-org/braidfs.git
|
|
17
|
+
cd braidfs
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Install dependencies:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Run the server:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
node index.js [PORT] [OPTIONS]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Options
|
|
35
|
+
|
|
36
|
+
- `PORT`: The port number to run the server on (default: 10000)
|
|
37
|
+
- `-pin URL`: Pin a specific URL to be proxied
|
|
38
|
+
- `-pin index URL`: Pin an index URL that contains a list of URLs to be proxied
|
|
39
|
+
- `COOKIE`: Set a cookie to be used in requests (optional)
|
|
40
|
+
|
|
41
|
+
Example:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node index.js 60000 -pin https://example.com/resource -pin index https://example.com/index.json mycookie=value
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This will run a server on port 60000, pin the specified URL, use the index URL to proxy multiple resources, and set a cookie for requests.
|
|
48
|
+
|
|
49
|
+
## Accessing the Proxy
|
|
50
|
+
|
|
51
|
+
The proxy only allows connections from localhost for security reasons.
|
|
52
|
+
|
|
53
|
+
- `/pages`: Shows all the proxied URLs
|
|
54
|
+
- `/URL`: Proxies the specified URL as Braid text and creates a file in `proxy_base/URL`
|
|
55
|
+
|
|
56
|
+
## File Structure
|
|
57
|
+
|
|
58
|
+
- `braid-text-db`: Stores local cached information
|
|
59
|
+
- `proxy_base`: Stores proxied files, which are updated when resources change and monitored for local changes
|
|
60
|
+
|
|
61
|
+
## Security Note
|
|
62
|
+
|
|
63
|
+
This proxy is designed to be accessible only from localhost. Attempting to access it from any other IP address will result in a 403 Forbidden error.
|
|
64
|
+
|
|
65
|
+
## Known Issues
|
|
66
|
+
|
|
67
|
+
- The server doesn't automatically resubscribe to proxied resources when restarted, though it will keep trying to re-establish broken connections while running.
|