Skip to content

Commit 462efc8

Browse files
committed
Development adjustments
1 parent 2e53fb5 commit 462efc8

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM alpine:latest
2+
RUN adduser -D -h /home/coder -s /bin/bash coder
3+
RUN apk update; apk add vim bash
4+
USER coder
5+
COPY build/coder_0.17.4-devel+????????_linux_arm64 /home/coder/coder
6+
WORKDIR /home/coder/
7+
ENTRYPOINT ["./coder", "server"]
8+
9+
# An example
10+
# docker run --rm -it -p 4000:4000 -e CODER_ACCESS_URL="http://localhost:4000" coder_custom

coderd/apikey.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ func (api *API) createAPIKey(ctx context.Context, params createAPIKeyParams) (*h
369369
Value: sessionToken,
370370
Path: "/",
371371
HttpOnly: true,
372-
SameSite: http.SameSiteLaxMode,
372+
SameSite: http.SameSiteNoneMode,
373373
Secure: api.SecureAuthCookie,
374374
}, &key, nil
375375
}

coderd/httpmw/csrf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func CSRF(secureCookie bool) func(next http.Handler) http.Handler {
1616
return func(next http.Handler) http.Handler {
1717
mw := nosurf.New(next)
18-
mw.SetBaseCookie(http.Cookie{Path: "/", HttpOnly: true, SameSite: http.SameSiteLaxMode, Secure: secureCookie})
18+
mw.SetBaseCookie(http.Cookie{Path: "/", HttpOnly: true, SameSite: http.SameSiteNoneMode, Secure: secureCookie})
1919
mw.SetFailureHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2020
http.Error(w, "Something is wrong with your CSRF token. Please refresh the page. If this error persists, try clearing your cookies.", http.StatusBadRequest)
2121
}))

coderd/httpmw/oauth2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func ExtractOAuth2(config OAuth2Config, client *http.Client) func(http.Handler)
7575
Value: state,
7676
Path: "/",
7777
HttpOnly: true,
78-
SameSite: http.SameSiteLaxMode,
78+
SameSite: http.SameSiteNoneMode,
7979
})
8080
// Redirect must always be specified, otherwise
8181
// an old redirect could apply!
@@ -84,7 +84,7 @@ func ExtractOAuth2(config OAuth2Config, client *http.Client) func(http.Handler)
8484
Value: r.URL.Query().Get("redirect"),
8585
Path: "/",
8686
HttpOnly: true,
87-
SameSite: http.SameSiteLaxMode,
87+
SameSite: http.SameSiteNoneMode,
8888
})
8989

9090
http.Redirect(rw, r, config.AuthCodeURL(state, oauth2.AccessTypeOffline), http.StatusTemporaryRedirect)

coderd/workspaceapps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ func (api *API) setWorkspaceAppCookie(rw http.ResponseWriter, r *http.Request, t
664664
Path: "/",
665665
MaxAge: maxAge,
666666
HttpOnly: true,
667-
SameSite: http.SameSiteLaxMode,
667+
SameSite: http.SameSiteNoneMode,
668668
Secure: api.SecureAuthCookie,
669669
})
670670

site/site.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ func cspHeaders(next http.Handler) http.Handler {
352352
_, _ = fmt.Fprintf(&csp, "%s %s; ", src, strings.Join(vals, " "))
353353
}
354354

355-
w.Header().Set("Content-Security-Policy", csp.String())
356355
next.ServeHTTP(w, r)
357356
})
358357
}

0 commit comments

Comments
 (0)