
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@arcblock/crawler-middleware
Advanced tools
This express middleware provides pre-rendered HTML generated by SnapKit for Blocklets, enabling them to return complete HTML content to web spider. This is essential for SEO and ensuring that search engines can properly index dynamically generated content
This express middleware provides pre-rendered HTML generated by SnapKit for Blocklets, enabling them to return complete HTML content to web spider. This is essential for SEO and ensuring that search engines can properly index dynamically generated content.
<meta name="arcblock-crawler" content="true">.
import { createSnapshotMiddleware } from '@arcblock/crawler-middleware';
const app = express();
const snapshotMiddleware = createSnapshotMiddleware({
endpoint: process.env.SNAP_KIT_ENDPOINT,
accessKey: process.env.SNAP_KIT_ACCESS_KEY,
allowCrawler: (req) => {
return req.path === '/';
},
});
// for all route
app.use(snapshotMiddleware);
// for one route
app.use('/doc', snapshotMiddleware, (req) => {
/* ... */
});
The options for createSnapshotMiddleware:
{
/** SnapKit endpoint */
endpoint: string;
/** SnapKit access key */
accessKey: string;
/** Max cache size for LRU cache */
cacheMax?: number;
/** When cache exceeds this time, it will try to fetch and update cache from SnapKit */
updateInterval?: number;
/** When failed cache exceeds this time, it will try to fetch and update cache from SnapKit */
failedUpdateInterval?: number;
/** Update queue concurrency */
updatedConcurrency?: number;
/** Call res.send(html) when cache hit */
autoReturnHtml?: boolean;
/** Custom function to determine whether to return cached content */
allowCrawler?: (req: Request) => boolean;
};
When using this middleware outside of a Blocklet environment, you need to configure the following environment variables:
BLOCKLET_DATA_DIR
: (Required) Directory path for storing the sqlite fileBLOCKLET_LOG_DIR
: (Required) Directory path for storing @blocklet/logger logsBLOCKLET_APP_URL
: (Optional) Deployed domainWhen createSnapshotMiddleware is called, it attempts to create an SQLite database at BLOCKLET_DATA_DIR
. This database is used to cache HTML content retrieved from SnapKit. Please ensure that the deployment environment supports SQLite.
FAQs
This express middleware provides pre-rendered HTML generated by SnapKit for Blocklets, enabling them to return complete HTML content to web spider. This is essential for SEO and ensuring that search engines can properly index dynamically generated content
The npm package @arcblock/crawler-middleware receives a total of 24 weekly downloads. As such, @arcblock/crawler-middleware popularity was classified as not popular.
We found that @arcblock/crawler-middleware demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.