Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Hofmann committed Jun 5, 2024
1 parent 5565f2d commit b5e9bd4
Showing 1 changed file with 8 additions and 100 deletions.
108 changes: 8 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

*PowerRqlite* is a small [PowerDNS Authoritative](https://powerdns.com) backend which allows to use a [rqlite](https://github.com/rqlite/rqlite) cluster as database / storage.

![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/KlettIT/PowerRqlite/master?style=plastic)
![GitHub](https://img.shields.io/github/license/KlettIT/PowerRqlite?style=plastic)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/KlettIT/PowerRqlite/CI?style=plastic)


## How it works

Expand Down Expand Up @@ -34,11 +33,12 @@ A simple deployment could be look like this:

## Known Issues

* Domains can not be created via pdnsutil. This have to be done via sql.
* Domains/Zones can not be deleted via pdnsutil. This have to be done via sql.
```
INSERT INTO domains (name,master,last_check,type,notified_serial,account) VALUES('example.com.','',NULL,'NATIVE',NULL,'');
DELETE FROM domain WHERE name='example.com.';
```


## Quick Start

### rqlite
Expand All @@ -49,87 +49,6 @@ Grab the latest release from the rqlite [Github release page](https://github.com
rqlited -node-id 1 ~/node.1
```

Once running we have to create the needed sql schema:

```
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE domains (
id INTEGER PRIMARY KEY,
name VARCHAR(255) NOT NULL COLLATE NOCASE,
master VARCHAR(128) DEFAULT NULL,
last_check INTEGER DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INTEGER DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL
);
CREATE TABLE records (
id INTEGER PRIMARY KEY,
domain_id INTEGER DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(10) DEFAULT NULL,
content VARCHAR(65535) DEFAULT NULL,
ttl INTEGER DEFAULT NULL,
disabled BOOLEAN DEFAULT 0,
ordername VARCHAR(255),
auth BOOL DEFAULT 1,
FOREIGN KEY(domain_id) REFERENCES domains(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE supermasters (
ip VARCHAR(64) NOT NULL,
nameserver VARCHAR(255) NOT NULL COLLATE NOCASE,
account VARCHAR(40) NOT NULL
);
CREATE TABLE comments (
id INTEGER PRIMARY KEY,
domain_id INTEGER NOT NULL,
name VARCHAR(255) NOT NULL,
type VARCHAR(10) NOT NULL,
modified_at INT NOT NULL,
account VARCHAR(40) DEFAULT NULL,
comment VARCHAR(65535) NOT NULL,
FOREIGN KEY(domain_id) REFERENCES domains(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE domainmetadata (
id INTEGER PRIMARY KEY,
domain_id INT NOT NULL,
kind VARCHAR(32) COLLATE NOCASE,
content TEXT,
FOREIGN KEY(domain_id) REFERENCES domains(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE cryptokeys (
id INTEGER PRIMARY KEY,
domain_id INT NOT NULL,
flags INT NOT NULL,
active BOOL,
published BOOL DEFAULT 1,
content TEXT,
FOREIGN KEY(domain_id) REFERENCES domains(id) ON DELETE CASCADE ON UPDATE CASCADE
);
CREATE TABLE tsigkeys (
id INTEGER PRIMARY KEY,
name VARCHAR(255) COLLATE NOCASE,
algorithm VARCHAR(50) COLLATE NOCASE,
secret VARCHAR(255)
);
ANALYZE sqlite_master;
INSERT INTO sqlite_stat1 VALUES('records','records_order_idx','324 15 15');
INSERT INTO sqlite_stat1 VALUES('records','records_lookup_id_idx','324 15 2 2');
INSERT INTO sqlite_stat1 VALUES('records','records_lookup_idx','324 2 2');
INSERT INTO sqlite_stat1 VALUES('domains','name_index','23 1');
CREATE UNIQUE INDEX name_index ON domains(name);
CREATE INDEX records_lookup_idx ON records(name, type);
CREATE INDEX records_lookup_id_idx ON records(domain_id, name, type);
CREATE INDEX records_order_idx ON records(domain_id, ordername);
CREATE UNIQUE INDEX ip_nameserver_pk ON supermasters(ip, nameserver);
CREATE INDEX comments_idx ON comments(domain_id, name, type);
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);
CREATE INDEX domainmetaidindex ON domainmetadata(domain_id);
CREATE INDEX domainidindex ON cryptokeys(domain_id);
CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);
COMMIT;
```

### PowerDNS

Install PowerDNS Authoritative a documented [here](https://doc.powerdns.com/authoritative/installation.html).
Expand Down Expand Up @@ -166,26 +85,15 @@ If you running *PowerRqlite* as a Docker container you can use Environment varia

```
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"rqliteOptions": {
"Url": "http://localhost:4001"
},
...
"Kestrel": {
"EndPoints": {
"Http": {
"Url": "http://localhost:5555"
"Url": "http://localhost:8081"
}
}
},
"RemoveTrailingDot": false
}
}
```

Translated into "Docker" it would be the following environment variable: `ASPNETCORE_Kestrel__EndPoints__Http__Url=http://localhost:5555`
Translated into "Docker" it would be the following environment variable: `ASPNETCORE_Kestrel__EndPoints__Http__Url=http://localhost:8081`

0 comments on commit b5e9bd4

Please sign in to comment.