mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
- RSA to ECC migration was introduced in October 2020 is available to Buster (via backports) and to Bullseye users. Dropping the code will make it easy to test regular maintenance code updates. - A two step setup process of first installing and then setting up the certificates is no longer necessary. (New installs already don't use this). The certificate generation process does not take hours but minutes. We also have a good progress indication during install+setup process. Tests: - Functional tests pass. - Initial setup completes successfully and does not take very long time. - Profiles can be downloaded successfully and imported. - A client an use them to connect. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
38 lines
966 B
Python
38 lines
966 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""FreedomBox app for configuring OpenVPN server."""
|
|
|
|
import logging
|
|
|
|
from django.http import HttpResponse
|
|
|
|
from plinth.modules import config
|
|
from plinth.views import AppView
|
|
|
|
from . import privileged
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class OpenVPNAppView(AppView):
|
|
"""Show OpenVPN app main page."""
|
|
|
|
app_id = 'openvpn'
|
|
template_name = 'openvpn.html'
|
|
|
|
|
|
def profile(request):
|
|
"""Provide the user's profile for download."""
|
|
username = request.user.username
|
|
domainname = config.get_domainname()
|
|
|
|
if not config.get_domainname():
|
|
domainname = config.get_hostname()
|
|
|
|
profile_string = privileged.get_profile(username, domainname)
|
|
response = HttpResponse(profile_string,
|
|
content_type='application/x-openvpn-profile')
|
|
response['Content-Disposition'] = \
|
|
'attachment; filename={username}.ovpn'.format(username=username)
|
|
|
|
return response
|