使用比特币自动购买VPS实例
cloudomate的Python项目详细描述
概述
cloudomate是一个未经许可的开放计算api,它提供了从多个提供商购买vps实例和vpn服务器的自动化方法。使用cloudomate最简单的方法是通过命令行界面。
要求
- python 2或3
- 适用于Linux、Mac OSX、BSD
- 有足够资金的活跃钱包Electrum
安装
项目可以通过pip安装:
pip3 install cloudomate
提供者
vps
目前已实现以下VPS提供程序:
blueangelhost https://www.blueangelhost.com/ linevast https://linevast.de/ twosync https://ua.2sync.org/ undergroundprivate https://undergroundprivate.com/ proxhost Proxmox provider emulation
可以通过list命令访问相同的列表:
cloudomate vps list
vpn
目前已实现以下VPN提供程序:
azirevpn https://www.azirevpn.com
可以通过list命令访问相同的列表:
cloudomate vpn list
兼容性
cloudomate的稳定性取决于它的读写能力 供应商网页上的注册表格。并非所有供应商都提供 相同的表单和不同的功能(用户可能无法发送 他们在注册过程中选择的根密码)。下表 描述已在中实现的提供程序的当前状态 克劳多马特。
Provider | Type | Compatible | Control panel | ClientArea | Email parsing | Rootpassword | Settings | Notes |
---|---|---|---|---|---|---|---|---|
BlueAngelHost | vps | yes | extended | yes | from email | >12h purchase processing | ||
TwoSync | vps | yes | extended | yes | from email | TUN/TAP | TUN/TAP on by default | |
UndergroundPrivate | vps | yes | default | registration | ||||
LineVast | vps | yes | yes | extended | yes | registration | TUN/TAP | TUN/TAP enabling implemented |
AzireVPN | vpn | yes | none | registration | ||||
CCIHosting | vps | no | default | Gateway broken | ||||
CrownCloud | vps | no | default | Manual order reviews | ||||
PulseServers | vps | no | default | Gateway broken | ||||
ProxHost (TBTC) | vps | yes | none | registration | TUN/TAP | Emulated (ProxMox) |
不兼容的提供程序需要修复才能正常工作。 提供程序没有被删除,因为它们有可能 以后再修理。
控制面板是某些提供程序添加的功能,允许 cloudomate可更改vpn的tun/tap等设置。控制面板 可以进一步实现以更改更多设置。
client area客户区域包含一般信息,如 VPS的IP地址和对电子邮件的访问。
电子邮件解析使用扩展客户端区域,可以将电子邮件解析为 进入控制面板。
配置
对于一些命令,主要是购买,需要用户配置。这个 主要的方法是通过一个配置文件。对于Linux,默认 配置文件的位置是$home/.config/cloudomate.cfg。
配置文件如下:
[user] email = firstname = lastname = password = companyname = phonenumber = username = [address] address = city = state = countrycode = zipcode = [payment] walletpath = [server] ns1 = ns2 = hostname = root_password =
可以通过添加节来重写特定提供程序的节, 例如,[linevast]部分只能包含单独的电子邮件地址 用于Linevast。
基本用法
usage: cloudomate [-h] {vps,vpn} ... Cloudomate positional arguments: {vps,vpn} optional arguments: -h, --help show this help message and exit
vps
usage: cloudomate vps [-h] {list,options,purchase,status,setrootpw,getip,ssh,info} ... positional arguments: {list,options,purchase,status,setrootpw,getip,ssh,info} list List VPS providers options List VPS provider configurations purchase Purchase VPS status Get the status of the VPS services setrootpw Set the root password of the last activated service getip Get the IP address of the specified service ssh SSH into an active service info Get information of the specified VPS service optional arguments: -h, --help show this help message and exit
VPN
usage: cloudomate [-h] {vps,vpn} ... positional arguments: {list,options,purchase,status,info} list List VPN providers options List VPN provider configurations purchase Purchase VPN status Get the status of the VPN services info Get information of the specified VPN service optional arguments: -h, --help show this help message and exit
选项
列出Linevast的选项
$ cloudomate vps options linevast
Options for linevast: # Name CPU (cores) RAM (GB) Storage (GB) Bandwidth (TB) Connection (Mbps) Est. Price (mBTC) Price 0 Basis OVZ 1 2 50 unmetered 1000 1.03 EUR 6.99 1 Business OVZ 2 4 150 unmetered 1000 1.64 EUR 12.99 2 Advanced OVZ 4 8 300 unmetered 1000 2.35 EUR 19.99 3 Black OVZ 8 16 1000 unmetered 1000 2.96 EUR 25.99 4 Basic KVM 1 2 30 unmetered 1000 1.03 EUR 6.99 5 Business KVM 2 4 50 unmetered 1000 1.64 EUR 12.99 6 Advanced KVM 4 8 75 unmetered 1000 2.96 EUR 25.99 7 Black KVM 6 16 100 unmetered 1000 4.18 EUR 37.99
购买
使用purchase命令购买vps实例。已创建帐户 这个例子是通过一个银金矿钱包支付的。
$ cloudomate vps purchase linevast 0
Selected configuration: Name CPU RAM Storage Bandwidth Est.Price Basis OVZ 1 2 50 unmetered 6.99 Purchase this option? (y/N)
此外,还可以为购买生成一个随机用户:
$ cloudomate vps purchase linevast 0 –randomuser
配置文件存储在~/.config/cloudomate.cfg中。
对于proxhost,可以使用testnet比特币购买服务器:
$ cloudomate vps purchase proxhost 0 –testnet
管理
vps
以下功能可用于管理购买的VPS实例
status Get the status of the service. info Get information of the specified service setrootpw Set the root password of the last activated service. getip Get the ip of the specified service.
VPN
以下功能可用于管理购买的VPN实例
status Get the status of the service. info Get configuration of the specified service
测试
要运行项目的测试(请确保安装时使用额外的u requires:[测试])
python -m unittest discover