Skip to content

Commit dc07e38

Browse files
Adding application version
1 parent da15112 commit dc07e38

19 files changed

+49
-28
lines changed

apps/backend/dist/controllers/shared.js

+5
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ class SharedController {
3131
try {
3232
logger.info('Getting Connection Settings');
3333
let macaroon = '';
34+
let packageData = '{ version: "0.0.2" }';
3435
if (fs.existsSync(APP_CONSTANTS.MACAROON_PATH)) {
3536
logger.info('Getting REST Access Macaroon from ' + process.env.APP_CORE_LIGHTNING_REST_CERT_DIR);
3637
macaroon = Buffer.from(fs.readFileSync(APP_CONSTANTS.MACAROON_PATH)).toString('hex');
3738
}
39+
if (fs.existsSync('package.json')) {
40+
packageData = Buffer.from(fs.readFileSync('package.json')).toString();
41+
}
3842
const CONNECT_WALLET_SETTINGS = {
3943
LOCAL_HOST: process.env.LOCAL_HOST || '',
4044
DEVICE_DOMAIN_NAME: process.env.DEVICE_DOMAIN_NAME || '',
@@ -46,6 +50,7 @@ class SharedController {
4650
CLN_NODE_IP: process.env.APP_CORE_LIGHTNING_DAEMON_IP || '',
4751
NODE_PUBKEY: process.env.LIGHTNING_PUBKEY || '',
4852
COMMANDO_RUNE: process.env.COMMANDO_RUNE,
53+
APP_VERSION: JSON.parse(packageData).version || '',
4954
};
5055
res.status(200).json(CONNECT_WALLET_SETTINGS);
5156
}

apps/backend/source/controllers/shared.ts

+6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@ class SharedController {
3838
try {
3939
logger.info('Getting Connection Settings');
4040
let macaroon = '';
41+
let packageData = '{ version: "0.0.2" }';
42+
4143
if (fs.existsSync(APP_CONSTANTS.MACAROON_PATH)) {
4244
logger.info(
4345
'Getting REST Access Macaroon from ' + process.env.APP_CORE_LIGHTNING_REST_CERT_DIR,
4446
);
4547
macaroon = Buffer.from(fs.readFileSync(APP_CONSTANTS.MACAROON_PATH)).toString('hex');
4648
}
49+
if (fs.existsSync('package.json')) {
50+
packageData = Buffer.from(fs.readFileSync('package.json')).toString();
51+
}
4752
const CONNECT_WALLET_SETTINGS = {
4853
LOCAL_HOST: process.env.LOCAL_HOST || '',
4954
DEVICE_DOMAIN_NAME: process.env.DEVICE_DOMAIN_NAME || '',
@@ -55,6 +60,7 @@ class SharedController {
5560
CLN_NODE_IP: process.env.APP_CORE_LIGHTNING_DAEMON_IP || '',
5661
NODE_PUBKEY: process.env.LIGHTNING_PUBKEY || '',
5762
COMMANDO_RUNE: process.env.COMMANDO_RUNE,
63+
APP_VERSION: JSON.parse(packageData).version || '',
5864
};
5965
res.status(200).json(CONNECT_WALLET_SETTINGS);
6066
} catch (error: any) {
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"files": {
3-
"main.css": "/static/css/main.fa3c1194.css",
4-
"main.js": "/static/js/main.60ee4b12.js",
3+
"main.css": "/static/css/main.76dfbe10.css",
4+
"main.js": "/static/js/main.5cb1d6e3.js",
55
"static/media/Inter-Bold.ttf": "/static/media/Inter-Bold.88fa7ae373b07b41ecce.ttf",
66
"static/media/Inter-SemiBold.ttf": "/static/media/Inter-SemiBold.4d56bb21f2399db8ad48.ttf",
77
"static/media/Inter-Medium.ttf": "/static/media/Inter-Medium.6dcbc9bed1ec438907ee.ttf",
88
"static/media/Inter-Thin.ttf": "/static/media/Inter-Thin.f341ca512063c66296d1.ttf",
99
"index.html": "/index.html",
1010
"static/media/radio-button.svg": "/static/media/radio-button.69aa1495d8439f869898.svg",
11-
"main.fa3c1194.css.map": "/static/css/main.fa3c1194.css.map",
12-
"main.60ee4b12.js.map": "/static/js/main.60ee4b12.js.map"
11+
"main.76dfbe10.css.map": "/static/css/main.76dfbe10.css.map",
12+
"main.5cb1d6e3.js.map": "/static/js/main.5cb1d6e3.js.map"
1313
},
1414
"entrypoints": [
15-
"static/css/main.fa3c1194.css",
16-
"static/js/main.60ee4b12.js"
15+
"static/css/main.76dfbe10.css",
16+
"static/js/main.5cb1d6e3.js"
1717
]
1818
}

apps/frontend/build/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./images/cln-favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="color-scheme" content="light dark"><meta name="description" content="Core lightning application"/><link rel="apple-touch-icon" href="./images/cln-logo-dark.png"/><title>Core Lightning</title><script defer="defer" src="/static/js/main.60ee4b12.js"></script><link href="/static/css/main.fa3c1194.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./images/cln-favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="color-scheme" content="light dark"><meta name="description" content="Core lightning application"/><link rel="apple-touch-icon" href="./images/cln-logo-dark.png"/><title>Core Lightning</title><script defer="defer" src="/static/js/main.5cb1d6e3.js"></script><link href="/static/css/main.76dfbe10.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

apps/frontend/build/static/css/main.76dfbe10.css

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/frontend/build/static/css/main.76dfbe10.css.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/frontend/build/static/css/main.fa3c1194.css

-6
This file was deleted.

apps/frontend/build/static/css/main.fa3c1194.css.map

-1
This file was deleted.

apps/frontend/build/static/js/main.5cb1d6e3.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/frontend/build/static/js/main.5cb1d6e3.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/frontend/build/static/js/main.60ee4b12.js

-3
This file was deleted.

apps/frontend/build/static/js/main.60ee4b12.js.map

-1
This file was deleted.

apps/frontend/src/components/ui/Settings/Settings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const Settings = (props) => {
2323
<SettingsSVG className={((!!appCtx.nodeInfo.error || appCtx.nodeInfo.isLoading) ? 'mt-1 svg-fill-disabled' : 'mt-1')} />
2424
</Dropdown.Toggle>
2525
<Dropdown.Menu className='fs-7 inner-box-shadow'>
26+
<Dropdown.Item>Version: {appCtx.walletConnect.APP_VERSION}</Dropdown.Item>
2627
<Dropdown.Item data-bs-toggle='modal' data-bs-target='#staticBackdrop' onClick={() => appCtx.setShowModals({...appCtx.showModals, nodeInfoModal: true})}>Show node ID</Dropdown.Item>
2728
<Dropdown.Item data-bs-toggle='modal' data-bs-target='#staticBackdrop' onClick={() => appCtx.setShowModals({...appCtx.showModals, connectWalletModal: true})}>Connect wallet</Dropdown.Item>
2829
<Dropdown.Divider />

apps/frontend/src/styles/constants.scss

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ $enable-shadows: true;
1010
$enable-gradients: true;
1111
$enable-responsive-font-sizes: true;
1212

13-
// $font-family-base: -apple-system, BlinkMacSystemFont, 'DM Sans', 'Helvetica Neue', 'Segoe UI', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
14-
$font-family-base: 'Inter';
13+
$font-family-base: -apple-system, BlinkMacSystemFont, 'Inter', 'DM Sans', 'Helvetica Neue', 'Segoe UI', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
1514

1615
$font-size-base: 14px;
1716
$font-weight-base: 500;
@@ -71,4 +70,4 @@ $form-range-thumb-border:0.5px solid $gray-300;
7170
$form-range-thumb-focus-box-shadow: 0 0 0 1px $body-bg, $primary;
7271
$form-range-thumb-active-bg: tint-color($primary, 70%);
7372

74-
$toast-max-width: 24rem;
73+
$toast-max-width: 24rem;

apps/frontend/src/styles/mode-dark.scss

+7-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116

117117
.btn-group {
118118
&.btn-group-action .btn, &.btn-group-action button.btn-actions {
119+
color: $text-dark;
119120
&:hover {
120121
& + button.btn-actions {
121122
border-color: $card-bg-dark;
@@ -126,7 +127,12 @@
126127
}
127128
}
128129

129-
130+
.form-check.form-check-inline {
131+
& .form-check-input[type="radio"] {
132+
background-color: $form-ctrl-bg-dark;
133+
}
134+
}
135+
130136
.dropdown {
131137
& a.dropdown-item {
132138
color: $white;

apps/frontend/src/types/app-config.type.ts

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type WalletConnect = {
1414
WS_PORT?: string;
1515
NODE_PUBKEY?: string;
1616
COMMANDO_RUNE?: string;
17+
APP_VERSION?: string;
1718
error?: any;
1819
}
1920

apps/frontend/src/utilities/data-formatters.ts

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const formatCurrencyType = (num: number, shorten: boolean, returnFormat:
3636
};
3737

3838
export const formatCurrency = (num: number, fromUnit: Units, toUnit: Units = Units.SATS, shorten: boolean = false, numDecimalPlaces: number = 5, returnFormat: string = 'string') => {
39+
if (typeof num === 'undefined') { num = 0; }
3940
switch (fromUnit) {
4041
case Units.MSATS:
4142
return toUnit === Units.BTC ? ConvertMSatsToBTC(num, numDecimalPlaces) : toUnit === Units.SATS ? ConvertMSatsToSats(num, numDecimalPlaces, returnFormat) : formatCurrencyType(num, shorten, returnFormat);

docker-compose.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ services:
55
image: lncm/bitcoind:v24.0@sha256:db19fe46f30acd3854f4f0d239278137d828ce3728f925c8d92faaab1ba8556a
66
command:
77
- -${APP_CORE_LIGHTNING_BITCOIN_NETWORK}
8+
- -fallbackfee=0.0002
89
- -rpcbind=0.0.0.0
910
- -rpcallowip=0.0.0.0/0
1011
- -rpcauth=user:d58ddb294b3a3812ff5fee50d6f24b29$19212992730deeaf6e596d471260a966b011a00446d45b193c94e79c4f4a1266
@@ -30,17 +31,17 @@ services:
3031
restart: on-failure
3132
volumes:
3233
- ${PWD}/data/lightningd:/root/.lightning
33-
expose:
34-
- ${APP_CORE_LIGHTNING_WEBSOCKET_PORT}:${APP_CORE_LIGHTNING_WEBSOCKET_PORT}
34+
ports:
35+
- ${APP_CORE_LIGHTNING_WEBSOCKET_PORT}:${APP_CORE_LIGHTNING_WEBSOCKET_PORT}
3536
networks:
3637
networkcln:
3738
ipv4_address: ${APP_CORE_LIGHTNING_DAEMON_IP}
3839

3940
application:
40-
# build:
41-
# dockerfile: ./Dockerfile
42-
# context: ./
43-
image: ghcr.io/elementsproject/cln-application:0.0.1@sha256:c43642d578bb22754e1e6eb054be86d0a6af51f30752cd51e942996870d4c8f5
41+
build:
42+
dockerfile: ./Dockerfile
43+
context: ./
44+
# image: ghcr.io/elementsproject/cln-application:0.0.2@sha256:6188255f56a679b9e5785036ab50ad1d2c869568c2f29d07f0c482917c7442e9
4445
depends_on:
4546
- bitcoind
4647
- lightningd
@@ -58,6 +59,7 @@ services:
5859
COMMANDO_CONFIG: ${COMMANDO_CONFIG}
5960
APP_CONFIG_DIR: ${APP_CONFIG_DIR}
6061
APP_MODE: "production"
62+
DEVICE_DOMAIN_NAME: ${DEVICE_DOMAIN_NAME}
6163
LOCAL_HOST: http://${DEVICE_DOMAIN_NAME}
6264
CA_CERT: /root/.lightning/bitcoin/ca.pem
6365
CLIENT_KEY: /root/.lightning/bitcoin/client-key.pem

0 commit comments

Comments
 (0)