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

Add Makefile and Caddy config generator #60

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

xrobau
Copy link

@xrobau xrobau commented Nov 25, 2022

This adds some tools and helpers to make deploying a new instance
easier. I also encourage the use of Caddy, which allows reverse
proxy of the required paths, and a simple webserver for anything
that doesn't match anything known about by the API instance.

There is a very simple index.html which is copied to the webroot
folder (/var/lib/relay/webroot) which the end user can then modify
if wanted.

This consists of squashed commits:
    Put the default webroot in a sensible location
    Add a slightly better 404 string
    Add caddyfile generator
    Add config hooks
    Add basic Makefile

See https://git.artemai.art/xrobau/Activity-Relay for raw commits

Signed-Off-By: Rob Thomas <[email protected]>

This adds some tools and helpers to make deploying a new instance
easier. I also encourage the use of Caddy, which allows reverse
proxy of the required paths, and a simple webserver for anything
that doesn't match anything known about by the API instance.

There is a very simple index.html which is copied to the webroot
folder (/var/lib/relay/webroot) which the end user can then modify
if wanted.

This consists of squashed commits:
    Put the default webroot in a sensible location
    Add a slightly better 404 string
    Add caddyfile generator
    Add config hooks
    Add basic Makefile

See https://git.artemai.art/xrobau/Activity-Relay for raw commits

Signed-Off-By: Rob Thomas <[email protected]>
@lifeofguenter
Copy link

This might be adding some bloat? Go already comes with a webserver? Eg rather let the user chose between traefik, nginx or any other loadbalancer.

@xrobau
Copy link
Author

xrobau commented Nov 27, 2022

This just connects to the Go webserver, but Caddy does all the SSL Certificate request/install/update for you. The other thing this adds is the ability to remap OTHER paths to a webroot, so that a relay instance doesn't just 404 - see https://relay.wig.gl/ vs https://relay.oi.au/

Basically, there needs to be SOMETHING that takes https:://... and maps it to http://localhost:8080 so why not use Caddy, as the config is much simpler than anything else.

The current known paths are here, and should be painless to update: https://github.com/yukimochi/Activity-Relay/pull/60/files#diff-104158face756c55045ed32564fe140ef2afd207b04608d7a0d9459bd513295dR7

@lifeofguenter
Copy link

I know what Caddy is and what your PR does :)

My question is around: why is this needed in first place, why Caddy and not xyz?

I am sure some setups already today do not have to worry about HTTPS as they would run docker behind k8s, a loadbalancer (AWS) or even traefik. So your setup with Caddy might be specific / opinionated, but not necessarily common.

If its just for adding additional pages/APIs, then I think this should belong into the core with templating, not having to manage another process which is against the grain on how docker should be running.

Maybe this can just be part of a documentation for scenario "self hosted on non-docker environments" or similar?

@xrobau
Copy link
Author

xrobau commented Dec 9, 2022

Updated with recent commits from master, fixed conflict

@seano-vs
Copy link

My question is around: why is this needed in first place, why Caddy and not xyz?

I am sure some setups already today do not have to worry about HTTPS as they would run docker behind k8s, a loadbalancer (AWS) or even traefik. So your setup with Caddy might be specific / opinionated, but not necessarily common.

If its just for adding additional pages/APIs, then I think this should belong into the core with templating, not having to manage another process which is against the grain on how docker should be running.

Maybe this can just be part of a documentation for scenario "self hosted on non-docker environments" or similar?

Have to +1 this.

@xrobau
Copy link
Author

xrobau commented Dec 19, 2022

Uh, because it's there? It's not ENFORCING anything, people were asking for help with setting this up. All this does is provide an example. I'm not sure what the big deal is?

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.

3 participants