GithubHelp home page GithubHelp logo

nodeactyl / nodeactyl Goto Github PK

View Code? Open in Web Editor NEW
174.0 9.0 26.0 22.99 MB

A NodeJS API for Pterodactyl panel, this was originally designed for discord.js (Discord bots)

License: MIT License

JavaScript 100.00%
nodejs pterodactyl-panel pterodactyl pterodactyl-api wrapper rest-api node axios

nodeactyl's Introduction

GitHub Issues Current Version Support Server


📌 What am I?

Nodeactyl is a Library for Node.js to communicate with the Pterodactyl Panel. You can control any server on your nodes with it (If you purchase a server from another host, no worry! The API works with your own server too!). This library's originally was to be used in Discord bots, however it can be used in any Node.js project.


❓ How do I work?

This library works by querying the Pterodactyl API (REST requests) using a library called axios.


💻 Getting started with installation

npm i nodeactyl

📖 Documentation

The full docs can be found here


✨ Contributors

Here are the people that make nodeactyl possible and keep the code working!

Would you like to see your GitHub profile picture here?

Simply open a pull request and improve or create code that makes Nodeactyl better!


🚨 Disclaimer

We (The Nodeactyl team & contributors) are not responsible for any damages that you cause to your servers/nodes by using this API.

Remember: This API can potentially be dangerous - it is extremely easy to delete servers/nodes at an instant!

It is NOT our fault if your API key is revealed to the public. When asking for help PLEASE DO NOT SEND THE FULL STACK ERROR. This will reveal your ENTIRE Host/Application API key in the request, if someone asks you to show them the error it should only be trusted sources! (such as the Pterodactyl Team/Nodeactyl Team). You should also have your API key changed every 1-3 days to prevent issues like this.


🧾 License

This project is licensed under the terms of the MIT License.

You can check out the full license here

nodeactyl's People

Contributors

alhassanv avatar androz2091 avatar arantesxyz avatar arnaudlier avatar burchard36 avatar cainthebest avatar dejaydev avatar dependabot[bot] avatar djohts avatar emmanuel-novus-zz avatar ikbenignace avatar jelly-exe avatar jeweetzelfwastaken avatar rubenuijtdewilligen avatar saiteja-madha avatar thewillft avatar tygrxqt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodeactyl's Issues

Regex Test Emails

Currently any wrong email would return in a 422 error which might be confusing.

Unknow error while trying to create server

Hey, I having an error while create server,

I made

const node = require('nodeactyl');
let app = node.Application;

app.login(url, key, (logged_in, err) => {
    console.log(logged_in);
    app.createServer("latest", "test", 26, 7, 17, "quay.io/parkervcp/pterodactyl-images:debian_nodejs-12", "npm install", 512, 0, 200, 500, 100, 0, 1).then(res => {
        console.log(res)
    }).catch(error =>{
        console.log(error);
    })
});

But in console I recieved

node main.js
NODEACTYL WARNING: There has been a COMPLETE rewrite of Nodeactyl, Please review our new documentation at: https://nodeactyl.ell
iotfrost.xyz/v/v2.0.0-english/ Alternativly if you need further assistance ask for help in our discord server: https://discordap
p.com/invite/3e5uJPt
true
undefined

it's normal to return undefined ?

Status not updating

When I send a power action to a server, and I try to fetch the resource usage and status, it's not updating.

For example: I send the kill action to a server. On the panel, I can see it's killed, but in my NodeJS application it's not updating. It's already in a setTimeout to give the server time to stop.

Who can help me with this?

Proof It's Me

Hey Jelly,
It's me alhassan#5471 827614989892059247

callback is not a function

Hey guys,
Callback is not a function on nodeactyl/client/index.js:48:4. might wanna ehmm? idk help me?

422 error

I keep getting a 422 (Unprocessable Entity) error whenever attempting to create a server. Here's my code:

router.get("/newserver", checkAuth, async function(req, res) {
    let pteroData = await client.getUserByEmail(req.user.email)
    let server = new Nodeactyl.ServerBuilder()
    server.setServerName(req.query.name)
    server.setServerOwner(pteroData.attributes.id)
    server.setServerEgg(parseInt(req.query.egg))
    server.setServerLimitsJson(JSON.stringify({
        "ram": parseInt(req.query.ram),
        "disk": parseInt(req.query.disk),
        "cpu": parseInt(req.query.cpu),
        "swap": 0
    }))
    let JSONobject = await server.getServerObject()
    console.log(JSONobject)
    client.createRawServer(JSONobject)
    res.redirect("/shop")
})

Package not seeming to install right

It seems that the nodeactyl cant be installed normally. it can only be installed by typing npm init into your main user folder (C:\Users\User) after proceeding to generate a package.json file in that directory it seems to fix the issue, anyone know why this is?

Unsuspending servers not working

Code:
Application.login('HOST', 'API_KEY', (logged_in, err) => { Application.unSuspendServer("2").then(server => { console.log(server) }).catch(err => { console.log(err); }) });

logged_in return true
server returns Server unsuspended successfully
After that server still suspended

Im sure server internalid is valid

Update:
Seems like the panel was rate limiting me somehow, my request didnt go through, works fine now though.

Unhandled error code 422 when using "createServer" [Nodeactyl V2]

When creating 2nd server on the same user, and you use the same ID/Name (Not sure yet) that already exists for creating a server the error code comes up "422" and leads to a runtime error/crash. This is not top priority but this issue is here for my personal checklist.

README typo

The word "axios" is misspelled in the README file.

TypeError: Cannot read property 'status' of undefined

(node:6160) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'status' of undefined
    at throwErrors (D:\DiscordBots\Modulohost\node_modules\nodeactyl\Nodeactyl.js:20:31)
    at axios.then.catch.error (D:\DiscordBots\Modulohost\node_modules\nodeactyl\Nodeactyl.js:526:9)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:6160) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6160) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This is the error I get when I attempt to use <Client>.createUser etc

Create server function not doing anything

I login, and do everything right. But when I call it, nothing happens, and I entered in all of the info correctly. The createUser works too, so it is just the createServer function.

Issue

application
  .createUser("email", "aydn", "Halil", "Aydın")
  .then((res) => {
    console.log(res);
  })
  .catch((rej) => {
    console.log(rej);
  });

it doesnt create new user and returns already existing users it happens also when i want to create new server

createServer returns undefined

I can't create a server,
It returns undefined
and all parameters are good
application.Application.createServer("latest", NodeJs, uss /* User Id */ , 5, 16,"dockerImage", "Cmd", 200,0, 1000, 500, 0, 5, 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.