From 0e357cb72a5ceefdb694c7c4c8d506588e76ee96 Mon Sep 17 00:00:00 2001 From: KF Date: Wed, 1 Mar 2023 13:28:17 +0800 Subject: [PATCH] NEW: flarectl replacing cloudflare-cli --- alpine/cloudflare-cli/Dockerfile | 18 ------------------ alpine/cloudflare-cli/cloudflare-cli | 1 - alpine/cloudflare-cli/list-zones.sh | 1 - alpine/flarectl/Dockerfile | 8 ++++++++ alpine/flarectl/README.md | 4 ++++ .../{cloudflare-cli => flarectl}/monitoring.sh | 0 .../setenv-cl.sh.asc | 0 .../setenv-rs.sh.asc | 0 alpine/{cloudflare-cli => flarectl}/setenv.sh | 0 9 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 alpine/cloudflare-cli/Dockerfile delete mode 160000 alpine/cloudflare-cli/cloudflare-cli delete mode 100755 alpine/cloudflare-cli/list-zones.sh create mode 100644 alpine/flarectl/Dockerfile create mode 100644 alpine/flarectl/README.md rename alpine/{cloudflare-cli => flarectl}/monitoring.sh (100%) rename alpine/{cloudflare-cli => flarectl}/setenv-cl.sh.asc (100%) rename alpine/{cloudflare-cli => flarectl}/setenv-rs.sh.asc (100%) rename alpine/{cloudflare-cli => flarectl}/setenv.sh (100%) diff --git a/alpine/cloudflare-cli/Dockerfile b/alpine/cloudflare-cli/Dockerfile deleted file mode 100644 index 98b2943..0000000 --- a/alpine/cloudflare-cli/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM node:8.14-alpine - -LABEL maintainer="Mriyam Tamuli " - -# Set a working directory -WORKDIR /usr/src/app - -COPY . /usr/src/app -RUN npm install -RUN npm link -RUN apk add bash jq httpie -COPY setenv-cl.sh /root/setenv-cl.sh -COPY setenv-rs.sh /root/setenv-rs.sh -COPY list-zones.sh /root/list-zones.sh -RUN wget -O- https://github.com/cloudflare/cloudflare-go/releases/download/v0.15.0/flarectl_0.15.0_linux_amd64.tar.xz | tar Jxf - -RUN mv flarectl /usr/bin/ - -ENTRYPOINT [ "/bin/bash" ] diff --git a/alpine/cloudflare-cli/cloudflare-cli b/alpine/cloudflare-cli/cloudflare-cli deleted file mode 160000 index 628e1e8..0000000 --- a/alpine/cloudflare-cli/cloudflare-cli +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 628e1e80ac65d0307907980b5bbcd3d32e1b2a22 diff --git a/alpine/cloudflare-cli/list-zones.sh b/alpine/cloudflare-cli/list-zones.sh deleted file mode 100755 index 9cd62e0..0000000 --- a/alpine/cloudflare-cli/list-zones.sh +++ /dev/null @@ -1 +0,0 @@ -cfcli -f json zones | jq -cr ".[] | [.name, .status, .account.name, .plan.name]" diff --git a/alpine/flarectl/Dockerfile b/alpine/flarectl/Dockerfile new file mode 100644 index 0000000..ac74e0e --- /dev/null +++ b/alpine/flarectl/Dockerfile @@ -0,0 +1,8 @@ +FROM alpine:latest + +# Set a working directory +RUN apk add go bash jq +RUN go install github.com/cloudflare/cloudflare-go/cmd/flarectl@latest +RUN echo "export PATH=/root/go/bin:$PATH" >> /root/.bashrc + +ENTRYPOINT [ "/bin/bash" ] diff --git a/alpine/flarectl/README.md b/alpine/flarectl/README.md new file mode 100644 index 0000000..8c9cafd --- /dev/null +++ b/alpine/flarectl/README.md @@ -0,0 +1,4 @@ +# Usage: +export CF_API_KEY=xxx +export CF_API_EMAIL=yyy +flarectl dns l --zone your-domain.com diff --git a/alpine/cloudflare-cli/monitoring.sh b/alpine/flarectl/monitoring.sh similarity index 100% rename from alpine/cloudflare-cli/monitoring.sh rename to alpine/flarectl/monitoring.sh diff --git a/alpine/cloudflare-cli/setenv-cl.sh.asc b/alpine/flarectl/setenv-cl.sh.asc similarity index 100% rename from alpine/cloudflare-cli/setenv-cl.sh.asc rename to alpine/flarectl/setenv-cl.sh.asc diff --git a/alpine/cloudflare-cli/setenv-rs.sh.asc b/alpine/flarectl/setenv-rs.sh.asc similarity index 100% rename from alpine/cloudflare-cli/setenv-rs.sh.asc rename to alpine/flarectl/setenv-rs.sh.asc diff --git a/alpine/cloudflare-cli/setenv.sh b/alpine/flarectl/setenv.sh similarity index 100% rename from alpine/cloudflare-cli/setenv.sh rename to alpine/flarectl/setenv.sh