GURT protocol (lib, cli, gdextension, Flumi integration)
This commit is contained in:
@@ -13,15 +13,37 @@ max_connections = 10
|
||||
[settings]
|
||||
# Available top-level domains
|
||||
tld_list = [
|
||||
"mf", "btw", "fr", "yap", "dev", "scam", "zip", "root",
|
||||
"web", "rizz", "habibi", "sigma", "now", "it", "soy",
|
||||
"lol", "uwu", "ohio", "cat"
|
||||
"shit", "based", "delulu", "aura", "pmo", "sucks", "emo", "twin",
|
||||
"zorp", "clank", "web", "fent", "yeah", "slop", "job", "goat",
|
||||
"buss", "dawg", "opium", "gang", "ok", "wtf", "lol", "scam", "cat",
|
||||
"edge", "miku", "dumb", "balls", "yap", "attic", "ayo", "dev",
|
||||
|
||||
# Country code TLDs
|
||||
"ac", "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "aq", "ar", "as",
|
||||
"at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be", "bf", "bg", "bh",
|
||||
"bi", "bj", "bl", "bm", "bn", "bo", "bq", "br", "bs", "bt", "bv", "bw",
|
||||
"by", "bz", "ca", "cc", "cd", "cf", "cg", "ch", "ci", "ck", "cl", "cm",
|
||||
"cn", "co", "cr", "cu", "cv", "cw", "cx", "cy", "cz", "de", "dj", "dk",
|
||||
"dm", "do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", "eu", "fi",
|
||||
"fj", "fk", "fm", "fo", "fr", "ga", "gb", "gd", "ge", "gf", "gg", "gh",
|
||||
"gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs", "gt", "gu", "gw", "gy",
|
||||
"hk", "hm", "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "io",
|
||||
"iq", "ir", "is", "it", "je", "jm", "jo", "jp", "ke", "kg", "kh", "ki",
|
||||
"km", "kn", "kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk",
|
||||
"lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me", "mg", "mh",
|
||||
"mk", "ml", "mm", "mn", "mo", "mp", "mq", "mr", "ms", "mt", "mu", "mv",
|
||||
"mw", "mx", "my", "mz", "na", "nc", "ne", "nf", "ng", "ni", "nl", "no",
|
||||
"np", "nr", "nu", "nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl",
|
||||
"pm", "pn", "pr", "ps", "pt", "pw", "py", "qa", "re", "ro", "rs", "ru",
|
||||
"rw", "sa", "sb", "sc", "sd", "se", "sg", "sh", "si", "sj", "sk", "sl",
|
||||
"sm", "sn", "so", "sr", "ss", "st", "su", "sv", "sx", "sy", "sz", "tc",
|
||||
"td", "tf", "tg", "th", "tj", "tk", "tl", "tm", "tn", "to", "tr", "tt",
|
||||
"tv", "tw", "tz", "ua", "ug", "uk", "us", "uy", "uz", "va", "vc", "ve",
|
||||
"vg", "vi", "vn", "vu", "wf", "ws", "ye", "yt", "za", "zm", "zw"
|
||||
]
|
||||
|
||||
# Words that are not allowed in domain names
|
||||
offensive_words = [
|
||||
"nigg", "sex", "porn", "igg"
|
||||
]
|
||||
offensive_words = []
|
||||
|
||||
[discord]
|
||||
# Discord bot token for domain approval notifications
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
-- Create users table
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id SERIAL PRIMARY KEY,
|
||||
username VARCHAR(50) UNIQUE NOT NULL,
|
||||
@@ -8,7 +7,6 @@ CREATE TABLE IF NOT EXISTS users (
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Create invite codes table
|
||||
CREATE TABLE IF NOT EXISTS invite_codes (
|
||||
id SERIAL PRIMARY KEY,
|
||||
code VARCHAR(32) UNIQUE NOT NULL,
|
||||
@@ -18,7 +16,6 @@ CREATE TABLE IF NOT EXISTS invite_codes (
|
||||
used_at TIMESTAMP
|
||||
);
|
||||
|
||||
-- Create domains table
|
||||
CREATE TABLE IF NOT EXISTS domains (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name VARCHAR(100) NOT NULL,
|
||||
@@ -31,7 +28,6 @@ CREATE TABLE IF NOT EXISTS domains (
|
||||
UNIQUE(name, tld)
|
||||
);
|
||||
|
||||
-- Create indexes for faster lookups
|
||||
CREATE INDEX IF NOT EXISTS idx_domains_name_tld ON domains(name, tld);
|
||||
CREATE INDEX IF NOT EXISTS idx_domains_user_id ON domains(user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_domains_status ON domains(status);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
-- Remove email field from users table
|
||||
ALTER TABLE users DROP COLUMN IF EXISTS email;
|
||||
|
||||
-- Drop email index if it exists
|
||||
DROP INDEX IF EXISTS idx_users_email;
|
||||
@@ -1,4 +1,3 @@
|
||||
-- Fix timestamp columns to use TIMESTAMPTZ instead of TIMESTAMP
|
||||
ALTER TABLE users ALTER COLUMN created_at TYPE TIMESTAMPTZ;
|
||||
ALTER TABLE invite_codes ALTER COLUMN created_at TYPE TIMESTAMPTZ;
|
||||
ALTER TABLE invite_codes ALTER COLUMN used_at TYPE TIMESTAMPTZ;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
-- Add domain_invite_codes field to users table
|
||||
ALTER TABLE users ADD COLUMN domain_invite_codes INTEGER DEFAULT 3;
|
||||
|
||||
-- Create domain invite codes table for domain-specific invites
|
||||
CREATE TABLE IF NOT EXISTS domain_invite_codes (
|
||||
id SERIAL PRIMARY KEY,
|
||||
code VARCHAR(32) UNIQUE NOT NULL,
|
||||
@@ -11,7 +9,6 @@ CREATE TABLE IF NOT EXISTS domain_invite_codes (
|
||||
used_at TIMESTAMPTZ
|
||||
);
|
||||
|
||||
-- Create indexes for faster lookups
|
||||
CREATE INDEX IF NOT EXISTS idx_domain_invite_codes_code ON domain_invite_codes(code);
|
||||
CREATE INDEX IF NOT EXISTS idx_domain_invite_codes_created_by ON domain_invite_codes(created_by);
|
||||
CREATE INDEX IF NOT EXISTS idx_domain_invite_codes_used_by ON domain_invite_codes(used_by);
|
||||
23
dns/migrations/005_add_dns_records.sql
Normal file
23
dns/migrations/005_add_dns_records.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
CREATE TABLE dns_records (
|
||||
id SERIAL PRIMARY KEY,
|
||||
domain_id INTEGER NOT NULL REFERENCES domains(id) ON DELETE CASCADE,
|
||||
record_type VARCHAR(10) NOT NULL CHECK (record_type IN ('A', 'AAAA', 'CNAME', 'TXT', 'MX', 'NS', 'SRV')),
|
||||
name VARCHAR(255) NOT NULL DEFAULT '@', -- @ for root, or subdomain name
|
||||
value VARCHAR(1000) NOT NULL,
|
||||
ttl INTEGER DEFAULT 3600,
|
||||
priority INTEGER, -- For MX records
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX idx_dns_records_domain_type ON dns_records(domain_id, record_type);
|
||||
CREATE INDEX idx_dns_records_name ON dns_records(name);
|
||||
|
||||
INSERT INTO dns_records (domain_id, record_type, name, value, ttl)
|
||||
SELECT id, 'A', '@', ip, 3600
|
||||
FROM domains
|
||||
WHERE status = 'approved';
|
||||
|
||||
INSERT INTO dns_records (domain_id, record_type, name, value, ttl, priority)
|
||||
SELECT id, 'SRV', '_gurt._tcp', '0 5 4878 @', 3600, 0
|
||||
FROM domains
|
||||
WHERE status = 'approved';
|
||||
@@ -22,6 +22,22 @@ pub struct Domain {
|
||||
pub(crate) created_at: Option<DateTime<Utc>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, FromRow)]
|
||||
pub struct DnsRecord {
|
||||
#[serde(skip_deserializing)]
|
||||
pub(crate) id: Option<i32>,
|
||||
pub(crate) domain_id: i32,
|
||||
#[serde(deserialize_with = "deserialize_lowercase")]
|
||||
pub(crate) record_type: String, // A, AAAA, CNAME, TXT, MX, NS
|
||||
#[serde(deserialize_with = "deserialize_lowercase")]
|
||||
pub(crate) name: String, // subdomain or @ for root
|
||||
pub(crate) value: String, // IP, domain, text value, etc.
|
||||
pub(crate) ttl: Option<i32>, // Time to live in seconds
|
||||
pub(crate) priority: Option<i32>, // For MX records
|
||||
#[serde(skip_deserializing)]
|
||||
pub(crate) created_at: Option<DateTime<Utc>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, FromRow)]
|
||||
pub struct User {
|
||||
pub(crate) id: i32,
|
||||
@@ -57,6 +73,16 @@ pub(crate) struct ResponseDomain {
|
||||
pub(crate) tld: String,
|
||||
pub(crate) ip: String,
|
||||
pub(crate) name: String,
|
||||
pub(crate) records: Option<Vec<ResponseDnsRecord>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub(crate) struct ResponseDnsRecord {
|
||||
pub(crate) record_type: String,
|
||||
pub(crate) name: String,
|
||||
pub(crate) value: String,
|
||||
pub(crate) ttl: i32,
|
||||
pub(crate) priority: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user