Skip to content

Commit

Permalink
adding valis env setting toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed Jan 24, 2025
1 parent 9844e9a commit 27069d7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ ENV VALIS_SOCKET_DIR='/tmp/webapp'
ENV VALIS_LOGS_DIR='/tmp/webapp'
ENV VALIS_ALLOW_ORIGIN="https://data.sdss5.org/zora/"
ENV VALIS_DB_REMOTE=True
ENV VALIS_ENV="production"
ENV SOLARA_CHECK_HOOKS="off"

# Stage 3: Build stage (inherits from dev-stage)
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ENV VALIS_SOCKET_DIR='/tmp/valis'
ENV VALIS_LOGS_DIR='/tmp'
ENV VALIS_ALLOW_ORIGIN="http://localhost:3000"
ENV VALIS_DB_REMOTE=True
ENV VALIS_ENV="development"
ENV SOLARA_CHECK_HOOKS="off"

# Stage 3: Build stage (inherits from dev-stage)
Expand Down
4 changes: 3 additions & 1 deletion python/valis/routes/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from fastapi_restful.cbv import cbv

from valis.routes.base import Base, release
from valis.settings import settings

router = APIRouter()
auth_callback_router = APIRouter()
Expand Down Expand Up @@ -53,7 +54,8 @@ class SDSSAuthPasswordBearer(OAuth2PasswordBearer):

async def __call__(self, request: Request, release: str = Depends(release)):
self.release = release or "WORK"
if 'DR' in self.release:

if 'DR' in self.release or settings.env == 'development':
return None
await super().__call__(request)

Expand Down
2 changes: 1 addition & 1 deletion python/valis/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CacheBackendEnum(str, Enum):


class Settings(BaseSettings):
valis_env: EnvEnum = EnvEnum.dev
env: EnvEnum = EnvEnum.dev
allow_origin: Union[str, List[AnyHttpUrl]] = Field([])
db_server: str | None = 'pipelines'
db_remote: bool = False
Expand Down

0 comments on commit 27069d7

Please sign in to comment.