Skip to content
New issue

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

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

Already on GitHub? # to your account

caddy add package support. #19

Closed
gedw99 opened this issue Aug 29, 2024 · 8 comments
Closed

caddy add package support. #19

gedw99 opened this issue Aug 29, 2024 · 8 comments

Comments

@gedw99
Copy link

gedw99 commented Aug 29, 2024

in the latest tagged caddy you dont need to use xacddy.

Instead you can use the package cmd calls like below.

works for me :) Might be a good one for xtemplate ?

It will take ANY caddy and recompile it to have the package inside.

caddy-run-package-add:
	$(CADDY_RUN_CMD) add-package -h
	$(CADDY_RUN_CMD) add-package $(CADDY_RUN_VAR_PACKAGE)
	

	#$(CADDY_RUN_CMD) add-package github.com/Odyssey346/ListenCaddy
	#$(CADDY_RUN_CMD) add-package github.com/abiosoft/caddy-exec
	#$(CADDY_RUN_CMD) add-package github.com/greenpau/caddy-git
caddy-run-package-del:
	$(CADDY_RUN_CMD) remove-package github.com/Odyssey346/ListenCaddy
	$(CADDY_RUN_CMD) remove-package github.com/abiosoft/caddy-exec
caddy-run-package-ls:
	$(CADDY_RUN_CMD) list-modules --packages
@gedw99
Copy link
Author

gedw99 commented Aug 29, 2024

hey @infogulch

The above is a botnet I think. Can you delete it ?

@gedw99
Copy link
Author

gedw99 commented Aug 29, 2024

@infogulch

caddyserver/caddy#6548 would be useful ?

Its not idempotent, which kind of sucks.

caddy add-package github.com/abiosoft/caddy-exec
Error: package is already added

@gedw99 gedw99 changed the title caddy add caddy add package support. Aug 29, 2024
@gedw99
Copy link
Author

gedw99 commented Aug 29, 2024

xtemplate works btw :)

appd github.com/greenpau/caddy-appd
exec github.com/abiosoft/caddy-exec
git github.com/greenpau/caddy-git
http.handlers.exec github.com/abiosoft/caddy-exec
http.handlers.git github.com/greenpau/caddy-git
http.handlers.xtemplate github.com/infogulch/xtemplate-caddy

I think your xtemplate can also include the SQLite db features and needs CGO if we want SQL included ?

@francislavoie
Copy link

francislavoie commented Aug 29, 2024

in the latest tagged caddy you dont need to use xacddy.

But you still should, if possible. caddy add-package downloads from https://caddyserver.com/download which has no uptime guarantees. If this is for automation at all, you should avoid it. add-package is specifically meant for manual usage (individual end-users), not automation. Using xcaddy is strongly preferred because you're always building from source, relying on Github infrastructure etc rather than cheap/unreliable caddyserver.com infrastructure.

@infogulch
Copy link
Owner

Recommending xcaddy seems to be the way. I'll update the readme to reflect this soon. Thanks all for your input. :)

@gedw99
Copy link
Author

gedw99 commented Sep 5, 2024

Recommending xcaddy seems to be the way. I'll update the readme to reflect this soon. Thanks all for your input. :)

Got it :)

did not realise add package was dependent on their server

@infogulch
Copy link
Owner

I looked at moving the caddy-xtemplate package into a subdirectory/package of the Go module in this repo, but it looks like caddy packages must be the root Go package in a Go module, so this won't work. Is this correct @francislavoie ?

@francislavoie
Copy link

No, they can be in subdirectories, you just need to make their package name (in your go.mod) match. For example https://github.com/RussellLuo/caddy-ext has multiple plugins organized that way (I don't necessarily agree though, there's advantages to having it one per repo)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@infogulch @francislavoie @gedw99 and others