Skip to content
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

Refactor to use .env for node and wallet-rpc config #11

Open
wants to merge 9 commits into
base: main
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
32 changes: 32 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Details of Monero node
VITE_NODE_HOST="1.2.3.4"
VITE_NODE_PROTOCOL="https"
VITE_NODE_PORT="38084"
VITE_NODE_NETWORK="STAGENET"

# Login details for monerod, if required
VITE_NODE_USERNAME="username"
VITE_NODE_PASSWORD="mysecretpassword"

# Details for the in memory wallet
VITE_WALLET_SEED="25 mnemonic seed words"
VITE_WALLET_RESTORE="wallet restore height"

# Details for the RPC wallet (reverse proxy host and port)
VITE_WALLET_RPC_HOST="<host where monero-wallet-rpc is running>"
VITE_WALLET_RPC_PORT="<port where monero-wallet-rpc is running>"

# Login details for monero-wallet-rpc, if required
VITE_WALLET_RPC_USERNAME="<username for monero-wallet-rpc>"
VITE_WALLET_RPC_PASSWORD="<password for monero-wallet-rpc>"

# Details for the RPC wallet (wallet name, seed and address)
VITE_WALLET_RPC_NAME="<name of the wallet>"
VITE_WALLET_RPC_SEED="<seed of the wallet>"
VITE_WALLET_RPC_ADDR="<address of the wallet>"

# Details for the CURL test
CURL_ORIGIN="<request origin>"
CURL_HOST="<host where monerod is running>"
CURL_PORT="<port where monerod is running>"
CURL_PROTOCOL="<protocol for the request>"
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
node_modules
yarn.lock
bun.lockb
package-lock.json
pnpm-lock.yaml
package-lock.json
dist
public/monero*
public/monero*
public/monero_w*
.env*
!.env.example
48 changes: 48 additions & 0 deletions apache-monero-dynamic.conf.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<VirtualHost host.domain.tld:443>

ServerName host.domain.tld
ServerAdmin webmaster@domain.tld

# Include the Let's Encrypt challenge configuration
# Include /etc/httpd/acme-challenge.conf

SSLEngine on

SSLCertificateFile "/etc/httpd/certs/host.domain.tld.crt"
SSLCertificateKeyFile "/etc/httpd/certs/host.domain.tld.key"
SSLCACertificateFile "/etc/httpd/certs/ca.crt"

<Location "/rpc">
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods "POST, PUT, GET, OPTIONS"
Header add Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"

</Location>

SSLProxyEngine On
ProxyPreserveHost On
ProxyRequests Off

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/rpc/(\d+)
RewriteRule ^/rpc/(\d+)(.*) https://host.domain.tld:%1$2 [P]
ProxyPassReverse /rpc/ https://host.domain.tld/

ErrorLog "/var/log/httpd/error_log"
TransferLog "/var/log/httpd/access_log"

CustomLog "/var/log/httpd/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

<VirtualHost host.domain.tld:80>

ServerName host.domain.tld
ServerAdmin webmaster@domain.tld

# Include /etc/httpd/acme-challenge.conf

Redirect / https://host.domain.tld/

</VirtualHost>
46 changes: 46 additions & 0 deletions apache-monero-static.conf.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<VirtualHost host.domain.tld:443>

ServerName host.domain.tld
ServerAdmin webmaster@domain.tld

# Include the Let's Encrypt challenge configuration
# Include /etc/httpd/acme-challenge.conf

SSLEngine on

SSLCertificateFile "/etc/httpd/certs/host.domain.tld.crt"
SSLCertificateKeyFile "/etc/httpd/certs/host.domain.tld.key"
SSLCACertificateFile "/etc/httpd/certs/ca.crt"

<Location "/rpc">
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Methods "POST, PUT, GET, OPTIONS"
Header add Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With"

</Location>

SSLProxyEngine On
ProxyPreserveHost On
ProxyRequests Off

ProxyPass /rpc/38085 https://host.domain.tld:38085
ProxyPassReverse /rpc/38085 https://host.domain.tld:38085

ErrorLog "/var/log/httpd/error_log"
TransferLog "/var/log/httpd/access_log"

CustomLog "/var/log/httpd/ssl_request_log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>

<VirtualHost host.domain.tld:80>

ServerName host.domain.tld
ServerAdmin webmaster@domain.tld

# Include /etc/httpd/acme-challenge.conf

Redirect / https://host.domain.tld/

</VirtualHost>
15 changes: 10 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height"
/>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<!-- No-cache headers -->
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
</head>

<body>
<div id="output"></div>
<div id="wallet_address"></div>
<div id="wallet_seed_phrase"></div>
<div id="wallet_spend_key"></div>
<div id="wallet_view_key"></div>
<script type="module" src="src/index.ts"></script>
</body>
</html>

</html>
Loading