测试内网穿透

– Function cowstonecowstoneCREATE OR REPLACE FUNCTION public.sync_tags()cowstone RETURNS triggercowstone LANGUAGE plpgsqlcowstoneAS f u n c t i o n function functioncowstone BEGINcowstone IF (TG_OP = ‘TRUNCATE’) THENcowstone DELETE FROM tags WHERE entity_name = TG_TABLE_NAME;cowstone RETURN NULL;cowstone ELSIF (TG_OP = ‘DELETE’) THENcowstone DELETE FROM tags WHERE entity_id = OLD.id;cowstone RETURN OLD;cowstone ELSEcowstonecowstone – Triggered by INSERT/UPDATEcowstone – Do an upsert on the tags tablecowstone – So we don’t need to migrate pre 1.1 entitiescowstone INSERT INTO tags VALUES (NEW.id, TG_TABLE_NAME, NEW.tags)cowstone ON CONFLICT (entity_id) DO UPDATEcowstone SET tags=EXCLUDED.tags;cowstone END IF;cowstone RETURN NEW;cowstone END;cowstone f u n c t i o n function functioncowstone;cowstonecowstone-- public.acme_storage definitioncowstoneCREATE TABLE public.acme_storage (cowstone id uuid NOT NULL,cowstone “key” text NULL,cowstone value text NULL,cowstone created_at timestamptz NULL,cowstone ttl timestamptz NULL,cowstone CONSTRAINT acme_storage_key_key UNIQUE (key),cowstone CONSTRAINT acme_storage_pkey PRIMARY KEY (id)cowstone);cowstoneCREATE INDEX acme_storage_ttl_idx ON public.acme_storage USING btree (ttl);cowstonecowstone-- public.ca_certificates definitioncowstoneCREATE TABLE public.ca_certificates (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone cert text NOT NULL,cowstone tags _text NULL,cowstone cert_digest text NOT NULL,cowstone CONSTRAINT ca_certificates_cert_digest_key UNIQUE (cert_digest),cowstone CONSTRAINT ca_certificates_pkey PRIMARY KEY (id)cowstone);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger ca_certificates_sync_tags_trigger AFTER insert OR delete OR UPDATE of tags ON public.ca_certificates for each row execute function sync_tags();cowstonecowstone-- public.cluster_events definitioncowstoneCREATE TABLE public.cluster_events (cowstone id uuid NOT NULL,cowstone node_id uuid NOT NULL,cowstone “at” timestamptz NOT NULL,cowstone nbf timestamptz NULL,cowstone expire_at timestamptz NOT NULL,cowstone channel text NULL,cowstone “data” text NULL,cowstone CONSTRAINT cluster_events_pkey PRIMARY KEY (id)cowstone);cowstoneCREATE INDEX cluster_events_at_idx ON public.cluster_events USING btree (at);cowstoneCREATE INDEX cluster_events_channel_idx ON public.cluster_events USING btree (channel);cowstoneCREATE INDEX cluster_events_expire_at_idx ON public.cluster_events USING btree (expire_at);cowstonecowstone-- public.clustering_data_planes definitioncowstoneCREATE TABLE public.clustering_data_planes (cowstone id uuid NOT NULL,cowstone hostname text NOT NULL,cowstone ip text NOT NULL,cowstone last_seen timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone config_hash text NOT NULL,cowstone ttl timestamptz NULL,cowstone “version” text NULL,cowstone sync_status text NOT NULL DEFAULT ‘unknown’::text,cowstone CONSTRAINT clustering_data_planes_pkey PRIMARY KEY (id)cowstone);cowstoneCREATE INDEX clustering_data_planes_ttl_idx ON public.clustering_data_planes USING btree (ttl);cowstonecowstone-- public.locks definitioncowstoneCREATE TABLE public.locks (cowstone “key” text NOT NULL,cowstone “owner” text NULL,cowstone ttl timestamptz NULL,cowstone CONSTRAINT locks_pkey PRIMARY KEY (key)cowstone);cowstoneCREATE INDEX locks_ttl_idx ON public.locks USING btree (ttl);cowstonecowstone-- public.parameters definitioncowstoneCREATE TABLE public.parameters (cowstone “key” text NOT NULL,cowstone value text NOT NULL,cowstone created_at timestamptz NULL,cowstone CONSTRAINT parameters_pkey PRIMARY KEY (key)cowstone);cowstonecowstone-- public.ratelimiting_metrics definitioncowstoneCREATE TABLE public.ratelimiting_metrics (cowstone identifier text NOT NULL,cowstone “period” text NOT NULL,cowstone period_date timestamptz NOT NULL,cowstone service_id uuid NOT NULL DEFAULT ‘00000000-0000-0000-0000-000000000000’::uuid,cowstone route_id uuid NOT NULL DEFAULT ‘00000000-0000-0000-0000-000000000000’::uuid,cowstone value int4 NULL,cowstone ttl timestamptz NULL,cowstone CONSTRAINT ratelimiting_metrics_pkey PRIMARY KEY (identifier, period, period_date, service_id, route_id)cowstone);cowstoneCREATE INDEX ratelimiting_metrics_idx ON public.ratelimiting_metrics USING btree (service_id, route_id, period_date, period);cowstoneCREATE INDEX ratelimiting_metrics_ttl_idx ON public.ratelimiting_metrics USING btree (ttl);cowstonecowstone-- public.response_ratelimiting_metrics definitioncowstoneCREATE TABLE public.response_ratelimiting_metrics (cowstone identifier text NOT NULL,cowstone “period” text NOT NULL,cowstone period_date timestamptz NOT NULL,cowstone service_id uuid NOT NULL DEFAULT ‘00000000-0000-0000-0000-000000000000’::uuid,cowstone route_id uuid NOT NULL DEFAULT ‘00000000-0000-0000-0000-000000000000’::uuid,cowstone value int4 NULL,cowstone CONSTRAINT response_ratelimiting_metrics_pkey PRIMARY KEY (identifier, period, period_date, service_id, route_id)cowstone);cowstonecowstone-- public.schema_meta definitioncowstoneCREATE TABLE public.schema_meta (cowstone “key” text NOT NULL,cowstone subsystem text NOT NULL,cowstone last_executed text NULL,cowstone executed _text NULL,cowstone pending _text NULL,cowstone CONSTRAINT schema_meta_pkey PRIMARY KEY (key, subsystem)cowstone);cowstonecowstone-- public.sessions definitioncowstoneCREATE TABLE public.sessions (cowstone id uuid NOT NULL,cowstone session_id text NULL,cowstone expires int4 NULL,cowstone “data” text NULL,cowstone created_at timestamptz NULL,cowstone ttl timestamptz NULL,cowstone CONSTRAINT sessions_pkey PRIMARY KEY (id),cowstone CONSTRAINT sessions_session_id_key UNIQUE (session_id)cowstone);cowstoneCREATE INDEX session_sessions_expires_idx ON public.sessions USING btree (expires);cowstoneCREATE INDEX sessions_ttl_idx ON public.sessions USING btree (ttl);cowstonecowstone-- public.tags definitioncowstoneCREATE TABLE public.tags (cowstone entity_id uuid NOT NULL,cowstone entity_name text NULL,cowstone tags _text NULL,cowstone CONSTRAINT tags_pkey PRIMARY KEY (entity_id)cowstone);cowstoneCREATE INDEX tags_entity_name_idx ON public.tags USING btree (entity_name);cowstoneCREATE INDEX tags_tags_idx ON public.tags USING gin (tags);cowstonecowstone-- public.ttls definitioncowstoneCREATE TABLE public.ttls (cowstone primary_key_value text NOT NULL,cowstone primary_uuid_value uuid NULL,cowstone table_name text NOT NULL,cowstone primary_key_name text NOT NULL,cowstone expire_at timestamp NOT NULL,cowstone CONSTRAINT ttls_pkey PRIMARY KEY (primary_key_value, table_name)cowstone);cowstoneCREATE INDEX ttls_primary_uuid_value_idx ON public.ttls USING btree (primary_uuid_value);cowstonecowstone-- public.workspaces definitioncowstoneCREATE TABLE public.workspaces (cowstone id uuid NOT NULL,cowstone “name” text NULL,cowstone “comment” text NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone meta jsonb NULL,cowstone config jsonb NULL,cowstone CONSTRAINT workspaces_name_key UNIQUE (name),cowstone CONSTRAINT workspaces_pkey PRIMARY KEY (id)cowstone);cowstonecowstone-- public.certificates definitioncowstoneCREATE TABLE public.certificates (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone cert text NULL,cowstone “key” text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone cert_alt text NULL,cowstone key_alt text NULL,cowstone CONSTRAINT certificates_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT certificates_pkey PRIMARY KEY (id),cowstone CONSTRAINT certificates_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX certificates_tags_idx ON public.certificates USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger certificates_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.certificates for each row execute function sync_tags();cowstonecowstone-- public.consumers definitioncowstoneCREATE TABLE public.consumers (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone username text NULL,cowstone custom_id text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT consumers_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT consumers_pkey PRIMARY KEY (id),cowstone CONSTRAINT consumers_ws_id_custom_id_unique UNIQUE (ws_id, custom_id),cowstone CONSTRAINT consumers_ws_id_username_unique UNIQUE (ws_id, username),cowstone CONSTRAINT consumers_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX consumers_tags_idx ON public.consumers USING gin (tags);cowstoneCREATE INDEX consumers_username_idx ON public.consumers USING btree (lower(username));cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger consumers_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.consumers for each row execute function sync_tags();cowstonecowstone-- public.hmacauth_credentials definitioncowstoneCREATE TABLE public.hmacauth_credentials (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone consumer_id uuid NULL,cowstone username text NULL,cowstone secret text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT hmacauth_credentials_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT hmacauth_credentials_pkey PRIMARY KEY (id),cowstone CONSTRAINT hmacauth_credentials_ws_id_username_unique UNIQUE (ws_id, username),cowstone CONSTRAINT hmacauth_credentials_consumer_id_fkey FOREIGN KEY (consumer_id,ws_id) REFERENCES public.consumers(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT hmacauth_credentials_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX hmacauth_credentials_consumer_id_idx ON public.hmacauth_credentials USING btree (consumer_id);cowstoneCREATE INDEX hmacauth_tags_idex_tags_idx ON public.hmacauth_credentials USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger hmacauth_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.hmacauth_credentials for each row execute function sync_tags();cowstonecowstone-- public.jwt_secrets definitioncowstoneCREATE TABLE public.jwt_secrets (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone consumer_id uuid NULL,cowstone “key” text NULL,cowstone secret text NULL,cowstone algorithm text NULL,cowstone rsa_public_key text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT jwt_secrets_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT jwt_secrets_pkey PRIMARY KEY (id),cowstone CONSTRAINT jwt_secrets_ws_id_key_unique UNIQUE (ws_id, key),cowstone CONSTRAINT jwt_secrets_consumer_id_fkey FOREIGN KEY (consumer_id,ws_id) REFERENCES public.consumers(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT jwt_secrets_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX jwt_secrets_consumer_id_idx ON public.jwt_secrets USING btree (consumer_id);cowstoneCREATE INDEX jwt_secrets_secret_idx ON public.jwt_secrets USING btree (secret);cowstoneCREATE INDEX jwtsecrets_tags_idex_tags_idx ON public.jwt_secrets USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger jwtsecrets_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.jwt_secrets for each row execute function sync_tags();cowstonecowstonecowstone-- public.key_sets definitioncowstoneCREATE TABLE public.key_sets (cowstone id uuid NOT NULL,cowstone “name” text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone created_at timestamptz NULL,cowstone updated_at timestamptz NULL,cowstone CONSTRAINT key_sets_name_key UNIQUE (name),cowstone CONSTRAINT key_sets_pkey PRIMARY KEY (id),cowstone CONSTRAINT key_sets_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX key_sets_tags_idx ON public.key_sets USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger key_sets_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.key_sets for each row execute function sync_tags();cowstonecowstone-- public.keyauth_credentials definitioncowstoneCREATE TABLE public.keyauth_credentials (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone consumer_id uuid NULL,cowstone “key” text NULL,cowstone tags _text NULL,cowstone ttl timestamptz NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT keyauth_credentials_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT keyauth_credentials_pkey PRIMARY KEY (id),cowstone CONSTRAINT keyauth_credentials_ws_id_key_unique UNIQUE (ws_id, key),cowstone CONSTRAINT keyauth_credentials_consumer_id_fkey FOREIGN KEY (consumer_id,ws_id) REFERENCES public.consumers(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT keyauth_credentials_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX keyauth_credentials_consumer_id_idx ON public.keyauth_credentials USING btree (consumer_id);cowstoneCREATE INDEX keyauth_credentials_ttl_idx ON public.keyauth_credentials USING btree (ttl);cowstoneCREATE INDEX keyauth_tags_idex_tags_idx ON public.keyauth_credentials USING gin (tags);cowstonecowstone-- Table Triggerscowstonecreate trigger keyauth_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.keyauth_credentials for each row execute function sync_tags();cowstonecowstone-- public.keys definitioncowstoneCREATE TABLE public.keys (cowstone id uuid NOT NULL,cowstone set_id uuid NULL,cowstone “name” text NULL,cowstone cache_key text NULL,cowstone ws_id uuid NULL,cowstone kid text NULL,cowstone jwk text NULL,cowstone pem jsonb NULL,cowstone tags _text NULL,cowstone created_at timestamptz NULL,cowstone updated_at timestamptz NULL,cowstone CONSTRAINT keys_cache_key_key UNIQUE (cache_key),cowstone CONSTRAINT keys_kid_set_id_key UNIQUE (kid, set_id),cowstone CONSTRAINT keys_name_key UNIQUE (name),cowstone CONSTRAINT keys_pkey PRIMARY KEY (id),cowstone CONSTRAINT keys_set_id_fkey FOREIGN KEY (set_id) REFERENCES public.key_sets(id) ON DELETE CASCADE,cowstone CONSTRAINT keys_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX keys_fkey_key_sets ON public.keys USING btree (set_id);cowstoneCREATE INDEX keys_tags_idx ON public.keys USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger keys_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.keys for each row execute function sync_tags();cowstonecowstone-- public.oauth2_credentials definitioncowstonecowstoneCREATE TABLE public.oauth2_credentials (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone “name” text NULL,cowstone consumer_id uuid NULL,cowstone client_id text NULL,cowstone client_secret text NULL,cowstone redirect_uris _text NULL,cowstone tags _text NULL,cowstone client_type text NULL,cowstone hash_secret bool NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT oauth2_credentials_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT oauth2_credentials_pkey PRIMARY KEY (id),cowstone CONSTRAINT oauth2_credentials_ws_id_client_id_unique UNIQUE (ws_id, client_id),cowstone CONSTRAINT oauth2_credentials_consumer_id_fkey FOREIGN KEY (consumer_id,ws_id) REFERENCES public.consumers(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT oauth2_credentials_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX oauth2_credentials_consumer_id_idx ON public.oauth2_credentials USING btree (consumer_id);cowstoneCREATE INDEX oauth2_credentials_secret_idx ON public.oauth2_credentials USING btree (client_secret);cowstoneCREATE INDEX oauth2_credentials_tags_idex_tags_idx ON public.oauth2_credentials USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger oauth2_credentials_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.oauth2_credentials for each row execute function sync_tags();cowstonecowstone-- public.services definitioncowstonecowstoneCREATE TABLE public.services (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL,cowstone updated_at timestamptz NULL,cowstone “name” text NULL,cowstone retries int8 NULL,cowstone protocol text NULL,cowstone host text NULL,cowstone port int8 NULL,cowstone “path” text NULL,cowstone connect_timeout int8 NULL,cowstone write_timeout int8 NULL,cowstone read_timeout int8 NULL,cowstone tags _text NULL,cowstone client_certificate_id uuid NULL,cowstone tls_verify bool NULL,cowstone tls_verify_depth int2 NULL,cowstone ca_certificates _uuid NULL,cowstone ws_id uuid NULL,cowstone enabled bool NULL DEFAULT true,cowstone CONSTRAINT services_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT services_pkey PRIMARY KEY (id),cowstone CONSTRAINT services_ws_id_name_unique UNIQUE (ws_id, name),cowstone CONSTRAINT services_client_certificate_id_fkey FOREIGN KEY (client_certificate_id,ws_id) REFERENCES public.certificates(id,ws_id),cowstone CONSTRAINT services_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX services_fkey_client_certificate ON public.services USING btree (client_certificate_id);cowstoneCREATE INDEX services_tags_idx ON public.services USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger services_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.services for each row execute function sync_tags();cowstonecowstonecowstone-- public.sm_vaults definitioncowstonecowstoneCREATE TABLE public.sm_vaults (cowstone id uuid NOT NULL,cowstone ws_id uuid NULL,cowstone prefix text NULL,cowstone “name” text NOT NULL,cowstone description text NULL,cowstone config jsonb NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone updated_at timestamptz NULL,cowstone tags _text NULL,cowstone CONSTRAINT sm_vaults_id_ws_id_key UNIQUE (id, ws_id),cowstone CONSTRAINT sm_vaults_pkey PRIMARY KEY (id),cowstone CONSTRAINT sm_vaults_prefix_key UNIQUE (prefix),cowstone CONSTRAINT sm_vaults_prefix_ws_id_key UNIQUE (prefix, ws_id),cowstone CONSTRAINT sm_vaults_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX sm_vaults_tags_idx ON public.sm_vaults USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger sm_vaults_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.sm_vaults for each row execute function sync_tags();cowstonecowstone-- public.snis definitioncowstonecowstoneCREATE TABLE public.snis (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone “name” text NOT NULL,cowstone certificate_id uuid NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT snis_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT snis_name_key UNIQUE (name),cowstone CONSTRAINT snis_pkey PRIMARY KEY (id),cowstone CONSTRAINT snis_certificate_id_fkey FOREIGN KEY (certificate_id,ws_id) REFERENCES public.certificates(id,ws_id),cowstone CONSTRAINT snis_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX snis_certificate_id_idx ON public.snis USING btree (certificate_id);cowstoneCREATE INDEX snis_tags_idx ON public.snis USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger snis_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.snis for each row execute function sync_tags();cowstonecowstone-- public.upstreams definitioncowstonecowstoneCREATE TABLE public.upstreams (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(3) AT TIME ZONE ‘UTC’::text),cowstone “name” text NULL,cowstone hash_on text NULL,cowstone hash_fallback text NULL,cowstone hash_on_header text NULL,cowstone hash_fallback_header text NULL,cowstone hash_on_cookie text NULL,cowstone hash_on_cookie_path text NULL,cowstone slots int4 NOT NULL,cowstone healthchecks jsonb NULL,cowstone tags _text NULL,cowstone algorithm text NULL,cowstone host_header text NULL,cowstone client_certificate_id uuid NULL,cowstone ws_id uuid NULL,cowstone hash_on_query_arg text NULL,cowstone hash_fallback_query_arg text NULL,cowstone hash_on_uri_capture text NULL,cowstone hash_fallback_uri_capture text NULL,cowstone use_srv_name bool NULL DEFAULT false,cowstone CONSTRAINT upstreams_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT upstreams_pkey PRIMARY KEY (id),cowstone CONSTRAINT upstreams_ws_id_name_unique UNIQUE (ws_id, name),cowstone CONSTRAINT upstreams_client_certificate_id_fkey FOREIGN KEY (client_certificate_id) REFERENCES public.certificates(id),cowstone CONSTRAINT upstreams_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX upstreams_fkey_client_certificate ON public.upstreams USING btree (client_certificate_id);cowstoneCREATE INDEX upstreams_tags_idx ON public.upstreams USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger upstreams_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.upstreams for each row execute function sync_tags();cowstonecowstone-- public.acls definitioncowstonecowstoneCREATE TABLE public.acls (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone consumer_id uuid NULL,cowstone “group” text NULL,cowstone cache_key text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT acls_cache_key_key UNIQUE (cache_key),cowstone CONSTRAINT acls_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT acls_pkey PRIMARY KEY (id),cowstone CONSTRAINT acls_consumer_id_fkey FOREIGN KEY (consumer_id,ws_id) REFERENCES public.consumers(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT acls_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX acls_consumer_id_idx ON public.acls USING btree (consumer_id);cowstoneCREATE INDEX acls_group_idx ON public.acls USING btree (“group”);cowstoneCREATE INDEX acls_tags_idex_tags_idx ON public.acls USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger acls_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.acls for each row execute function sync_tags();cowstonecowstone-- public.basicauth_credentials definitioncowstonecowstoneCREATE TABLE public.basicauth_credentials (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone consumer_id uuid NULL,cowstone username text NULL,cowstone “password” text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT basicauth_credentials_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT basicauth_credentials_pkey PRIMARY KEY (id),cowstone CONSTRAINT basicauth_credentials_ws_id_username_unique UNIQUE (ws_id, username),cowstone CONSTRAINT basicauth_credentials_consumer_id_fkey FOREIGN KEY (consumer_id,ws_id) REFERENCES public.consumers(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT basicauth_credentials_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX basicauth_consumer_id_idx ON public.basicauth_credentials USING btree (consumer_id);cowstoneCREATE INDEX basicauth_tags_idex_tags_idx ON public.basicauth_credentials USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger basicauth_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.basicauth_credentials for each row execute function sync_tags();cowstonecowstone-- public.oauth2_authorization_codes definitioncowstonecowstoneCREATE TABLE public.oauth2_authorization_codes (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone credential_id uuid NULL,cowstone service_id uuid NULL,cowstone code text NULL,cowstone authenticated_userid text NULL,cowstone “scope” text NULL,cowstone ttl timestamptz NULL,cowstone challenge text NULL,cowstone challenge_method text NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT oauth2_authorization_codes_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT oauth2_authorization_codes_pkey PRIMARY KEY (id),cowstone CONSTRAINT oauth2_authorization_codes_ws_id_code_unique UNIQUE (ws_id, code),cowstone CONSTRAINT oauth2_authorization_codes_credential_id_fkey FOREIGN KEY (credential_id,ws_id) REFERENCES public.oauth2_credentials(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT oauth2_authorization_codes_service_id_fkey FOREIGN KEY (service_id,ws_id) REFERENCES public.services(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT oauth2_authorization_codes_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX oauth2_authorization_codes_authenticated_userid_idx ON public.oauth2_authorization_codes USING btree (authenticated_userid);cowstoneCREATE INDEX oauth2_authorization_codes_ttl_idx ON public.oauth2_authorization_codes USING btree (ttl);cowstoneCREATE INDEX oauth2_authorization_credential_id_idx ON public.oauth2_authorization_codes USING btree (credential_id);cowstoneCREATE INDEX oauth2_authorization_service_id_idx ON public.oauth2_authorization_codes USING btree (service_id);cowstonecowstonecowstone-- public.oauth2_tokens definitioncowstonecowstoneCREATE TABLE public.oauth2_tokens (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone credential_id uuid NULL,cowstone service_id uuid NULL,cowstone access_token text NULL,cowstone refresh_token text NULL,cowstone token_type text NULL,cowstone expires_in int4 NULL,cowstone authenticated_userid text NULL,cowstone “scope” text NULL,cowstone ttl timestamptz NULL,cowstone ws_id uuid NULL,cowstone CONSTRAINT oauth2_tokens_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT oauth2_tokens_pkey PRIMARY KEY (id),cowstone CONSTRAINT oauth2_tokens_ws_id_access_token_unique UNIQUE (ws_id, access_token),cowstone CONSTRAINT oauth2_tokens_ws_id_refresh_token_unique UNIQUE (ws_id, refresh_token),cowstone CONSTRAINT oauth2_tokens_credential_id_fkey FOREIGN KEY (credential_id,ws_id) REFERENCES public.oauth2_credentials(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT oauth2_tokens_service_id_fkey FOREIGN KEY (service_id,ws_id) REFERENCES public.services(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT oauth2_tokens_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX oauth2_tokens_authenticated_userid_idx ON public.oauth2_tokens USING btree (authenticated_userid);cowstoneCREATE INDEX oauth2_tokens_credential_id_idx ON public.oauth2_tokens USING btree (credential_id);cowstoneCREATE INDEX oauth2_tokens_service_id_idx ON public.oauth2_tokens USING btree (service_id);cowstoneCREATE INDEX oauth2_tokens_ttl_idx ON public.oauth2_tokens USING btree (ttl);cowstonecowstonecowstone-- public.routes definitioncowstonecowstoneCREATE TABLE public.routes (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL,cowstone updated_at timestamptz NULL,cowstone “name” text NULL,cowstone service_id uuid NULL,cowstone protocols _text NULL,cowstone methods _text NULL,cowstone hosts _text NULL,cowstone paths _text NULL,cowstone snis _text NULL,cowstone sources _jsonb NULL,cowstone destinations _jsonb NULL,cowstone regex_priority int8 NULL,cowstone strip_path bool NULL,cowstone preserve_host bool NULL,cowstone tags _text NULL,cowstone https_redirect_status_code int4 NULL,cowstone headers jsonb NULL,cowstone path_handling text NULL DEFAULT ‘v0’::text,cowstone ws_id uuid NULL,cowstone request_buffering bool NULL,cowstone response_buffering bool NULL,cowstone “expression” text NULL,cowstone priority int8 NULL,cowstone CONSTRAINT routes_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT routes_pkey PRIMARY KEY (id),cowstone CONSTRAINT routes_ws_id_name_unique UNIQUE (ws_id, name),cowstone CONSTRAINT routes_service_id_fkey FOREIGN KEY (service_id,ws_id) REFERENCES public.services(id,ws_id),cowstone CONSTRAINT routes_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX routes_service_id_idx ON public.routes USING btree (service_id);cowstoneCREATE INDEX routes_tags_idx ON public.routes USING gin (tags);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger routes_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.routes for each row execute function sync_tags();cowstonecowstone-- public.targets definitioncowstonecowstoneCREATE TABLE public.targets (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(3) AT TIME ZONE ‘UTC’::text),cowstone upstream_id uuid NULL,cowstone target text NOT NULL,cowstone weight int4 NOT NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone cache_key text NULL,cowstone CONSTRAINT targets_cache_key_key UNIQUE (cache_key),cowstone CONSTRAINT targets_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT targets_pkey PRIMARY KEY (id),cowstone CONSTRAINT targets_upstream_id_fkey FOREIGN KEY (upstream_id,ws_id) REFERENCES public.upstreams(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT targets_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX targets_tags_idx ON public.targets USING gin (tags);cowstoneCREATE INDEX targets_target_idx ON public.targets USING btree (target);cowstoneCREATE INDEX targets_upstream_id_idx ON public.targets USING btree (upstream_id);cowstonecowstone-- Table Triggerscowstonecowstonecreate trigger targets_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.targets for each row execute function sync_tags();cowstonecowstone-- public.plugins definitioncowstonecowstoneCREATE TABLE public.plugins (cowstone id uuid NOT NULL,cowstone created_at timestamptz NULL DEFAULT (CURRENT_TIMESTAMP(0) AT TIME ZONE ‘UTC’::text),cowstone “name” text NOT NULL,cowstone consumer_id uuid NULL,cowstone service_id uuid NULL,cowstone route_id uuid NULL,cowstone config jsonb NOT NULL,cowstone enabled bool NOT NULL,cowstone cache_key text NULL,cowstone protocols _text NULL,cowstone tags _text NULL,cowstone ws_id uuid NULL,cowstone instance_name text NULL,cowstone CONSTRAINT plugins_cache_key_key UNIQUE (cache_key),cowstone CONSTRAINT plugins_id_ws_id_unique UNIQUE (id, ws_id),cowstone CONSTRAINT plugins_pkey PRIMARY KEY (id),cowstone CONSTRAINT plugins_ws_id_instance_name_unique UNIQUE (ws_id, instance_name),cowstone CONSTRAINT plugins_consumer_id_fkey FOREIGN KEY (consumer_id,ws_id) REFERENCES public.consumers(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT plugins_route_id_fkey FOREIGN KEY (route_id,ws_id) REFERENCES public.routes(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT plugins_service_id_fkey FOREIGN KEY (service_id,ws_id) REFERENCES public.services(id,ws_id) ON DELETE CASCADE,cowstone CONSTRAINT plugins_ws_id_fkey FOREIGN KEY (ws_id) REFERENCES public.workspaces(id)cowstone);cowstoneCREATE INDEX plugins_consumer_id_idx ON public.plugins USING btree (consumer_id);cowstoneCREATE INDEX plugins_name_idx ON public.plugins USING btree (name);cowstoneCREATE INDEX plugins_route_id_idx ON public.plugins USING btree (route_id);cowstoneCREATE INDEX plugins_service_id_idx ON public.plugins USING btree (service_id);cowstoneCREATE INDEX plugins_tags_idx ON public.plugins USING gin (tags);cowstonecowstone-- Table Triggerscowstonecreate trigger plugins_sync_tags_trigger AFTER INSERT OR DELETE OR UPDATE of tags ON public.plugins for each row execute function sync_tags();cowstonecowstone-- 初始化数据cowstoneINSERT INTO public.workspaces (id, “name”, “comment”, created_at, meta, config) VALUES(‘dbcec625-c3e2-4737-867c-01c88c97ffab’::uuid, ‘default’, NULL, ‘2023-07-20 14:25:54.000’, NULL, NULL);cowstonecowstoneINSERT INTO public.services (id, created_at, updated_at, “name”, retries, protocol, host, port, “path”, connect_timeout, write_timeout, read_timeout, tags, client_certificate_id, tls_verify, tls_verify_depth, ca_certificates, ws_id, enabled) VALUES(‘c8d6569e-0cb3-42f2-8a40-b0c9c29cea5b’::uuid, ‘2023-07-20 14:33:02.000’, ‘2023-07-20 14:33:02.000’, ‘adminapi’, 5, ‘http’, ‘localhost’, 8001, NULL, 60000, 60000, 60000, NULL, NULL, NULL, NULL, NULL, ‘dbcec625-c3e2-4737-867c-01c88c97ffab’::uuid, true);cowstonecowstoneINSERT INTO public.consumers (id, created_at, username, custom_id, tags, ws_id) VALUES(‘c375a446-ad2a-4b57-b0b4-23a499302b76’::uuid, ‘2023-07-20 14:33:02.000’, ‘adminapi’, NULL, NULL, ‘dbcec625-c3e2-4737-867c-01c88c97ffab’::uuid);cowstonecowstoneINSERT INTO public.acls (id, created_at, consumer_id, “group”, cache_key, tags, ws_id) VALUES(‘032d6440-81de-4f65-ad5b-f71a3c741109’::uuid, ‘2023-07-20 14:33:02.000’, ‘c375a446-ad2a-4b57-b0b4-23a499302b76’::uuid, ‘adminapi’, ‘acls:c375a446-ad2a-4b57-b0b4-23a499302b76:adminapi::::dbcec625-c3e2-4737-867c-01c88c97ffab’, NULL, ‘dbcec625-c3e2-4737-867c-01c88c97ffab’::uuid);cowstonecowstoneINSERT INTO public.keyauth_credentials (id, created_at, consumer_id, “key”, tags, ttl, ws_id) VALUES(‘38d8ef7a-ccc3-4ed4-af14-3afb540a26dd’::uuid, ‘2023-07-20 14:33:02.000’, ‘c375a446-ad2a-4b57-b0b4-23a499302b76’::uuid, ‘A9APUx2AqAmS6BU’, NULL, NULL, ‘dbcec625-c3e2-4737-867c-01c88c97ffab’::uuid);cowstoneINSERT INTO public.parameters (“key”, value, created_at) VALUES(‘cluster_id’, ‘66d94d44-91c9-43e0-856a-f0faceeb1667’, NULL);cowstonecowstoneINSERT INTO public.plugins (id, created_at, “name”, consumer_id, service_id, route_id, config, enabled, cache_key, protocols, tags, ws_id, instance_name) VALUES(‘ecb7393c-3ea7-42a7-ae8f-20fe8c730fee’::uuid, ‘2023-07-20 14:33:02.000’, ‘key-auth’, NULL, ‘c8d6569e-0cb3-42f2-8a40-b0c9c29cea5b’::uuid, NULL, ‘{“anonymous”: null, “key_names”: [“apikey”], “key_in_body”: false, “key_in_query”: true, “key_in_header”: true, “hide_credentials”: false, “run_on_preflight”: true}’::jsonb, true, ‘plugins:key-auth::c8d6569e-0cb3-42f2-8a40-b0c9c29cea5b:::dbcec625-c3e2-4737-867c-01c88c97ffab’, ‘{grpc,grpcs,http,https}’, NULL, ‘dbcec625-c3e2-4737-867c-01c88c97ffab’::uuid, NULL);cowstonecowstoneINSERT INTO public.routes (id, created_at, updated_at, “name”, service_id, protocols, methods, hosts, paths, snis, sources, destinations, regex_priority, strip_path, preserve_host, tags, https_redirect_status_code, headers, path_handling, ws_id, request_buffering, response_buffering, “expression”, priority) VALUES(‘548722a4-2cb2-4685-bae6-baabcae94c75’::uuid, ‘2023-07-20 14:33:02.000’, ‘2023-07-20 14:33:02.000’, NULL, ‘c8d6569e-0cb3-42f2-8a40-b0c9c29cea5b’::uuid, ‘{http,https}’, NULL, NULL, ‘{/adminapi}’, NULL, NULL, NULL, 0, true, false, NULL, 426, NULL, ‘v0’, ‘dbcec625-c3e2-4737-867c-01c88c97ffab’::uuid, true, true, NULL, NULL);cowstonecowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘basic-auth’, ‘003_200_to_210’, ‘{000_base_basic_auth,002_130_to_140,003_200_to_210}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘bot-detection’, ‘001_200_to_210’, ‘{001_200_to_210}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘hmac-auth’, ‘003_200_to_210’, ‘{000_base_hmac_auth,002_130_to_140,003_200_to_210}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘http-log’, ‘001_280_to_300’, ‘{001_280_to_300}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘ip-restriction’, ‘001_200_to_210’, ‘{001_200_to_210}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘jwt’, ‘003_200_to_210’, ‘{000_base_jwt,002_130_to_140,003_200_to_210}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘key-auth’, ‘003_200_to_210’, ‘{000_base_key_auth,002_130_to_140,003_200_to_210}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘core’, ‘018_310_to_320’, ‘{000_base,003_100_to_110,004_110_to_120,005_120_to_130,006_130_to_140,007_140_to_150,008_150_to_200,009_200_to_210,010_210_to_211,011_212_to_213,012_213_to_220,013_220_to_230,014_230_to_270,015_270_to_280,016_280_to_300,017_300_to_310,018_310_to_320}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘acl’, ‘004_212_to_213’, ‘{000_base_acl,002_130_to_140,003_200_to_210,004_212_to_213}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘acme’, ‘001_280_to_300’, ‘{000_base_acme,001_280_to_300}’, NULL);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘oauth2’, ‘005_210_to_211’, ‘{000_base_oauth2,003_130_to_140,004_200_to_210,005_210_to_211}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘post-function’, ‘001_280_to_300’, ‘{001_280_to_300}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘pre-function’, ‘001_280_to_300’, ‘{001_280_to_300}’, ‘{}’);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘rate-limiting’, ‘004_200_to_210’, ‘{000_base_rate_limiting,003_10_to_112,004_200_to_210}’, NULL);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘response-ratelimiting’, ‘000_base_response_rate_limiting’, ‘{000_base_response_rate_limiting}’, NULL);cowstoneINSERT INTO public.schema_meta (“key”, subsystem, last_executed, executed, pending) VALUES(‘schema_meta’, ‘session’, ‘001_add_ttl_index’, ‘{000_base_session,001_add_ttl_index}’, NULL);cowstonecowstonecowstonecowstone-- webhook 插件cowstonecowstoneCREATE TABLE “public”.“handle_chain” (cowstone “id” varchar(30) COLLATE “pg_catalog”.“default” NOT NULL,cowstone “tenant_id” varchar(30) COLLATE “pg_catalog”.“default” NOT NULL,cowstone “web_hook_code” varchar(255) COLLATE “pg_catalog”.“default” NOT NULL,cowstone “web_hook_name” varchar(255) COLLATE “pg_catalog”.“default” NOT NULL,cowstone “handler_chain_config” text COLLATE “pg_catalog”.“default” NOT NULL,cowstone “run_status” varchar(255) COLLATE “pg_catalog”.“default” NOT NULL,cowstone CONSTRAINT “handle_chain_pkey” PRIMARY KEY (“id”)cowstone);cowstonecowstoneCOMMENT ON COLUMN “public”.“handle_chain”.“tenant_id” IS ‘租户id’;cowstonecowstoneCOMMENT ON COLUMN “public”.“handle_chain”.“web_hook_code” IS ‘编码’;cowstonecowstoneCOMMENT ON COLUMN “public”.“handle_chain”.“web_hook_name” IS ‘名称’;cowstonecowstoneCOMMENT ON COLUMN “public”.“handle_chain”.“handler_chain_config” IS ‘配置json’;cowstonecowstoneCOMMENT ON COLUMN “public”.“handle_chain”.“run_status” IS ‘运行状态:RUNNING/STOP’;cowstonecowstone-- postgresql 数字签名优化cowstoneALTER TABLE hmacauth_credentials ADD COLUMN public_key text; cowstone cowstone-- 环境变量插件优化cowstone-- 租户表cowstonecreate table tenantscowstone(cowstone id uuid not nullcowstone primary key,cowstone created_at timestamp with time zone default timezone(‘UTC’::text, (‘now’::text)::timestamp(0) with time zone),cowstone tenant_code text uniquecowstone);cowstonecowstone-- 环境变量表cowstonecreate table request_variablescowstone(cowstone id uuid not nullcowstone primary key,cowstone created_at timestamp with time zone default timezone(‘UTC’::text, (‘now’::text)::timestamp(0) with time zone),cowstone cache_key textcowstone unique,cowstone tenant_id uuid,cowstone variables_name text,cowstone variables_value text,cowstone ws_id uuidcowstone references workspaces,cowstone constraint request_variables_id_ws_id_uniquecowstone unique (id, ws_id),cowstone constraint request_variables_ws_id_tenant_code_variables_name_uniquecowstone unique (ws_id, tenant_id, variables_name),cowstone constraint variables_targets_target_id_fkeycowstone foreign key (tenant_id) references public.tenants (id)cowstone on delete cascadecowstone);cowstonecowstonecreate index request_variables_tenant_id_idxcowstone on public.request_variables (tenant_id);cowstonecowstone-- 环境变量与target关联表cowstonecreate table variables_targetscowstone(cowstone id uuid not nullcowstone primary key,cowstone created_at timestamp with time zone default timezone(‘UTC’::text, (‘now’::text)::timestamp(0) with time zone),cowstone cache_key textcowstone unique,cowstone target_id uuid,cowstone variable_id uuid,cowstone constraint variables_targets_target_id_fkeycowstone foreign key (target_id) references targets (id)cowstone on delete cascade,cowstone constraint variables_targets_variables_id_fkeycowstone foreign key (variable_id) references public.request_variables (id)cowstone on delete cascadecowstone);cowstonecowstoneALTER TABLE variables_targetscowstone ADD COLUMN update_type text;cowstonecowstonecreate index variables_targets_variable_id_idxcowstone on public.variables_targets (variable_id);cowstone cowstone cowstone

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot通过使用内网穿透工具,可以将本地部署的应用程序暴露给公网,从而可以在外部访问该应用程序。下面是一些步骤来解决Spring Boot内网穿透的问题: 1. 创建Spring Boot项目:首先创建一个新的Spring Boot项目,可以使用Spring Initializr或者其他方式创建项目。 2. 解决内网穿透的问题:为了实现内网穿透,我们可以使用第三方工具,例如Ngrok、Frp等。这些工具可以将本地应用程序的端口映射到公网上,实现公网访问。 3. 测试内网穿透是否成功:在完成内网穿透设置后,你可以使用外部设备或者浏览器访问你的应用程序。输入正确的公网地址和端口号,如果能够正常访问到应用程序,则说明内网穿透已经成功。 4. 打包并运行Spring Boot应用程序:为了在生产环境中部署应用程序,我们可以使用Spring Boot的打包功能,将应用程序打包成可执行的jar文件。然后,我们可以在目标服务器上运行该jar文件来启动应用程序。 5. 本地运行jar文件:如果你想在本地运行打包后的jar文件,可以通过命令行或者IDE来运行。使用如下命令来启动应用程序:java -jar your-application.jar,其中your-application.jar是你打包后的jar文件。 总结: 通过创建Spring Boot项目,解决内网穿透的问题,并测试内网穿透是否成功,然后使用Spring Boot的打包功能来打包应用程序,并在目标服务器上运行jar文件来部署应用程序。如果需要在本地运行打包后的jar文件,可以使用命令行或者IDE来运行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值