2019-10-29 20:54:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2019-11-02 14:32:58 +00:00
|
|
|
log "github.com/sirupsen/logrus"
|
2019-10-29 20:54:47 +00:00
|
|
|
"github.com/spf13/cobra"
|
2020-04-05 12:37:21 +00:00
|
|
|
|
|
|
|
"github.com/authelia/authelia/internal/utils"
|
2019-10-29 20:54:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ServeCmd serve authelia with the provided configuration
|
|
|
|
func ServeCmd(cobraCmd *cobra.Command, args []string) {
|
2019-11-02 14:32:58 +00:00
|
|
|
log.Infof("Running Authelia with config %s...", args[0])
|
2019-12-08 15:51:12 +00:00
|
|
|
cmd := utils.CommandWithStdout(OutputDir+"/authelia", "--config", args[0])
|
2019-10-29 20:54:47 +00:00
|
|
|
cmd.Env = append(os.Environ(), "PUBLIC_DIR=dist/public_html")
|
2019-11-02 14:32:58 +00:00
|
|
|
utils.RunCommandUntilCtrlC(cmd)
|
2019-10-29 20:54:47 +00:00
|
|
|
}
|