rezor92
4 years ago
9 changed files with 47 additions and 6 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) |
||||
|
keep_alive = Column('keep_alive', Text) |
||||
|
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,14 +1,11 @@ |
|||||
[Interface] |
[Interface] |
||||
Address = {{ data.peer.address }}/{{ data.server.subnet }}{%- if is_ipv6 -%},{{ data.peer.v6_address }}/{{ data.server.v6_subnet }}{%- endif %} |
Address = {{ data.peer.address }}/{{ data.server.subnet }}{%- if is_ipv6 -%},{{ data.peer.v6_address }}/{{ data.server.v6_subnet }}{%- endif %} |
||||
PrivateKey = {{ data.peer.private_key }} |
PrivateKey = {{ data.peer.private_key }} |
||||
{% if data.peer.dns %} |
{% if data.peer.dns %}DNS = {{ data.peer.dns }}{% endif %} |
||||
DNS = {{ data.peer.dns }} |
|
||||
{% endif %} |
|
||||
|
|
||||
[Peer] |
[Peer] |
||||
PublicKey = {{ data.server.public_key }} |
PublicKey = {{ data.server.public_key }} |
||||
AllowedIPs = {{ data.peer.allowed_ips }} |
AllowedIPs = {{ data.peer.allowed_ips }} |
||||
Endpoint = {{ data.server.endpoint }}:{{ data.server.listen_port }} |
Endpoint = {{ data.server.endpoint }}:{{ data.server.listen_port }} |
||||
{% if data.peer.shared_key %} |
{% if data.peer.shared_key %}PresharedKey = {{ data.peer.shared_key }}{% endif %} |
||||
PresharedKey = {{ data.peer.shared_key }} |
{% if data.peer.keep_alive %}PersistentKeepalive = {{data.peer.keep_alive}}{% endif %} |
||||
{% endif %} |
|
||||
|
Loading…
Reference in new issue