Compare commits
2 Commits
bc1089be21
...
2a270dac74
Author | SHA1 | Date |
---|---|---|
|
2a270dac74 | |
|
667695881c |
|
@ -27,6 +27,31 @@ CREATE TABLE rights (
|
|||
name TEXT NOT NULL UNIQUE
|
||||
);
|
||||
|
||||
CREATE TABLE login_attepts (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
ip_address TEXT NOT NULL,
|
||||
username TEXT NOT NULL,
|
||||
attempted_at TEXT DEFAULT (DATETIME('now')),
|
||||
);
|
||||
CREATE INDEX idx_ip_username ON login_attempts (ip_address, username);
|
||||
|
||||
CREATE TABLE ip_whitelist (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
ip_address TEXT NOT NULL,
|
||||
is_network BOOLEAN DEFAULT 0 CHECK(is_network IN (0, 1)),
|
||||
description TEXT,
|
||||
created_at TEXT DEFAULT (DATETIME('now')),
|
||||
created_by TEXT,
|
||||
UNIQUE (ip_address)
|
||||
);
|
||||
|
||||
INSERT INTO ip_whitelist (ip_address, is_network, description, created_by) VALUES
|
||||
('127.0.0.1', 0, 'localhost IPv4', 'system'),
|
||||
('::1', 0, 'localhost IPv6', 'system'),
|
||||
('10.0.0.0/8', 1, 'Private network', 'system'),
|
||||
('172.16.0.0/12', 1, 'Private network', 'system'),
|
||||
('192.168.0.0/16', 1, 'Private network', 'system');
|
||||
|
||||
CREATE TABLE logs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
user_id INTEGET NOT NULL,
|
||||
|
|
Loading…
Reference in New Issue