mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-21 21:17:37 -08:00
1. split out LICENSE 2. Install Caddyfile as upstream intended. 3. show correct version on `caddy version` 4. misc improvements in initd & confd like validate config file, reload, add variables for config file & logfile Closes: https://bugs.gentoo.org/915687 Signed-off-by: Rahil Bhimjiani <rahil3108@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
62 lines
2.2 KiB
Diff
62 lines
2.2 KiB
Diff
# Remove commands which can modify binary outside of Portage.
|
|
# Inspired from:
|
|
# https://src.fedoraproject.org/rpms/caddy/blob/rawhide/f/0001-Disable-commands-that-can-alter-the-binary.patch
|
|
# https://salsa.debian.org/go-team/packages/caddy/-/blob/debian/sid/debian/patches/0005-Remove-obsolote-subcommands.patch?ref_type=heads
|
|
--- a/cmd/commands.go
|
|
+++ a/cmd/commands.go
|
|
@@ -393,54 +393,10 @@
|
|
cmd.RunE = WrapCommandFuncForCobra(cmdFmt)
|
|
},
|
|
})
|
|
|
|
RegisterCommand(Command{
|
|
- Name: "upgrade",
|
|
- Short: "Upgrade Caddy (EXPERIMENTAL)",
|
|
- Long: `
|
|
-Downloads an updated Caddy binary with the same modules/plugins at the
|
|
-latest versions. EXPERIMENTAL: May be changed or removed.
|
|
-`,
|
|
- CobraFunc: func(cmd *cobra.Command) {
|
|
- cmd.Flags().BoolP("keep-backup", "k", false, "Keep the backed up binary, instead of deleting it")
|
|
- cmd.RunE = WrapCommandFuncForCobra(cmdUpgrade)
|
|
- },
|
|
- })
|
|
-
|
|
- RegisterCommand(Command{
|
|
- Name: "add-package",
|
|
- Usage: "<packages...>",
|
|
- Short: "Adds Caddy packages (EXPERIMENTAL)",
|
|
- Long: `
|
|
-Downloads an updated Caddy binary with the specified packages (module/plugin)
|
|
-added. Retains existing packages. Returns an error if the any of packages are
|
|
-already included. EXPERIMENTAL: May be changed or removed.
|
|
-`,
|
|
- CobraFunc: func(cmd *cobra.Command) {
|
|
- cmd.Flags().BoolP("keep-backup", "k", false, "Keep the backed up binary, instead of deleting it")
|
|
- cmd.RunE = WrapCommandFuncForCobra(cmdAddPackage)
|
|
- },
|
|
- })
|
|
-
|
|
- RegisterCommand(Command{
|
|
- Name: "remove-package",
|
|
- Func: cmdRemovePackage,
|
|
- Usage: "<packages...>",
|
|
- Short: "Removes Caddy packages (EXPERIMENTAL)",
|
|
- Long: `
|
|
-Downloads an updated Caddy binaries without the specified packages (module/plugin).
|
|
-Returns an error if any of the packages are not included.
|
|
-EXPERIMENTAL: May be changed or removed.
|
|
-`,
|
|
- CobraFunc: func(cmd *cobra.Command) {
|
|
- cmd.Flags().BoolP("keep-backup", "k", false, "Keep the backed up binary, instead of deleting it")
|
|
- cmd.RunE = WrapCommandFuncForCobra(cmdRemovePackage)
|
|
- },
|
|
- })
|
|
-
|
|
- RegisterCommand(Command{
|
|
Name: "manpage",
|
|
Usage: "--directory <path>",
|
|
Short: "Generates the manual pages for Caddy commands",
|
|
Long: `
|
|
Generates the manual pages for Caddy commands into the designated directory
|