Commit 7766db0b authored by chrissi^'s avatar chrissi^
Browse files

parker/strategy: set static wireguard key

parent e6f181d2
......@@ -4,12 +4,15 @@ import requests
import time
import logging
logger = logging.getLogger(__name__)
import yaml
from labgrid.driver import SmallUBootDriver, ShellDriver, GpioDigitalOutputDriver
from labgrid.protocol import PowerProtocol
from labgrid.factory import target_factory
from labgrid.strategy.common import Strategy
with open("parker_test_config.yaml") as fh:
config = yaml.load(fh)
@attr.s(cmp=False)
class StrategyError(Exception):
......@@ -122,6 +125,14 @@ class SmallUBootStrategy(Strategy):
elif status == Status.good_running:
self.transition(Status.good_config)
# setup static wireguard key
stdout, _, rc = self.shell.run("echo '{}' > /etc/parker/wg-privkey".format(config["wg_privkey"]))
assert rc == 0
stdout, _, rc = self.shell.run("echo '{}' > /etc/parker/wg-pubkey".format(config["wg_pubkey"]))
assert rc == 0
# reboot via config mode web interface
payload = {
"token": "",
"id.1":"1",
......
......@@ -7,3 +7,6 @@ ssh_key_file: "/home/chris/.ssh/id_rsa"
location_lat: "10.52378"
location_lon: "52.26469"
site_name: "Freifunk Braunschweig"
wg_privkey: "YI8OJzuDkk01NZa3UUHjCj77WFZl3TUeTTzAISFFh2Y="
wg_pubkey: "1n2UtfAauzZAwwZu7IXfCkWerqJ4RgO2w1QE6w1dVS4="
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment