- Notifications
You must be signed in to change notification settings - Fork1k
chore: override codersdk.SessionTokenCookie in develop.sh#18991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Changes fromall commits
9ce2437
5497686
5868b0b
6c86d8c
a2dcf61
cb6b8b3
f4e5a14
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -49,6 +49,7 @@ boringcrypto=${CODER_BUILD_BORINGCRYPTO:-0} | ||
dylib=0 | ||
windows_resources="${CODER_WINDOWS_RESOURCES:-0}" | ||
debug=0 | ||
develop_in_coder="${DEVELOP_IN_CODER:-0}" | ||
bin_ident="com.coder.cli" | ||
@@ -149,6 +150,13 @@ if [[ "$debug" == 0 ]]; then | ||
ldflags+=(-s -w) | ||
fi | ||
if [[ "$develop_in_coder" == 1 ]]; then | ||
echo "INFO : Overriding codersdk.SessionTokenCookie as we are developing inside a Coder workspace." | ||
ldflags+=( | ||
-X "'github.com/coder/coder/v2/codersdk.SessionTokenCookie=dev_coder_session_token'" | ||
) | ||
fi | ||
Comment on lines +153 to +158 MemberAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I decided to try this way instead. It's a little more involved but requires less code changes in | ||
# We use ts_omit_aws here because on Linux it prevents Tailscale from importing | ||
# github.com/aws/aws-sdk-go-v2/aws, which adds 7 MB to the binary. | ||
TS_EXTRA_SMALL="ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -10,6 +10,8 @@ source "${SCRIPT_DIR}/lib.sh" | ||
GOOS="$(go env GOOS)" | ||
GOARCH="$(go env GOARCH)" | ||
CODER_AGENT_URL="${CODER_AGENT_URL:-}" | ||
DEVELOP_IN_CODER="${DEVELOP_IN_CODER:-0}" | ||
DEBUG_DELVE="${DEBUG_DELVE:-0}" | ||
BINARY_TYPE=coder-slim | ||
if [[ ${1:-} == server ]]; then | ||
@@ -35,16 +37,20 @@ CODER_DEV_DIR="$(realpath ./.coderv2)" | ||
CODER_DELVE_DEBUG_BIN=$(realpath "./build/coder_debug_${GOOS}_${GOARCH}") | ||
popd | ||
if [ -n "${CODER_AGENT_URL}" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. We could also check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I forgot about that one! Member
| ||
DEVELOP_IN_CODER=1 | ||
fi | ||
case $BINARY_TYPE in | ||
coder-slim) | ||
# Ensure the coder slim binary is always up-to-date with local | ||
# changes, this simplifies usage of this script for development. | ||
# NOTE: we send all output of `make` to /dev/null so that we do not break | ||
# scripts that read the output of this command. | ||
if [[ -t 1 ]]; then | ||
DEVELOP_IN_CODER="${DEVELOP_IN_CODER}"make -j "${RELATIVE_BINARY_PATH}" | ||
else | ||
DEVELOP_IN_CODER="${DEVELOP_IN_CODER}"make -j "${RELATIVE_BINARY_PATH}" >/dev/null 2>&1 | ||
fi | ||
;; | ||
coder) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -107,6 +107,13 @@ const getMissingParameters = ( | ||
return missingParameters; | ||
}; | ||
/** | ||
* Originally from codersdk/client.go. | ||
* The below declaration is required to stop Knip from complaining. | ||
* @public | ||
*/ | ||
export const SessionTokenCookie = "coder_session_token"; | ||
Comment on lines +110 to +115 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. TIL | ||
/** | ||
* @param agentId | ||
* @returns {OneWayWebSocket} A OneWayWebSocket that emits Server-Sent Events. | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -116,7 +116,7 @@ export default defineConfig({ | ||
secure: process.env.NODE_ENV === "production", | ||
}, | ||
}, | ||
allowedHosts: [".coder", ".dev.coder.com"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. review: also updated | ||
}, | ||
resolve: { | ||
alias: { | ||