
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Utility for managing a Minecraft server running on Google Cloud Compute. Automatically shuts down server after 10 minutes of inactivity.
See mcm-server for a more useful and higher level implementation.
npm install --save mcm
You also need to download Google Application credentials and set the GOOGLE_APPLICATION_CREDENTIALS
environment variable to the json filepath unless you have authenticated via another method.
import mcm from 'mcm';
let minecraftOptions = {
host: 'localhost',
port: '25565'
};
let googleComputeOptions = {
project: 'random-name-34834',
zone: 'us-central1-a',
instance: 'minecraft-instance'
};
const mcServer = mcm(minecraftOptions, googleComputeOptions);
mcServer.getStatus((err, stat) => {
if (!err) {
// server already started!
}
else {
// server not started!
mcServer.start((err) => {
if (!err) {
// server started!
// will shutdown automatically after 10 minutes of inactivity
}
})
}
});
const mcServer = mcm([minecraftOptions], [googleComputeOptions]);
minecraftOptions
Object:
host
- Minecraft server hostport
- Minecraft server portgoogleComputeOptions
Object:
project
- Google Cloud project namezone
- Google Cloud zone where instance residesinstance
- Google Cloud Compute instance nameminecraftOptions
defaults to:
{ host: process.env.MC_SERVER || 'localhost',
port: process.env.MC_PORT || 25565 }
googleComputeOptions
defaults to:
{ project: process.env.GC_PROJECT,
zone: process.env.GC_ZONE,
instance: process.env.GC_INSTANCE }
Starts the Google Compute instance.
If present, the callback will be called with any potential errors.
Stops the Google Compute intance.
If present, the callback will be called with any potential errors.
Called on 'empty'
.
Gets the status of the Minecraft server.
Callback should take two arguments, err
and status
.
status
will contain an object that looks similar to:
{ protocol_version: '51',
minecraft_version: '1.4.7',
server_name: 'Your Server MOTD',
num_players: 0,
max_players: 20 }
Start monitoring. This will ping the server every 5 minutes. After two pings in which the server is empty, it will emit 'empty'
.
Called on 'start'
.
Emitted after the server is successfully started.
Emitted after the server is successfully stopped.
Emitted when the server has no players after 10 minutes.
FAQs
Automatically start up and shut down a minecraft server.
We found that mcm demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.