Compare commits

...
1 Commits
3 changed files with 20 additions and 8 deletions

No files matched your search

+12
View File
@@ -1,3 +1,15 @@
vpn-router (0.39.1-1) unstable; urgency=medium
fix: the web service starts again after its first start with 0.39.0, and the
name server's domains can be changed from any process.
* The schemas of the web sites and of the name server can be applied any
number of times, so the web service no longer keeps retrying with
'function "site_put" already exists' and never listening, and
vpn-router-site and setup no longer fail the same way.
-- Slawomir Koszewski <slawek@koszewscy.waw.pl> Fri, 06 Nov 2026 20:16:57 +0100
vpn-router (0.39.0-2) unstable; urgency=medium
update: vpn-router is published in the koszewscy package registry.
@@ -39,14 +39,14 @@ CREATE TABLE IF NOT EXISTS dns_state (
serial bigint NOT NULL
);
CREATE FUNCTION dns_domains_list()
CREATE OR REPLACE FUNCTION dns_domains_list()
RETURNS TABLE (name text, ttl integer)
LANGUAGE sql STABLE AS $$
SELECT name, ttl FROM dns_domains ORDER BY name;
$$;
-- Add the domain, or set its TTL.
CREATE PROCEDURE dns_domain_put(p_name text, p_ttl integer)
CREATE OR REPLACE PROCEDURE dns_domain_put(p_name text, p_ttl integer)
LANGUAGE sql AS $$
INSERT INTO dns_domains (name, ttl) VALUES (p_name, p_ttl)
ON CONFLICT (name) DO UPDATE SET ttl = p_ttl;
@@ -32,7 +32,7 @@ DROP FUNCTION IF EXISTS sites_served();
DROP PROCEDURE IF EXISTS site_put(text, boolean, text[], integer, text, text, text, text, text, text, boolean, text);
-- Every site, by name; the private key is left out.
CREATE FUNCTION sites_list()
CREATE OR REPLACE FUNCTION sites_list()
RETURNS TABLE (name text, enabled boolean, hosts text[], port integer, listen text, tls text, ca text,
certificate text, index_file text, spa boolean, editors text, dns text, dns_address text,
modified timestamptz)
@@ -42,7 +42,7 @@ LANGUAGE sql STABLE AS $$
$$;
-- The site with its private key.
CREATE FUNCTION site_get(p_name text)
CREATE OR REPLACE FUNCTION site_get(p_name text)
RETURNS TABLE (name text, enabled boolean, hosts text[], port integer, listen text, tls text, ca text,
certificate text, private_key text, index_file text, spa boolean, editors text, dns text,
dns_address text, modified timestamptz)
@@ -53,7 +53,7 @@ LANGUAGE sql STABLE AS $$
$$;
-- The enabled sites with their private keys, by name, for Caddy's configuration and certificate files.
CREATE FUNCTION sites_served()
CREATE OR REPLACE FUNCTION sites_served()
RETURNS TABLE (name text, enabled boolean, hosts text[], port integer, listen text, tls text, ca text,
certificate text, private_key text, index_file text, spa boolean, editors text, dns text,
dns_address text, modified timestamptz)
@@ -64,9 +64,9 @@ LANGUAGE sql STABLE AS $$
$$;
-- Add the site, or replace all its settings.
CREATE PROCEDURE site_put(p_name text, p_enabled boolean, p_hosts text[], p_port integer, p_listen text, p_tls text,
p_ca text, p_certificate text, p_private_key text, p_index_file text, p_spa boolean,
p_editors text, p_dns text, p_dns_address text)
CREATE OR REPLACE PROCEDURE site_put(p_name text, p_enabled boolean, p_hosts text[], p_port integer, p_listen text,
p_tls text, p_ca text, p_certificate text, p_private_key text, p_index_file text,
p_spa boolean, p_editors text, p_dns text, p_dns_address text)
LANGUAGE sql AS $$
INSERT INTO sites (name, enabled, hosts, port, listen, tls, ca, certificate, private_key, index_file, spa, editors,
dns, dns_address, modified)