mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
feat: remove apiKey from server
This commit is contained in:
@@ -146,7 +146,6 @@ export const serverState: Server = {
|
||||
showBannerGradient: 'yes',
|
||||
partnerLogo: true,
|
||||
},
|
||||
apiKey: 'unupc_fab6ff6ffe51040595c6d9ffb63a353ba16cc2ad7d93f813a2e80a5810',
|
||||
avatar: 'https://source.unsplash.com/300x300/?portrait',
|
||||
config: {
|
||||
id: 'config-id',
|
||||
|
||||
@@ -68,7 +68,6 @@ if (!file_exists('/var/lib/pkgtools/packages/dynamix.unraid.net') && !file_exist
|
||||
}
|
||||
|
||||
$serverData = [
|
||||
"apiKey" => $myservers['upc']['apikey'] ?? '',
|
||||
"apiVersion" => $myservers['api']['version'] ?? '',
|
||||
"avatar" => (!empty($myservers['remote']['avatar']) && $connectPluginInstalled) ? $myservers['remote']['avatar'] : '',
|
||||
"banner" => $display['banner'] ?? '',
|
||||
|
||||
@@ -8,9 +8,7 @@ import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const { apiKey } = storeToRefs(useServerStore());
|
||||
|
||||
const downloadUrl = computed(() => new URL(`/graphql/api/logs?apiKey=${apiKey.value}`, WEBGUI_GRAPHQL));
|
||||
const downloadUrl = computed(() => new URL(`/graphql/api/logs`, WEBGUI_GRAPHQL));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -19,7 +19,6 @@ import { WEBGUI_GRAPHQL } from './urls';
|
||||
const httpEndpoint = WEBGUI_GRAPHQL;
|
||||
const wsEndpoint = new URL(WEBGUI_GRAPHQL.toString().replace('http', 'ws'));
|
||||
|
||||
// const headers = { 'x-api-key': serverStore.apiKey };
|
||||
const headers = {
|
||||
'x-csrf-token': globalThis.csrf_token,
|
||||
};
|
||||
|
||||
@@ -67,7 +67,6 @@ export const useServerStore = defineStore("server", () => {
|
||||
/**
|
||||
* State
|
||||
*/
|
||||
const apiKey = ref<string>("");
|
||||
const apiVersion = ref<string>("");
|
||||
const array = ref<ServerStateArray | undefined>();
|
||||
// helps to display warning next to array status
|
||||
@@ -201,7 +200,6 @@ export const useServerStore = defineStore("server", () => {
|
||||
|
||||
const server = computed((): Server => {
|
||||
return {
|
||||
apiKey: apiKey.value,
|
||||
apiVersion: apiVersion.value,
|
||||
array: array.value,
|
||||
avatar: avatar.value,
|
||||
@@ -328,10 +326,6 @@ export const useServerStore = defineStore("server", () => {
|
||||
|
||||
const serverDebugPayload = computed((): Server => {
|
||||
const payload = {
|
||||
apiKey:
|
||||
apiKey.value && typeof apiKey.value === "string"
|
||||
? `${apiKey.value.substring(0, 6)}__[REDACTED]`
|
||||
: "", // so we don't send full api key in email
|
||||
apiVersion: apiVersion.value,
|
||||
avatar: avatar.value,
|
||||
connectPluginInstalled: connectPluginInstalled.value,
|
||||
@@ -1443,7 +1437,6 @@ export const useServerStore = defineStore("server", () => {
|
||||
|
||||
return {
|
||||
// state
|
||||
apiKey,
|
||||
array,
|
||||
avatar,
|
||||
cloud,
|
||||
|
||||
@@ -69,7 +69,6 @@ export interface ServerStateArray {
|
||||
|
||||
export interface Server {
|
||||
activationCodeData?: ActivationCodeData;
|
||||
apiKey?: string;
|
||||
apiVersion?: string;
|
||||
array?: ServerStateArray;
|
||||
avatar?: string;
|
||||
|
||||
Reference in New Issue
Block a user