Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
4fdb26fd
Commit
4fdb26fd
authored
May 26, 2024
by
Jun Siang Cheah
Browse files
refac: rename build hash vars
parent
a579f5f8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
12 deletions
+12
-12
Dockerfile
Dockerfile
+2
-2
backend/apps/web/main.py
backend/apps/web/main.py
+1
-1
backend/config.py
backend/config.py
+2
-2
backend/main.py
backend/main.py
+2
-2
hatch_build.py
hatch_build.py
+1
-1
src/lib/components/chat/Settings/About.svelte
src/lib/components/chat/Settings/About.svelte
+2
-2
src/lib/constants.ts
src/lib/constants.ts
+1
-1
vite.config.ts
vite.config.ts
+1
-1
No files found.
Dockerfile
View file @
4fdb26fd
...
@@ -26,7 +26,7 @@ COPY package.json package-lock.json ./
...
@@ -26,7 +26,7 @@ COPY package.json package-lock.json ./
RUN
npm ci
RUN
npm ci
COPY
. .
COPY
. .
ENV
WEBUI_VERSION
=${BUILD_HASH}
ENV
APP_BUILD_HASH
=${BUILD_HASH}
RUN
npm run build
RUN
npm run build
######## WebUI backend ########
######## WebUI backend ########
...
@@ -159,6 +159,6 @@ HEALTHCHECK CMD curl --silent --fail http://localhost:8080/health | jq -e '.stat
...
@@ -159,6 +159,6 @@ HEALTHCHECK CMD curl --silent --fail http://localhost:8080/health | jq -e '.stat
USER
$UID:$GID
USER
$UID:$GID
ENV
WEBUI_VERSION=${BUILD_HASH}
ENV
WEBUI_
BUILD_
VERSION=${BUILD_HASH}
CMD
[ "bash", "start.sh"]
CMD
[ "bash", "start.sh"]
backend/apps/web/main.py
View file @
4fdb26fd
...
@@ -13,7 +13,7 @@ from apps.web.routers import (
...
@@ -13,7 +13,7 @@ from apps.web.routers import (
utils
,
utils
,
)
)
from
config
import
(
from
config
import
(
WEBUI_
VERSION
,
WEBUI_
BUILD_HASH
,
WEBUI_AUTH
,
WEBUI_AUTH
,
DEFAULT_MODELS
,
DEFAULT_MODELS
,
DEFAULT_PROMPT_SUGGESTIONS
,
DEFAULT_PROMPT_SUGGESTIONS
,
...
...
backend/config.py
View file @
4fdb26fd
...
@@ -162,10 +162,10 @@ CHANGELOG = changelog_json
...
@@ -162,10 +162,10 @@ CHANGELOG = changelog_json
####################################
####################################
# WEBUI_
VERSION
# WEBUI_
BUILD_HASH
####################################
####################################
WEBUI_
VERSION
=
os
.
environ
.
get
(
"WEBUI_
VERSION"
,
"v1.0.0-alpha.100
"
)
WEBUI_
BUILD_HASH
=
os
.
environ
.
get
(
"WEBUI_
BUILD_HASH"
,
"dev-build
"
)
####################################
####################################
# DATA/FRONTEND BUILD DIR
# DATA/FRONTEND BUILD DIR
...
...
backend/main.py
View file @
4fdb26fd
...
@@ -61,7 +61,7 @@ from config import (
...
@@ -61,7 +61,7 @@ from config import (
WEBHOOK_URL
,
WEBHOOK_URL
,
ENABLE_ADMIN_EXPORT
,
ENABLE_ADMIN_EXPORT
,
AppConfig
,
AppConfig
,
WEBUI_
VERSION
,
WEBUI_
BUILD_HASH
,
)
)
from
constants
import
ERROR_MESSAGES
from
constants
import
ERROR_MESSAGES
...
@@ -92,7 +92,7 @@ print(
...
@@ -92,7 +92,7 @@ print(
v
{
VERSION
}
- building the best open-source AI user interface.
v
{
VERSION
}
- building the best open-source AI user interface.
{
f
"Commit:
{
WEBUI_
VERSION
}
" if WEBUI_
VERSION != "
v1
.
0.0
-
alpha
.
100
" else ""
}
{
f
"Commit:
{
WEBUI_
BUILD_HASH
}
" if WEBUI_
BUILD_HASH != "
dev
-
build
" else ""
}
https://github.com/open-webui/open-webui
https://github.com/open-webui/open-webui
"""
"""
)
)
...
...
hatch_build.py
View file @
4fdb26fd
...
@@ -19,5 +19,5 @@ class CustomBuildHook(BuildHookInterface):
...
@@ -19,5 +19,5 @@ class CustomBuildHook(BuildHookInterface):
stderr
.
write
(
"### npm install
\n
"
)
stderr
.
write
(
"### npm install
\n
"
)
subprocess
.
run
([
npm
,
"install"
],
check
=
True
)
# noqa: S603
subprocess
.
run
([
npm
,
"install"
],
check
=
True
)
# noqa: S603
stderr
.
write
(
"
\n
### npm run build
\n
"
)
stderr
.
write
(
"
\n
### npm run build
\n
"
)
os
.
environ
[
"
WEBUI_VERSION
"
]
=
version
os
.
environ
[
"
APP_BUILD_HASH
"
]
=
version
subprocess
.
run
([
npm
,
"run"
,
"build"
],
check
=
True
)
# noqa: S603
subprocess
.
run
([
npm
,
"run"
,
"build"
],
check
=
True
)
# noqa: S603
src/lib/components/chat/Settings/About.svelte
View file @
4fdb26fd
<script lang="ts">
<script lang="ts">
import { getVersionUpdates } from '$lib/apis';
import { getVersionUpdates } from '$lib/apis';
import { getOllamaVersion } from '$lib/apis/ollama';
import { getOllamaVersion } from '$lib/apis/ollama';
import { WEBUI_HASH, WEBUI_VERSION } from '$lib/constants';
import { WEBUI_
BUILD_
HASH, WEBUI_VERSION } from '$lib/constants';
import { WEBUI_NAME, config, showChangelog } from '$lib/stores';
import { WEBUI_NAME, config, showChangelog } from '$lib/stores';
import { compareVersion } from '$lib/utils';
import { compareVersion } from '$lib/utils';
import { onMount, getContext } from 'svelte';
import { onMount, getContext } from 'svelte';
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
<div class="flex w-full justify-between items-center">
<div class="flex w-full justify-between items-center">
<div class="flex flex-col text-xs text-gray-700 dark:text-gray-200">
<div class="flex flex-col text-xs text-gray-700 dark:text-gray-200">
<div class="flex gap-1">
<div class="flex gap-1">
<Tooltip content={WEBUI_HASH}>
<Tooltip content={WEBUI_
BUILD_
HASH}>
v{WEBUI_VERSION}
v{WEBUI_VERSION}
</Tooltip>
</Tooltip>
...
...
src/lib/constants.ts
View file @
4fdb26fd
...
@@ -14,7 +14,7 @@ export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/images/api/v1`;
...
@@ -14,7 +14,7 @@ export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/images/api/v1`;
export
const
RAG_API_BASE_URL
=
`
${
WEBUI_BASE_URL
}
/rag/api/v1`
;
export
const
RAG_API_BASE_URL
=
`
${
WEBUI_BASE_URL
}
/rag/api/v1`
;
export
const
WEBUI_VERSION
=
APP_VERSION
;
export
const
WEBUI_VERSION
=
APP_VERSION
;
export
const
WEBUI_HASH
=
APP_HASH
;
export
const
WEBUI_
BUILD_
HASH
=
APP_
BUILD_
HASH
;
export
const
REQUIRED_OLLAMA_VERSION
=
'
0.1.16
'
;
export
const
REQUIRED_OLLAMA_VERSION
=
'
0.1.16
'
;
export
const
SUPPORTED_FILE_TYPE
=
[
export
const
SUPPORTED_FILE_TYPE
=
[
...
...
vite.config.ts
View file @
4fdb26fd
...
@@ -19,7 +19,7 @@ export default defineConfig({
...
@@ -19,7 +19,7 @@ export default defineConfig({
plugins
:
[
sveltekit
()],
plugins
:
[
sveltekit
()],
define
:
{
define
:
{
APP_VERSION
:
JSON
.
stringify
(
process
.
env
.
npm_package_version
),
APP_VERSION
:
JSON
.
stringify
(
process
.
env
.
npm_package_version
),
APP_HASH
:
JSON
.
stringify
(
process
.
env
.
WEBUI_VERSION
||
'
dev-build
'
)
APP_
BUILD_
HASH
:
JSON
.
stringify
(
process
.
env
.
APP_BUILD_HASH
||
'
dev-build
'
)
},
},
worker
:
{
worker
:
{
format
:
'
es
'
format
:
'
es
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment