Skip to content

Commit

Permalink
Merge pull request #173 from ivpn/feature/s170-update-readme
Browse files Browse the repository at this point in the history
Readme update
  • Loading branch information
stenya authored Feb 12, 2024
2 parents 13ae90b + 4914495 commit 9c8a3f6
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 77 deletions.
17 changes: 12 additions & 5 deletions cli/References/Linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,23 @@ while getopts ":v:" opt; do
case $opt in
v) VERSION="$OPTARG"
;;
# \?) echo "Invalid option -$OPTARG" >&2
# ;;
esac
done

if [ -z "$VERSION" ]
then
echo "Usage:"
echo " $0 -v <version>"
exit 1
# Version was not provided by argument.
# Intialize $VERSION by the data from of command: '../../../ui/package.json'
VERSION="$(awk -F: '/"version"/ { gsub(/[" ,\n\r]/, "", $2); print $2 }' ../../../ui/package.json)"
if [ -n "$VERSION" ]
then
echo "[ ] You are going to compile IVPN Daemon & CLI 'v${VERSION}' (commit:${COMMIT})"
read -p "Press enter to continue" yn
else
echo "Usage:"
echo " $0 -v <version>"
exit 1
fi
fi

echo '---------------------------'
Expand Down
135 changes: 135 additions & 0 deletions docs/readme-build-manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Manual build and installation

This document describes how to manually build and install IVPN binaries on Linux.

## Requirements

Please, refer to development dependencies described in the [main readme](../readme.md#requirements_linux).

## Compilation

Clone the sources and build everything using the script `cli/References/Linux/build.sh`:

```bash
git clone https://github.com/ivpn/desktop-app.git
cd desktop-app/cli/References/Linux/
./build.sh
```

As a result, you will have compiled all the required binaries:

- service binary (`daemon/References/Linux/scripts/_out_bin/ivpn-service`)
- CLI binary (`cli/References/Linux/_out_bin/ivpn`)
- all third-party binaries (located under folders `daemon\References\Linux\_deps\*_inst`)
- ready-to-use DEB and RPM packages (located at `cli/References/Linux/_out_bin`)

## Manual installation

Manual installation involves placing compiled binaries into specified locations on the target system. The IVPN service checks for the existence of required files, their access rights, and owner. All the necessary files should be located under `/opt/ivpn`.

Below is an example of a correct installation.
The file source locations are indicated as comments (e.g. `# path-relative-to-repository-root`)
***Note: Files' owner and access rights are important!***

```bash
/opt/ivpn/etc:
-r-------- 1 root root 2358 Feb 8 16:10 ca.crt # daemon\References\common\etc\ca.crt
-rwx------ 1 root root 268 Feb 8 16:10 client.down # daemon\References\Linux\etc\client.down
-rwx------ 1 root root 2664 Feb 8 16:10 client.up # daemon\References\Linux\etc\client.up
-r-------- 1 root root 28111 Feb 8 16:10 dnscrypt-proxy-template.toml # daemon\References\common\etc\dnscrypt-proxy-template.toml
-rwx------ 1 root root 27168 Feb 8 16:10 firewall.sh # daemon\References\Linux\etc\firewall.sh
-rw------- 1 root root 68694 Feb 8 16:10 servers.json # daemon\References\common\etc\servers.json
-rwx------ 1 root root 33173 Feb 8 16:10 splittun.sh # daemon\References\Linux\etc\splittun.sh
-r-------- 1 root root 636 Feb 8 16:10 ta.key # daemon\References\common\etc\ta.key

/opt/ivpn/dnscrypt-proxy:
-rwxr-xr-x 1 root root 10828056 Feb 8 16:10 dnscrypt-proxy # daemon\References\Linux\_deps\dnscryptproxy_inst\dnscrypt-proxy

/opt/ivpn/kem:
-rwxr-xr-x 1 root root 313568 Feb 8 16:10 kem-helper # daemon\References\Linux\_deps\kem-helper\kem-helper-bin\kem-helper

/opt/ivpn/obfsproxy:
-rwxr-xr-x 1 root root 5460792 Feb 8 16:10 obfs4proxy # daemon\References\Linux\_deps\obfs4proxy_inst\obfs4proxy

/opt/ivpn/v2ray:
-rwxr-xr-x 1 root root 31774552 Feb 8 16:10 v2ray # daemon\References\Linux\_deps\v2ray_inst\v2ray

/opt/ivpn/wireguard-tools:
-rwxr-xr-x 1 root root 101312 Feb 8 16:10 wg # daemon\References\Linux\_deps\wireguard-tools_inst\wg
-rwxr-xr-x 1 root root 13460 Feb 8 16:10 wg-quick # daemon\References\Linux\_deps\wireguard-tools_inst\wg-quick
```

Place the IVPN binaries in the system's binary folder to access them from the terminal:

```bash
/usr/bin/ivpn-service # service: `daemon/References/Linux/scripts/_out_bin/ivpn-service`
/usr/bin/ivpn # CLI binary: `cli/References/Linux/_out_bin/ivpn`
```

The IVPN service must be started under a privileged user.
You can use the command-line parameter `--logging` to force-enable logging for the service.

*Example:*

```bash
# Run IVPN service
/usr/bin/ivpn-service --logging
# Run the IVPN CLI (from a separate terminal!)
# The CLI requires the IVPN service to be already started
/usr/bin/ivpn
```

You can configure your environment to start the ivpn-service as a daemon.

#### Example: Register and start as systemd daemon

Example of a `systemd` configuration file (`/etc/systemd/system/ivpn-service.service`):

```bash
[Unit]
Description=ivpn-service
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/ivpn-service
Restart=always
WorkingDirectory=/
TimeoutStopSec=infinity
[Install]
WantedBy=multi-user.target
```

Start `systemd` service example:

```bash
# reload the systemd daemon to recognize your new service (`/etc/systemd/system/ivpn-service.service`)
sudo systemctl daemon-reload
# start service
sudo systemctl start ivpn-service
# enable service to start automatically at boot
sudo systemctl enable ivpn-service
```


## Graphical User Interface

Compilation:

```bash
cd desktop-app/ui/References/Linux
./build.sh
```

Compiled files location:

- compiled binaries: `ui/dist/bin`
- ready-to-use DEB/RPM packages: `ui/References/Linux/_out_bin`

## Useful links

- [ArchLinux User Repository installation files (base package)](https://aur.archlinux.org/cgit/aur.git/tree/?h=ivpn)
- [ArchLinux User Repository installation files (UI package)](https://aur.archlinux.org/cgit/aur.git/tree/?h=ivpn-ui)
- [Configuring IVPN daemon on OpenRC init systems](https://github.com/ivpn/desktop-app/issues/1#issuecomment-822919358)
Loading

0 comments on commit 9c8a3f6

Please sign in to comment.