|
|
há 9 anos atrás | |
|---|---|---|
| .. | ||
| .gitignore | há 9 anos atrás | |
| Dockerfile | há 9 anos atrás | |
| Dockerfile-binary-builder | há 9 anos atrás | |
| README.md | há 9 anos atrás | |
| deploy_ad-hoc_server.sh | há 9 anos atrás | |
| main.go | há 9 anos atrás | |
| make.bash | há 9 anos atrás | |
| privatePlugins.go | há 9 anos atrás | |
The Server/psiphond program and the github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/server package contain the Psiphon server software.
Functionality is based on the legacy server stack. psiphond has entered production.
Prerequisites:
Build Steps:
go get -d -v ./...go build -o psiphond main.go (will generate a binary named psiphond for Linux/OSX or psiphond.exe for Windows)libc build (for Alpine Linux on Docker)Prerequisites:
git clone git://git.musl-libc.org/muslcd musl./configuremakesudo make install
/usr/local/musl by default, change by passing --prefix <path> as a flag to the configure script in step 3Build Steps:
GOOS=linux GOARCH=amd64 go get -d -v ./...GOOS=linux GOARCH=amd64 CC=/usr/local/musl/bin/musl-gcc go build --ldflags '-linkmode external -extldflags "-static"' -o psiphond main.go (will generate a statically linked binary named psiphond)NOTE: If you have ever used a GNU libc based build of this project, you will need to append the -a flag to your go build command in order to force rebuilding of previously built libraries. Additionally, compiling with the GNU libc again (after having compiled with MUSL libc) will also require the -a flag.
Updated build command: GOOS=linux GOARCH=amd64 CC=/usr/local/musl/bin/musl-gcc go build -a --ldflags '-linkmode external -extldflags "-static"' -o psiphond main.go
You may also use the Dockerfile-binary-builder docker file to create an image that will be able to build the binary for you without installing MUSL and cross-compiling locally.
docker build -f Dockerfile-binary-builder -t psiphond-builder .docker run --rm -v $PWD/../:/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core psiphond-builderpsiphond binary. The permissions are 777/a+rwx, but the owner and group will both be root. Functionally, this should not matter at all../psiphond --help to get a list of flags to pass to the generate sub-command./psiphond --ipaddress 0.0.0.0 --web 3000 --protocol SSH:3001 --protocol OSSH:3002 --logFilename /var/log/psiphon/psiphond.log generate (IP address 0.0.0.0 is used due to how docker handles services bound to the loopback device)docker build --no-cache=true -t psiphond . (this may take some time to complete)
--no-cache=true flag to speed up buildspsiphond when running: docker images./psiphond generate to generate a server configuration, including new key material and credentials. This will emit a config file and a server entry file.
generate does not yet take input parameters, so for now you must edit code if you must change the server IP address or ports../psiphond run to run the server stack using the generated configuration.TargetServerEntry config field in the tunnel-core client) to connect to the server.Run the docker container built above as follows: docker run -d --name psiphond-1 -p 13000:3000 -p 13001:3001 -p 13002:3002 psiphond
This will start a daemonized container, running the tunnel core server named psiphond-1, with host:container port mappings:
The container can be stopped by issuing the command docker stop psiphond-1. It will send the server a SIGTERM, followed by a SIGKILL if it is still running after a grace period
The container logs can be viewed/tailed/etc via the docker logs psiphond-1 command and the various flags the logs subcommand allows