Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple domains #43

Open
kennygrant opened this issue Apr 8, 2018 · 5 comments
Open

Handle multiple domains #43

kennygrant opened this issue Apr 8, 2018 · 5 comments

Comments

@kennygrant
Copy link
Contributor

The CMS should let you serve pages on multiple domains. At present the assumption is that each server only serves one domain.

This would require:

  • Add domains resource with at minimum name, aliases
  • Change pages, posts, tags to be domain specific with a domain_id col
  • Not sure if users should be shared or independent, there are arguments for both
  • Handle https - see server issue on multiple https domains
@kennygrant
Copy link
Contributor Author

On users, for the CMS, at present they're only used for admin, so this doesn't really come up. For more complex use-cases with custom code, that code would depend on the site. So I'm inclined to add the column but ignore it for now on the cms.

@lastzero
Copy link

Thank you for adding this ticket. Multi-site support is really helpful for many use cases where you have to manage lots of small sites (like for my open source projects). From what I've seen I expect Fragmenta to follow a lean approach with high performance and not too many features. I guess the simplest implementation therefore would be to add a sites table that can be referenced in pages via site_id:

CREATE TABLE sites (
id SERIAL NOT NULL,
created_at timestamp,
updated_at timestamp,
title text,
description text,
canonical_name text,
domains text,
active bool,
https bool
);

Images should be sharable across sites so that you don't have to upload an image multiple times.

@ghost
Copy link

ghost commented Oct 8, 2018

It's probably easier to use caddy for this ?
Caddy also has lots of other fantastic things that most web servers need.
For example a their famous file browser etc.

Also I think caddy can run embedded or in a different process / server. So you can use either topology approach.

https://github.com/mholt/caddy

https://github.com/mholt/caddy/blob/master/README.md#features

It also provides the hardening needed as well as many Operation features that are needed for running Fragmenta in production. For example rotation of the Https cert, logging and rotating.

There is a fantastic file browser example that works with Caddy btw. I feel it might be very useful for Fragmenta as a file viewer for the editor aspects btw. It uses Vuejs since it needs fast feedback which I think is not how Fragmenta is designed but it makes sense to use it as a GUI widget though. The golang template just needs to load it up

Anyway sorry about such a long explanation but I wanted to point out how caddy not only solves the multiple domain use case nicely but also provides some other features that Fragmenta y need at this stage in its maturity.

@lastzero
Copy link

lastzero commented Oct 8, 2018

Yes, maybe. Did you try it? I actually figured that using GitHub pages and a static site generator is all I need since they started to support custom domains and SSL (all free).

@kennygrant
Copy link
Contributor Author

It's probably easier to use caddy for this ?

The reason for adding multiple domains directly is that it's much easier to have one server running to serve multiple small domains than it is to maintain multiple CMS servers just to serve multiple domains. Running a proxy in front and lots of fragmenta servers behind is possible (and the best solution right now), but not really ideal if the sites are smaller and don't change much.

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

No branches or pull requests

2 participants