Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f3c9b391b | |||
| 5a9d883a93 | |||
| c2e8af5ed1 | |||
| 70a85d6111 | |||
| 1163745a03 | |||
| 529fcaa5c9 | |||
| 681fd4ff3b | |||
| 0917fa6f4a | |||
| c7d3969a53 |
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [0.3.4] - 2024-06-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- **🔒 Mixed Content with HTTPS Issue**: Resolved a problem where mixed content (HTTP and HTTPS) was causing security warnings and blocking resources on HTTPS sites.
|
||||
- **🔍 Web Search Issue**: Addressed the problem where web search functionality was not working correctly. The 'ENABLE_RAG_LOCAL_WEB_FETCH' option has been reintroduced to restore proper web searching capabilities.
|
||||
- **💾 RAG Template Not Being Saved**: Fixed an issue where the RAG template was not being saved correctly, ensuring your custom templates are now preserved as expected.
|
||||
|
||||
## [0.3.3] - 2024-06-12
|
||||
|
||||
### Added
|
||||
|
||||
@@ -717,13 +717,18 @@ def validate_url(url: Union[str, Sequence[str]]):
|
||||
if isinstance(validators.url(url), validators.ValidationError):
|
||||
raise ValueError(ERROR_MESSAGES.INVALID_URL)
|
||||
if not ENABLE_RAG_LOCAL_WEB_FETCH:
|
||||
# Check if the URL exists by making a HEAD request
|
||||
try:
|
||||
response = requests.head(url, allow_redirects=True)
|
||||
if response.status_code != 200:
|
||||
# Local web fetch is disabled, filter out any URLs that resolve to private IP addresses
|
||||
parsed_url = urllib.parse.urlparse(url)
|
||||
# Get IPv4 and IPv6 addresses
|
||||
ipv4_addresses, ipv6_addresses = resolve_hostname(parsed_url.hostname)
|
||||
# Check if any of the resolved addresses are private
|
||||
# This is technically still vulnerable to DNS rebinding attacks, as we don't control WebBaseLoader
|
||||
for ip in ipv4_addresses:
|
||||
if validators.ipv4(ip, private=True):
|
||||
raise ValueError(ERROR_MESSAGES.INVALID_URL)
|
||||
for ip in ipv6_addresses:
|
||||
if validators.ipv6(ip, private=True):
|
||||
raise ValueError(ERROR_MESSAGES.INVALID_URL)
|
||||
except requests.exceptions.RequestException:
|
||||
raise ValueError(ERROR_MESSAGES.INVALID_URL)
|
||||
return True
|
||||
elif isinstance(url, Sequence):
|
||||
return all(validate_url(u) for u in url)
|
||||
@@ -731,6 +736,17 @@ def validate_url(url: Union[str, Sequence[str]]):
|
||||
return False
|
||||
|
||||
|
||||
def resolve_hostname(hostname):
|
||||
# Get address information
|
||||
addr_info = socket.getaddrinfo(hostname, None)
|
||||
|
||||
# Extract IP addresses from address information
|
||||
ipv4_addresses = [info[4][0] for info in addr_info if info[0] == socket.AF_INET]
|
||||
ipv6_addresses = [info[4][0] for info in addr_info if info[0] == socket.AF_INET6]
|
||||
|
||||
return ipv4_addresses, ipv6_addresses
|
||||
|
||||
|
||||
def search_web(engine: str, query: str) -> list[SearchResult]:
|
||||
"""Search the web using a search engine and return the results as a list of SearchResult objects.
|
||||
Will look for a search engine API key in environment variables in the following order:
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "open-webui",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "open-webui",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.4",
|
||||
"dependencies": {
|
||||
"@codemirror/lang-javascript": "^6.2.2",
|
||||
"@codemirror/lang-python": "^6.1.6",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "open-webui",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "npm run pyodide:fetch && vite dev --host",
|
||||
|
||||
+48
-39
@@ -83,54 +83,53 @@
|
||||
src="/logo.svg"
|
||||
/>
|
||||
|
||||
<img
|
||||
id="logo-her"
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
width: 13rem;
|
||||
height: 13rem;
|
||||
top: 33%;
|
||||
left: 50%;
|
||||
margin-left: -6.5rem;
|
||||
"
|
||||
src="/logo.svg"
|
||||
class="animate-pulse-fast"
|
||||
/>
|
||||
|
||||
<div
|
||||
id="progress-background"
|
||||
style="
|
||||
position: absolute;
|
||||
top: 58%;
|
||||
left: 50%;
|
||||
|
||||
margin-left: -12rem;
|
||||
|
||||
width: 24rem;
|
||||
height: 0.75rem;
|
||||
border-radius: 9999px;
|
||||
background-color: #fafafa9a;
|
||||
"
|
||||
class="bg-white"
|
||||
></div>
|
||||
|
||||
<div
|
||||
id="progress-bar"
|
||||
style="
|
||||
position: absolute;
|
||||
top: 58%;
|
||||
left: 50%;
|
||||
|
||||
margin-left: -12rem;
|
||||
|
||||
height: 0.75rem;
|
||||
border-radius: 9999px;
|
||||
background-color: #fff;
|
||||
|
||||
width: 0rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
"
|
||||
class="bg-white"
|
||||
></div>
|
||||
>
|
||||
<img
|
||||
id="logo-her"
|
||||
style="width: 13rem; height: 13rem"
|
||||
src="/logo.svg"
|
||||
class="animate-pulse-fast"
|
||||
/>
|
||||
|
||||
<div style="position: relative; width: 24rem; margin-top: 0.5rem">
|
||||
<div
|
||||
id="progress-background"
|
||||
style="
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 0.75rem;
|
||||
|
||||
border-radius: 9999px;
|
||||
background-color: #fafafa9a;
|
||||
"
|
||||
></div>
|
||||
|
||||
<div
|
||||
id="progress-bar"
|
||||
style="
|
||||
position: absolute;
|
||||
width: 0%;
|
||||
height: 0.75rem;
|
||||
border-radius: 9999px;
|
||||
background-color: #fff;
|
||||
"
|
||||
class="bg-white"
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <span style="position: absolute; bottom: 32px; left: 50%; margin: -36px 0 0 -36px">
|
||||
Footer content
|
||||
@@ -188,6 +187,16 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 24rem) {
|
||||
html.her #progress-background {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html.her #progress-bar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
opacity: 0.65;
|
||||
|
||||
@@ -34,7 +34,7 @@ export const createNewTool = async (token: string, tool: object) => {
|
||||
export const getTools = async (token: string = '') => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/tools`, {
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/tools/`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
|
||||
@@ -166,6 +166,8 @@
|
||||
chunk_size: chunkSize
|
||||
}
|
||||
});
|
||||
|
||||
await updateQuerySettings(localStorage.token, querySettings);
|
||||
};
|
||||
|
||||
const setEmbeddingConfig = async () => {
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
const progressBar = document.getElementById('progress-bar');
|
||||
|
||||
if (progressBar) {
|
||||
progressBar.style.width = `${value * 0.24}rem`;
|
||||
progressBar.style.width = `${value}%`;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user