1
1
# Feature patch (cc-tdx v1.0) based on tag 0.5.20: Introducing support for confidential computing VMs on TDX
2
2
3
3
diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py
4
- index 416460837..06d85350e 100644
4
+ index 416460837..fa3c850b5 100644
5
5
--- a/backend/open_webui/main.py
6
6
+++ 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():
8
8
return {"status": True}
9
9
10
10
@@ -26,8 +26,6 @@ index 416460837..06d85350e 100644
26
26
+ "id": str(uuid.uuid4()),
27
27
+ "status": True
28
28
+ }
29
- + print(f"response: {result}")
30
- + log.info(f"Returned message: {result}")
31
29
+ return result
32
30
+
33
31
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
@@ -846,7 +844,7 @@ index 02bdd4eb3..4add7d713 100644
846
844
+ return resJson.quote;
847
845
+ };
848
846
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
850
848
--- a/src/lib/components/chat/Chat.svelte
851
849
+++ b/src/lib/components/chat/Chat.svelte
852
850
@@ -13,6 +13,9 @@
@@ -878,7 +876,7 @@ index ca766c9f7..bbdf3ad5a 100644
878
876
879
877
$: if (chatIdProp) {
880
878
(async () => {
881
- @@ -639,11 +645,91 @@
879
+ @@ -639,11 +645,90 @@
882
880
}
883
881
};
884
882
@@ -905,12 +903,9 @@ index ca766c9f7..bbdf3ad5a 100644
905
903
+ attestationInfo = null;
906
904
+ attestationValid = false;
907
905
+ const _quote_hex = await getQuote(localStorage.token);
908
- + console.log('Quote:', _quote_hex);
909
906
+ const quote = hexToBytes(_quote_hex);
910
907
+ const token = await acs_attest_client.attest(quote);
911
- + console.log('Attestation Token:', token);
912
908
+ const jwtclaims = await acs_attest_client.decode_apprasial_token(token);
913
- + console.log('Attestation Claims:', jwtclaims);
914
909
+ let tmpInfo = {};
915
910
+ const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
916
911
+ tmpInfo.exp = moment((jwtclaims.exp)*1000).format('YYYY-MM-DD HH:mm:ss ')+timeZone;
@@ -919,13 +914,13 @@ index ca766c9f7..bbdf3ad5a 100644
919
914
+ tmpInfo.tee = jwtclaims.tee;
920
915
+
921
916
+ 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'];
925
920
+ tmpInfo.mr_seam = tmp_tcbinfo['tdx.quote.body.mr_seam'];
926
921
+ tmpInfo.mr_servicetd = tmp_tcbinfo['tdx.quote.body.mr_servicetd'];
927
922
+ 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'];
929
924
+ tmpInfo.rtmr_0 = tmp_tcbinfo['tdx.quote.body.rtmr_0'];
930
925
+ tmpInfo.rtmr_1 = tmp_tcbinfo['tdx.quote.body.rtmr_1'];
931
926
+ tmpInfo.rtmr_2 = tmp_tcbinfo['tdx.quote.body.rtmr_2'];
@@ -934,19 +929,21 @@ index ca766c9f7..bbdf3ad5a 100644
934
929
+ tmpInfo.tcb_svn = tmp_tcbinfo['tdx.quote.body.tcb_svn'];
935
930
+ tmpInfo.td_attributes = tmp_tcbinfo['tdx.quote.body.td_attributes'];
936
931
+ 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'];
940
935
+ 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']
949
945
+ });
946
+ + */
950
947
+ attestationInfo = tmpInfo;
951
948
+ attestationValid = true;
952
949
+ } catch (error) {
@@ -971,7 +968,7 @@ index ca766c9f7..bbdf3ad5a 100644
971
968
if ($page.url.searchParams.get('models')) {
972
969
selectedModels = $page.url.searchParams.get('models')?.split(',');
973
970
} else if ($page.url.searchParams.get('model')) {
974
- @@ -2031,6 +2117 ,8 @@
971
+ @@ -2031,6 +2116 ,8 @@
975
972
bind:codeInterpreterEnabled
976
973
bind:webSearchEnabled
977
974
bind:atSelectedModel
@@ -980,7 +977,7 @@ index ca766c9f7..bbdf3ad5a 100644
980
977
transparentBackground={$settings?.backgroundImageUrl ?? false}
981
978
{stopResponse}
982
979
{createMessagePair}
983
- @@ -2083,6 +2171 ,8 @@
980
+ @@ -2083,6 +2170 ,8 @@
984
981
bind:codeInterpreterEnabled
985
982
bind:webSearchEnabled
986
983
bind:atSelectedModel
@@ -990,30 +987,20 @@ index ca766c9f7..bbdf3ad5a 100644
990
987
{stopResponse}
991
988
{createMessagePair}
992
989
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
994
991
--- a/src/lib/components/chat/MessageInput.svelte
995
992
+++ b/src/lib/components/chat/MessageInput.svelte
996
- @@ -59,7 +59,18 @@
993
+ @@ -59,7 +59,8 @@
997
994
998
995
export let atSelectedModel: Model | undefined = undefined;
999
996
export let selectedModels: [''];
1000
997
-
1001
998
+ export let attestationValid = false;
1002
999
+ 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
- + }
1013
1000
let selectedModelIds = [];
1014
1001
$: selectedModelIds = atSelectedModel !== undefined ? [atSelectedModel.id] : selectedModels;
1015
1002
1016
- @@ -1231,6 +1242 ,35 @@
1003
+ @@ -1231,6 +1232 ,35 @@
1017
1004
</div>
1018
1005
1019
1006
<div class="self-end flex space-x-1 mr-1 shrink-0">
0 commit comments