diff --git a/.github/docs/Docker-Setup.md b/.github/docs/Docker-Setup.md new file mode 100644 index 00000000..fa97bd3f --- /dev/null +++ b/.github/docs/Docker-Setup.md @@ -0,0 +1,75 @@ +## Docker Setup Guide + +### Application Configuration + +Create a configuration file that will be mounted into the container. This persists your settings between runs. + +**File:** `config.json` +```bash +mkdir -p /tmp/docker/ && cat > /tmp/docker/config.json << 'EOF' +{ + "unit": "SATS", + "fiatUnit": "USD", + "appMode": "DARK", + "singleSignOn": false, + "password": "" +} +EOF +``` + +### Replace the Entrypoint Script + +The default entrypoint expects a local `lightning-rpc` socket. It can be replaced with simpler version below if we can not provide access to `lightning-rpc`. + +**File:** `entrypoint.sh` +```bash +cat > /tmp/docker/entrypoint.sh << 'EOF' +#!/bin/sh +echo "Replaced default entrypoint" +exec "$@" +EOF + +chmod +x /tmp/docker/entrypoint.sh +``` + +### Core Lightning Authentication (Commando) + +Create a file to store the credentials for authenticating with remote Core Lightning node. + +**File:** `.commando` +```bash +cat > /tmp/docker/.commando << 'EOF' +LIGHTNING_PUBKEY="" +LIGHTNING_RUNE="" +EOF +``` + +### 4. Run the Docker Container + +The following command starts the `cln-application` container, configured to connect to remote core lightning node "cln-node" via its exposed WebSocket port 5018. + +```bash +docker run -d \ + --name cln-app \ + --network application-net \ + -v '/tmp/docker/config.json:/app/config.json' \ + -v '/tmp/docker/.commando:/app/.commando' \ + -v '/tmp/docker/entrypoint.sh:/app/entrypoint.sh' \ + -p 2103:2103 \ + -e APP_SINGLE_SIGN_ON=false \ + -e BITCOIN_NETWORK="regtest" \ + -e APP_CONFIG_FILE="/app/config.json" \ + -e APP_CONNECT="COMMANDO" \ + -e APP_PROTOCOL="http" \ + -e APP_HOST="0.0.0.0" \ + -e APP_PORT=2103 \ + -e LIGHTNING_HOST="cln-node" \ + -e LIGHTNING_VARS_FILE="/app/.commando" \ + -e LIGHTNING_WS_PROTOCOL="ws" \ + -e LIGHTNING_WS_PORT=5018 \ + ghcr.io/elementsproject/cln-application:25.07.2 npm run start +``` + +### Access the Application + +Once the container is running, open your web browser and navigate to: **http://localhost:2103** diff --git a/README.md b/README.md index ee33a76f..e3c98b27 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,8 @@ ``` npm run start ``` +- ## Docker + - For a minimal Docker setup to run the application with a remote Core Lightning node, see our [Docker Setup Guide](./.github/docs/Docker-Setup.md). - ## Stores/Marketplaces - This application is also available on Umbrel App Store and Start9 OS with one click install. diff --git a/apps/backend/package.json b/apps/backend/package.json index c854e98b..19c2dc2c 100755 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -1,6 +1,6 @@ { "name": "cln-application-backend", - "version": "25.07.2", + "version": "25.07.3", "description": "Core lightning application backend", "private": true, "license": "MIT", diff --git a/apps/backend/source/controllers/shared.ts b/apps/backend/source/controllers/shared.ts index bc4187d2..fabc3806 100644 --- a/apps/backend/source/controllers/shared.ts +++ b/apps/backend/source/controllers/shared.ts @@ -27,7 +27,7 @@ export class SharedController { try { logger.info('Getting Application Settings from ' + APP_CONSTANTS.APP_CONFIG_FILE); if (!fs.existsSync(APP_CONSTANTS.APP_CONFIG_FILE)) { - logger.warning( + logger.warn( `Config file ${APP_CONSTANTS.APP_CONFIG_FILE} not found. Creating default config.`, ); fs.writeFileSync( diff --git a/apps/backend/source/shared/utils.ts b/apps/backend/source/shared/utils.ts index 34d4ffe3..17dc64d6 100644 --- a/apps/backend/source/shared/utils.ts +++ b/apps/backend/source/shared/utils.ts @@ -51,7 +51,7 @@ export function verifyPassword(password: string) { return error; } } else { - return 'Config file does not exist'; + return 'Config file does not exist to verify the password'; } } @@ -68,7 +68,7 @@ export function isValidPassword() { return error; } } else { - return 'Config file does not exist'; + return 'Config file does not exist to validate the password'; } } diff --git a/apps/frontend/package.json b/apps/frontend/package.json index d0d1380e..c7ea1159 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -1,6 +1,6 @@ { "name": "cln-application-frontend", - "version": "25.07.2", + "version": "25.07.3", "description": "Core lightning application frontend", "private": true, "license": "MIT", diff --git a/apps/frontend/src/components/ui/Header/Header.tsx b/apps/frontend/src/components/ui/Header/Header.tsx index eae00189..ece5ce09 100755 --- a/apps/frontend/src/components/ui/Header/Header.tsx +++ b/apps/frontend/src/components/ui/Header/Header.tsx @@ -62,7 +62,7 @@ const Header = (props) => {
- {serverConfig.singleSignOn === true ? + {serverConfig.singleSignOn === true || serverConfig.singleSignOn === "true" ? :
@@ -131,7 +131,7 @@ const Header = (props) => {
- {serverConfig.singleSignOn === true ? + {serverConfig.singleSignOn === true || serverConfig.singleSignOn === "true" ? :
@@ -193,7 +193,7 @@ const Header = (props) => {
- {serverConfig.singleSignOn === true ? + {serverConfig.singleSignOn === true || serverConfig.singleSignOn === "true" ? :
diff --git a/apps/frontend/src/components/ui/Settings/Settings.tsx b/apps/frontend/src/components/ui/Settings/Settings.tsx index 90d040d0..9256eff8 100755 --- a/apps/frontend/src/components/ui/Settings/Settings.tsx +++ b/apps/frontend/src/components/ui/Settings/Settings.tsx @@ -33,7 +33,7 @@ const Settings = (props) => { dispatch(setShowModals({...showModals, nodeInfoModal: true}))}>Show node ID dispatch(setShowModals({ ...showModals, connectWalletModal: true }))}>Connect wallet dispatch(setShowModals({ ...showModals, sqlTerminalModal: true }))}>SQL Terminal - { serverConfig.singleSignOn === true ? + { serverConfig.singleSignOn === true || serverConfig.singleSignOn === "true" ? <> : dispatch(setShowModals({ ...showModals, setPasswordModal: true }))}>Reset Password diff --git a/apps/frontend/src/types/root.type.ts b/apps/frontend/src/types/root.type.ts index 9151992d..fa019354 100755 --- a/apps/frontend/src/types/root.type.ts +++ b/apps/frontend/src/types/root.type.ts @@ -108,7 +108,7 @@ export type ApplicationConfiguration = { appPort?: string; appProtocol?: string; appVersion?: string; - singleSignOn?: boolean; + singleSignOn?: boolean | string; } error?: any; }; diff --git a/apps/frontend/src/utilities/test-utilities/mockData.tsx b/apps/frontend/src/utilities/test-utilities/mockData.tsx index 8f9f4285..5d10e79b 100644 --- a/apps/frontend/src/utilities/test-utilities/mockData.tsx +++ b/apps/frontend/src/utilities/test-utilities/mockData.tsx @@ -868,7 +868,7 @@ export const mockFeeRate = { export const mockCLNStoreData = { listInvoices: mockListInvoices, - listPayments: mockListInvoices, + listPayments: mockListPayments, listOffers: mockListOffers, listLightningTransactions: mockListLightningTransactions, listBitcoinTransactions: mockListBitcoinTransactions, diff --git a/package-lock.json b/package-lock.json index 572ce50f..e21695ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cln-application", - "version": "25.07.2", + "version": "25.07.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cln-application", - "version": "25.07.2", + "version": "25.07.3", "license": "MIT", "workspaces": [ "apps/*" @@ -14,7 +14,7 @@ }, "apps/backend": { "name": "cln-application-backend", - "version": "25.07.2", + "version": "25.07.3", "license": "MIT", "dependencies": { "axios": "1.7.7", @@ -53,7 +53,7 @@ }, "apps/frontend": { "name": "cln-application-frontend", - "version": "25.07.2", + "version": "25.07.3", "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "6.4.2", diff --git a/package.json b/package.json index 5f370125..b70f863c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cln-application", - "version": "25.07.2", + "version": "25.07.3", "description": "Core lightning application", "private": true, "license": "MIT",