Skip to content

Conversation

LucilleH
Copy link
Collaborator

@LucilleH LucilleH commented Jun 6, 2023

Summary

Change caddy to run on non privileged ports. I added the following script to the caddy example:

  • devbox run start

Since I have a global caddy running on port 2019 for the admin endpoint already, I need to run this caddy under a separate admin port.

Issue I still need help with (resolved. See commit "fix process compose")

Running devbox services up has the following error

[caddy_1	] Error: loading initial config: loading new config: starting caddy administration endpoint: listen tcp 127.0.0.1:2019: bind: address already in use

Where as devbox run start is successful 🤷‍♀️ Are we doing something special with process compose? Seems like for some reason, it is loading some initial config, then reload it with the new config. And because the initial config has a port conflict, everything fails.

To reproduce, go to https://devbox.sh/github.com/jetpack-io/devbox?folder=examples/servers/caddy&branch=lucille--caddy-on-vm

How was it tested?

devbox.sh

@LucilleH LucilleH force-pushed the lucille--caddy-on-vm branch from 2d0fd63 to 4bde0e3 Compare June 6, 2023 21:00
@LucilleH LucilleH requested review from Lagoja and mikeland73 June 6, 2023 21:01
Copy link
Contributor

@mikeland73 mikeland73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, can you bump plugin version. We don't use it right now, but it gets saved in the lock file and in the future we can use it to suggest updates that can fix overwrite and fix config files.

Should we choose different ports for different services? (e.g. Apache already uses 8080).

Reason to use same port: projects rarely need more than 1 webserver.
Reason not to: People can accidentally trigger conflicts between different projects and it's a bit hard to debug.

Comment on lines +2 to +7
{
admin 0.0.0.0:2020
auto_https disable_certs
http_port 8800
https_port 4443
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Collaborator Author

@LucilleH LucilleH Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to change the default caddy http 80 and https port 443 port to be non privileged port 8800 and 4443. Change the default caddy admin api from :2019 to :2020

mikeland73

This comment was marked as duplicate.

@LucilleH LucilleH force-pushed the lucille--caddy-on-vm branch from 9a9292d to f0a1086 Compare June 6, 2023 22:13
@LucilleH LucilleH merged commit 5701f0f into main Jun 6, 2023
@LucilleH LucilleH deleted the lucille--caddy-on-vm branch June 6, 2023 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants