Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gitpod covers #9869

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ tasks:
sudo chmod g+w -R $GITPOD_REPO_ROOT
# because: https://github.com/gitpod-io/gitpod/issues/9311
chmod o+rx $GITPOD_REPO_ROOT
# set coverstore url
mkdir -p env
echo "OL_COVERSTORE_PUBLIC_URL=https://7075-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}" > env/web.env
# init runs once for each commit to the default branch
init: docker compose up --no-start && gp sync-done docker-up
# command runs each time a user starts their workspace
Expand Down
3 changes: 3 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ services:
- OL_CONFIG=${OL_CONFIG:-/openlibrary/conf/openlibrary.yml}
- GUNICORN_OPTS=${GUNICORN_OPTS:- --reload --workers 4 --timeout 180}
command: docker/ol-web-start.sh
env_file:
- path: "env/web.env"
required: false
ports:
- ${WEB_PORT:-8080}:8080
networks:
Expand Down
6 changes: 5 additions & 1 deletion openlibrary/plugins/upstream/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import functools
import os
from typing import Any, Protocol, TYPE_CHECKING, TypeVar
from collections.abc import Callable, Generator, Iterable, Iterator
import unicodedata
Expand Down Expand Up @@ -388,7 +389,10 @@ def get_coverstore_url() -> str:

@public
def get_coverstore_public_url() -> str:
return config.get('coverstore_public_url', get_coverstore_url()).rstrip('/')
if OL_COVERSTORE_PUBLIC_URL := os.environ.get('OL_COVERSTORE_PUBLIC_URL'):
return OL_COVERSTORE_PUBLIC_URL.rstrip('/')
else:
return config.get('coverstore_public_url', get_coverstore_url()).rstrip('/')


def _get_changes_v1_raw(
Expand Down
Loading