Skip to content

Commit 13ac256

Browse files
committed
Merge branch 'master' of https://github.com/syvita/i2p-zero
2 parents 248a46e + 5e60339 commit 13ac256

File tree

1 file changed

+29
-222
lines changed

1 file changed

+29
-222
lines changed

README.md

+29-222
Original file line numberDiff line numberDiff line change
@@ -1,230 +1,37 @@
1-
<img src="https://github.com/syvita/i2p-zero/blob/master/i2p-zero.png" align="left" width="336" height="124">
1+
# `NANO`
2+
### Zero dependency, small footprint, cross-platform I2P Java Router with a simple tunnel controller and SAM interface
3+
###
24

3-
## Zero dependency, small footprint, cross-platform I2P Java Router with GUI, simple tunnel/socks controller and SAM interface
5+
`NANO` is a wrapper of I2P.core using only a subset of it's massive codebase.
46

5-
##
6-
7-
Note that I2P-zero is not a re-implementation of I2P. It uses the exact I2P source code from the official I2P GitHub repository.
8-
9-
I2P-zero is a build script that produces a zero-dependency installation of the official I2P release, and includes a simplified front end interface.
10-
11-
This project will run under Linux, and build native launchers for Linux, MacOS and Windows.
12-
The launchers will include the I2P router, a SAM listener, simple tunnel and socks tunnel functionality and a minimal JVM.
13-
14-
## Downloads
15-
16-
Download the latest binary releases for Mac/Windows/Linux here: https://github.com/syvita/i2p-zero/releases
17-
18-
## Building the launchers
19-
20-
All binary releases for Windows, Mac and Linux can be built from either Linux or Mac.
21-
22-
Use the Docker build method for reproducible builds.
23-
24-
### To build using Docker on Mac:
25-
26-
First install docker from https://hub.docker.com/editions/community/docker-ce-desktop-mac
27-
28-
````
29-
containerId=$(docker run -td --rm ubuntu)
30-
docker exec -ti $containerId bash -c '\
31-
apt-get update \
32-
&& apt-get -y install git wget zip unzip \
33-
&& git clone https://github.com/i2p-zero/i2p-zero.git --depth 1 \
34-
&& cd i2p-zero && bash bin/build-all-and-zip.sh'
35-
docker cp $containerId:/i2p-zero/dist-zip ./
36-
docker container stop $containerId
37-
````
38-
39-
### To build using Docker on Ubuntu:
40-
41-
````
42-
sudo apt -y install docker docker.io
43-
systemctl start docker
44-
45-
containerId=$(sudo docker run -td --rm ubuntu)
46-
sudo docker exec -ti $containerId bash -c '\
47-
apt-get update \
48-
&& apt-get -y install git wget zip unzip \
49-
&& git clone https://github.com/i2p-zero/i2p-zero.git --depth 1 \
50-
&& cd i2p-zero && bash bin/build-all-and-zip.sh'
51-
sudo docker cp $containerId:/i2p-zero/dist-zip ./
52-
sudo docker container stop $containerId
53-
````
54-
55-
This will result in a dist-zip directory being copied into the current directory. The dist-zip directory will contain the builds for all platforms.
56-
57-
### To build without Docker on Ubuntu:
58-
59-
To build without Docker on a freshly installed Ubuntu system, first ensure git is installed:
60-
61-
`sudo apt install git`
62-
63-
Then, retrieve this project from git:
64-
65-
`git clone https://github.com/i2p-zero/i2p-zero.git`
66-
67-
Also note that JDKs for Linux, MacOS and Windows will be downloaded, which will total several hundred megabytes. You may need to ensure your system has zip, unzip and bzip2 installed to run the build script.
68-
69-
Run the `bin/build-all-and-zip.sh` script, which will in turn call the following scripts:
70-
71-
1. `bin/import-packages.sh` to retrieve the I2P Java sources, OpenJDK and the Ant build tool
72-
73-
2. `bin/build-original-i2p.sh` to build the I2P project retrieved from the I2P repository
74-
75-
3. `bin/build-launcher.sh` to convert the I2P JARs to modules, compile the Java source code in this project, and then use
76-
the jlink tool to build zero-dependency platform-specific launchers.
77-
78-
4. `bin/zip-all.sh` to produce the distribution zip files and display their SHA-256 hashes. Note that reproducible builds are currently a work in progress, and that only builds on Linux will show the same hashes as the official releases.
79-
80-
## Running the command line version
81-
82-
To run the Linux router, type:
83-
84-
`dist/linux/router/bin/i2p-zero`
85-
86-
To run the MacOS router, type:
87-
88-
`dist/mac/router/bin/launch.sh`
89-
90-
For Windows, run: (note that the Windows build will run in the background and not show a success message)
91-
92-
`dist/win/router/i2p-zero.exe`
93-
94-
If it launches successfully, you'll see the message:
7+
This project is a fork of [github.com/i2p-zero/i2p-zero](https://github.com/i2p-zero/i2p-zero) made by @nurviro, @dginovker, @Malinero, @eyedeekay, @jtgrassie & @knaccc.
958

9+
#### Running
10+
Clone it.
11+
```sh
12+
git clone https://github.com/syvita/nano.git
9613
```
97-
I2P router launched.
98-
Press Ctrl-C to gracefully shut down the router (or send the SIGINT signal to the process).
14+
Enter it.
15+
```sh
16+
cd nano
9917
```
18+
Build it.
19+
```sh
20+
chmod 777 ./build.sh && ./build.sh
21+
```
22+
Unarchive it.
23+
```sh
24+
unzip dist-zip/i2p-zero-${YOUR_OPERATING_SYSTEM}.v1.20.zip
25+
```
26+
Run it.
27+
```sh
28+
# MAC OS
10029

101-
## Tunnel control
102-
103-
Note that it may take a short while for new tunnels to be set up.
104-
105-
Call the `dist/linux/router/bin/tunnel-control.sh` script as follows to create and destroy tunnels:
106-
107-
#### Get the router reachability status. Returns a string such as "Testing", "Firewalled", "Running", "Error"
108-
109-
`tunnel-control.sh router.reachability`
110-
111-
#### Find out if the router is running (where "running" means it has warmed up and is allowing I2P connections to be created). Returns "true" or "false"
112-
113-
`tunnel-control.sh router.isRunning`
114-
115-
#### Listen for I2P connections and forward them to the specified host and port. Returns the I2P base 32 destination address for the server tunnel created.
116-
117-
Optionally, specify a directory for storing/reading the server key file.
118-
If the directory doesn't exist with a file named *.b32.i2p.keys in it,
119-
returns a newly created destination address and writes the secret key for the
120-
new address to a file called <I2P dest addr>.keys in the specified directory. Otherwise, read the existing
121-
secret key from that directory. The server tunnel will listen for I2P connections and forward them to the
122-
specified host and port. Note that the base 32 I2P destination address deterministically depends on the contents of the .keys file).
123-
124-
`tunnel-control.sh server.create <host> <port> <(optional) directory>`
125-
126-
or, if you would like a vanity b32 address for your server tunnel that begins with a 3 character (alphanumeric) prefix, type:
127-
128-
`tunnel-control.sh server.create.vanity <host> <port> <directory> <prefix>`
129-
130-
If you do not want to specify the directory parameter above, specify `none` as the directory. Note that this command may take several minutes to complete.
131-
132-
#### Check the state of a tunnel. Returns "opening" or "open"
133-
134-
`tunnel-control.sh server.state <base 32 I2P address>`
135-
`tunnel-control.sh client.state <local port>`
136-
`tunnel-control.sh http.state <local port>`
137-
`tunnel-control.sh socks.state <local port>`
138-
139-
140-
#### Close the tunnel listening for connections on the specified I2P destination address. Returns "OK".
141-
142-
`tunnel-control.sh server.destroy <base 32 I2P address>`
143-
144-
145-
#### Create a tunnel that listens for connections on localhost on the specified port and forwards connections over I2P to the specified destination public key.
146-
147-
`tunnel-control.sh client.create <I2P destination> <local port>`
148-
149-
150-
#### Close the tunnel listening for connections on the specified port. Returns "OK".
151-
152-
`tunnel-control.sh client.destroy <local port>`
153-
154-
#### Create an http proxy (for accessing .i2p web sites), listening on the specified port
155-
156-
`tunnel-control.sh http.create <local port>`
157-
158-
#### Destroy the http proxy listening on the specified port
159-
160-
`tunnel-control.sh http.destroy <local port>`
161-
162-
#### Create a socks tunnel, listening on the specified port
163-
164-
`tunnel-control.sh socks.create <local port>`
165-
166-
#### Destroy the socks tunnel listening on the specified port
167-
168-
`tunnel-control.sh socks.destroy <local port>`
169-
170-
#### Destroy all tunnels. Returns "OK"
171-
172-
`tunnel-control.sh all.destroy`
173-
174-
#### List all tunnels. Returns JSON string containing information about all tunnels currently in existence
175-
176-
`tunnel-control.sh all.list`
177-
178-
#### Start a SAM listener on port 7656. Returns "OK"
179-
180-
`tunnel-control.sh sam.create`
181-
182-
#### Get the external port randomly assigned to this router when first run, which the firewall should allow incoming UDP and TCP connections on. Returns the port number.
183-
184-
`tunnel-control.sh router.externalPort`
185-
186-
#### Set the bandwidth limit, measured in KBps. Returns "OK".
187-
188-
`tunnel-control.sh router.setBandwidthLimitKBps <KBps>`
189-
190-
#### Get the bandwidth limit, measured in KBps
191-
192-
`tunnel-control.sh router.getBandwidthLimitKBps`
193-
194-
#### Get bandwidth statistics. Returns a comma separated list of statistics
195-
196-
`tunnel-control.sh router.getBandwidthStats`
197-
198-
example response:
199-
200-
`1sRateInKBps=12.34,1sRateOutKBps=12.34,5mRateInKBps=12.34,5mRateOutKBps=12.34,avgRateInKBps=12.34,avgRateOutKBps=12.34,totalInMB=12.34,totalOutMB=12.34`
201-
202-
or, for pleasant viewing on the command line, automatically updating every 2 seconds:
203-
204-
`watch "tunnel-control.sh router.getBandwidthStats | tr ',' '\n' | sort"`
205-
206-
#### Get the I2P-zero version
207-
208-
`tunnel-control.sh version`
209-
210-
example response:
211-
212-
`i2p-zero 1.8`
213-
214-
215-
## Watch the I2P log for messages
216-
217-
`tail -f dist/linux/router/i2p.config/wrapper.log`
218-
219-
220-
## Note on bundled windows launcher.exe executable
30+
chmod 777 ./dist-zip/i2p-zero-mac.v1.20/router/bin/launch.sh
31+
./dist-zip/i2p-zero-mac.v1.20/router/bin/launch.sh
22132

222-
There is a bundled `resources/launcher.exe` file in the source tree. This allows the windows distributable to be built
223-
even on a non-windows platform.
33+
# LINUX
22434

225-
#This file can be deterministically recreated by following these steps on a Windows machine:
226-
1. Download AdoptOpenJDK14 from https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk14-2020-03-09-04-56/OpenJDK14-jdk_x64_windows_hotspot_2020-03-09-04-56.zip
227-
2. Create a new folder, and place inside the `resources/icons.ico` file and the `router` folder from an I2P-zero for Windows GUI build
228-
3. Run `<path to jdk>\bin\jpackage.exe --type app-image --icon icons.ico --name i2p-zero -m org.getmonero.i2p.zero.gui/org.getmonero.i2p.zero.gui.Gui --runtime-image router\runtime
229-
4. Run `certUtil -hashfile i2p-zero/i2p-zero.exe SHA256` to get the SHA256 hash.
230-
5. This hash should exactly match the SHA256 hash of the `resources/launcher.exe` file, which should be `3d5d00eeff5cb9d63ea415c593d67f201a7d024b6378d22d702b001e6693a93a`
35+
chmod 777 ./dist-zip/i2p-zero-linux.v1.20/router/bin/i2p-zero
36+
./dist-zip/i2p-zero-linux.v1.20/router/bin/i2p-zero
37+
```

0 commit comments

Comments
 (0)