v bump to 0.3.0-alpha1, database structure
This commit is contained in:
parent
011737c527
commit
bda0ac2a52
|
@ -3075,7 +3075,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "trifid-api"
|
name = "trifid-api"
|
||||||
version = "0.3.0"
|
version = "0.3.0-alpha1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-cors",
|
"actix-cors",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "trifid-api"
|
name = "trifid-api"
|
||||||
version = "0.3.0"
|
version = "0.3.0-alpha1"
|
||||||
authors = ["core <core@e3t.cc>"]
|
authors = ["core <core@e3t.cc>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "An open-source reimplementation of the Defined Networking API server"
|
description = "An open-source reimplementation of the Defined Networking API server"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
DROP TABLE roles;
|
|
@ -0,0 +1,6 @@
|
||||||
|
CREATE TABLE roles (
|
||||||
|
id VARCHAR NOT NULL PRIMARY KEY,
|
||||||
|
name VARCHAR NOT NULL,
|
||||||
|
description VARCHAR NOT NULL,
|
||||||
|
organizationId VARCHAR NOT NULL REFERENCES organizations(id)
|
||||||
|
);
|
|
@ -0,0 +1 @@
|
||||||
|
DROP TABLE role_firewall_rules;
|
|
@ -0,0 +1,9 @@
|
||||||
|
CREATE TABLE role_firewall_rules (
|
||||||
|
id VARCHAR NOT NULL UNIQUE,
|
||||||
|
roleId VARCHAR NOT NULL REFERENCES roles(id),
|
||||||
|
protocol VARCHAR NOT NULL,
|
||||||
|
description VARCHAR NOT NULL,
|
||||||
|
allowedRoleId VARCHAR NULL,
|
||||||
|
allowedTags VARCHAR[],
|
||||||
|
portRange int4range NULL
|
||||||
|
);
|
|
@ -0,0 +1 @@
|
||||||
|
DROP TABLE hosts;
|
|
@ -0,0 +1,21 @@
|
||||||
|
CREATE TABLE hosts (
|
||||||
|
id VARCHAR NOT NULL PRIMARY KEY,
|
||||||
|
organizationId VARCHAR NOT NULL REFERENCES organizations(id),
|
||||||
|
networkId VARCHAR NOT NULL REFERENCES networks(id),
|
||||||
|
roleId VARCHAR NULL REFERENCES roles(id),
|
||||||
|
name VARCHAR NOT NULL,
|
||||||
|
ipAddress VARCHAR NOT NULL,
|
||||||
|
staticAddresses VARCHAR[] NOT NULL,
|
||||||
|
listenPort int2 NOT NULL,
|
||||||
|
isLighthouse BOOLEAN NOT NULL,
|
||||||
|
isRelay BOOLEAN NOT NULL,
|
||||||
|
createdAt TIMESTAMP NOT NULL,
|
||||||
|
isBlocked BOOLEAN NOT NULL,
|
||||||
|
|
||||||
|
lastSeenAt TIMESTAMP NULL,
|
||||||
|
clientVersion VARCHAR NULL,
|
||||||
|
platform VARCHAR NULL,
|
||||||
|
updateAvailable BOOLEAN NULL,
|
||||||
|
|
||||||
|
tags VARCHAR[] NOT NULL
|
||||||
|
);
|
|
@ -0,0 +1 @@
|
||||||
|
DROP TABLE host_overrides;
|
|
@ -0,0 +1,6 @@
|
||||||
|
CREATE TABLE host_overrides (
|
||||||
|
id VARCHAR NOT NULL PRIMARY KEY,
|
||||||
|
hostId VARCHAR NOT NULL REFERENCES hosts(id),
|
||||||
|
key VARCHAR NOT NULL,
|
||||||
|
value jsonb NOT NULL
|
||||||
|
);
|
|
@ -0,0 +1 @@
|
||||||
|
-- This file should undo anything in `up.sql`
|
|
@ -0,0 +1,11 @@
|
||||||
|
CREATE TABLE host_keys (
|
||||||
|
id VARCHAR NOT NULL PRIMARY KEY,
|
||||||
|
hostId VARCHAR NOT NULL REFERENCES hosts(id),
|
||||||
|
|
||||||
|
counter INT NOT NULL,
|
||||||
|
client_ed_pub bytea NOT NULL,
|
||||||
|
client_dh_pub bytea NOT NULL,
|
||||||
|
client_cert bytea NOT NULL,
|
||||||
|
|
||||||
|
UNIQUE (hostId, counter)
|
||||||
|
);
|
Loading…
Reference in New Issue