使用比特币自动购买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第三方库


热门话题
Spring、JPA和hibernate的java问题   如何将JMC(Java任务控制)连接到ubuntu中的远程JVM?   java如何将eventListener的结果存储为对象?   java在安卓中,点击一个按钮,我如何停止发送循环中发送的消息   java打开活动中的电子邮件   使用velocity模板打印JasperReports   java无法在自定义信息窗口上拨号   java如何在jsonb postgresql中查询并转换为谓词JPA   java更好地理解J2EE环境中的异常和日志记录   java打印多个文件   java无法使用API v2 Foreman 1.7.1创建主机   HTML单一提交类型按钮在java中不起作用   java调用静态方法的实例   ViewPage中替换片段的java问题   C++在java中创建数组(2D)而不初始化内部数组   java如何在NetBeans中同时更改变量名称的多个实例?   如何完成这个关于集合的java程序   java如何选择使用selenium从下拉菜单动态生成的元素?