Custom domains #20

Open
opened 2026-08-27 23:31:15 +02:00 by hannaeko · 0 comments
Owner
  • Add route POST /api/websites/{name}/domains with body {"domains": ["www.example.net"]}
  • Check for authorisation dns records:
    • _scribouilli-website.www.example.net. TXT "https://scribouilli.example.org/websites/{name}"
    • www.example.net resolve to same IP addresses as the default subdomain URL
  • Add custom domain to database
create table website_domains (
    domain text primary key,
    website_name text not null,

    foreign key(website_name) references websites(name) on update cascade on delete cascade
)
  • Add symlink from {data}/domains/www.example.net to {data}/websites/{name}
  • Add admin only listener for admin commands (including domain check), authenticated by an "admin token" in the config file
  • Add route GET /_admin/domains/check?={domain} that check that the domain exists in the database
  • Update Caddy configuration
{
	on_demand_tls {
		permission http http://localhost:3001/_admin/domains/check?token=<admin token>
	}
}

https:// {
	tls {
		on_demand
	}
	root /var/lib/scribouilli/domains/{host}
	file_server
}
  • Update website deletion function to also delete symlinks for custom domains
- [ ] Add route `POST /api/websites/{name}/domains` with body `{"domains": ["www.example.net"]}` - [ ] Check for authorisation dns records: - `_scribouilli-website.www.example.net. TXT "https://scribouilli.example.org/websites/{name}"` - `www.example.net` resolve to same IP addresses as the default subdomain URL - [ ] Add custom domain to database ```sql create table website_domains ( domain text primary key, website_name text not null, foreign key(website_name) references websites(name) on update cascade on delete cascade ) ``` - [ ] Add symlink from `{data}/domains/www.example.net` to `{data}/websites/{name}` - [ ] Add admin only listener for admin commands (including domain check), authenticated by an "admin token" in the config file - [ ] Add route `GET /_admin/domains/check?={domain}` that check that the domain exists in the database - [ ] Update Caddy configuration ```caddy { on_demand_tls { permission http http://localhost:3001/_admin/domains/check?token=<admin token> } } https:// { tls { on_demand } root /var/lib/scribouilli/domains/{host} file_server } ``` - [ ] Update website deletion function to also delete symlinks for custom domains
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hannaeko/scribouilli-backend#20
No description provided.