Skip to content

Add ADMIN_DOMAIN and support for "global" domains#918

Open
matt17r wants to merge 1 commit intothedevs-network:mainfrom
matt17r:feature/admin-domain-global-domains
Open

Add ADMIN_DOMAIN and support for "global" domains#918
matt17r wants to merge 1 commit intothedevs-network:mainfrom
matt17r:feature/admin-domain-global-domains

Conversation

@matt17r
Copy link
Copy Markdown

@matt17r matt17r commented Jun 11, 2025

This PR addresses a number of existing issues. I've tried to do so in a purely additive/optional way. Existing installations should not be impacted unless they change their configuration.

"Admin" domain

  • Admin domain (env.ADMIN_DOMAIN) is added as an optional environment variable.
  • If set, it's the domain you use to access the admin dashboard through.
  • This allows you to run Kutt at a long url (e.g. links.my-company.example.com) while still using a short URL for links (e.g. eg.url), keeping the published links separate from the backend service

"Global" domains

"Default" domain

Known issues

Homepage/fallback redirect

The DEFAULT_DOMAIN does not support fallback redirects to a homepage. One possible solution would be to set it in the env also (e.g. env.DEFAULT_HOMEPAGE). Not yet implemented in this PR.

Default domain not obvious when admin domain is set

The default domain is not listed on the Admin → Domains page. If the admin domain is set, it's not obvious what the default domain is. In this case, it might be worth appending it to the bottom of the domains table as a static entry or showing it somewhere else on that page?

P.S. Sorry for all the whitespace only changes. My editor automatically removes trailing whitespace whenever I edit a file

@Loocos
Copy link
Copy Markdown

Loocos commented Nov 12, 2025

Hello @matt17r,

Thanks for your PR, I was also looking for such a feature.

I would suggest another way, which is to be able to only say SHARE_CUSTOM_DOMAINS=true/false
This way we do not have to add it to the list of domains in the .env

Use case: Agencies that run tracking links for their customers, they need to add a domain for every single customer.
This will require a technical assistance to edit the .env for each domain.

What do you think?

 - Admin domain is optional. If set, it's the domain you access the admin dashboard through
- This means the DEFAULT_DOMAIN can now be different to the admin domain (e.g. manage at a long domain but links default to a short domain)
- Global domains can be configured by admins. They are avaialble to all users.
- Users can't see other people's links on the global domain but they are still forced to be unique
@matt17r matt17r force-pushed the feature/admin-domain-global-domains branch from df92075 to d2bef1c Compare February 23, 2026 05:30
@matt17r matt17r changed the title WIP - Add "admin" and "other global" domains Add ADMIN_DOMAIN and support for "global" domains Feb 23, 2026
@matt17r
Copy link
Copy Markdown
Author

matt17r commented Feb 23, 2026

Good point @Loocos! I've fleshed out the implementation and moved away from .env for global domains. Much simpler to just add an isGlobal flag that admins can set.

I've tested this locally and I think this is now ready for review. It would close off two items from the backlog @poeti8 and I'm pretty sure it works seamlessly with existing installs.

@Loocos
Copy link
Copy Markdown

Loocos commented Feb 23, 2026

Awesome @matt17r !
Thanks for doing it, this gonna be very useful!

Can't wait to see it merged 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants