Go source code modified from: https://blog.yessure.org/index.php/archives/203
To generate token:
- IE:
https://eu.api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*
- CA:
https://ca.api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*
To get Eco planCode and options:
- IE: https://eu.api.ovh.com/v1/order/catalog/public/eco?ovhSubsidiary=IE
- CA: https://ca.api.ovh.com/v1/order/catalog/public/eco?ovhSubsidiary=CA
docker run -e APP_KEY="ovh_appkey" \
-e APP_SECRET="ovh_appsecret" \
-e CONSUMER_KEY="ovh_consumerkey" \
-e REGION="ovh_region" \
-e TG_TOKEN="telegram_bot_token" \
-e TG_CHATID="telegram_your_chatid" \
-e ZONE="ovh_zone" \
-e PLANCODE="product_plancode" \
-e OPTIONS="product_options" \
-e AUTOPAY=true \
-e FREQUENCY=5 \
katorly/ovh-auto-buy:latest
services:
auto-buy:
image: katorly/ovh-auto-buy:latest
container_name: ks-buy
environment:
APP_KEY: "ovh_appkey" # OVH的应用key
APP_SECRET: "ovh_appsecret" # OVH的应用secret
CONSUMER_KEY: "ovh_consumerkey" # OVH的消费者key
REGION: "ovh_region" # 区域设置为, e.g. ovh-eu
TG_TOKEN: "telegram_bot_token" # 你的Telegram Bot Token
TG_CHATID: "telegram_your_chatid" # 你希望发送消息的Telegram Chat ID
ZONE: "ovh_zone" # OVH子公司区域设置, e.g. IE
PLANCODE: "product_plancode" # 需要购买的产品的planCode, e.g. 25skleb01
OPTIONS: "product_options" # 选择的配置, e.g. bandwidth-300-25skle,ram-32g-ecc-2400-25skle,softraid-2x450nvme-25skle
AUTOPAY: true # 是否自动支付, e.g. true
FREQUENCY: 5 # 检查频率单位为秒, e.g. 5