Code Monkey home page Code Monkey logo

cdnfix's Introduction

tencent cloud cdn refresh tool

  • refresh cdn cache by url and url dir
  • push cache by url
  • query refresh status

TODO

  • add aliyun cloud cdn

how to use

create scretId and scretKey in https://console.cloud.tencent.com/cam/capi

set enviroment variables or edit .env

  • copy env.example to.env.
  • .env is the default enviroment file, you cat use -e to set enviroment file
export SECRET_ID=xxxxxx
export SECRET_KEY=xxxxxx

use source run commad

  1. git clone https://github.com/zzerding/cdnfix.git
  2. cd cdnfix
  3. go run main.go

use binary run commad

  1. go install github.com/zzerding/cdnfix
  2. cdnfix

use docker run commad

  1. docker run -rm -v $PWD:/app -e SECRET_ID=xxx -e SECRET_KEY=xxx zzerding/refresh-cnd
  2. docker run --rm --env-file=.env -v $(PWD)/.task_push.cache:/root/.task_push.cache -v $(PWD)/.task_refresh.cache:/root/.task_refresh.cache zzerding/cdnfix -u https://www.xxxx.com/join/ push
  3. docker run --rm --env-file=.env -v $(PWD)/.task_push.cache:/root/.task_push.cache -v $(PWD)/.task_refresh.cache:/root/.task_refresh.cache zzerding/cdnfix query

example

set .env or set enviroment variables

  • refresh cdn cache by url

    cdnfix -u https://www.xxxx.com refresh

  • refresh cdn cache by dir cdnfix -u https://www.xxxx.com/ refresh

  • query refresh status cdnfix query

  • refresh cdn cache by url file

    echo https://www.xxx.com/s?wd=tencent > /tmp/test.txt
    echo https://www.xxxx.com/ > /tmp/test.html
    cdnfix -f /tmp/test.txt refresh
    
  • use othev env file cdnfix -e /tmp/.env.shanghai -f /tmp/urlList.txt refresh

  • use debug mode cdnfix -d query

cdnfix's People

Contributors

zzerding avatar

Stargazers

GuangyiLi avatar Damon Road avatar  avatar Hank Shen avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.