This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
zone_name=$1 | |
record_name=$2 | |
api_key=$3 | |
current_ip=`curl -s https://api.ipify.org` | |
zone_id=`curl -s -X GET "https://api.cloudflare.com/client/v4/zones" \ | |
-H "Authorization: Bearer ${api_key}" -H "Content-Type: application/json" \ | |
| jq -r ".result | .[] | select(.name == \"${zone_name}\") | .id"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let github2jsdelivr = (_url) => { | |
regex = {"blob": /(.+)github.com\/(.+)\/(.+)\/blob\/(.+)\/(.+)/, | |
"tree": /(.+)github.com\/(.+)\/(.+)\/blob\/(.+)\/(.+)/}; | |
if(_url.match(regex.tree)){ | |
return _url.replace(regex.tree, "$1cdn.jsdelivr.net/gh/$2/$3@$4/$5"); | |
}else if(_url.match(regex.blob)){ | |
return _url.replace(regex.blob, "$1cdn.jsdelivr.net/gh/$2/$4@$4/$5"); | |
}else{ | |
return _url; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 需要反代的地址 | |
const upstream = 'api.github.com' | |
// 反代地址的子路径 | |
const upstreamPath = '/' | |
// 反代网站的移动端域名 | |
const upstreamMobile = 'api.github.com' | |
// 是否使用 https | |
const useHttps = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.5' | |
services: | |
shlink-frontend: | |
image: shlinkio/shlink-web-client:stable | |
container_name: shlink-frontend | |
restart: unless-stopped | |
depends_on: | |
- shlink-backend | |
- shlink-db |
OlderNewer