dxomg / vpsbot Goto Github PK
View Code? Open in Web Editor NEWAllows you to create & admin LinuxContainers (LXC) Using Discord
Home Page: https://discord.gg/Dfn5SDRN4W
License: MIT License
Allows you to create & admin LinuxContainers (LXC) Using Discord
Home Page: https://discord.gg/Dfn5SDRN4W
License: MIT License
There is pretty good library to handle config file. it is better to use them for environment as you don't have to modify the code and when you push updates upstream, people can upgrade their bot without needing to redo their config file every time
https://docs.python.org/3/library/configparser.html seems like a good config parser (hense the name haha)
Line 14 in 5bdbc14
This line should be as config, not hardcoded ^^
Hardcodding command in python and in any other language is really bad practice.. because you should not expect that the user use the system exactly as you do and because bad actor can use it at their advantage to bypass some security. do some ctf and you will find a lot of these exemple...
The best way is to find a lib that handle that for you (you could do syscall too but honestly, that's quite a leap in difficulty)
for instace you can use that https://github.com/lxc/python3-lxc You can check the code... there is some python interface to use and in the background it uses lxclib which handle lxc directly
same should exist for docker tho
Line 341 in 5bdbc14
You should not remove that file!! this is really not the way as this file is really used by a lot of application.
Imo you should let the user handle the problem with known host by themself... they just have to do ssh-keygen -R <ip>
and it's done....
but if you really want to, i'm pretty sure ssh have an option to bypass known_host check. should be something like StrictHostKeyChecking . so you do ssh -o StrictHostKeyChecking=no
I see you use some documentation, which is really good. but if you want to be even gooder, you can follow the PEP 257.
This is just minor improvement
Line 1205 in 5bdbc14
The token could also be in config for ease of use
Python projects should have a requirements.txt for all the dependencies and to manage easier your venv.
Line 44 in 5bdbc14
path like that sould be local and not global...
this could also be in config file. se by default to local then different installation would put their config file wherever they want
so by default I think you should do
filelocation=./myfiles/
and use it on every path possible
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.