Skip to content

Commit ef5634f

Browse files
zzzqc1234RodgerZhu
andauthored
update patchfile (#301)
* update readme * update picure name * update issue link * update link * update links * update * update pictures * update readme_cn * update * update * update * fix format * update open-webui work flow * update flow * update * Add patch readme * fix quotedata undefine error --------- Co-authored-by: Zhu Yunge <[email protected]>
1 parent 47665db commit ef5634f

File tree

3 files changed

+40
-58
lines changed

3 files changed

+40
-58
lines changed

cczoo/confidential_ai/README_CN.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,25 +119,6 @@
119119
bash Miniconda3-latest-Linux-x86_64.sh
120120
### 安装过程中可通过输入q,跳过阅读安装信息
121121

122-
```ini
123-
# Ollama URL地址,用于后端连接
124-
OLLAMA_BASE_URL='http://ip_address:port'
125-
126-
# OpenAI API 配置 (未使用则置空)
127-
OPENAI_API_BASE_URL=''
128-
OPENAI_API_KEY=''
129-
130-
# AUTOMATIC1111 API (如需要,取消注释)
131-
# AUTOMATIC1111_BASE_URL="http://localhost:7860"
132-
133-
# 禁用跟踪和遥测
134-
SCARF_NO_ANALYTICS=true
135-
DO_NOT_TRACK=true
136-
ANONYMIZED_TELEMETRY=false
137-
```
138-
确保替换掉`ip_address:port`为真实的**Ollama server**的ip地址和端口。
139-
140-
141122
```
142123
- 配置minconda环境:
143124
```bash
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Apply patch on open-webui
2+
3+
1.download open-webui
4+
   ```sh
5+
   git clone https://github.com/xxxxx/open-webui.git
6+
   ```
7+
8+
2.download patchfile and put it in the same directory as open-webui
9+
   ```sh
10+
   git apply --directory=open-webui/ xxx.patch
11+
   ```
12+
 
13+
**NOTE**
14+
Please make sure you open-webui is basic on feature/v0.5.20-cllm.

cczoo/confidential_ai/open-webui-patch/v0.5.20-feature-cc-tdx-v1.0.patch

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Feature patch (cc-tdx v1.0) based on tag 0.5.20: Introducing support for confidential computing VMs on TDX
22

33
diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py
4-
index 416460837..06d85350e 100644
4+
index 416460837..fa3c850b5 100644
55
--- a/backend/open_webui/main.py
66
+++ b/backend/open_webui/main.py
7-
@@ -1370,6 +1370,28 @@ async def healthcheck_with_db():
7+
@@ -1370,6 +1370,26 @@ async def healthcheck_with_db():
88
return {"status": True}
99

1010

@@ -26,8 +26,6 @@ index 416460837..06d85350e 100644
2626
+ "id": str(uuid.uuid4()),
2727
+ "status": True
2828
+ }
29-
+ print(f"response: {result}")
30-
+ log.info(f"Returned message: {result}")
3129
+ return result
3230
+
3331
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
@@ -846,7 +844,7 @@ index 02bdd4eb3..4add7d713 100644
846844
+ return resJson.quote;
847845
+};
848846
diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte
849-
index ca766c9f7..bbdf3ad5a 100644
847+
index ca766c9f7..37f7584a9 100644
850848
--- a/src/lib/components/chat/Chat.svelte
851849
+++ b/src/lib/components/chat/Chat.svelte
852850
@@ -13,6 +13,9 @@
@@ -878,7 +876,7 @@ index ca766c9f7..bbdf3ad5a 100644
878876

879877
$: if (chatIdProp) {
880878
(async () => {
881-
@@ -639,11 +645,91 @@
879+
@@ -639,11 +645,90 @@
882880
}
883881
};
884882

@@ -905,12 +903,9 @@ index ca766c9f7..bbdf3ad5a 100644
905903
+ attestationInfo = null;
906904
+ attestationValid = false;
907905
+ const _quote_hex = await getQuote(localStorage.token);
908-
+ console.log('Quote:', _quote_hex);
909906
+ const quote = hexToBytes(_quote_hex);
910907
+ const token = await acs_attest_client.attest(quote);
911-
+ console.log('Attestation Token:', token);
912908
+ const jwtclaims = await acs_attest_client.decode_apprasial_token(token);
913-
+ console.log('Attestation Claims:', jwtclaims);
914909
+ let tmpInfo = {};
915910
+ const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
916911
+ tmpInfo.exp = moment((jwtclaims.exp)*1000).format('YYYY-MM-DD HH:mm:ss ')+timeZone;
@@ -919,13 +914,13 @@ index ca766c9f7..bbdf3ad5a 100644
919914
+ tmpInfo.tee = jwtclaims.tee;
920915
+
921916
+ const tmp_tcbinfo = JSON.parse(jwtclaims['tcb-status']);
922-
+ tmpInfo.mr_config_id = tmp_tcbinfo['tdx.quote.body.mr_config_id'];
923-
+ tmpInfo.mr_owner = tmp_tcbinfo['tdx.quote.body.mr_owner'];
924-
+ tmpInfo.mr_owner_config = tmp_tcbinfo['tdx.quote.body.mr_owner_config'];
917+
+ //tmpInfo.mr_config_id = tmp_tcbinfo['tdx.quote.body.mr_config_id'];
918+
+ //tmpInfo.mr_owner = tmp_tcbinfo['tdx.quote.body.mr_owner'];
919+
+ //tmpInfo.mr_owner_config = tmp_tcbinfo['tdx.quote.body.mr_owner_config'];
925920
+ tmpInfo.mr_seam = tmp_tcbinfo['tdx.quote.body.mr_seam'];
926921
+ tmpInfo.mr_servicetd = tmp_tcbinfo['tdx.quote.body.mr_servicetd'];
927922
+ tmpInfo.mr_td = tmp_tcbinfo['tdx.quote.body.mr_td'];
928-
+ tmpInfo.mrsigner_seam = tmp_tcbinfo['tdx.quote.body.mrsigner_seam'];
923+
+ //tmpInfo.mrsigner_seam = tmp_tcbinfo['tdx.quote.body.mrsigner_seam'];
929924
+ tmpInfo.rtmr_0 = tmp_tcbinfo['tdx.quote.body.rtmr_0'];
930925
+ tmpInfo.rtmr_1 = tmp_tcbinfo['tdx.quote.body.rtmr_1'];
931926
+ tmpInfo.rtmr_2 = tmp_tcbinfo['tdx.quote.body.rtmr_2'];
@@ -934,19 +929,21 @@ index ca766c9f7..bbdf3ad5a 100644
934929
+ tmpInfo.tcb_svn = tmp_tcbinfo['tdx.quote.body.tcb_svn'];
935930
+ tmpInfo.td_attributes = tmp_tcbinfo['tdx.quote.body.td_attributes'];
936931
+ tmpInfo.tee_tcb_svn2 = tmp_tcbinfo['tdx.quote.body.tee_tcb_svn2'];
937-
+ tmpInfo.xfam = tmp_tcbinfo['tdx.quote.body.xfam'];
938-
+ tmpInfo.att_key_type = tmp_tcbinfo['tdx.quote.header.att_key_type'];
939-
+ tmpInfo.tee_type = tmp_tcbinfo['tdx.quote.header.tee_type'];
932+
+ //tmpInfo.xfam = tmp_tcbinfo['tdx.quote.body.xfam'];
933+
+ //tmpInfo.att_key_type = tmp_tcbinfo['tdx.quote.header.att_key_type'];
934+
+ //tmpInfo.tee_type = tmp_tcbinfo['tdx.quote.header.tee_type'];
940935
+ tmpInfo.user_data = tmp_tcbinfo['tdx.quote.header.user_data'];
941-
+ tmpInfo.vendor_id = tmp_tcbinfo['tdx.quote.header.vendor_id'];
942-
+ tmpInfo.version = tmp_tcbinfo['tdx.quote.header.version'];
943-
+ tmpInfo.type = tmp_tcbinfo['tdx.quote.type'];
944-
+ Object.assign(tmpInfo,{'td_attributes.debug':tmp_tcbinfo['td_attributes.debug'],
945-
+ 'td_attributes.key_locker':tmp_tcbinfo['td_attributes.key_locker'],
946-
+ 'td_attributes.perfmon':tmp_tcbinfo['td_attributes.perfmon'],
947-
+ 'td_attributes.protection_keys':tmp_tcbinfo['td_attributes.protection_keys'],
948-
+ 'td_attributes.septve_disable':tmp_tcbinfo['td_attributes.septve_disable']
936+
+ //tmpInfo.vendor_id = tmp_tcbinfo['tdx.quote.header.vendor_id'];
937+
+ //tmpInfo.version = tmp_tcbinfo['tdx.quote.header.version'];
938+
+ //tmpInfo.type = tmp_tcbinfo['tdx.quote.type'];
939+
+ /*
940+
+ Object.assign(tmpInfo,{'td_attributes.debug':tmp_tcbinfo['tdx.td_attributes.debug'],
941+
+ 'td_attributes.key_locker':tmp_tcbinfo['tdx.td_attributes.key_locker'],
942+
+ 'td_attributes.perfmon':tmp_tcbinfo['tdx.td_attributes.perfmon'],
943+
+ 'td_attributes.protection_keys':tmp_tcbinfo['tdx.td_attributes.protection_keys'],
944+
+ 'td_attributes.septve_disable':tmp_tcbinfo['tdx.td_attributes.septve_disable']
949945
+ });
946+
+ */
950947
+ attestationInfo = tmpInfo;
951948
+ attestationValid = true;
952949
+ } catch (error) {
@@ -971,7 +968,7 @@ index ca766c9f7..bbdf3ad5a 100644
971968
if ($page.url.searchParams.get('models')) {
972969
selectedModels = $page.url.searchParams.get('models')?.split(',');
973970
} else if ($page.url.searchParams.get('model')) {
974-
@@ -2031,6 +2117,8 @@
971+
@@ -2031,6 +2116,8 @@
975972
bind:codeInterpreterEnabled
976973
bind:webSearchEnabled
977974
bind:atSelectedModel
@@ -980,7 +977,7 @@ index ca766c9f7..bbdf3ad5a 100644
980977
transparentBackground={$settings?.backgroundImageUrl ?? false}
981978
{stopResponse}
982979
{createMessagePair}
983-
@@ -2083,6 +2171,8 @@
980+
@@ -2083,6 +2170,8 @@
984981
bind:codeInterpreterEnabled
985982
bind:webSearchEnabled
986983
bind:atSelectedModel
@@ -990,30 +987,20 @@ index ca766c9f7..bbdf3ad5a 100644
990987
{stopResponse}
991988
{createMessagePair}
992989
diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte
993-
index 7db31010b..bda7fe816 100644
990+
index 7db31010b..de6eeeacc 100644
994991
--- a/src/lib/components/chat/MessageInput.svelte
995992
+++ b/src/lib/components/chat/MessageInput.svelte
996-
@@ -59,7 +59,18 @@
993+
@@ -59,7 +59,8 @@
997994

998995
export let atSelectedModel: Model | undefined = undefined;
999996
export let selectedModels: [''];
1000997
-
1001998
+ export let attestationValid = false;
1002999
+ export let attestationInfo = null;
1003-
+ $: {
1004-
+ try {
1005-
+ console.log('[MessageInput] attestation State Update:', {
1006-
+ valid: attestationValid,
1007-
+ info: attestationInfo ? JSON.parse(JSON.stringify(attestationInfo)) : 'undefined'
1008-
+ });
1009-
+ } catch (e) {
1010-
+ console.error('attestationInfo failed:', e);
1011-
+ }
1012-
+ }
10131000
let selectedModelIds = [];
10141001
$: selectedModelIds = atSelectedModel !== undefined ? [atSelectedModel.id] : selectedModels;
10151002

1016-
@@ -1231,6 +1242,35 @@
1003+
@@ -1231,6 +1232,35 @@
10171004
</div>
10181005

10191006
<div class="self-end flex space-x-1 mr-1 shrink-0">

0 commit comments

Comments
 (0)