mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-17 06:14:21 +01:00
Fixes for self-hosting
This commit is contained in:
committed by
Tony Giorgio
parent
9caa91242a
commit
27aee22d73
@@ -4,3 +4,4 @@ node_modules
|
|||||||
*.md
|
*.md
|
||||||
dist
|
dist
|
||||||
justfile
|
justfile
|
||||||
|
.env.local
|
||||||
|
|||||||
2
.github/workflows/android-prod.yml
vendored
2
.github/workflows/android-prod.yml
vendored
@@ -64,7 +64,7 @@ jobs:
|
|||||||
VITE_RGS: https://scorer.mutinywallet.com/v1/rgs/snapshot/
|
VITE_RGS: https://scorer.mutinywallet.com/v1/rgs/snapshot/
|
||||||
VITE_AUTH: https://auth.mutinywallet.com
|
VITE_AUTH: https://auth.mutinywallet.com
|
||||||
VITE_SUBSCRIPTIONS: https://subscriptions.mutinywallet.com
|
VITE_SUBSCRIPTIONS: https://subscriptions.mutinywallet.com
|
||||||
VITE_STORAGE: https://storage.mutinywallet.com
|
VITE_STORAGE: https://storage.mutinywallet.com/v2
|
||||||
VITE_FEEDBACK: https://feedback.mutinywallet.com
|
VITE_FEEDBACK: https://feedback.mutinywallet.com
|
||||||
VITE_SCORER: https://scorer.mutinywallet.com
|
VITE_SCORER: https://scorer.mutinywallet.com
|
||||||
VITE_PRIMAL: https://primal-cache.mutinywallet.com/api
|
VITE_PRIMAL: https://primal-cache.mutinywallet.com/api
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ RUN apt update && apt install -y git
|
|||||||
|
|
||||||
# Add the ARG directives for build-time environment variables
|
# Add the ARG directives for build-time environment variables
|
||||||
ARG VITE_NETWORK="bitcoin"
|
ARG VITE_NETWORK="bitcoin"
|
||||||
ARG VITE_PROXY="wss://p.mutinywallet.com"
|
ARG VITE_PROXY="/_services/proxy"
|
||||||
ARG VITE_ESPLORA="https://mutinynet.com/api"
|
ARG VITE_ESPLORA
|
||||||
ARG VITE_LSP="https://lsp.voltageapi.com"
|
ARG VITE_LSP="https://lsp.voltageapi.com"
|
||||||
ARG VITE_RGS="https://rgs.mutinynet.com/snapshot/"
|
ARG VITE_RGS
|
||||||
ARG VITE_AUTH
|
ARG VITE_AUTH
|
||||||
ARG VITE_STORAGE
|
ARG VITE_STORAGE="/_services/vss/v2"
|
||||||
ARG VITE_SELFHOSTED="true"
|
ARG VITE_SELFHOSTED="true"
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
"@kobalte/tailwindcss": "^0.5.0",
|
"@kobalte/tailwindcss": "^0.5.0",
|
||||||
"@modular-forms/solid": "^0.18.1",
|
"@modular-forms/solid": "^0.18.1",
|
||||||
"@mutinywallet/barcode-scanner": "5.0.0-beta.3",
|
"@mutinywallet/barcode-scanner": "5.0.0-beta.3",
|
||||||
"@mutinywallet/mutiny-wasm": "0.4.19",
|
"@mutinywallet/mutiny-wasm": "0.4.20",
|
||||||
"@mutinywallet/waila-wasm": "^0.2.1",
|
"@mutinywallet/waila-wasm": "^0.2.1",
|
||||||
"@nostr-dev-kit/ndk": "^0.8.11",
|
"@nostr-dev-kit/ndk": "^0.8.11",
|
||||||
"@solid-primitives/upload": "^0.0.111",
|
"@solid-primitives/upload": "^0.0.111",
|
||||||
|
|||||||
16
pnpm-lock.yaml
generated
16
pnpm-lock.yaml
generated
@@ -1,9 +1,5 @@
|
|||||||
lockfileVersion: '6.0'
|
lockfileVersion: '6.0'
|
||||||
|
|
||||||
settings:
|
|
||||||
autoInstallPeers: true
|
|
||||||
excludeLinksFromLockfile: false
|
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
.:
|
.:
|
||||||
@@ -42,8 +38,8 @@ importers:
|
|||||||
specifier: 5.0.0-beta.3
|
specifier: 5.0.0-beta.3
|
||||||
version: 5.0.0-beta.3(@capacitor/core@5.2.2)
|
version: 5.0.0-beta.3(@capacitor/core@5.2.2)
|
||||||
'@mutinywallet/mutiny-wasm':
|
'@mutinywallet/mutiny-wasm':
|
||||||
specifier: 0.4.19
|
specifier: 0.4.20
|
||||||
version: 0.4.19
|
version: 0.4.20
|
||||||
'@mutinywallet/waila-wasm':
|
'@mutinywallet/waila-wasm':
|
||||||
specifier: ^0.2.1
|
specifier: ^0.2.1
|
||||||
version: 0.2.1
|
version: 0.2.1
|
||||||
@@ -2497,8 +2493,8 @@ packages:
|
|||||||
'@capacitor/core': 5.2.2
|
'@capacitor/core': 5.2.2
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@mutinywallet/mutiny-wasm@0.4.19:
|
/@mutinywallet/mutiny-wasm@0.4.20:
|
||||||
resolution: {integrity: sha512-iDH6JFinOUnJu57tbdJqCMWjN1h5+UDznK8hLga+1l7LJw9ro/wxop+hsvKwGSsX6rvK3xhRKQHsFsb7NkiRfQ==}
|
resolution: {integrity: sha512-dygacqfLbWzUeN9iUpWwmZluM5ZfwYpzBXOeTTYSweiWpblTia7x67UqTNgzxh88gkuM4b0GUoo69QO5LppPSQ==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@mutinywallet/waila-wasm@0.2.1:
|
/@mutinywallet/waila-wasm@0.2.1:
|
||||||
@@ -14066,3 +14062,7 @@ packages:
|
|||||||
/yocto-queue@0.1.0:
|
/yocto-queue@0.1.0:
|
||||||
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
|
settings:
|
||||||
|
autoInstallPeers: true
|
||||||
|
excludeLinksFromLockfile: false
|
||||||
|
|||||||
@@ -110,21 +110,27 @@ export async function getSettings() {
|
|||||||
|
|
||||||
// Expect urls like /_services/proxy and /_services/storage
|
// Expect urls like /_services/proxy and /_services/storage
|
||||||
if (selfhosted) {
|
if (selfhosted) {
|
||||||
const base = window.location.origin;
|
let base = window.location.origin;
|
||||||
console.log("Self-hosted mode enabled, using base URL", base);
|
console.log("Self-hosted mode enabled, using base URL", base);
|
||||||
const proxy = settings.proxy;
|
|
||||||
const storage = settings.storage;
|
const storage = settings.storage;
|
||||||
if (proxy && proxy.startsWith("/")) {
|
|
||||||
settings.proxy = base + proxy;
|
|
||||||
}
|
|
||||||
if (storage && storage.startsWith("/")) {
|
if (storage && storage.startsWith("/")) {
|
||||||
settings.storage = base + storage;
|
settings.storage = base + storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const proxy = settings.proxy;
|
||||||
|
if (proxy && proxy.startsWith("/")) {
|
||||||
|
if (base.startsWith("http://")) {
|
||||||
|
base = base.replace("http://", "ws://");
|
||||||
|
} else if (base.startsWith("https://")) {
|
||||||
|
base = base.replace("https://", "wss://");
|
||||||
|
}
|
||||||
|
settings.proxy = base + proxy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!settings.network || !settings.proxy || !settings.esplora) {
|
if (!settings.network || !settings.proxy) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Missing a default setting for network, proxy, or esplora. Check your .env file to make sure it looks like .env.sample"
|
"Missing a default setting for network or proxy. Check your .env file to make sure it looks like .env.sample"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user