freman / caddy-reauth

Auth your Caddyserver requests against another server
MIT License
27 stars 15 forks source link

Failing to Build #36

Closed PhantomEight closed 4 years ago

PhantomEight commented 4 years ago

This plugin is failing to build on the v1.0.4 download page: https://caddyserver.com/v1/download Can you take a look and see why?

I tried to build manually, I use Windows so I downloaded Go for Windows 64bit. Perhaps I didn't get the go file right... It downloads the package, but doesn't spit out a useful error message. This output is after successfully building caddy without reauth. I just added the "github.com/freman/caddy-reauth" to the import directive and ran go install again.

C:\Users\xxxxx\go\src\caddy>go install
go: finding github.com/freman/caddy-reauth latest
go: extracting github.com/freman/caddy-reauth v0.0.0-20191025011741-deaa60e56872
# caddy
.\caddy.go:5:2: imported and not used: "github.com/freman/caddy-reauth" as reauth

Contents of caddy.go

package main

import (
    "github.com/caddyserver/caddy/caddy/caddymain"
    "github.com/freman/caddy-reauth"

    // plug in plugins here, for example:
    // _ "import/path/here"
)

func main() {
    // optional: disable telemetry
    // caddymain.EnableTelemetry = false
    caddymain.Run()
}
freman commented 4 years ago

Hi.

As this plugin has a rather large dependency I'm afraid it is known to fail sometimes on the caddy servers as they timeout the build. @mholt is aware but is understandably busy with caddy2

Only thing I can do to fix it is remove the dependency and one of the auth methods that relies on it (or rewrite that method to not need the dependency)

If you change your import line to the following (note the underscore) it should build and work for you

_ "github.com/freman/caddy-reauth"
PhantomEight commented 4 years ago

Ok, that worked. I'm assuming for the manual build, that was just a syntax error... because I need better glasses. I googled for build examples and didn't come up with much and somehow missed that. Thanks!