使用比特币自动购买VPS实例

cloudomate的Python项目详细描述


Build StatusCloudomate logo

概述

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的稳定性取决于它的读写能力 供应商网页上的注册表格。并非所有供应商都提供 相同的表单和不同的功能(用户可能无法发送 他们在注册过程中选择的根密码)。下表 描述已在中实现的提供程序的当前状态 克劳多马特。

ProviderTypeCompatibleControl panelClientAreaEmail parsingRootpasswordSettingsNotes
BlueAngelHostvpsyesextendedyesfrom email>12h purchase processing
TwoSyncvpsyesextendedyesfrom emailTUN/TAPTUN/TAP on by default
UndergroundPrivatevpsyesdefaultregistration
LineVastvpsyesyesextendedyesregistrationTUN/TAPTUN/TAP enabling implemented
AzireVPNvpnyesnoneregistration
CCIHostingvpsnodefaultGateway broken
CrownCloudvpsnodefaultManual order reviews
PulseServersvpsnodefaultGateway broken
ProxHost (TBTC)vpsyesnoneregistrationTUN/TAPEmulated (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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java安卓,如何从一个私有的内部类更新视图元素,这个类是一个异步任务   如果代码中没有数字,则返回true的java方法   java是否将liferay service builder数据放入api?   java如何在javafx中显示单元格中的字符串数组   javascript如何从另一个GUI类获取变量?   创建多个对象后的java REST API POST响应?   java中静态块中声明的变量的范围是什么?   jsp Java,Spring MVC,从服务器中提取任何类型的文件(.png,.jpg,.pdf,.doc等)并提供给用户下载的最简单方法?   java应用程序运行在其他应用程序之上   java正则表达式匹配字符串是否应包含“;”特定字符串前后   C++的java原生源代码。awt。机器人   用于访问/共享单个目录的java多个Xodus应用程序   java将方法传递给另一个活动   java如何获取Struts 2中XWWWForMurlen编码的contenttype的参数