From 51465f8b771e2bbbe460ef6ec5f3160b3ef6d4cd Mon Sep 17 00:00:00 2001 From: Amir Zarrinkafsh Date: Sun, 10 Nov 2019 05:42:36 +1100 Subject: [PATCH] Sync README.md from GitHub to DockerHub after push-manifest --- README.md | 46 +++++++++++++++--------------- cmd/authelia-scripts/cmd_docker.go | 17 ++++++++--- cmd/authelia-scripts/docker.go | 9 ++++-- 3 files changed, 43 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 638acb58..8d519fa9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- +

[![license](https://img.shields.io/badge/license-Apache%202.0-green.svg)][Apache 2.0] @@ -18,25 +18,25 @@ It acts as a companion of reverse proxies like [nginx] or [Traefik] by handling

- - - - + + + +

**Authelia** can be installed as a standalone service using Docker or NPM but can also be deployed easily on [Kubernetes] leveraging ingress controllers and ingress configuration.

- - + +

Here is what Authelia's portal looks like

- - + +

## Features summary @@ -44,9 +44,9 @@ Here is what Authelia's portal looks like Here is the list of the main available features: * Several kind of second factor: - * **[Security Key (U2F)](./docs/2factor/security-key.md)** with [Yubikey]. - * **[Time-based One-Time password](./docs/2factor/time-based-one-time-password.md)** with [Google Authenticator]. - * **[Mobile Push Notifications](./docs/2factor/duo-push-notifications.md)** with [Duo](https://duo.com/). + * **[Security Key (U2F)](https://github.com/clems4ever/authelia/blob/master/docs/2factor/security-key.md)** with [Yubikey]. + * **[Time-based One-Time password](https://github.com/clems4ever/authelia/blob/master/docs/2factor/time-based-one-time-password.md)** with [Google Authenticator]. + * **[Mobile Push Notifications](https://github.com/clems4ever/authelia/blob/master/docs/2factor/duo-push-notifications.md)** with [Duo](https://duo.com/). * Password reset with identity verification using email confirmation. * Single-factor only authentication method available. * Access restriction after too many authentication attempts. @@ -55,7 +55,7 @@ Here is the list of the main available features: * Highly-available using distributed database and KV store. * Compatible with Kubernetes [ingress-nginx](https://github.com/kubernetes/ingress-nginx) controller out of the box. -For more details about the features, follow [Features](./docs/features.md). +For more details about the features, follow [Features](https://github.com/clems4ever/authelia/blob/master/docs/features.md). ## Proxy support @@ -64,9 +64,9 @@ Authelia works in combination with [nginx] or [Traefik] and soon with [HAProxy] Docker or directly in [Kubernetes].

- - - + + +

## Getting Started @@ -76,12 +76,12 @@ You can start off with git clone https://github.com/clems4ever/authelia.git && cd authelia source bootstrap.sh -If you want to go further, please read [Getting Started](./docs/getting-started.md). +If you want to go further, please read [Getting Started](https://github.com/clems4ever/authelia/blob/master/docs/getting-started.md). ## Deployment Now that you have tested **Authelia** and you want to try it out in your own infrastructure, -you can learn how to deploy and use it with [Deployment](./docs/deployment-production.md). +you can learn how to deploy and use it with [Deployment](https://github.com/clems4ever/authelia/blob/master/docs/deployment-production.md). This guide will show you how to deploy it on bare metal as well as on [Kubernetes](https://kubernetes.io/). @@ -89,11 +89,11 @@ This guide will show you how to deploy it on bare metal as well as on If you want more information about the security measures applied by **Authelia** and some tips on how to set up **Authelia** in a secure way, -refer to [Security](./docs/security.md). +refer to [Security](https://github.com/clems4ever/authelia/blob/master/docs/security.md). ## Changelog & Breaking changes -See [CHANGELOG.md](CHANGELOG.md) and [BREAKING.md](BREAKING.md). +See [CHANGELOG.md](https://github.com/clems4ever/authelia/blob/master/CHANGELOG.md) and [BREAKING.md](https://github.com/clems4ever/authelia/blob/master/BREAKING.md). ## Contribute @@ -102,16 +102,16 @@ documentation, security reviews or whatever, are very welcome to issue or review pull requests and take part to discussions in [Gitter](https://gitter.im/authelia/general?utm_source=share-link&utm_medium=link&utm_campaign=share-link). -I am very greatful to contributors for their contributions to the project. Don't hesitate be the next! +I am very grateful to contributors for their contributions to the project. Don't hesitate be the next! ## Build Authelia -If you want to contribute with code, you should follow the documentation explaining how to [build](./docs/build.md) the application. +If you want to contribute with code, you should follow the documentation explaining how to [build](https://github.com/clems4ever/authelia/blob/master/docs/build-and-dev.md) the application. ## License **Authelia** is **licensed** under the **[Apache 2.0]** license. The terms of the license are detailed -in [LICENSE](LICENSE). +in [LICENSE](https://github.com/clems4ever/authelia/blob/master/LICENSE). [Apache 2.0]: https://www.apache.org/licenses/LICENSE-2.0 diff --git a/cmd/authelia-scripts/cmd_docker.go b/cmd/authelia-scripts/cmd_docker.go index 1024f147..3ddca4fc 100644 --- a/cmd/authelia-scripts/cmd_docker.go +++ b/cmd/authelia-scripts/cmd_docker.go @@ -131,6 +131,7 @@ func login(docker *Docker) { func deploy(docker *Docker, tag string) { imageWithTag := DockerImageName + ":" + tag + fmt.Println("===================================================") fmt.Println("Docker image " + imageWithTag + " will be deployed on Dockerhub.") fmt.Println("===================================================") @@ -150,6 +151,7 @@ func deploy(docker *Docker, tag string) { func deployManifest(docker *Docker, tag string, amd64tag string, arm32v7tag string, arm64v8tag string) { dockerImagePrefix := DockerImageName + ":" + fmt.Println("===================================================") fmt.Println("Docker manifest " + dockerImagePrefix + tag + " will be deployed on Dockerhub.") fmt.Println("===================================================") @@ -162,19 +164,26 @@ func deployManifest(docker *Docker, tag string, amd64tag string, arm32v7tag stri tags := []string{amd64tag, arm32v7tag, arm64v8tag} for _, t := range tags { - username := os.Getenv("DOCKER_USERNAME") - password := os.Getenv("DOCKER_PASSWORD") - fmt.Println("===================================================") fmt.Println("Docker removing tag for " + dockerImagePrefix + t + " on Dockerhub.") fmt.Println("===================================================") - err = docker.CleanTag(username, password, t) + err = docker.CleanTag(t) if err != nil { panic(err) } } + + fmt.Println("===================================================") + fmt.Println("Docker pushing README.md to Dockerhub.") + fmt.Println("===================================================") + + err = docker.PublishReadme() + + if err != nil { + panic(err) + } } func publishDockerImage(arch string) { diff --git a/cmd/authelia-scripts/docker.go b/cmd/authelia-scripts/docker.go index 914161e1..1aec7dff 100644 --- a/cmd/authelia-scripts/docker.go +++ b/cmd/authelia-scripts/docker.go @@ -47,6 +47,11 @@ func (d *Docker) Manifest(tag, amd64tag, arm32v7tag, arm64v8tag string) error { } // CleanTag remove a tag from dockerhub. -func (d *Docker) CleanTag(username, password, tag string) error { - return CommandWithStdout("curl", "-u", username+":"+password, "-X", "DELETE", "https://cloud.docker.com/v2/repositories/"+DockerImageName+"/tags/"+tag+"/").Run() +func (d *Docker) CleanTag(tag string) error { + return CommandWithStdout("curl", "-s", "-o", "/dev/null", "-u", "$DOCKER_USERNAME:$DOCKER_PASSWORD", "-X", "DELETE", "https://cloud.docker.com/v2/repositories/"+DockerImageName+"/tags/"+tag+"/").Run() +} + +// PublishReadme push README.md to dockerhub. +func (d *Docker) PublishReadme() error { + return CommandWithStdout("bash", "-c", `jq -n --arg msg "$(