Skip to content

Commit

Permalink
Doc: Add an install script
Browse files Browse the repository at this point in the history
Following the docs can be confusing which distribution/codename to
pick.

This script aims to fix that by installing if the distro + codename is supported.
  • Loading branch information
jwijenbergh committed Oct 5, 2023
1 parent 5254230 commit 6c74edc
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 14 deletions.
1 change: 1 addition & 0 deletions doc/build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh

mkdocs build
cp ../install.sh site
41 changes: 27 additions & 14 deletions doc/md/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ packages for Fedora, and Deb packages for Debian and Ubuntu.
> packages (we use a compiled dependency), if you want an ARM package for
> a certain target you can also make an issue.
## Debian 11

## Installation using a script
> **Note**
> This needs curl installed, `sudo apt-get update && sudo apt-get install curl` on Debian/Ubuntu systems.
> Fedora systems automatically have curl installed
```console
$ curl --proto '=https' --tlsv1.2 https://docs.eduvpn.org/client/linux/install.sh
$ bash ./install.sh
```

## Manual installation

### Debian 11

``` console
$ sudo apt update
Expand All @@ -23,7 +36,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Debian 12
### Debian 12

``` console
$ sudo apt update
Expand All @@ -34,7 +47,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Ubuntu 20.04
### Ubuntu 20.04

``` console
$ sudo apt update
Expand All @@ -45,7 +58,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Ubuntu 22.04
### Ubuntu 22.04

``` console
$ sudo apt update
Expand All @@ -56,7 +69,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Ubuntu 22.10
### Ubuntu 22.10

``` console
$ sudo apt update
Expand All @@ -67,7 +80,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Ubuntu 23.04
### Ubuntu 23.04

``` console
$ sudo apt update
Expand All @@ -78,7 +91,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Linux Mint 20.x
### Linux Mint 20.x

``` console
$ sudo apt update
Expand All @@ -89,7 +102,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Linux Mint 21.x
### Linux Mint 21.x

``` console
$ sudo apt update
Expand All @@ -100,7 +113,7 @@ $ sudo apt update
$ sudo apt install eduvpn-client
```

## Fedora (37 & 38)
### Fedora (37 & 38)

``` console
$ curl -O https://app.eduvpn.org/linux/v4/rpm/[email protected]
Expand All @@ -114,7 +127,7 @@ EOF
$ sudo dnf install eduvpn-client
```

## CentOS (Stream 9)
### CentOS (Stream 9)

``` console
$ curl -O https://app.eduvpn.org/linux/v4/rpm/[email protected]
Expand All @@ -128,17 +141,17 @@ EOF
$ sudo dnf install eduvpn-client
```

## Arch (Unofficial)
### Arch (Unofficial)

There is an unofficial package in the [Arch User Repository
(AUR)](https://aur.archlinux.org/packages/python-eduvpn-client/).

## Pip installation
### Pip installation

We also provide Pip packages. These are useful if your distro is not
officially supported in our packaging (yet).

### Dependencies
#### Dependencies

To manually install the eduVPN package via Pip you first need to satisfy
the dependencies.
Expand Down Expand Up @@ -178,7 +191,7 @@ $ sudo dnf install \
dbus-python-devel
```

### Pip commands
#### Pip commands

You can then continue with installing via Pip:

Expand Down
81 changes: 81 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/sh

set -e

. "/etc/os-release"

install_deb() {
set -x
sudo apt update
# Make sure https apt transport is possible and curl is available
# curl might not be available if the script is downloaded manually
sudo apt install apt-transport-https curl
curl -sSf https://app.eduvpn.org/linux/v4/deb/[email protected] | gpg --dearmor | sudo tee /usr/share/keyrings/eduvpn-v4.gpg >/dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/eduvpn-v4.gpg] https://app.eduvpn.org/linux/v4/deb/ $1 main" | sudo tee /etc/apt/sources.list.d/eduvpn-v4.list
sudo apt update
sudo apt install eduvpn-client
exit 0
}

install_fedora() {
set -x
curl -O https://app.eduvpn.org/linux/v4/rpm/[email protected]
sudo rpm --import [email protected]
cat << 'EOF' | sudo tee /etc/yum.repos.d/python-eduvpn-client_v4.repo
[python-eduvpn-client_v4]
name=eduVPN for Linux 4.x (Fedora $releasever)
baseurl=https://app.eduvpn.org/linux/v4/rpm/fedora-$releasever-$basearch
gpgcheck=1
EOF
sudo dnf install -y eduvpn-client
exit 0
}

install_centos() {
if [ "$VERSION" != "9" ]; then
echo "CentOS Stream $VERSION is not supported"
exit 1
fi
set -x
curl -O https://app.eduvpn.org/linux/v4/rpm/[email protected]
sudo rpm --import [email protected]
cat << 'EOF' | sudo tee /etc/yum.repos.d/python-eduvpn-client_v4.repo
[python-eduvpn-client_v4]
name=eduVPN for Linux 4.x (CentOS Stream 9)
baseurl=https://app.eduvpn.org/linux/v4/rpm/centos-stream+epel-next-9-$basearch
gpgcheck=1
EOF
sudo dnf install -y eduvpn-client
exit 0
}

case $VERSION_CODENAME in
# ubuntu versions
"focal" | "jammy" | "lunar" | "bullseye" | "bookworm")
install_deb "$VERSION_CODENAME"
;;
# For linux mint we need to do some redirections to ubuntu codenames
# See https://linuxmint.com/download_all.php
# redirect linux mint 20.x codenames to focal
"ulyana" | "ulyssa" | "uma" | "una")
install_deb "focal"
;;
# redirect linux mint 21.x codenames to jammy
"vanessa" | "vera" | "victoria")
install_deb "jammy"
;;
esac

# No codename or unsupported codename, get based on name
case $NAME in
"Fedora Linux")
install_fedora
;;
"CentOS Stream")
install_centos
;;
*)
echo "OS: \"$NAME\" with codename \"$VERSION_CODENAME\" is not supported"
exit 1
;;
esac

0 comments on commit 6c74edc

Please sign in to comment.