Package Details: caddy2 2.2.0-1

Git Clone URL: https://aur.archlinux.org/caddy2.git (read-only, click to copy)
Package Base: caddy2
Description: Fast web server with automatic HTTPS
Upstream URL: https://caddyserver.com
Keywords: webserver
Licenses: Apache
Conflicts: caddy
Provides: caddy
Submitter: Poscat
Maintainer: Arisu
Last Packager: Arisu
Votes: 23
Popularity: 4.56
First Submitted: 2019-10-21 13:43
Last Updated: 2020-09-24 18:41

Pinned Comments

Arisu commented on 2020-10-14 08:13

v2.2.1 pending https://github.com/caddyserver/caddy/issues/3797

Latest Comments

« First ‹ Previous 1 2 3 4 Next › Last »

athei commented on 2020-07-01 09:21

I just cloned the repo and executed makepkg -si. It is as fresh as it it gets. I do not understand the permission denied error. The file is accessible by my user (why shouldn't it be):

[alexander@homebsd src]$ file /home/alexander/caddy2/src/caddy/caddytest/a.caddy.localhost.crt
/home/alexander/caddy2/src/caddy/caddytest/a.caddy.localhost.crt: PEM certificate

I have caddy2 already installed from an older revision of this AUR package. Maybe this is interfering somehow?

Arisu commented on 2020-07-01 08:52

@athei I can't reproduce your issue(s) with a basic clean build of the package.

I assume you're building it manually. Did you make any modification to any of the files before running makepkg -si? Have you tried to start with a fresh clean version of the aur package repo?

I see at least two issues occurring in these logs :

  • A permission problem open /home/alexander/caddy2/src/caddy/caddytest/a.caddy.localhost.crt: permission denied

  • A missing module (doesn't happen on any of my machines?) adapting config using caddyfile adapter: Caddyfile:8: unrecognized directive: map loading module 'map': unknown module: http.handlers.map

athei commented on 2020-07-01 07:41

Tried to install the package but it fails in check():

==> Starting check()...
ok      github.com/caddyserver/caddy/v2 0.009s
?       github.com/caddyserver/caddy/v2/caddyconfig [no test files]
ok      github.com/caddyserver/caddy/v2/caddyconfig/caddyfile   0.014s
ok      github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile   0.028s
ok      github.com/caddyserver/caddy/v2/caddytest   0.023s
2020/07/01 09:39:47 caddytest: config load time took 1.196778ms
2020/07/01 09:39:47 caddytest: redirecting the dialer from localhost:9080 to 127.0.0.1:9080
2020/07/01 09:39:47 caddytest: config load time took 2.225377ms
2020/07/01 09:39:47 caddytest: redirecting the dialer from localhost:9080 to 127.0.0.1:9080
2020/07/01 09:39:47 caddytest: config load time took 706.247µs
2020/07/01 09:39:47 caddytest: config load time took 940.829µs
2020/07/01 09:39:47 caddytest: redirecting the dialer from localhost:9080 to 127.0.0.1:9080
--- FAIL: TestReadCookie (0.00s)
    caddytest.go:414: requesting "" expected status code: 200 but got 404
    caddytest.go:434: requesting "" expected response body "<h2>Cookie.ClientName caddytest</h2>" but got ""
    caddytest.go:131: ----------- failed with config -----------
        {
          "apps": {
            "http": {
              "http_port": 9080,
              "https_port": 9443,
              "servers": {
                "srv0": {
                  "listen": [
                    ":9080"
                  ],
                  "routes": [
                    {
                      "handle": [
                        {
                          "handler": "subroute",
                          "routes": [
                            {
                              "handle": [
                                {
                                  "file_root": "testdata",
                                  "handler": "templates"
                                },
                                {
                                  "handler": "file_server",
                                  "hide": [
                                    "Caddyfile"
                                  ],
                                  "root": "testdata"
                                }
                              ]
                            }
                          ]
                        }
                      ],
                      "match": [
                        {
                          "host": [
                            "localhost"
                          ]
                        }
                      ],
                      "terminal": true
                    }
                  ]
                }
              }
            }
          }
        }
2020/07/01 09:39:47 caddytest: config load time took 320.231µs
2020/07/01 09:39:47 caddytest: redirecting the dialer from localhost:9080 to 127.0.0.1:9080
--- FAIL: TestMap (0.00s)
    caddytest.go:98: failed to load config: {"error":"adapting config using caddyfile adapter: Caddyfile:8: unrecognized directive: map"}
    caddytest.go:414: requesting "" expected status code: 200 but got 404
    caddytest.go:434: requesting "" expected response body "hello from localhost get-called" but got ""
    caddytest.go:401: Content-Type header not provided
    caddytest.go:414: requesting "" expected status code: 200 but got 404
    caddytest.go:434: requesting "" expected response body "hello from localhost post-called" but got ""
2020/07/01 09:39:47 caddytest: config load time took 244.163µs
2020/07/01 09:39:47 caddytest: redirecting the dialer from localhost:9080 to 127.0.0.1:9080
--- FAIL: TestMapRespondWithDefault (0.00s)
    caddytest.go:98: failed to load config: {"error":"adapting config using caddyfile adapter: Caddyfile:8: unrecognized directive: map"}
    caddytest.go:414: requesting "" expected status code: 200 but got 404
    caddytest.go:434: requesting "" expected response body "hello from localhost get-called" but got ""
    caddytest.go:401: Content-Type header not provided
    caddytest.go:414: requesting "" expected status code: 200 but got 404
    caddytest.go:434: requesting "" expected response body "hello from localhost unknown" but got ""
2020/07/01 09:39:47 caddytest: config load time took 800.605µs
2020/07/01 09:39:47 caddytest: redirecting the dialer from localhost:9080 to 127.0.0.1:9080
--- FAIL: TestMapAsJson (0.00s)
    caddytest.go:98: failed to load config: {"error":"loading config: loading new config: loading http app module: provision http: server srv0: setting up route handlers: route 0: loading handler modules: position 0: loading module 'subroute': provision http.handlers.subroute: setting up subroutes: route 0: loading handler modules: position 0: loading module 'map': unknown module: http.handlers.map"}
    caddytest.go:414: requesting "" expected status code: 200 but got 404
    caddytest.go:434: requesting "" expected response body "hello from localhost get-called" but got ""
    caddytest.go:401: Content-Type header not provided
    caddytest.go:414: requesting "" expected status code: 200 but got 404
    caddytest.go:434: requesting "" expected response body "hello from localhost post-called" but got ""
2020/07/01 09:39:47 caddytest: config load time took 1.09508ms
2020/07/01 09:39:47 caddytest: redirecting the dialer from 127.0.0.1:9443 to 127.0.0.1:9443
--- FAIL: TestDefaultSNI (0.00s)
    caddytest.go:98: failed to load config: {"error":"loading config: loading new config: loading http app module: provision http: getting tls app: loading tls app module: provision tls: loading certificates: open /home/alexander/caddy2/src/caddy/caddytest/caddy.localhost.crt: permission denied"}
    caddytest.go:410: failed to call server Get "https://127.0.0.1:9443/version": dial tcp 127.0.0.1:9443: connect: connection refused
2020/07/01 09:39:47 caddytest: config load time took 1.083295ms
2020/07/01 09:39:47 caddytest: redirecting the dialer from 127.0.0.1:9443 to 127.0.0.1:9443
--- FAIL: TestDefaultSNIWithNamedHostAndExplicitIP (0.00s)
    caddytest.go:98: failed to load config: {"error":"loading config: loading new config: loading tls app module: provision tls: loading certificates: open /home/alexander/caddy2/src/caddy/caddytest/a.caddy.localhost.crt: permission denied"}
    caddytest.go:410: failed to call server Get "https://127.0.0.1:9443/version": dial tcp 127.0.0.1:9443: connect: connection refused
2020/07/01 09:39:47 caddytest: config load time took 960.368µs
2020/07/01 09:39:47 caddytest: redirecting the dialer from 127.0.0.1:9443 to 127.0.0.1:9443
--- FAIL: TestDefaultSNIWithPortMappingOnly (0.00s)
    caddytest.go:98: failed to load config: {"error":"loading config: loading new config: loading http app module: provision http: getting tls app: loading tls app module: provision tls: loading certificates: open /home/alexander/caddy2/src/caddy/caddytest/a.caddy.localhost.crt: permission denied"}
    caddytest.go:410: failed to call server Get "https://127.0.0.1:9443/version": dial tcp 127.0.0.1:9443: connect: connection refused
FAIL
FAIL    github.com/caddyserver/caddy/v2/caddytest/integration   0.073s
?       github.com/caddyserver/caddy/v2/cmd [no test files]
?       github.com/caddyserver/caddy/v2/cmd/caddy   [no test files]
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp   0.063s
?       github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth [no test files]
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp/encode    0.033s [no tests to run]
?       github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip   [no test files]
?       github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd   [no test files]
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver    0.064s
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp/headers   0.037s
?       github.com/caddyserver/caddy/v2/modules/caddyhttp/map   [no test files]
?       github.com/caddyserver/caddy/v2/modules/caddyhttp/requestbody   [no test files]
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy  0.013s
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy/fastcgi  0.072s [no tests to run]
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite   0.036s
?       github.com/caddyserver/caddy/v2/modules/caddyhttp/standard  [no test files]
ok      github.com/caddyserver/caddy/v2/modules/caddyhttp/templates 0.028s
?       github.com/caddyserver/caddy/v2/modules/caddypki    [no test files]
?       github.com/caddyserver/caddy/v2/modules/caddypki/acmeserver [no test files]
ok      github.com/caddyserver/caddy/v2/modules/caddytls    0.009s
?       github.com/caddyserver/caddy/v2/modules/caddytls/distributedstek    [no test files]
?       github.com/caddyserver/caddy/v2/modules/caddytls/standardstek   [no test files]
?       github.com/caddyserver/caddy/v2/modules/filestorage [no test files]
?       github.com/caddyserver/caddy/v2/modules/logging [no test files]
?       github.com/caddyserver/caddy/v2/modules/standard    [no test files]
FAIL
==> ERROR: A failure occurred in check().
    Aborting...

Arisu commented on 2020-06-29 06:51

@stevendoesstuffs I don't know about the first point and agree with the second. However, the official package is being worked on (even though last commit was a month ago).

If anyone wants to do it (i.e. use https://git.archlinux.org/svntogit/community.git/tree/trunk/next?h=packages/caddy as a model), please either submit a pull request on https://github.com/ArisuOngaku/aur-caddy or send your terms to me via email (see PKGBUILD Maintainer).

stevendoesstuffs commented on 2020-06-27 23:22

I just started using this again, and it seems like caddy wants to be able to write to directories /srv/http/.local and /srv/http/.config, but it doesn't have ownership of /srv/http.

The workaround is to create those two directories and make them owned by the http user.

That way, we don't mess with the ownership of /srv/http, which may be used for other stuff.

Do you think it'd be a good idea to add this to the PKGBUILD?

Also, it'd be great if this was compliant with the go packaging guidelines (https://wiki.archlinux.org/index.php/Go_package_guidelines).

sleeping commented on 2020-05-28 16:07

Thanks for the heads-up.

Arisu commented on 2020-05-15 20:57

I just updated the package as said in previous comments. Note that this package now correctly provides "caddy" instead of "caddy2".

If you customized your /etc/caddy2/Caddyfile, you must move it to /etc/caddy/Caddyfile after upgrade.

Please let me know if you encounter any problem.

Also, package files aren't perfect, i.e. it looks like /var/lib/caddy isn't used, but unless there's a related critical issue with this, I think it's better to wait for the official community package to be upgraded at this point.

Arisu commented on 2020-05-06 13:37

@stevendoesstuffs thanks for this!

If the official caddy package doesn't get updated before May 15, I'll make the update.

stevendoesstuffs commented on 2020-05-06 00:57

@Arisu Hey, I'm the guy who added the default config and the Caddyfile a while back. I'll admit, I didn't really know what I was doing, and looking back, there is a naming discrepancy between where the config is stored (/etc/caddy2/Caddyfile) and the systemd service (caddy.service).

Anyhow, it seems like Caddy is officially providing (https://github.com/caddyserver/dist/tree/master/archlinux) support for archlinux, so I'm guessing that the official repo package will update soon. Theirs is much better than what I wrote (the naming + the weird hack I had for tempfiles).

Anyhow, that's just a heads up this'll probably be obsolete soon, and if it doesn't for a while, I suggest basically replacing whatever's here with their package (and updating it to 2.0, since they haven't done that yet) until they do.

Poscat commented on 2019-11-11 05:41

oops