mirror of
https://github.com/go-i2p/checki2cp.git
synced 2025-06-08 09:16:25 -04:00
Be a little more verbose about what router we're starting
This commit is contained in:
68
Makefile
68
Makefile
@ -68,74 +68,6 @@ zero-assets:
|
||||
gothub upload -R -u eyedeekay -r "checki2cp" -t $(ZEROB_VERSION) -n "assets_darwin.go" -f "zerobundle/mac/assets.go"
|
||||
gothub upload -R -u eyedeekay -r "checki2cp" -t $(ZEROB_VERSION) -n "assets_linux.go" -f "zerobundle/linux/assets.go"
|
||||
|
||||
I2PD_VERSION=2.31.0
|
||||
|
||||
i2pd-clean:
|
||||
rm -rf i2pdbundle/osx i2pdbundle/win_amd64 i2pdbundle/win_386 i2pdbundle/linux_amd64 i2pdbundle/test i2pdbundle/test_files
|
||||
|
||||
i2pd-zip: i2pd-clean i2pd-linux
|
||||
mkdir -p i2pdbundle/mac i2pdbundle/win_amd64 i2pdbundle/win_386 i2pdbundle/test i2pdbundle/test/subtest i2pdbundle/test/subtest/subsubtest i2pdbundle/test/subsubsubtest
|
||||
wget -c -qO i2pdbundle/mac.tar.gz https://github.com/PurpleI2P/i2pd/releases/download/$(I2PD_VERSION)/i2pd_$(I2PD_VERSION)_osx.tar.gz
|
||||
cd i2pdbundle/mac && cp ../mac.tar.gz .
|
||||
wget -c -qO i2pdbundle/win_amd64.zip https://github.com/PurpleI2P/i2pd/releases/download/$(I2PD_VERSION)/i2pd_$(I2PD_VERSION)_win64_mingw_avx_aesni.zip
|
||||
cd i2pdbundle/win_amd64 && cp ../win_amd64.zip .
|
||||
wget -c -qO i2pdbundle/win_386.zip https://github.com/PurpleI2P/i2pd/releases/download/$(I2PD_VERSION)/i2pd_$(I2PD_VERSION)_win32_mingw_avx_aesni.zip
|
||||
cd i2pdbundle/win_386 && cp ../win_386.zip .
|
||||
touch i2pdbundle/test/test.txt \
|
||||
i2pdbundle/test/subtest/test.txt \
|
||||
i2pdbundle/test/subtest/subsubtest/test.txt \
|
||||
i2pdbundle/test/subsubsubtest/test.txt \
|
||||
i2pdbundle/test/test_other.txt \
|
||||
i2pdbundle/test/subtest/test_other.txt \
|
||||
i2pdbundle/test/subtest/subsubtest/test_other.txt \
|
||||
i2pdbundle/test/subsubsubtest/test_other.txt
|
||||
|
||||
i2pd-linux:
|
||||
mkdir -p i2pdbundle/linux_amd64/lib
|
||||
cd $(WORK_DIR)/i2pd-static-64-build/ && tar czvf ../../../i2pdbundle/linux_amd64/i2pd.tar.gz ./i2pd
|
||||
cp /lib64/ld-linux-x86-64.so.2 i2pdbundle/linux_amd64/lib
|
||||
cp /lib/x86_64-linux-gnu/libc.so.6 i2pdbundle/linux_amd64/lib
|
||||
cp /lib/x86_64-linux-gnu/libdl.so.2 i2pdbundle/linux_amd64/lib
|
||||
cp /lib/x86_64-linux-gnu/libgcc_s.so.1 i2pdbundle/linux_amd64/lib
|
||||
cp /lib/x86_64-linux-gnu/libm.so.6 i2pdbundle/linux_amd64/lib
|
||||
cp /lib/x86_64-linux-gnu/libpthread.so.0 i2pdbundle/linux_amd64/lib
|
||||
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 i2pdbundle/linux_amd64/lib
|
||||
cd i2pdbundle/linux_amd64/lib && tar czvf ../lib.tar.gz .
|
||||
rm -rf i2pdbundle/linux_amd64/lib
|
||||
|
||||
|
||||
i2p-i2pd:
|
||||
cd i2pdbundle && git clone https://github.com/purplei2p/i2pd.git; \
|
||||
cd i2pd && \
|
||||
git fetch --all --tags && \
|
||||
git checkout $(I2PD_VERSION)
|
||||
|
||||
|
||||
#i2pd-build-static: i2p-i2pd
|
||||
# cd i2pdbundle/i2pd/ && make clean && \
|
||||
# USE_STATIC=yes make USE_STATIC=yes
|
||||
|
||||
|
||||
WORK_DIR=$(PWD)/i2pdbundle/i2pd
|
||||
|
||||
i2pd-build: i2p-i2pd
|
||||
cd $(WORK_DIR) && \
|
||||
rm -rf $(WORK_DIR)/i2pd-static-64-build && \
|
||||
mkdir -p $(WORK_DIR)/i2pd-static-64-build && \
|
||||
cd $(WORK_DIR)/i2pd-static-64-build && \
|
||||
cmake -G 'Unix Makefiles' $(WORK_DIR)/build \
|
||||
-DBUILD_TYPE=Release \
|
||||
-DWITH_STATIC=ON -DWITH_HARDENING=ON -DWITH_UPNP=ON \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$(WORK_DIR)/i2pd-static-64-build && \
|
||||
make CXXFLAGS=-static
|
||||
|
||||
i2pd-bundle: i2pd-zip
|
||||
cd i2pdbundle && \
|
||||
go run --tags generate ./gen.go
|
||||
|
||||
I2PDB_VERSION=d9.45.12
|
||||
|
||||
i2pd-assets:
|
||||
#gothub release -p -u eyedeekay -r "checki2cp" -t $(I2PD_VERSION) -n "i2pd C++ pre-encoded assets" -d "assets.go file containing a zipped bundle of I2P Zero"
|
||||
#gothub upload -R -u eyedeekay -r "checki2cp" -t $(I2PD_VERSION) -n "assets_windows.go" -f "i2pdbundle/windows/assets.go"
|
||||
#gothub upload -R -u eyedeekay -r "checki2cp" -t $(I2PD_VERSION) -n "assets_darwin.go" -f "i2pdbundle/mac/assets.go"
|
||||
|
@ -79,7 +79,7 @@ func CheckI2PIsRunning() (bool, error) {
|
||||
return false, err
|
||||
}
|
||||
if destination == nil {
|
||||
return false, fmt.Errorf("")
|
||||
return false, fmt.Errorf("Client connection was made bug no destination could be generated.")
|
||||
}
|
||||
client.Disconnect()
|
||||
log.Println("I2P is running.")
|
||||
@ -238,14 +238,17 @@ func FindI2PIsInstalledDefaultLocation() (string, error) {
|
||||
// make sure that it is started, i.e. launch the router *only* if it is not
|
||||
// already running.
|
||||
func ConditionallyLaunchI2P() (bool, error) {
|
||||
log.Println("Checking if I2P is installed at a default location.")
|
||||
ok, err := CheckI2PIsInstalledDefaultLocation()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
log.Println("I2P was found at a default location, continuing procedure on:", ok)
|
||||
if ok {
|
||||
ok, err := CheckI2PIsRunning()
|
||||
if err == nil {
|
||||
if !ok {
|
||||
log.Println("Looking for an I2P router to start")
|
||||
path, err := FindI2PIsInstalledDefaultLocation()
|
||||
if err != nil {
|
||||
return false, err
|
||||
@ -260,13 +263,15 @@ func ConditionallyLaunchI2P() (bool, error) {
|
||||
if err := cmd.Start(); err != nil {
|
||||
return false, fmt.Errorf("i2pd router startup failure %s", err)
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
cmd := exec.Command(path)
|
||||
if err := cmd.Start(); err != nil {
|
||||
return false, fmt.Errorf("I2P Zero router startup failure %s", err)
|
||||
}
|
||||
}
|
||||
return true, nil
|
||||
} else {
|
||||
log.Println("I2P appears to be running, nothing to do.")
|
||||
}
|
||||
return true, nil
|
||||
}
|
||||
|
@ -22,7 +22,19 @@ func TestRouter(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if ok {
|
||||
t.Log("I2P is installed, successfully confirmed")
|
||||
t.Log("I2P is installed, successfully confirmed", ok)
|
||||
} else {
|
||||
t.Log("I2P is in a default location, user feedback is needed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRouterPath(t *testing.T) {
|
||||
ok, err := FindI2PIsInstalledDefaultLocation()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if ok != "" {
|
||||
t.Log("I2P is installed, successfully confirmed", ok)
|
||||
} else {
|
||||
t.Log("I2P is in a default location, user feedback is needed")
|
||||
}
|
||||
|
Reference in New Issue
Block a user