Skip to content

Commit c6a0cec

Browse files
authored
Merge pull request #85 from sineverba/release-4.3.0
Release 4.3.0
2 parents 714f6b8 + 29bd679 commit c6a0cec

18 files changed

Lines changed: 693 additions & 258 deletions

.deploy/scripts/build.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.deploy/scripts/deploy.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.deploy/scripts/test.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

.semaphore/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: v1.0
2+
3+
name: Build and deploy Pipeline
4+
agent:
5+
machine:
6+
type: e1-standard-2
7+
os_image: ubuntu1804
8+
execution_time_limit:
9+
hours: 3
10+
11+
global_job_config:
12+
13+
prologue:
14+
commands:
15+
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USERNAME" --password-stdin
16+
17+
env_vars:
18+
- name: DOCKER_USERNAME
19+
value: sineverba
20+
- name: DOCKER_IMAGE
21+
value: cfhookbash
22+
23+
blocks:
24+
- name: 'Build and deploy'
25+
task:
26+
jobs:
27+
- name: 'Build and deploy'
28+
commands:
29+
- checkout
30+
- docker -v
31+
- mkdir -vp ~/.docker/cli-plugins/
32+
- curl --silent -L "https://github.com/docker/buildx/releases/download/v0.5.1/buildx-v0.5.1.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
33+
- chmod a+x ~/.docker/cli-plugins/docker-buildx
34+
- docker buildx version
35+
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
36+
- docker buildx create --name mybuilder && docker buildx use mybuilder && docker buildx inspect --bootstrap
37+
- docker buildx build --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7 --tag $DOCKER_USERNAME/$DOCKER_IMAGE:$SEMAPHORE_GIT_TAG_NAME --tag $DOCKER_USERNAME/$DOCKER_IMAGE:latest --file ./docker/Dockerfile . --push
38+
secrets:
39+
- name: DOCKER_TOKEN

.semaphore/semaphore.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: v1.0
2+
3+
name: Build and test Pipeline
4+
agent:
5+
machine:
6+
type: e1-standard-2
7+
os_image: ubuntu1804
8+
9+
global_job_config:
10+
11+
prologue:
12+
commands:
13+
- echo $DOCKER_TOKEN | docker login --username "$DOCKER_USERNAME" --password-stdin
14+
15+
env_vars:
16+
- name: DOCKER_USERNAME
17+
value: sineverba
18+
- name: DOCKER_IMAGE
19+
value: cfhookbash
20+
21+
blocks:
22+
- name: 'Build and test'
23+
skip:
24+
when: "tag =~ '.*'"
25+
task:
26+
jobs:
27+
- name: 'Build and test'
28+
commands:
29+
- checkout
30+
- docker build --tag $DOCKER_USERNAME/$DOCKER_IMAGE --file ./docker/Dockerfile .
31+
- docker run -it --rm --name cfhookbash $DOCKER_USERNAME/$DOCKER_IMAGE | grep "Using main config file /app/dehydrated/config"
32+
- docker run -it --rm --name cfhookbash $DOCKER_USERNAME/$DOCKER_IMAGE | grep "Registering account"
33+
34+
secrets:
35+
- name: DOCKER_TOKEN
36+
37+
promotions:
38+
- name: Deploy
39+
pipeline_file: deploy.yml
40+
auto_promote:
41+
when: "result = 'passed' and tag =~ '.*'"

.travis.yml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
11
os: linux
2-
32
dist: bionic
4-
53
language: shell
64

75
env:
86
DOCKER_USERNAME: sineverba
97
DOCKER_IMAGE: cfhookbash
108

119
before_install:
12-
- export VCS_REF=$(git rev-parse --short HEAD)
13-
- |
14-
if [[ $TRAVIS_BRANCH == "master" || $TRAVIS_BRANCH == "develop" || $TRAVIS_TAG != "" ]]; then
15-
chmod +x ./.deploy/scripts/build.sh
16-
chmod +x ./.deploy/scripts/test.sh
17-
chmod +x ./.deploy/scripts/deploy.sh
18-
fi
10+
- echo "before install"
1911

2012
install:
21-
- |
22-
if [[ $TRAVIS_BRANCH == "master" || $TRAVIS_BRANCH == "develop" || $TRAVIS_TAG != "" ]]; then
23-
./.deploy/scripts/build.sh
24-
fi
13+
- echo "install"
2514

2615
script:
27-
- |
28-
if [[ $TRAVIS_BRANCH == "master" || $TRAVIS_BRANCH == "develop" || $TRAVIS_TAG != "" ]]; then
29-
./.deploy/scripts/test.sh
30-
fi
16+
- echo "script"
3117

3218
after_success:
33-
- |
34-
if [[ $TRAVIS_TAG != "" ]]; then
35-
./.deploy/scripts/deploy.sh
36-
fi
19+
- echo "after success"

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# 4.2.0
1+
# 4.3.0
2+
+ Remove Docker implementation (not completed)
3+
+ Remove config folder (for old Docker)
4+
+ Add Dockerfile
5+
+ Add instructions for Docker
6+
+ Add semaphore
7+
+ Fix semaphore
8+
9+
## 4.2.0
210
+ Add hook-chaining support
311
+ Improve logging/error messages
412

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ We accept contributions via Pull Requests.
2626

2727
- Create a branch `feature-myawesomefeature` or `hotfix-myhotfix` from `develop`
2828
- Push your branch against `develop` branch.
29+
- Update `CHANGELOG.md` under a `#Next version` section
2930

3031
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
3132

Makefile

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
build:
2-
@docker build --tag sineverba/cfhookbash:latest --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --file ./docker/Dockerfile .
2+
docker build --tag sineverba/cfhookbash:latest --file ./docker/Dockerfile .
3+
4+
multi:
5+
docker buildx build --platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7 --tag sineverba/cfhookbash:latest --file ./docker/Dockerfile . --push
36

47
run:
5-
@docker run -it -v ${PWD}/certs:/certs -v ${PWD}/config:/config --name cfhookbash sineverba/cfhookbash:latest
8+
#docker run -it -v ${PWD}/certs:/certs -v ${PWD}/config:/config --name cfhookbash sineverba/cfhookbash:latest
9+
docker run -it --rm --name cfhookbash sineverba/cfhookbash:latest
610

711
test:
8-
docker run -dit -v ${PWD}/certs:/certs -v ${PWD}/config:/config --name cfhookbash --entrypoint=/bin/sh sineverba/cfhookbash:latest
9-
docker exec -it cfhookbash cat /dehydrated/dehydrated | grep 0.6.5
10-
docker container stop cfhookbash
11-
docker container rm cfhookbash
12+
docker run -it --rm --name cfhookbash sineverba/cfhookbash:latest | grep "INFO: Using main config file /app/dehydrated/config"
13+
docker run -it --rm --name cfhookbash sineverba/cfhookbash:latest | grep "Registering account"
1214

1315
inspect:
14-
docker run -it --entrypoint "/bin/bash" -v ${PWD}/certs:/certs -v ${PWD}/config:/config cfhookbash
15-
16-
push:
17-
docker push sineverba/cfhookbash:latest
16+
#docker run -it --entrypoint "/bin/bash" -v ${PWD}/certs:/certs -v ${PWD}/config:/config cfhookbash
17+
docker run -it --entrypoint "/bin/bash" cfhookbash
1818

1919
destroy:
20-
docker container stop cfhookbash
21-
docker container rm cfhookbash
22-
# sudo rm -r certs/
23-
docker image rm sineverba/cfhookbash:latest
20+
docker image rm sineverba/cfhookbash:latest

README.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Cloudflare dns-01 challenge hook bash for dehydrated
22
====================================================
33

4+
| CD / CI | |
5+
| --------- | --------- |
6+
| Semaphore CI | [![Build Status](https://sineverba.semaphoreci.com/badges/cfhookbash/branches/master.svg)](https://sineverba.semaphoreci.com/projects/cfhookbash) |
7+
48
**If you like this project, or use it, please, star it!**
59

610
Cloudflare Bash hook for [dehydrated](https://github.com/lukas2511/dehydrated).
711

8-
| CI / CD | Status |
9-
| ------- | ------ |
10-
| Travis | [![Build Status](https://travis-ci.com/sineverba/cfhookbash.svg?branch=master)](https://travis-ci.com/sineverba/cfhookbash) |
11-
| Docker | [![](https://images.microbadger.com/badges/image/sineverba/cfhookbash.svg)](https://microbadger.com/images/sineverba/cfhookbash "Get your own image badge on microbadger.com") |
1212

1313
## Why Cloudflare? What is this script?
1414

@@ -136,28 +136,18 @@ Inspired by
136136
+ [https://www.splitbrain.org/blog/2017-08/10-homeassistant_duckdns_letsencrypt](https://www.splitbrain.org/blog/2017-08/10-homeassistant_duckdns_letsencrypt)
137137
+ [https://github.com/kappataumu/letsencrypt-Cloudflare-hook](https://github.com/kappataumu/letsencrypt-Cloudflare-hook)
138138

139-
----------------------------------------------------
140-
141-
### Docker mode - beware! Not stable and under development!
142-
+ Make a new dir (e.g. `mkdir -p /home/$USER/cfhookbashdocker`)
143-
+ Create a `certs` folder
144-
+ Create one or more folders with name of domain in `certs` (e.g. `certs/example.com` and `certs/test.example.com`)
145-
+ Create a `config` folder
146-
+ Create a `config.sh` file in `/config/` and fill it (see below how to get data)
147-
+ Create a `domains.txt` file in `/config/` and insert a domain for every line
148-
+ Make a first run in stage mode: create a `config` file under `/config` with this content `CA="https://acme-staging-v02.api.letsencrypt.org/directory"`
139+
## Docker version
149140

150-
Run
141+
+ Pull from Docker Hub: `docker pull sineverba/cfhookbash`
142+
+ Make a first run, it will create the correct directories and files:
151143

152-
``` shell
153-
docker run -it \
154-
-v ${PWD}/certs:/certs \
155-
-v ${PWD}/config:/config \
156-
--name cfhookbash \
157-
sineverba/cfhookbash:latest
144+
```shell
145+
$ docker run -it --rm -v $(pwd)/data:/app/dehydrated --name cfhookbash sineverba/cfhookbash:latest
158146
```
147+
+ Edit `data/config`, `data/config.sh` and `data/domains.txt`
148+
+ Rerun:
159149

160-
+ Certs will be available in `/certs`
161-
+ Docker run a cronjob every minute
150+
```shell
151+
$ docker run -it --rm -v $(pwd)/data:/app/dehydrated --name cfhookbash sineverba/cfhookbash:latest
152+
```
162153

163-
-------------------------------------------------------

0 commit comments

Comments
 (0)