Compare commits
14 commits
dns-ops-20
...
main
Author | SHA1 | Date | |
---|---|---|---|
e00a7dc7b5 | |||
899cf92d6d | |||
097895b63d | |||
95f4855290 | |||
8b9c4ec8b3 | |||
cf6ff5f3a3 | |||
1c945a4ad6 | |||
f8e3d05d70 | |||
85d7afb9da | |||
5b84480f8d | |||
76f403a6ed | |||
f448be8bf8 | |||
a273ba637d | |||
793989e599 |
5 changed files with 91 additions and 9 deletions
|
@ -1,5 +1,11 @@
|
|||
---
|
||||
knot_rest_token_secret: ENC[PKCS7,MIIC8gYJKoZIhvcNAQcDoIIC4zCCAt8CAQAxggJ6MIICdgIBADBeMEYxCzAJBgNVBAYTAlNFMQ4wDAYDVQQKDAVTVU5FVDEOMAwGA1UECwwFRVlBTUwxFzAVBgNVBAMMDjE5Mi4zNi4xNzEuMjE5AhQNByDxtRKM7mjQvskJVp1wrj/QxjANBgkqhkiG9w0BAQEFAASCAgBJrZoCKLB9RrjZtwYb5uFxDcuSngzvXVVZe3BtQdSgSq9PzG5dg9me59s7nhIj2WdWFuAdW+BuQ5pa8D+xxeKoqHhUQNCfgIE70tlhI0s9TrWJogDH+QZHE7TC3z8gUNdBo51C8Aq5FqU/Mql8MxnGMe2vgsT79pyM+2PZ6uqMqw1QiOjpFOgQ0uVb1qdYlOx6WbUuuRjGPxvxTogyX+ujdvVPnDmibgAv9UKYkfArsFLYRRB/p6uo4bTvyvwWLu1FLrVH8JSWP5o9otBNAJTCu49ayz09ED8CfnVRyRrgkKOOmqTeh44vyMJtgKjTKvldbypsdbvqFYgIazHBl3aCYlNs0GPyKVFtCNoWaAqv+waZCEccv6uz4q/9XdMLw6vcKYcc38EaYHUc0hp0XbKnGjgojsjhIjCEcqEsvbWyLqkH7Kf6Yot3zE8S3kp1LfV7eHipVysxVyHPTRKZXVl8s6nKvVGk5ZCyXS6B1Ky+aRVk7yt/QvtSAG19RRywhGVEOniugICCASnc4Dyeb1eQq6PBwq6O7b0A7QFIudR2LXNG8YHWqKBBOQMCk1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pXn8Nq9hu0sx22HpLOSgDBksY4jO87KhP9Qws/bBeeRuDNSZo1245AYbBVcF9DZmkjcqZKGFFuLYgj/g4fqrIo=]
|
||||
certbot_acmed_clients:
|
||||
dns-rest-api.sunet.se:
|
||||
allowfrom: []
|
||||
|
|
|
@ -1,20 +1,47 @@
|
|||
# 0sunet.catalog (catalog generator)
|
||||
|
||||
# hmac-sha256:knot-ladok:NkiX/2BhxLFO8FPWGp6g0F9uHNvKw0I8GufIFkGOuYM=
|
||||
key:
|
||||
- id: knot-ladok
|
||||
algorithm: hmac-sha256
|
||||
secret: NkiX/2BhxLFO8FPWGp6g0F9uHNvKw0I8GufIFkGOuYM=
|
||||
|
||||
acl:
|
||||
- id: txt_ddns_allow
|
||||
action: update
|
||||
key: knot-ladok
|
||||
update-type: [CNAME]
|
||||
update-type: [TXT]
|
||||
update-owner: name
|
||||
update-owner-name: [ _acme-challenge.*.ladok.se. ]
|
||||
update-owner-name: [ _acme-challenge.*.alternativ.ladok.se. ]
|
||||
update-owner-match: pattern
|
||||
|
||||
- id: ddns_allow_alt_ladok
|
||||
action: update
|
||||
key: alt-ladok
|
||||
update-type: [TXT]
|
||||
update-owner: name
|
||||
update-owner-name: [ _acme-challenge.*.alt.ladok.se., _acme-challenge.*.*.alt.ladok.se. ]
|
||||
update-owner-match: pattern
|
||||
|
||||
- id: ddns_allow_sun_ladok
|
||||
action: update
|
||||
key: sun-ladok
|
||||
update-type: [TXT]
|
||||
update-owner: name
|
||||
update-owner-name: [ _acme-challenge.*.sun.ladok.se., _acme-challenge.*.*.sun.ladok.se. ]
|
||||
update-owner-match: pattern
|
||||
|
||||
- id: ddns_allow_infra_utv_ladok
|
||||
action: update
|
||||
key: infra-utv-ladok
|
||||
update-type: [TXT]
|
||||
update-owner: name
|
||||
update-owner-name: [ _acme-challenge.*.infra.utv.ladok.se. ]
|
||||
update-owner-match: pattern
|
||||
|
||||
- id: ddns_allow_lab_utv_ladok
|
||||
action: update
|
||||
key: lab-utv-ladok
|
||||
update-type: [TXT]
|
||||
update-owner: name
|
||||
update-owner-name: [ _acme-challenge.*.lab.utv.ladok.se. ]
|
||||
update-owner-match: pattern
|
||||
|
||||
|
||||
template:
|
||||
- id: 0sunet-catz
|
||||
catalog-role: member
|
||||
|
@ -34,5 +61,17 @@ zone:
|
|||
|
||||
- domain: alt.ladok.se.
|
||||
template: 0sunet-catz
|
||||
acl: [txt_ddns_allow]
|
||||
acl: [ddns_allow_alt_ladok]
|
||||
|
||||
- domain: sun.ladok.se.
|
||||
template: 0sunet-catz
|
||||
acl: [ddns_allow_sun_ladok]
|
||||
|
||||
- domain: infra.utv.ladok.se.
|
||||
template: 0sunet-catz
|
||||
acl: [ddns_allow_infra_utv_ladok]
|
||||
|
||||
- domain: lab.utv.ladok.se.
|
||||
template: 0sunet-catz
|
||||
acl: [ddns_allow_lab_utv_ladok]
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
# DCO.sunet.se (bj)
|
||||
|
||||
zone:
|
||||
- domain: dco.sunet.se
|
||||
dnssec-signing: off
|
||||
notify: [ ns1-sunet-se, sunic-node1, sunic-node2, sunic-node3, ns2-sunet-se ]
|
29
dns-rest-api1.sunet.se/overlay/usr/sbin/knot_lastlogin
Executable file
29
dns-rest-api1.sunet.se/overlay/usr/sbin/knot_lastlogin
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import yaml
|
||||
import sqlite3
|
||||
|
||||
try:
|
||||
with open('/etc/knot_rest/knot_rest.yaml') as stream:
|
||||
yamlconf = yaml.safe_load(stream)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
knotrestdb = yamlconf["database"].removeprefix("sqlite:///")
|
||||
|
||||
try:
|
||||
with sqlite3.connect(knotrestdb) as conn:
|
||||
cur = conn.cursor()
|
||||
cur.execute('select username, description, logged_in from user')
|
||||
rows = cur.fetchall()
|
||||
for row in rows:
|
||||
username = row[0]
|
||||
description = row[1]
|
||||
if description == None:
|
||||
description = "(no description)"
|
||||
lastlogin = row[2]
|
||||
if lastlogin == None:
|
||||
lastlogin = "**never logged in**"
|
||||
print(f"{username:<27}{description:<27}{lastlogin:<23}")
|
||||
except sqlite3.OperationalError as e:
|
||||
print(e)
|
|
@ -20,6 +20,8 @@ remote:
|
|||
- id: ns1-sunet-se
|
||||
address: 89.47.185.240@53
|
||||
address: 2001:6b0:5a:4020::384@53
|
||||
- id: ns2-sunet-se
|
||||
address: 130.242.114.44@53
|
||||
- id: sunic-node1
|
||||
address: 130.242.3.49@53
|
||||
address: 2001:6b0:1e:2::22d@53
|
||||
|
|
Loading…
Add table
Reference in a new issue