mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
wireguard: Fix module.app usage that is no longer available
Tests: - Add a new server and delete it. - Add a new client and delete it. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
f8136e8c8f
commit
bd90e59fa3
@ -9,7 +9,9 @@ import logging
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from plinth import actions, network
|
from plinth import actions
|
||||||
|
from plinth import app as app_module
|
||||||
|
from plinth import network
|
||||||
from plinth.utils import import_from_gi
|
from plinth.utils import import_from_gi
|
||||||
|
|
||||||
nm = import_from_gi('NM', '1.0')
|
nm = import_from_gi('NM', '1.0')
|
||||||
@ -156,8 +158,7 @@ def _find_next_interface():
|
|||||||
|
|
||||||
def add_server(settings):
|
def add_server(settings):
|
||||||
"""Add information for connecting to a server."""
|
"""Add information for connecting to a server."""
|
||||||
from plinth.modules.wireguard import app
|
app = app_module.App.get('wireguard')
|
||||||
|
|
||||||
interface_name = _find_next_interface()
|
interface_name = _find_next_interface()
|
||||||
settings['common']['name'] = 'WireGuard-Client-' + interface_name
|
settings['common']['name'] = 'WireGuard-Client-' + interface_name
|
||||||
settings['common']['interface'] = interface_name
|
settings['common']['interface'] = interface_name
|
||||||
@ -182,8 +183,7 @@ def edit_server(interface, settings):
|
|||||||
|
|
||||||
def setup_server():
|
def setup_server():
|
||||||
"""Setup a server connection that clients can connect to."""
|
"""Setup a server connection that clients can connect to."""
|
||||||
from plinth.modules.wireguard import app
|
app = app_module.App.get('wireguard')
|
||||||
|
|
||||||
setting_name = nm.SETTING_WIREGUARD_SETTING_NAME
|
setting_name = nm.SETTING_WIREGUARD_SETTING_NAME
|
||||||
private_key = _generate_private_key()
|
private_key = _generate_private_key()
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user