Skip to content

Commit fed2f75

Browse files
Changed things s.t., /data/config.json is the default config path. If a file cannot be found at that path, a warning is issued and we fallback on ./sample-config.json
1 parent d45a9bc commit fed2f75

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ WORKDIR /app
3232
ENV NODE_ENV=production
3333
ENV NEXT_TELEMETRY_DISABLED=1
3434
ENV DATA_DIR=/data
35-
ENV CONFIG_PATH=$DATA_DIR/sample-config.json
35+
ENV CONFIG_PATH=$DATA_DIR/config.json
3636
ENV DATA_CACHE_DIR=$DATA_DIR/.sourcebot
3737

3838
# Sourcebot collects anonymous usage data using [PostHog](https://posthog.com/). Uncomment this line to disable.

entrypoint.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/sh
22
set -e
33

4-
# Check if CONFIG_PATH is set
5-
if [ -z "$CONFIG_PATH" ]; then
6-
echo "\e[33mWarning: CONFIG_PATH environment variable is not set.\e[0m"
4+
# Fallback to sample config if a config does not exist
5+
if [ ! -f "$CONFIG_PATH" ]; then
6+
echo -e "\e[33m[Warning] Config file at CONFIG_PATH not found. Falling back on sample config.\e[0m"
7+
CONFIG_PATH="./sample-config.json"
78
fi
89

10+
echo -e "\e[34m[Info] Using config file at: '$CONFIG_PATH'.\e[0m"
11+
912
# Check if GITHUB_TOKEN is set
1013
if [ -n "$GITHUB_TOKEN" ]; then
1114
echo "$GITHUB_TOKEN" > "$HOME/.github-token"
@@ -17,7 +20,7 @@ if [ -n "$GITHUB_TOKEN" ]; then
1720
password ${GITHUB_TOKEN}" >> "$HOME/.netrc"
1821
chmod 600 "$HOME/.netrc"
1922
else
20-
echo -e "\e[33mWarning: Private GitHub repositories will not be indexed since GITHUB_TOKEN was not set. If you are not using GitHub, disregard.\e[0m"
23+
echo -e "\e[34m[Info] Private GitHub repositories will not be indexed since GITHUB_TOKEN was not set.\e[0m"
2124
fi
2225

2326
# Check if GITLAB_TOKEN is set
@@ -31,7 +34,7 @@ if [ -n "$GITLAB_TOKEN" ]; then
3134
password ${GITLAB_TOKEN}" >> "$HOME/.netrc"
3235
chmod 600 "$HOME/.netrc"
3336
else
34-
echo -e "\e[33mWarning: GitLab repositories will not be indexed since GITLAB_TOKEN was not set. If you are not using GitLab, disregard.\e[0m"
37+
echo -e "\e[34m[Info] GitLab repositories will not be indexed since GITLAB_TOKEN was not set.\e[0m"
3538
fi
3639

3740
# Update nextjs public env variables w/o requiring a rebuild.

0 commit comments

Comments
 (0)