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

DRAFT: Add changes to support deployment to Azure Container Apps #994

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.venv
.env
Dockerfile
.dockerignore
frontend/node_modules
File renamed without changes.
5 changes: 0 additions & 5 deletions WebApp.dockerignore

This file was deleted.

7 changes: 6 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ def create_app():

@bp.route("/")
async def index():
identity_provider_enabled = "false"
if request.headers.get("X-Ms-Client-Principal"):
identity_provider_enabled = "true"

return await render_template(
"index.html",
title=app_settings.ui.title,
favicon=app_settings.ui.favicon
favicon=app_settings.ui.favicon,
identity_provider_enabled=identity_provider_enabled
)


Expand Down
13 changes: 9 additions & 4 deletions frontend/src/pages/chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,17 @@ const Chat = () => {
setShowAuthMessage(false)
return
}
const userInfoList = await getUserInfo()
if (userInfoList.length === 0 && window.location.hostname !== '127.0.0.1') {
setShowAuthMessage(true)
} else {
if (document.currentScript?.getAttribute("identityProviderEnabled") == "true"){
setShowAuthMessage(false)
}
else {
const userInfoList = await getUserInfo()
if (userInfoList.length === 0 && window.location.hostname !== '127.0.0.1') {
setShowAuthMessage(true)
} else {
setShowAuthMessage(false)
}
}
}

let assistantMessage = {} as ChatMessage
Expand Down
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" type="image/x-icon" href="{{ favicon }}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ title }}</title>
<script type="module" crossorigin src="/assets/index-2e11eaf6.js"></script>
<script type="module" crossorigin src="/assets/index-2e11eaf6.js" identityProviderEnabled="{{ identity_provider_enabled }}"></script>
<link rel="stylesheet" href="/assets/index-61492790.css">
</head>
<body>
Expand Down
Loading