Skip to content

feat: Add Dockerfile and environment variable support #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM php:8-apache

# www-data user
USER 33
WORKDIR /var/www/html
COPY LICENSE index.php README.md ./

24 changes: 12 additions & 12 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
// Configuration
$dashboard_config = [
'network' => 'CHANGE_ME', // Supported values: BTC, LTC, or XMR
'node_ip' => 'CHANGE_ME', // Usually 127.0.0.1 if ran locally
'rpc_port' => 'CHANGE_ME', // Default RPC ports: BTC: 8332 | LTC: 9332 | XMR: 18081
'rpc_user' => 'CHANGE_ME', // Note: not usually needed for XMR (leave blank if XMR)
'rpc_pass' => 'CHANGE_ME', // Note: not usually needed for XMR (leave blank if XMR)
'show_node_info' => true,
'show_blockchain' => true,
'show_mempool' => true,
'show_mining' => true,
'show_transactions' => true,
'show_fees' => true,
'network' => getenv('NETWORK') ?: 'CHANGE_ME', // Supported values: BTC, LTC, or XMR
'node_ip' => getenv('NODE_IP') ?: 'CHANGE_ME', // Usually 127.0.0.1 if ran locally
'rpc_port' => getenv('RPC_PORT') ?: 'CHANGE_ME', // Default RPC ports: BTC: 8332 | LTC: 9332 | XMR: 18081
'rpc_user' => getenv('RPC_USER') ?: 'CHANGE_ME', // Note: not usually needed for XMR (leave blank if XMR)
'rpc_pass' => getenv('RPC_PASS') ?: 'CHANGE_ME', // Note: not usually needed for XMR (leave blank if XMR)
'show_node_info' => filter_var(getenv('SHOW_NODE_INFO') ?: 'true', FILTER_VALIDATE_BOOLEAN),
'show_blockchain' => filter_var(getenv('SHOW_BLOCKCHAIN') ?: 'true', FILTER_VALIDATE_BOOLEAN),
'show_mempool' => filter_var(getenv('SHOW_MEMPOOL') ?: 'true', FILTER_VALIDATE_BOOLEAN),
'show_mining' => filter_var(getenv('SHOW_MINING') ?: 'true', FILTER_VALIDATE_BOOLEAN),
'show_transactions' => filter_var(getenv('SHOW_TRANSACTIONS') ?: 'true', FILTER_VALIDATE_BOOLEAN),
'show_fees' => filter_var(getenv('SHOW_FEES') ?: 'true', FILTER_VALIDATE_BOOLEAN),
];

$network = strtoupper($dashboard_config['network']);
Expand Down Expand Up @@ -703,4 +703,4 @@ function call_rpc_cached($method, $params, $dashboard_config, $url_schema, $ttlO
</center>
</div>
</body>
</html>
</html>