π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
π Enables sensetive data to be passed by env var
Alicia Sykes25e774ca7990
diff --git a/src/components/Widgets/AdGuardDnsInfo.vue b/src/components/Widgets/AdGuardDnsInfo.vueindex a1b1fcb8..beb18725 100644--- a/src/components/Widgets/AdGuardDnsInfo.vue+++ b/src/components/Widgets/AdGuardDnsInfo.vue@@ -26,7 +26,7 @@ export default {/* URL/ IP or hostname to the AdGuardHome instance, without trailing slash */hostname() {if (!this.options.hostname) this.error('You must specify the path to your AdGuard server');- return this.options.hostname;+ return this.parseAsEnvVar(this.options.hostname);},showFullInfo() {return this.options.showFullInfo;@@ -39,7 +39,9 @@ export default {},authHeaders() {if (this.options.username && this.options.password) {- const encoded = window.btoa(`${this.options.username}:${this.options.password}`);+ const password = this.parseAsEnvVar(this.options.password);+ const username = this.parseAsEnvVar(this.options.username);+ const encoded = window.btoa(`${username}:${password}`);return { Authorization: `Basic ${encoded}` };}return {};diff --git a/src/components/Widgets/AdGuardFilterStatus.vue b/src/components/Widgets/AdGuardFilterStatus.vueindex bf1899fe..5997086f 100644--- a/src/components/Widgets/AdGuardFilterStatus.vue+++ b/src/components/Widgets/AdGuardFilterStatus.vue@@ -38,7 +38,7 @@ export default {/* URL/ IP or hostname to the AdGuardHome instance, without trailing slash */hostname() {if (!this.options.hostname) this.error('You must specify the path to your AdGuard server');- return this.options.hostname;+ return this.parseAsEnvVar(this.options.hostname);},showOnOffStatusOnly() {return this.options.showOnOffStatusOnly;@@ -48,7 +48,9 @@ export default {},authHeaders() {if (this.options.username && this.options.password) {- const encoded = window.btoa(`${this.options.username}:${this.options.password}`);+ const username = this.parseAsEnvVar(this.options.username);+ const password = this.parseAsEnvVar(this.options.password);+ const encoded = window.btoa(`${username}:${password}`);return { Authorization: `Basic ${encoded}` };}return {};diff --git a/src/components/Widgets/AdGuardStats.vue b/src/components/Widgets/AdGuardStats.vueindex f1123546..2c649d30 100644--- a/src/components/Widgets/AdGuardStats.vue+++ b/src/components/Widgets/AdGuardStats.vue@@ -20,14 +20,16 @@ export default {/* URL/ IP or hostname to the AdGuardHome instance, without trailing slash */hostname() {if (!this.options.hostname) this.error('You must specify the path to your AdGuard server');- return this.options.hostname;+ return this.parseAsEnvVar(this.options.hostname);},endpoint() {return `${this.hostname}/control/stats`;},authHeaders() {if (this.options.username && this.options.password) {- const encoded = window.btoa(`${this.options.username}:${this.options.password}`);+ const username = this.parseAsEnvVar(this.options.username);+ const password = this.parseAsEnvVar(this.options.password);+ const encoded = window.btoa(`${username}:${password}`);return { Authorization: `Basic ${encoded}` };}return {};diff --git a/src/components/Widgets/AdGuardTopDomains.vue b/src/components/Widgets/AdGuardTopDomains.vueindex d19ff7d7..69759457 100644--- a/src/components/Widgets/AdGuardTopDomains.vue+++ b/src/components/Widgets/AdGuardTopDomains.vue@@ -36,11 +36,13 @@ export default {/* URL/ IP or hostname to the AdGuardHome instance, without trailing slash */hostname() {if (!this.options.hostname) this.error('You must specify the path to your AdGuard server');- return this.options.hostname;+ return this.parseAsEnvVar(this.options.hostname);},authHeaders() {if (this.options.username && this.options.password) {- const encoded = window.btoa(`${this.options.username}:${this.options.password}`);+ const username = this.parseAsEnvVar(this.options.username);+ const password = this.parseAsEnvVar(this.options.password);+ const encoded = window.btoa(`${username}:${password}`);return { Authorization: `Basic ${encoded}` };}return {};diff --git a/src/components/Widgets/AnonAddy.vue b/src/components/Widgets/AnonAddy.vueindex 0e466c05..eb5d4d6c 100644--- a/src/components/Widgets/AnonAddy.vue+++ b/src/components/Widgets/AnonAddy.vue@@ -113,7 +113,7 @@ export default {},computed: {hostname() {- return this.options.hostname || widgetApiEndpoints.anonAddy;+ return this.parseAsEnvVar(this.options.hostname) || widgetApiEndpoints.anonAddy;},apiVersion() {return this.options.apiVersion || 'v1';@@ -132,7 +132,7 @@ export default {},apiKey() {if (!this.options.apiKey) this.error('An apiKey is required');- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},hideMeta() {return this.options.hideMeta;diff --git a/src/components/Widgets/BlacklistCheck.vue b/src/components/Widgets/BlacklistCheck.vueindex ad5975b9..7fee0094 100644--- a/src/components/Widgets/BlacklistCheck.vue+++ b/src/components/Widgets/BlacklistCheck.vue@@ -35,7 +35,7 @@ export default {},apiKey() {if (!this.options.apiKey) this.error('Missing API Key');- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},endpoint() {return `${widgetApiEndpoints.blacklistCheck}/${this.ipAddress}`;diff --git a/src/components/Widgets/CodeStats.vue b/src/components/Widgets/CodeStats.vueindex 61c3ae69..29be3b19 100644--- a/src/components/Widgets/CodeStats.vue+++ b/src/components/Widgets/CodeStats.vue@@ -38,12 +38,12 @@ export default {/* The username to fetch data from - REQUIRED */username() {if (!this.options.username) this.error('You must specify a username');- return this.options.username;+ return this.parseAsEnvVar(this.options.username);},/* Optionally override hostname, if using a self-hosted instance */hostname() {if (this.options.hostname) return this.options.hostname;- return widgetApiEndpoints.codeStats;+ return this.parseAsEnvVar(widgetApiEndpoints.codeStats);},hideMeta() {return this.options.hideMeta || false;diff --git a/src/components/Widgets/DomainMonitor.vue b/src/components/Widgets/DomainMonitor.vueindex 90d6c8ae..274d84fc 100644--- a/src/components/Widgets/DomainMonitor.vue+++ b/src/components/Widgets/DomainMonitor.vue@@ -63,11 +63,11 @@ export default {computed: {apiKey() {if (!this.options.apiKey) this.error('Missing API Key');- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},domain() {if (!this.options.domain) this.error('Missing Domain Name Key');- return this.options.domain;+ return this.parseAsEnvVar(this.options.domain);},endpoint() {return `${widgetApiEndpoints.domainMonitor}/?domain=${this.domain}&r=whois&apikey=${this.apiKey}`;diff --git a/src/components/Widgets/DroneCi.vue b/src/components/Widgets/DroneCi.vueindex 8ffb4e84..b80a792d 100644--- a/src/components/Widgets/DroneCi.vue+++ b/src/components/Widgets/DroneCi.vue@@ -106,7 +106,7 @@ export default {if (!this.options.apiKey) {this.error('An API key is required, please see the docs for more info');}- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},},methods: {diff --git a/src/components/Widgets/ExchangeRates.vue b/src/components/Widgets/ExchangeRates.vueindex 1c68dc14..294747a3 100644--- a/src/components/Widgets/ExchangeRates.vue+++ b/src/components/Widgets/ExchangeRates.vue@@ -45,7 +45,7 @@ export default {computed: {/* The users API key for exchangerate-api.com */apiKey() {- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},/* The currency to convert results into */inputCurrency() {diff --git a/src/components/Widgets/Flights.vue b/src/components/Widgets/Flights.vueindex 40adc857..f292317f 100644--- a/src/components/Widgets/Flights.vue+++ b/src/components/Widgets/Flights.vue@@ -71,7 +71,7 @@ export default {this.error('An API key must be supplied');return '';}- return usersChoice;+ return this.parseAsEnvVar(usersChoice);},/* The direction of flights: Arrival, Departure or Both */direction() {diff --git a/src/components/Widgets/GluetunStatus.vue b/src/components/Widgets/GluetunStatus.vueindex c07e96e2..f178dffe 100644--- a/src/components/Widgets/GluetunStatus.vue+++ b/src/components/Widgets/GluetunStatus.vue@@ -58,7 +58,7 @@ export default {},hostname() {if (!this.options.hostname) this.error('`hostname` is required');- return this.options.hostname;+ return this.parseAsEnvVar(this.options.hostname);},},methods: {diff --git a/src/components/Widgets/HealthChecks.vue b/src/components/Widgets/HealthChecks.vueindex 2ef02823..964fbff7 100644--- a/src/components/Widgets/HealthChecks.vue+++ b/src/components/Widgets/HealthChecks.vue@@ -56,7 +56,7 @@ export default {this.error('An API key is required, please see the docs for more info');}if (typeof this.options.apiKey === 'string') {- return [this.options.apiKey];+ return [this.parseAsEnvVar(this.options.apiKey)];}return this.options.apiKey;},diff --git a/src/components/Widgets/Linkding.vue b/src/components/Widgets/Linkding.vueindex 188fe9f2..0c2e26ec 100644--- a/src/components/Widgets/Linkding.vue+++ b/src/components/Widgets/Linkding.vue@@ -30,11 +30,11 @@ export default {computed: {endpoint() {if (!this.options.host) this.error('linkgding Host is required');- return `${this.options.host}/api/bookmarks`;+ return `${this.parseAsEnvVar(this.options.host)}/api/bookmarks`;},apiKey() {if (!this.options.apiKey) this.error('linkgding apiKey is required');- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},filtertags() {return this.options.tags;diff --git a/src/components/Widgets/NewsHeadlines.vue b/src/components/Widgets/NewsHeadlines.vueindex d467c70c..9d6df019 100644--- a/src/components/Widgets/NewsHeadlines.vue+++ b/src/components/Widgets/NewsHeadlines.vue@@ -29,7 +29,7 @@ export default {computed: {apiKey() {if (!this.options.apiKey) this.error('An API key is required, see docs for more info');- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},country() {return this.options.country ? `&country=${this.options.country}` : '';diff --git a/src/components/Widgets/NextcloudNotifications.vue b/src/components/Widgets/NextcloudNotifications.vueindex dd1d4f34..62802f2e 100644--- a/src/components/Widgets/NextcloudNotifications.vue+++ b/src/components/Widgets/NextcloudNotifications.vue@@ -22,7 +22,7 @@</span><span v-if="canDeleteNotification('delete')"><a @click="deleteNotification(notification.notification_id)"- class="action secondary">{{ tt('delete-notification') }}</a>+ class="action secondary">{{ tt('delete-notification') }}</a></span></p></div>diff --git a/src/components/Widgets/NextcloudStats.vue b/src/components/Widgets/NextcloudStats.vueindex 8860434f..12e5d1fe 100644--- a/src/components/Widgets/NextcloudStats.vue+++ b/src/components/Widgets/NextcloudStats.vue@@ -44,7 +44,7 @@<em v-html="formatNumber(shares.num_shares)"></em><strong>{{ tt('local') }}</strong> <small> {{ tt('and') }}</small><em v-html="formatNumber(shares.num_fed_shares_sent- + shares.num_fed_shares_received)"></em>+ + shares.num_fed_shares_received)"></em><strong>{{ tt('federated-shares') }}</strong>diff --git a/src/components/Widgets/Proxmox.vue b/src/components/Widgets/Proxmox.vueindex 5ae09fcc..c24724af 100644--- a/src/components/Widgets/Proxmox.vue+++ b/src/components/Widgets/Proxmox.vue@@ -34,22 +34,22 @@ export default {computed: {clusterUrl() {if (!this.options.cluster_url) this.error('The cluster URL is required.');- return this.options.cluster_url || '';+ return this.parseAsEnvVar(this.options.cluster_url) || '';},userName() {if (!this.options.user_name) this.error('The user name is required.');- return this.options.user_name || '';+ return this.parseAsEnvVar(this.options.user_name) || '';},tokenName() {if (!this.options.token_name) this.error('The token name is required.');- return this.options.token_name || '';+ return this.parseAsEnvVar(this.options.token_name) || '';},tokenUuid() {if (!this.options.token_uuid) this.error('The token uuid is required.');- return this.options.token_uuid || '';+ return this.parseAsEnvVar(this.options.token_uuid) || '';},node() {- return this.options.node || '';+ return this.parseAsEnvVar(this.options.node) || '';},nodeData() {return this.options.node_data || false;diff --git a/src/components/Widgets/PublicIp.vue b/src/components/Widgets/PublicIp.vueindex 86cd0032..8a188974 100644--- a/src/components/Widgets/PublicIp.vue+++ b/src/components/Widgets/PublicIp.vue@@ -35,7 +35,7 @@ export default {},provider() {// Can be either `ip-api`, `ipapi.co` or `ipgeolocation`- return this.options.provider || 'ipapi.co';+ return this.parseAsEnvVar(this.options.provider) || 'ipapi.co';},},data() {diff --git a/src/components/Widgets/RssFeed.vue b/src/components/Widgets/RssFeed.vueindex de9857aa..f958f603 100644--- a/src/components/Widgets/RssFeed.vue+++ b/src/components/Widgets/RssFeed.vue@@ -51,7 +51,7 @@ export default {return this.options.rssUrl || '';},apiKey() {- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},parseLocally() {return this.options.parseLocally;diff --git a/src/components/Widgets/SportsScores.vue b/src/components/Widgets/SportsScores.vueindex 2046e01c..6eadc536 100644--- a/src/components/Widgets/SportsScores.vue+++ b/src/components/Widgets/SportsScores.vue@@ -93,7 +93,7 @@ export default {return this.options.leagueId;},apiKey() {- return this.options.apiKey || '50130162';+ return this.parseAsEnvVar(this.options.apiKey) || '50130162';},limit() {return this.options.limit || 20;diff --git a/src/components/Widgets/StockPriceChart.vue b/src/components/Widgets/StockPriceChart.vueindex 68eec186..d8fb35bf 100644--- a/src/components/Widgets/StockPriceChart.vue+++ b/src/components/Widgets/StockPriceChart.vue@@ -29,7 +29,7 @@ export default {},/* The users API key for AlphaVantage */apiKey() {- return this.options.apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},/* The formatted GET request API endpoint to fetch stock data from */endpoint() {diff --git a/src/components/Widgets/SynologyDownload.vue b/src/components/Widgets/SynologyDownload.vueindex aa82089e..fe2fcaa9 100644--- a/src/components/Widgets/SynologyDownload.vue+++ b/src/components/Widgets/SynologyDownload.vue@@ -45,15 +45,15 @@ export default {computed: {hostname() {if (!this.options.hostname) this.error('A hostname is required');- return this.options.hostname;+ return this.parseAsEnvVar(this.options.hostname);},username() {if (!this.options.username) this.error('A username is required');- return this.options.username;+ return this.parseAsEnvVar(this.options.username);},password() {if (!this.options.password) this.error('A password is required');- return this.options.password;+ return this.parseAsEnvVar(this.options.password);},endpointLogin() {return `${this.hostname}/webapi/auth.cgi?api=SYNO.API.Auth&version=3&method=login&account=${this.username}&passwd=${this.password}&session=DownloadStation&format=sid`;diff --git a/src/components/Widgets/UptimeKuma.vue b/src/components/Widgets/UptimeKuma.vueindex b58c1d08..b342b767 100644--- a/src/components/Widgets/UptimeKuma.vue+++ b/src/components/Widgets/UptimeKuma.vue@@ -52,15 +52,11 @@ export default {computed: {/* Get API key for access to instance */apiKey() {- const { apiKey } = this.options;-- return apiKey;+ return this.parseAsEnvVar(this.options.apiKey);},/* Get instance URL */url() {- const { url } = this.options;-- return url;+ return this.parseAsEnvVar(this.options.url);},/* Create authorisation header for the instance from the apiKey */authHeaders() {diff --git a/src/components/Widgets/WalletBalance.vue b/src/components/Widgets/WalletBalance.vueindex 923ae8f9..c2d6dc74 100644--- a/src/components/Widgets/WalletBalance.vue+++ b/src/components/Widgets/WalletBalance.vue@@ -53,7 +53,7 @@ export default {},address() {if (!this.options.address) this.error('You must specify a public address');- return this.options.address;+ return this.parseAsEnvVar(this.options.address);},network() {return this.options.network || 'main';diff --git a/src/components/Widgets/Weather.vue b/src/components/Widgets/Weather.vueindex a72a0dde..11b164dd 100644--- a/src/components/Widgets/Weather.vue+++ b/src/components/Widgets/Weather.vue@@ -46,13 +46,12 @@ export default {return this.options.units || 'metric';},endpoint() {- const {- apiKey, city, lat, lon,- } = this.options;- if (lat && lon) {- return `${widgetApiEndpoints.weather}?lat=${lat}&lon=${lon}&appid=${apiKey}&units=${this.units}`;- }- return `${widgetApiEndpoints.weather}?q=${city}&appid=${apiKey}&units=${this.units}`;+ const apiKey = this.parseAsEnvVar(this.options.apiKey);+ const { city, lat, lon } = this.options;+ const params = (lat && lon)+ ? `lat=${lat}&lon=${lon}&appid=${apiKey}&units=${this.units}`+ : `q=${city}&appid=${apiKey}&units=${this.units}`;+ return `${widgetApiEndpoints.weather}?${params}`;},tempDisplayUnits() {switch (this.units) {