Skip to content

Commit

Permalink
Add possibility to add ALIAS DNS record (#51)
Browse files Browse the repository at this point in the history
* Add possibility to add ALIAS DNS record

Added possibility to add ALIAS DNS record.

Resolves PROD-1918. (3/3)

ChangeLog:
* [ADD] Added possibility to add ALIAS DNS records
  • Loading branch information
milica-spasic authored and sasa-mladenovic-troxo committed Aug 27, 2019
1 parent 8eedaa4 commit 07057e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion server/debian/atomiadns-database.postinst
Expand Up @@ -269,7 +269,7 @@ if [ $retval != 0 ]; then
echo "database zonedata already exist, but doesn't contain the atomiadns schema. You will have to make sure that the schema matches $basedir/schema manually"
exit 1
else
latest_version="88"
latest_version="89"

if [ "$schema_version" = "$latest_version" ]; then
echo "The installed schema is the latest version, keeping the database as it is."
Expand Down Expand Up @@ -597,6 +597,10 @@ if [ $retval != 0 ]; then
execute_query "DROP TYPE _algorithmtype"
fi

if [ "$schema_version" -lt 89 ]; then
execute_query "INSERT INTO allowed_type (type, synopsis, regexp) VALUES ('ALIAS', 'hostname', '^[a-z0-9_][a-z0-9._-]*$')"
fi

set_schema_version "$latest_version"
else
echo "database zonedata already exist, but contains a bad schema version ($schema_version), this should never happen and indicates a bug."
Expand Down
5 changes: 3 additions & 2 deletions server/schema/ddl.sql
Expand Up @@ -39,7 +39,7 @@ CREATE TABLE atomiadns_schemaversion (
version INT
);

INSERT INTO atomiadns_schemaversion (version) VALUES (87);
INSERT INTO atomiadns_schemaversion (version) VALUES (89);

CREATE TABLE allow_zonetransfer (
id SERIAL PRIMARY KEY NOT NULL,
Expand Down Expand Up @@ -91,7 +91,8 @@ INSERT INTO allowed_type (type, synopsis, regexp) VALUES
('SSHFP', 'algorithm fingerprinttype fingerprint', '^[0-9]+ [0-9]+ [0-9A-F]+$'),
('TLSA', 'usage selector type certificate', '^[0-9]+ [0-9]+ [0-9]+ [0-9A-F]+$'),
('TXT', 'quotedstring', '^"[^"]{0,255}"( "[^"]{0,255}")*$'),
('CAA', 'certificate authority authorization', '^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]) (issue|issuewild|iodef) ("[^"]{0,255}")*$');
('CAA', 'certificate authority authorization', '^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]) (issue|issuewild|iodef) ("[^"]{0,255}")*$'),
('ALIAS', 'hostname', '^[a-z0-9_][a-z0-9._-]*$');

CREATE TABLE nameserver_group (
id SERIAL PRIMARY KEY NOT NULL,
Expand Down

0 comments on commit 07057e8

Please sign in to comment.