apiVersion: v1 kind: ConfigMap metadata: name: importer data: init.sh: | #!/bin/bash if psql -p 5432 -l | grep statping then echo 'DATABASE EXIST' else psql -p 5432 -c 'CREATE DATABASE statping' psql -v ON_ERROR_STOP=1 -p 5432 -d statping -f /init.d/init.sql fi psql -v ON_ERROR_STOP=1 -p 5432 -d statping -f /init.d/data.sql data.sql: | TRUNCATE core; INSERT INTO "core" ("name", "description", "config", "api_secret", "style", "footer", "domain", "version", "language", "migration_id", "use_cdn", "allow_reports", "created_at", "updated_at", "oauth_providers", "gh_client_id", "gh_client_secret", "gh_users", "gh_orgs", "google_client_id", "google_client_secret", "google_users", "slack_client_id", "slack_client_secret", "slack_team", "slack_users", "custom_name", "custom_client_id", "custom_client_secret", "custom_endpoint_auth", "custom_endpoint_token", "custom_scopes", "custom_open_id") VALUES ('demo 3 status', 'This status page has sample data included', '', 'Siwo6GTDxM2wwl65K4kHKgu9QgmS7n6Q', '', '', 'http://localhost:8080', '0.90.74', 'en', 1674599079, 'f', 'f', '2023-01-24 22:24:39.291738+00', '2023-01-24 22:43:59.697317+00', 'local', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL); TRUNCATE groups; INSERT INTO "groups" ("id", "name", "public", "order_id", "created_at", "updated_at") VALUES (1, 'Main Services', 't', 1, '2023-01-24 22:24:39.616202+00', '2023-01-24 22:24:39.616202+00'); TRUNCATE services; INSERT INTO "services" ("id", "name", "domain", "expected", "expected_status", "check_interval", "check_type", "method", "post_data", "port", "timeout", "order_id", "verify_ssl", "grpc_health_check", "public", "group_id", "tls_cert", "tls_cert_key", "tls_cert_root", "headers", "permalink", "redirect", "created_at", "updated_at", "notify_after", "allow_notifications", "notify_all_changes") VALUES (2, 'gitea', 'https://gitea.superzach.de', '', 200, 30, 'http', 'GET', '', 0, 20, 2, 't', 'f', 't', 1, '', '', '', '', '', 'f', '2022-10-26 22:24:39.294125+00', '2023-01-24 22:24:39.306641+00', 1, 't', 't'), (1, 'status', 'https://status.superzach.de', '', 200, 10, 'http', 'GET', '', 0, 10, 1, 't', 'f', 't', 1, '', '', '', '', '', 't', '2022-10-26 22:24:39.294125+00', '2023-01-24 22:24:39.294254+00', 3, 't', 't'); TRUNCATE users; INSERT INTO "users" ("id", "username", "password", "email", "api_key", "scopes", "administrator", "created_at", "updated_at") VALUES (1, 'mystatping', '$2a$14$r7n8uEuWgRegyu9Efa5mwuyazFQSejltE/xuJSB0ae6gufPV6O6oa', 'info@admin.com', '7d8b24cebdfaf57b4cd57c3b6fd803c95a5d4f838b4f7d0544842444809e2cf5', 'admin', 't', '2023-01-24 22:24:39.238789+00', '2023-01-24 22:52:19.360722+00'); init.sql: | CREATE TABLE "core" ( "name" text NOT NULL, "description" text NOT NULL, "config" text, "api_secret" text, "style" text NOT NULL, "footer" text, "domain" text NOT NULL, "version" text, "language" text, "migration_id" bigint, "use_cdn" boolean DEFAULT false, "allow_reports" boolean DEFAULT false, "created_at" timestamptz, "updated_at" timestamptz, "oauth_providers" text, "gh_client_id" text, "gh_client_secret" text, "gh_users" text, "gh_orgs" text, "google_client_id" text, "google_client_secret" text, "google_users" text, "slack_client_id" text, "slack_client_secret" text, "slack_team" text, "slack_users" text, "custom_name" text, "custom_client_id" text, "custom_client_secret" text, "custom_endpoint_auth" text, "custom_endpoint_token" text, "custom_scopes" text, "custom_open_id" boolean ) WITH (oids = false); CREATE SEQUENCE groups_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1; CREATE TABLE "groups" ( "id" bigint DEFAULT nextval('groups_id_seq') NOT NULL, "name" text, "public" boolean DEFAULT true, "order_id" integer DEFAULT '0', "created_at" timestamptz, "updated_at" timestamptz, CONSTRAINT "groups_pkey" PRIMARY KEY ("id") ) WITH (oids = false); CREATE SEQUENCE services_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1; CREATE TABLE "services" ( "id" bigint DEFAULT nextval('services_id_seq') NOT NULL, "name" text, "domain" text, "expected" text, "expected_status" integer DEFAULT '200', "check_interval" integer DEFAULT '30', "check_type" text, "method" text, "post_data" text, "port" integer NOT NULL, "timeout" integer DEFAULT '30', "order_id" integer DEFAULT '0', "verify_ssl" boolean DEFAULT false, "grpc_health_check" boolean DEFAULT false, "public" boolean DEFAULT true, "group_id" integer DEFAULT '0', "tls_cert" text, "tls_cert_key" text, "tls_cert_root" text, "headers" text, "permalink" text, "redirect" boolean DEFAULT false, "created_at" timestamptz, "updated_at" timestamptz, "notify_after" bigint, "allow_notifications" boolean DEFAULT true, "notify_all_changes" boolean DEFAULT true, CONSTRAINT "services_pkey" PRIMARY KEY ("id") ) WITH (oids = false); CREATE SEQUENCE users_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1; CREATE TABLE "users" ( "id" bigint DEFAULT nextval('users_id_seq') NOT NULL, "username" character varying(100), "password" text, "email" character varying(100), "api_key" text, "scopes" text, "administrator" boolean, "created_at" timestamptz, "updated_at" timestamptz, CONSTRAINT "users_pkey" PRIMARY KEY ("id"), CONSTRAINT "users_username_key" UNIQUE ("username") ) WITH (oids = false);