1 Commits

Author SHA1 Message Date
Gianni Carafa
8b3551659f run make file in build job 2023-12-05 15:07:12 +01:00
3 changed files with 3 additions and 15 deletions

View File

@@ -7,7 +7,7 @@ COPY . .
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build -o ladder cmd/main.go
RUN make build
FROM debian:12-slim as release
@@ -18,8 +18,4 @@ RUN chmod +x /app/ladder
RUN apt update && apt install -y ca-certificates && rm -rf /var/lib/apt/lists/*
#EXPOSE 8080
#ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["sh", "-c", "/app/ladder"]

View File

@@ -3,7 +3,7 @@ services:
ladder:
image: ghcr.io/everywall/ladder:latest
container_name: ladder
#build: .
build: .
#restart: always
#command: sh -c ./ladder
environment:

View File

@@ -8,9 +8,7 @@ import (
"net/url"
"os"
"regexp"
"strconv"
"strings"
"time"
"ladder/pkg/ruleset"
@@ -23,7 +21,6 @@ var (
ForwardedFor = getenv("X_FORWARDED_FOR", "66.249.66.1")
rulesSet = ruleset.NewRulesetFromEnv()
allowedDomains = []string{}
defaultTimeout = 15 // in seconds
)
func init() {
@@ -31,9 +28,6 @@ func init() {
if os.Getenv("ALLOWED_DOMAINS_RULESET") == "true" {
allowedDomains = append(allowedDomains, rulesSet.Domains()...)
}
if timeoutStr := os.Getenv("HTTP_TIMEOUT"); timeoutStr != "" {
defaultTimeout, _ = strconv.Atoi(timeoutStr)
}
}
// extracts a URL from the request ctx. If the URL in the request
@@ -187,9 +181,7 @@ func fetchSite(urlpath string, queries map[string]string) (string, *http.Request
}
// Fetch the site
client := &http.Client{
Timeout: time.Second * time.Duration(defaultTimeout),
}
client := &http.Client{}
req, _ := http.NewRequest("GET", url, nil)
if rule.Headers.UserAgent != "" {