Per-Arne Andersen
4 years ago
committed by
GitHub
12 changed files with 88 additions and 13 deletions
@ -0,0 +1,21 @@ |
|||
from sqlalchemy import * |
|||
from migrate import * |
|||
|
|||
|
|||
def upgrade(migrate_engine): |
|||
try: |
|||
meta = MetaData(bind=migrate_engine) |
|||
server = Table('server', meta, autoload=True) |
|||
allowed_ips = Column('allowed_ips', Text) |
|||
allowed_ips.create(server) |
|||
except: |
|||
pass |
|||
|
|||
|
|||
def downgrade(migrate_engine): |
|||
try: |
|||
meta = MetaData(bind=migrate_engine) |
|||
server = Table('server', meta, autoload=True) |
|||
server.c.allowed_ips.drop() |
|||
except: |
|||
pass |
@ -0,0 +1,21 @@ |
|||
from sqlalchemy import * |
|||
from migrate import * |
|||
|
|||
|
|||
def upgrade(migrate_engine): |
|||
try: |
|||
meta = MetaData(bind=migrate_engine) |
|||
server = Table('server', meta, autoload=True) |
|||
keep_alive = Column('keep_alive', Integer) |
|||
keep_alive.create(server) |
|||
except: |
|||
pass |
|||
|
|||
|
|||
def downgrade(migrate_engine): |
|||
try: |
|||
meta = MetaData(bind=migrate_engine) |
|||
server = Table('server', meta, autoload=True) |
|||
server.c.keep_alive.drop() |
|||
except: |
|||
pass |
@ -1,12 +1,11 @@ |
|||
[Interface] |
|||
Address = {{ data.peer.address }}/{{ data.server.subnet }}{%- if is_ipv6 -%},{{ data.peer.v6_address }}/{{ data.server.v6_subnet }}{%- endif %} |
|||
PrivateKey = {{ data.peer.private_key }} |
|||
DNS = {{ data.peer.dns }} |
|||
{% if data.peer.dns %}DNS = {{ data.peer.dns }}{% endif %} |
|||
|
|||
[Peer] |
|||
PublicKey = {{ data.server.public_key }} |
|||
AllowedIPs = {{ data.peer.allowed_ips }} |
|||
Endpoint = {{ data.server.endpoint }}:{{ data.server.listen_port }} |
|||
{% if data.peer.shared_key %} |
|||
PresharedKey = {{ data.peer.shared_key }} |
|||
{% endif %} |
|||
{% if data.peer.shared_key %}PresharedKey = {{ data.peer.shared_key }}{% endif %} |
|||
{% if data.peer.keep_alive %}PersistentKeepalive = {{data.peer.keep_alive}}{% endif %} |
|||
|
Loading…
Reference in new issue