authelia/internal/commands/hash.go
Clement Michaud 2acf8bf21c Add hash-password and migrate commands to authelia binary.
This reduce the size of the docker image and avoid confusing users.

We keep the commands in authelia-scripts too in order to keep the
current workflow of developers.
2020-01-22 11:53:15 +11:00

18 lines
406 B
Go

package commands
import (
"fmt"
"github.com/authelia/authelia/internal/authentication"
"github.com/spf13/cobra"
)
var HashPasswordCmd = &cobra.Command{
Use: "hash-password [password]",
Short: "Hash a password to be used in file-based users database",
Run: func(cobraCmd *cobra.Command, args []string) {
fmt.Println(authentication.HashPassword(args[0], ""))
},
Args: cobra.MinimumNArgs(1),
}