-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: lavamoat #712
Open
andreabadesso
wants to merge
29
commits into
master
Choose a base branch
from
feat/lavamoat
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: lavamoat #712
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
2a86288
feat: pgs
andreabadesso 704d089
feat: working react-app-rewired
andreabadesso a16df67
chore: generating policy
andreabadesso 991441c
feat: added lockdown and config overrides adding ses
andreabadesso 61f6365
chore: lavamoat policy overrides working
andreabadesso 828ec61
chore: using path-browserify
andreabadesso 8fcceab
chore: build passing
andreabadesso c6296ba
fix: axios failing to be imported
andreabadesso fe6071a
fix: Buffer missing from bitcore-lib
andreabadesso c1ad57e
fix: global modal not showing sometimes
andreabadesso 915421e
chore: upgrade nodejs to v22
andreabadesso 205b123
chore: using fixed versions
andreabadesso a79fc09
chore: stop hardcoding debugMode and removed process
andreabadesso 786ac3b
chore: better pin modal
andreabadesso b4be97e
refactor: using path-browserify in transaction details
andreabadesso 944b6c1
refactor: using path-browserify in helpers
andreabadesso 2306201
refactor: removed walletconnect references
andreabadesso 780a778
chore: only add lavamoat in production builds
andreabadesso 7b8bc73
chore: watch-css on start script
andreabadesso 9f841f9
chore: update lavamoat policy
andreabadesso 34f7c64
docs: improved docs on lavamoat on dev
andreabadesso 9eabaa4
refactor: removed performance from lavamoat config-overrides
andreabadesso 6d3be4a
chore: added trace uncaught to dev and debug
andreabadesso b3601fe
fix: missing modalContext in App.js
andreabadesso 64ad5b9
fix: missing return on getfullExplorerUrl
andreabadesso f2163ef
chore: added log to bn.js patch so the developer knows that something…
andreabadesso d0dcb80
refactor: focus pin input on modal pin shown
andreabadesso e8c3382
refactor: onSuccess -> onModalHidden on modal pin
andreabadesso ea644ef
refactor: modal title id
andreabadesso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
const webpack = require('webpack'); | ||
const LavaMoatPlugin = require('@lavamoat/webpack') | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
module.exports = function override(config, env) { | ||
// Enable source maps for better debugging | ||
config.devtool = 'source-map'; | ||
|
||
config.optimization = { | ||
...config.optimization, | ||
minimize: false, | ||
concatenateModules: false | ||
}; | ||
|
||
// Configure module resolution | ||
config.resolve = { | ||
...config.resolve, | ||
fallback: { | ||
url: require.resolve('url'), | ||
fs: false, | ||
assert: require.resolve('assert'), | ||
crypto: require.resolve('crypto-browserify'), | ||
http: require.resolve('stream-http'), | ||
https: require.resolve('https-browserify'), | ||
os: require.resolve('os-browserify/browser'), | ||
buffer: require.resolve('buffer'), | ||
stream: require.resolve('stream-browserify'), | ||
vm: require.resolve('vm-browserify'), | ||
path: require.resolve("path-browserify"), | ||
worker_threads: false, | ||
perf_hooks: false, | ||
tls: false, | ||
net: false | ||
}, | ||
mainFields: ['browser', 'module', 'main'], | ||
conditionNames: ['import', 'require', 'node', 'default'], | ||
extensionAlias: { | ||
'.js': ['.js', '.ts', '.tsx'] | ||
}, | ||
alias: { | ||
'classic-level': false, | ||
'level': false, | ||
'pino-worker': false, | ||
'pino/file': false, | ||
'pino-pretty': false, | ||
'axios': path.resolve(__dirname, 'node_modules/axios'), | ||
// Add an alias for our buffer shim | ||
'buffer-shim': path.resolve(__dirname, 'src/buffer-shim.js') | ||
} | ||
}; | ||
|
||
// Add a rule to handle axios imports | ||
config.module.rules.push({ | ||
test: /[\\/]axios[\\/]/, | ||
resolve: { | ||
alias: { | ||
'axios': path.resolve(__dirname, 'node_modules/axios') | ||
} | ||
} | ||
}); | ||
|
||
config.module.rules.push({ | ||
test: /\.m?js/, | ||
resolve: { | ||
fullySpecified: false | ||
} | ||
}); | ||
|
||
// Use null-loader for Node.js-specific packages | ||
config.module.rules.push({ | ||
test: /[\\/](classic-level|pino)[\\/]/, | ||
use: 'null-loader' | ||
}); | ||
|
||
// Base plugins that we always want | ||
const basePlugins = [ | ||
...config.plugins.filter(p => !(p instanceof webpack.ProvidePlugin)), | ||
new webpack.ProvidePlugin({ | ||
process: 'process/browser', | ||
Buffer: ['buffer-shim', 'default'] | ||
}), | ||
]; | ||
|
||
// Only add LavaMoat in production because LavaMoat does not work with the | ||
// hot reloading feature in dev. | ||
if (env === 'production') { | ||
tuliomir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
config.plugins = [ | ||
new LavaMoatPlugin({ | ||
generatePolicy: true, | ||
HtmlWebpackPluginInterop: true, | ||
readableResourceIds: true, | ||
diagnosticsVerbosity: 1, | ||
lockdown: { | ||
consoleTaming: 'unsafe', | ||
errorTrapping: 'none', | ||
unhandledRejectionTrapping: 'none', | ||
overrideTaming: 'severe', | ||
} | ||
}), | ||
...basePlugins | ||
]; | ||
} else { | ||
config.plugins = basePlugins; | ||
} | ||
|
||
return config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
pkgs.devshell.mkShell { | ||
packages = with pkgs; [ | ||
nixpkgs-fmt | ||
nodejs_20 | ||
nodejs_22 | ||
libusb1 | ||
]; | ||
}; | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment for this rule also