Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation updates #299

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ manage remote servers.

- Ubuntu 24.04 LTS (noble)
- Debian 11 (bullseye)
- Rocky/Alma/RHEL 9
- CentOS / Rocky / Alma / RHEL 9


## Installation Options

- [source](#source)
- [deb/rpm](#deb--rpm)
- [deb/rpm](#debrpm)
- [apache](#apache)
- [docker](#docker)
- [virtualenv + pip + gunicorn](#virtualenv--pip--gunicorn)
- [nginx + uwsgi](#nginx--uwsgi)

N.B. all Rocky/Alma/RHEL instructions assume the EPEL repository has been installed:
N.B. all CentOS / Rocky / Alma / RHEL instructions assume the EPEL repository has been installed:

```shell
dnf -y install epel-release
Expand Down Expand Up @@ -81,9 +81,8 @@ apt update
apt -y install python3-openvpn-monitor
```

### CentOS 9
### CentOS / Rocky / Alma / RHEL 9

This also applies to Rocky/Alma/RHEL

```shell
curl -sS https://repo.openbytes.ie/openbytes.gpg > /etc/pki/rpm-gpg/RPM-GPG-KEY-openbytes
Expand All @@ -99,9 +98,9 @@ update-crypto-policies --set DEFAULT:SHA1
dnf -y install epel-release
dnf makecache
dnf -y install python3-openvpn-monitor
systemctl restart httpd
```

See [configuration](#configuration) for details on configuring openvpn-monitor.

### apache

Expand All @@ -112,18 +111,20 @@ These instructions assume a source checkout to /var/www/html/openvpn-monitor
##### Debian / Ubuntu

```shell
apt -y install git apache2 libapache2-mod-wsgi-py3 python3-geoip2 python3-humanize python3-flask python3-semver yarnpkg
a2enmod rewrite wsgi
echo "WSGIScriptAlias /openvpn-monitor /var/www/html/openvpn-monitor/openvpn_monitor/app.py" > /etc/apache2/conf-available/openvpn-monitor.conf
apt -y install git apache2 libapache2-mod-wsgi-py3 python3-geoip2 python3-humanize python3-flask python3-flaskext.wtf python3-semver yarnpkg
cp /var/www/html/openvpn-monitor/etc/openvpn-monitor/apache.conf.example /etc/apache2/conf-available/openvpn-monitor.conf
sed -i -e "s#^\(Define openvpn_monitor_pythonpath\).*#\1 /var/www/html/openvpn-monitor#" /etc/apache2/conf-available/openvpn-monitor.conf
a2enconf openvpn-monitor
service apache2 restart

systemctl restart apache2
```

##### CentOS / RHEL
##### CentOS / Rocky / Alma / RHEL

```shell
dnf -y install git httpd mod_wsgi python3-geoip2 python3-humanize python3-flask python3-semver geolite2-city yarnpkg
echo "WSGIScriptAlias /openvpn-monitor /var/www/html/openvpn-monitor/openvpn_monitor/app.py" > /etc/httpd/conf.d/openvpn-monitor.conf
dnf -y install git httpd mod_wsgi python3-geoip2 python3-humanize python3-flask python3-flask-wtf python3-semver geolite2-city yarnpkg
cp /var/www/html/openvpn-monitor/etc/openvpn-monitor/apache.conf.example /etc/httpd/conf.d/openvpn-monitor.conf
sed -i -e "s#^\(Define openvpn_monitor_pythonpath\).*#\1 /var/www/html/openvpn-monitor#" /etc/httpd/conf.d/openvpn-monitor.conf
systemctl restart httpd
```

Expand Down
3 changes: 1 addition & 2 deletions debian/python3-openvpn-monitor.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ if [ ! -e ${apache_conf_file} ] ; then
fi

site_packages=/usr/lib/python3/dist-packages
site_packages="${site_packages//\//\\\/}"
if ! grep ${site_packages} ${apache_conf_file} >/dev/null 2>&1 ; then
sed -i -e "s/^\(Define openvpn_monitor_pythonpath\).*/\1 ${site_packages}/" ${apache_conf_file}
sed -i -e "s#^\(Define openvpn_monitor_pythonpath\).*#\1 ${site_packages}#" ${apache_conf_file}
. /usr/share/apache2/apache2-maintscript-helper
apache2_invoke enconf openvpn-monitor.conf
fi
Expand Down
4 changes: 2 additions & 2 deletions etc/openvpn-monitor/openvpn-monitor.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ site=Example
#logo=logo.jpg
#latitude=40.72
#longitude=-74
maps=True
enable_maps=True
maps_height=500
geoip_data=/var/lib/GeoIP/GeoLite2-City.mmdb
geoip_data=/usr/share/GeoIP/GeoLite2-City.mmdb
datetime_format=%d/%m/%Y %H:%M:%S

[VPN1]
Expand Down
3 changes: 1 addition & 2 deletions rpm/rpm-post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ if [ ! -e ${apache_conf_file} ] ; then
fi

site_packages=$(python3 -c 'import site; print(site.getsitepackages()[-1])')
site_packages="${site_packages//\//\\\/}"
if ! grep ${site_packages} ${apache_conf_file} >/dev/null 2>&1 ; then
sed -i -e "s/^\(Define openvpn_monitor_pythonpath\).*/\1 ${site_packages}/" ${apache_conf_file}
sed -i -e "s#^\(Define openvpn_monitor_pythonpath\).*#\1 ${site_packages}#" ${apache_conf_file}
fi

systemctl enable httpd
Expand Down
Loading