43 lines
977 B
Go
43 lines
977 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"goauthentik.io/internal/common"
|
|
"goauthentik.io/internal/constants"
|
|
"goauthentik.io/internal/outpost/ak/entrypoint"
|
|
"goauthentik.io/internal/outpost/ak/healthcheck"
|
|
"goauthentik.io/internal/outpost/ldap"
|
|
)
|
|
|
|
const helpMessage = `authentik ldap
|
|
|
|
Required environment variables:
|
|
- AUTHENTIK_HOST: URL to connect to (format "http://authentik.company")
|
|
- AUTHENTIK_TOKEN: Token to authenticate with
|
|
- AUTHENTIK_INSECURE: Skip SSL Certificate verification`
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Long: helpMessage,
|
|
Version: constants.FullVersion(),
|
|
PersistentPreRun: common.PreRun,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
err := entrypoint.OutpostMain("authentik.outpost.ldap", ldap.NewServer)
|
|
if err != nil {
|
|
fmt.Println(helpMessage)
|
|
}
|
|
return err
|
|
},
|
|
}
|
|
|
|
func main() {
|
|
rootCmd.AddCommand(healthcheck.Command)
|
|
err := rootCmd.Execute()
|
|
if err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|