16 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
f524219387
openvpn: Work around firewalld bug 919517
Instead of using a wildcard tun+ interface, use a fixed number of tun
interfaces and hope OpenVPN will use one of them.

Fixes: #1438.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-01 22:01:09 -05:00
Sunil Mohan Adapa
117c3d7507
openvpn: Fix issues with upgrade easy-rsa 2 to 3 migration
- Set permissions properly as if they are created newly.

- Ensure that configuration file is rewritten so that new certificate paths are
  used.

- Run easyrsa init-pki to ensure that configuration file is present.

- Create necessary empty directories as per new structure.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-03-01 18:13:37 -05:00
Joseph Nuthalapati
544c317cd2
openvpn: Migration from easy-rsa 2 to 3 for existing installations
- Change file and directory structure from easy-rsa 2's flat format to easy-rsa
  3's format.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-03-01 18:13:27 -05:00
Joseph Nuthalapati
43e7633868
openvpn: Always write the latest server configuration on setup
This takes care of the case where a user has tried the "setup" step and
failed. The new configuration will overwrite the old one.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-19 07:46:38 -05:00
Joseph Nuthalapati
3a579e2d72
openvpn: is-setup checks for non-empty dh.pem file
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-19 07:46:31 -05:00
Joseph Nuthalapati
d5a73aaac4
openvpn: Migration from easy-rsa 2 to 3
Fixes #1318
Fixes #1327

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-11-19 07:46:27 -05:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Sunil Mohan Adapa
1779ac8928
openvpn: yapf indentation
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-01-14 20:40:21 -05:00
Sunil Mohan Adapa
71cc0e1fb0
openvpn: Upgrade to the new Debian way
Earlier only openvpn@.service file was available. Currently, Debian is using
openvpn-server@.service and openvpn-client@.service. Start using this and
upgrade our current users to this approach. This fixes the problem with
incorrect enabling/disabling of OpenVPN app in Plinth.

Tested primarily three cases:

- Install version 2 of the app directly. Make sure daemon runs,
  enabling/disabling the app works.

- Install version 1 of the app. Disable it. Upgrade to version 2 make sure
  everything is upgraded but disabled. Enabling make the app work properly.

- Install version 1 of the app. Enable it. Upgrade to version 2 make sure
  everything is upgraded, app is enabled and running.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-01-14 20:40:04 -05:00
Johannes Keyser
634afef1c9
actions: Make subparsers mandatory, fixes calls without arguments
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2017-04-10 11:54:23 +05:30
Sunil Mohan Adapa
dc0f3151b1
openvpn: Set unique subject property on each cert generation
Just to be sure of the ability to generate the certificate even on
modifications.
2017-03-29 21:49:50 +05:30
Hemanth Kumar Veeranki
04cadbc82f
openvpn: Prevent failures when regenerating user certificate
Set unique_subject attribute to no in index.txt.attr file.  This
allows regenerating a certificate for a user.

Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
2017-03-29 21:33:58 +05:30
Sunil Mohan Adapa
f9bd2542a7
openvpn: Apply empty file check to private key also
When downloading user's profile, if user's private key is empty,
regenerate user's key.

Minor styling fixes too.
2017-03-27 21:58:32 +05:30
Hemanth Kumar Veeranki
fcd2499092
openvpn: When user certificate is empty, regenerate it
Signed-off-by: Hemanth Kumar Veeranki <hemanthveeranki@gmail.com>
2017-03-27 21:57:56 +05:30
fonfon
a9528c56d9
Service object to handle services on a system-level
The Service object now offers handling services on a system level,
and gathering information whether it's enabled or running.
New methods: enable, disable, is_enabled, is_running;

For this it needs the correct (system-level) service name.
All of the methods can be overridden/customized.

This changes all modules to the new Service object and deletes
action scripts that are not required anymore.
2016-05-11 18:19:27 -04:00
Sunil Mohan Adapa
646763ff3c openvpn: New module VPN into FreedomBox
- Authentication using client certificates.  Extra password based
  authentication for later.

- Auto setup of CA, server and client certificates.

- Provides a .ovpn profile for each user for easy setup.

- Use 4096 bit Diffie-Hellman parameters for better security.  If this
  takes to much time, reduce it to 2048 or 1024, at least during
  debugging.
2015-11-03 20:24:40 -05:00