Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
storyblok-solr-indexer
Advanced tools
Indexer to index Storyblok stories in Solr.
Install package
npm install storyblok-solr-indexer
indexer.js
mport 'dotenv/config';
import StoryblokSolrIndexer from './StoryblokSolrIndexer.mjs';
// Destructure required environment variables for better readability and performance.
const {
STORYBLOK_ACCESS_TOKEN,
SOLR_HOST,
SOLR_PORT,
SOLR_PATH,
SOLR_USER,
SOLR_PASS,
SOLR_CORE,
TEST_DATA
} = process.env;
if (!STORYBLOK_ACCESS_TOKEN || !SOLR_HOST || !SOLR_PORT || !SOLR_PATH || !SOLR_USER || !SOLR_PASS || !SOLR_CORE || !TEST_DATA) {
throw new Error('One or more environment variables are missing or invalid');
}
// Configure storyblock options with access token and query parameters.
const storyblockOptions = {
accessToken: STORYBLOK_ACCESS_TOKEN,
options: {
starts_with: '',
'filter_query[component][in]': 'Page',
per_page: 100,
page: 1,
version: 'published'
}
};
// Configure Solr connection options using environment variables.
const solrOptions = {
host: SOLR_HOST,
port: SOLR_PORT,
path: SOLR_PATH,
user: SOLR_USER,
pass: SOLR_PASS,
core: SOLR_CORE,
};
// Parse the test data provided via environment variable.
const data = JSON.parse(TEST_DATA);
// Create an instance of StoryblokSolrIndexer and pass the configured options.
const indexer = new StoryblokSolrIndexer(storyblockOptions, solrOptions);
indexer.indexStoriesBasedOnAction(data)
The data
object passed through the indexer can contain a property action
and story_id
.
{
"action": "published", // 'unpublished', 'moved', 'deleted'
"story_id": 473816430
}
If no action is passed the Solr index is cleared and fully new indexed.
Run in Terminal
node indexer.js
https://www.npmjs.com/package/storyblok-solr-indexer
You can find a cloudflare worker using the indexer here:
https://github.com/dkd/cloudflare-worker-storyblok-solr-indexer
You can host your Solr core here:
FAQs
Storyblok Solr Indexer
We found that storyblok-solr-indexer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.