Skip to content

Commit

Permalink
Adding application version
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahanaFarooqui committed May 18, 2023
1 parent da15112 commit dc07e38
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 28 deletions.
5 changes: 5 additions & 0 deletions apps/backend/dist/controllers/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ class SharedController {
try {
logger.info('Getting Connection Settings');
let macaroon = '';
let packageData = '{ version: "0.0.2" }';
if (fs.existsSync(APP_CONSTANTS.MACAROON_PATH)) {
logger.info('Getting REST Access Macaroon from ' + process.env.APP_CORE_LIGHTNING_REST_CERT_DIR);
macaroon = Buffer.from(fs.readFileSync(APP_CONSTANTS.MACAROON_PATH)).toString('hex');
}
if (fs.existsSync('package.json')) {
packageData = Buffer.from(fs.readFileSync('package.json')).toString();
}
const CONNECT_WALLET_SETTINGS = {
LOCAL_HOST: process.env.LOCAL_HOST || '',
DEVICE_DOMAIN_NAME: process.env.DEVICE_DOMAIN_NAME || '',
Expand All @@ -46,6 +50,7 @@ class SharedController {
CLN_NODE_IP: process.env.APP_CORE_LIGHTNING_DAEMON_IP || '',
NODE_PUBKEY: process.env.LIGHTNING_PUBKEY || '',
COMMANDO_RUNE: process.env.COMMANDO_RUNE,
APP_VERSION: JSON.parse(packageData).version || '',
};
res.status(200).json(CONNECT_WALLET_SETTINGS);
}
Expand Down
6 changes: 6 additions & 0 deletions apps/backend/source/controllers/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ class SharedController {
try {
logger.info('Getting Connection Settings');
let macaroon = '';
let packageData = '{ version: "0.0.2" }';

if (fs.existsSync(APP_CONSTANTS.MACAROON_PATH)) {
logger.info(
'Getting REST Access Macaroon from ' + process.env.APP_CORE_LIGHTNING_REST_CERT_DIR,
);
macaroon = Buffer.from(fs.readFileSync(APP_CONSTANTS.MACAROON_PATH)).toString('hex');
}
if (fs.existsSync('package.json')) {
packageData = Buffer.from(fs.readFileSync('package.json')).toString();
}
const CONNECT_WALLET_SETTINGS = {
LOCAL_HOST: process.env.LOCAL_HOST || '',
DEVICE_DOMAIN_NAME: process.env.DEVICE_DOMAIN_NAME || '',
Expand All @@ -55,6 +60,7 @@ class SharedController {
CLN_NODE_IP: process.env.APP_CORE_LIGHTNING_DAEMON_IP || '',
NODE_PUBKEY: process.env.LIGHTNING_PUBKEY || '',
COMMANDO_RUNE: process.env.COMMANDO_RUNE,
APP_VERSION: JSON.parse(packageData).version || '',
};
res.status(200).json(CONNECT_WALLET_SETTINGS);
} catch (error: any) {
Expand Down
12 changes: 6 additions & 6 deletions apps/frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"files": {
"main.css": "/static/css/main.fa3c1194.css",
"main.js": "/static/js/main.60ee4b12.js",
"main.css": "/static/css/main.76dfbe10.css",
"main.js": "/static/js/main.5cb1d6e3.js",
"static/media/Inter-Bold.ttf": "/static/media/Inter-Bold.88fa7ae373b07b41ecce.ttf",
"static/media/Inter-SemiBold.ttf": "/static/media/Inter-SemiBold.4d56bb21f2399db8ad48.ttf",
"static/media/Inter-Medium.ttf": "/static/media/Inter-Medium.6dcbc9bed1ec438907ee.ttf",
"static/media/Inter-Thin.ttf": "/static/media/Inter-Thin.f341ca512063c66296d1.ttf",
"index.html": "/index.html",
"static/media/radio-button.svg": "/static/media/radio-button.69aa1495d8439f869898.svg",
"main.fa3c1194.css.map": "/static/css/main.fa3c1194.css.map",
"main.60ee4b12.js.map": "/static/js/main.60ee4b12.js.map"
"main.76dfbe10.css.map": "/static/css/main.76dfbe10.css.map",
"main.5cb1d6e3.js.map": "/static/js/main.5cb1d6e3.js.map"
},
"entrypoints": [
"static/css/main.fa3c1194.css",
"static/js/main.60ee4b12.js"
"static/css/main.76dfbe10.css",
"static/js/main.5cb1d6e3.js"
]
}
2 changes: 1 addition & 1 deletion apps/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -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>
<!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>
6 changes: 6 additions & 0 deletions apps/frontend/build/static/css/main.76dfbe10.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/frontend/build/static/css/main.76dfbe10.css.map

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions apps/frontend/build/static/css/main.fa3c1194.css

This file was deleted.

1 change: 0 additions & 1 deletion apps/frontend/build/static/css/main.fa3c1194.css.map

This file was deleted.

3 changes: 3 additions & 0 deletions apps/frontend/build/static/js/main.5cb1d6e3.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/frontend/build/static/js/main.5cb1d6e3.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions apps/frontend/build/static/js/main.60ee4b12.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/frontend/build/static/js/main.60ee4b12.js.map

This file was deleted.

1 change: 1 addition & 0 deletions apps/frontend/src/components/ui/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Settings = (props) => {
<SettingsSVG className={((!!appCtx.nodeInfo.error || appCtx.nodeInfo.isLoading) ? 'mt-1 svg-fill-disabled' : 'mt-1')} />
</Dropdown.Toggle>
<Dropdown.Menu className='fs-7 inner-box-shadow'>
<Dropdown.Item>Version: {appCtx.walletConnect.APP_VERSION}</Dropdown.Item>
<Dropdown.Item data-bs-toggle='modal' data-bs-target='#staticBackdrop' onClick={() => appCtx.setShowModals({...appCtx.showModals, nodeInfoModal: true})}>Show node ID</Dropdown.Item>
<Dropdown.Item data-bs-toggle='modal' data-bs-target='#staticBackdrop' onClick={() => appCtx.setShowModals({...appCtx.showModals, connectWalletModal: true})}>Connect wallet</Dropdown.Item>
<Dropdown.Divider />
Expand Down
5 changes: 2 additions & 3 deletions apps/frontend/src/styles/constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ $enable-shadows: true;
$enable-gradients: true;
$enable-responsive-font-sizes: true;

// $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';
$font-family-base: 'Inter';
$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';

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

$toast-max-width: 24rem;
$toast-max-width: 24rem;
8 changes: 7 additions & 1 deletion apps/frontend/src/styles/mode-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@

.btn-group {
&.btn-group-action .btn, &.btn-group-action button.btn-actions {
color: $text-dark;
&:hover {
& + button.btn-actions {
border-color: $card-bg-dark;
Expand All @@ -126,7 +127,12 @@
}
}


.form-check.form-check-inline {
& .form-check-input[type="radio"] {
background-color: $form-ctrl-bg-dark;
}
}

.dropdown {
& a.dropdown-item {
color: $white;
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/types/app-config.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type WalletConnect = {
WS_PORT?: string;
NODE_PUBKEY?: string;
COMMANDO_RUNE?: string;
APP_VERSION?: string;
error?: any;
}

Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/utilities/data-formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const formatCurrencyType = (num: number, shorten: boolean, returnFormat:
};

export const formatCurrency = (num: number, fromUnit: Units, toUnit: Units = Units.SATS, shorten: boolean = false, numDecimalPlaces: number = 5, returnFormat: string = 'string') => {
if (typeof num === 'undefined') { num = 0; }
switch (fromUnit) {
case Units.MSATS:
return toUnit === Units.BTC ? ConvertMSatsToBTC(num, numDecimalPlaces) : toUnit === Units.SATS ? ConvertMSatsToSats(num, numDecimalPlaces, returnFormat) : formatCurrencyType(num, shorten, returnFormat);
Expand Down
14 changes: 8 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
image: lncm/bitcoind:v24.0@sha256:db19fe46f30acd3854f4f0d239278137d828ce3728f925c8d92faaab1ba8556a
command:
- -${APP_CORE_LIGHTNING_BITCOIN_NETWORK}
- -fallbackfee=0.0002
- -rpcbind=0.0.0.0
- -rpcallowip=0.0.0.0/0
- -rpcauth=user:d58ddb294b3a3812ff5fee50d6f24b29$19212992730deeaf6e596d471260a966b011a00446d45b193c94e79c4f4a1266
Expand All @@ -30,17 +31,17 @@ services:
restart: on-failure
volumes:
- ${PWD}/data/lightningd:/root/.lightning
expose:
- ${APP_CORE_LIGHTNING_WEBSOCKET_PORT}:${APP_CORE_LIGHTNING_WEBSOCKET_PORT}
ports:
- ${APP_CORE_LIGHTNING_WEBSOCKET_PORT}:${APP_CORE_LIGHTNING_WEBSOCKET_PORT}
networks:
networkcln:
ipv4_address: ${APP_CORE_LIGHTNING_DAEMON_IP}

application:
# build:
# dockerfile: ./Dockerfile
# context: ./
image: ghcr.io/elementsproject/cln-application:0.0.1@sha256:c43642d578bb22754e1e6eb054be86d0a6af51f30752cd51e942996870d4c8f5
build:
dockerfile: ./Dockerfile
context: ./
# image: ghcr.io/elementsproject/cln-application:0.0.2@sha256:6188255f56a679b9e5785036ab50ad1d2c869568c2f29d07f0c482917c7442e9
depends_on:
- bitcoind
- lightningd
Expand All @@ -58,6 +59,7 @@ services:
COMMANDO_CONFIG: ${COMMANDO_CONFIG}
APP_CONFIG_DIR: ${APP_CONFIG_DIR}
APP_MODE: "production"
DEVICE_DOMAIN_NAME: ${DEVICE_DOMAIN_NAME}
LOCAL_HOST: http://${DEVICE_DOMAIN_NAME}
CA_CERT: /root/.lightning/bitcoin/ca.pem
CLIENT_KEY: /root/.lightning/bitcoin/client-key.pem
Expand Down

0 comments on commit dc07e38

Please sign in to comment.