From 4c8872c1ef8906ef1642abe978fc296b2707892e Mon Sep 17 00:00:00 2001 From: Marco Lanzara <48531002-marco370@users.noreply.replit.com> Date: Mon, 17 Nov 2025 18:26:12 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Release=20v1.0.17?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Tipo: patch - Database schema: database-schema/schema.sql (solo struttura) - Data: 2025-11-17 18:26:12 --- database-schema/schema.sql | 221 +++++++++++++++++++++++++++++++++++++ version.json | 10 +- 2 files changed, 229 insertions(+), 2 deletions(-) diff --git a/database-schema/schema.sql b/database-schema/schema.sql index e69de29..c20e37a 100644 --- a/database-schema/schema.sql +++ b/database-schema/schema.sql @@ -0,0 +1,221 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 16.9 (415ebe8) +-- Dumped by pg_dump version 16.9 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: detections; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.detections ( + id character varying DEFAULT gen_random_uuid() NOT NULL, + source_ip text NOT NULL, + risk_score numeric(5,2) NOT NULL, + confidence numeric(5,2) NOT NULL, + anomaly_type text NOT NULL, + reason text, + log_count integer NOT NULL, + first_seen timestamp without time zone NOT NULL, + last_seen timestamp without time zone NOT NULL, + blocked boolean DEFAULT false NOT NULL, + blocked_at timestamp without time zone, + detected_at timestamp without time zone DEFAULT now() NOT NULL +); + + +-- +-- Name: network_logs; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.network_logs ( + id character varying DEFAULT gen_random_uuid() NOT NULL, + router_id character varying NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + source_ip text NOT NULL, + dest_ip text, + source_port integer, + dest_port integer, + protocol text, + action text, + bytes integer, + packets integer, + logged_at timestamp without time zone DEFAULT now() NOT NULL +); + + +-- +-- Name: routers; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.routers ( + id character varying DEFAULT gen_random_uuid() NOT NULL, + name text NOT NULL, + ip_address text NOT NULL, + api_port integer DEFAULT 8728 NOT NULL, + username text NOT NULL, + password text NOT NULL, + enabled boolean DEFAULT true NOT NULL, + last_sync timestamp without time zone, + created_at timestamp without time zone DEFAULT now() NOT NULL +); + + +-- +-- Name: training_history; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.training_history ( + id character varying DEFAULT gen_random_uuid() NOT NULL, + model_version text NOT NULL, + records_processed integer NOT NULL, + features_count integer NOT NULL, + accuracy numeric(5,2), + training_duration integer, + status text NOT NULL, + notes text, + trained_at timestamp without time zone DEFAULT now() NOT NULL +); + + +-- +-- Name: whitelist; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.whitelist ( + id character varying DEFAULT gen_random_uuid() NOT NULL, + ip_address text NOT NULL, + comment text, + reason text, + created_by text, + active boolean DEFAULT true NOT NULL, + created_at timestamp without time zone DEFAULT now() NOT NULL +); + + +-- +-- Name: detections detections_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.detections + ADD CONSTRAINT detections_pkey PRIMARY KEY (id); + + +-- +-- Name: network_logs network_logs_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.network_logs + ADD CONSTRAINT network_logs_pkey PRIMARY KEY (id); + + +-- +-- Name: routers routers_ip_address_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.routers + ADD CONSTRAINT routers_ip_address_unique UNIQUE (ip_address); + + +-- +-- Name: routers routers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.routers + ADD CONSTRAINT routers_pkey PRIMARY KEY (id); + + +-- +-- Name: training_history training_history_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.training_history + ADD CONSTRAINT training_history_pkey PRIMARY KEY (id); + + +-- +-- Name: whitelist whitelist_ip_address_unique; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.whitelist + ADD CONSTRAINT whitelist_ip_address_unique UNIQUE (ip_address); + + +-- +-- Name: whitelist whitelist_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.whitelist + ADD CONSTRAINT whitelist_pkey PRIMARY KEY (id); + + +-- +-- Name: detected_at_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX detected_at_idx ON public.detections USING btree (detected_at); + + +-- +-- Name: detection_source_ip_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX detection_source_ip_idx ON public.detections USING btree (source_ip); + + +-- +-- Name: risk_score_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX risk_score_idx ON public.detections USING btree (risk_score); + + +-- +-- Name: router_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX router_id_idx ON public.network_logs USING btree (router_id); + + +-- +-- Name: source_ip_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX source_ip_idx ON public.network_logs USING btree (source_ip); + + +-- +-- Name: timestamp_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX timestamp_idx ON public.network_logs USING btree ("timestamp"); + + +-- +-- Name: network_logs network_logs_router_id_routers_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.network_logs + ADD CONSTRAINT network_logs_router_id_routers_id_fk FOREIGN KEY (router_id) REFERENCES public.routers(id); + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/version.json b/version.json index e5d8421..ec5cb29 100644 --- a/version.json +++ b/version.json @@ -1,7 +1,13 @@ { - "version": "1.0.16", - "lastUpdate": "2025-11-17T18:21:23.679Z", + "version": "1.0.17", + "lastUpdate": "2025-11-17T18:26:12.616Z", "changelog": [ + { + "version": "1.0.17", + "date": "2025-11-17", + "type": "patch", + "description": "Deployment automatico v1.0.17" + }, { "version": "1.0.16", "date": "2025-11-17",