-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from lvalics/main
HTTPS working version.
- Loading branch information
Showing
8 changed files
with
169 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Define the file path as a variable | ||
CHAT_JS_FILE="/app/web/static/chat.js" | ||
|
||
# Actual replacement | ||
sed -i "s|http://0.0.0.0:8000|${APP_URL}|g" $CHAT_JS_FILE | ||
|
||
# Check if the pattern with APP_URL already exists | ||
if grep -q '("${APP_URL}/chat/init")' $CHAT_JS_FILE; then | ||
echo "Pattern with APP_URL already exists, doing nothing." | ||
|
||
# Check if the pattern with the default URL exists | ||
elif grep -q '("http://0.0.0.0:8000/chat/init")' "$CHAT_JS_FILE"; then | ||
echo "Replacing default URL with APP_URL." | ||
sed -i "s|http://0.0.0.0:8000|${APP_URL}|g" "$CHAT_JS_FILE" | ||
|
||
# If none of the above conditions are met, append APP_URL to /chat/init | ||
else | ||
echo "Appending APP_URL to /chat/init." | ||
sed -i "s|/chat/init|${APP_URL}/chat/init|g" "$CHAT_JS_FILE" | ||
fi | ||
|
||
# Start your app normally | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,3 +76,4 @@ urllib3==1.26.16 | |
vine==5.0.0 | ||
wcwidth==0.2.6 | ||
yarl==1.9.2 | ||
django-cors-headers |