feat: persist encrypted env

This commit is contained in:
Lakhan Samani
2021-12-31 13:52:10 +05:30
parent d9c40057e6
commit e35d0cbcd6
41 changed files with 751 additions and 298 deletions

View File

@@ -22,10 +22,12 @@ func main() {
env.ARG_ENV_FILE = flag.String("env_file", "", "Env file path")
flag.Parse()
constants.VERSION = VERSION
constants.EnvData.VERSION = VERSION
env.InitEnv()
db.InitDB()
env.PersistEnv()
session.InitSession()
oauth.InitOAuth()
utils.InitServer()
@@ -35,7 +37,7 @@ func main() {
router.LoadHTMLGlob("templates/*")
// login page app related routes.
// if we put them in router file then tests would fail as templates or build path will be different
if !constants.DISABLE_LOGIN_PAGE {
if !constants.EnvData.DISABLE_LOGIN_PAGE {
app := router.Group("/app")
{
app.Static("/build", "app/build")
@@ -50,5 +52,5 @@ func main() {
app.GET("/", handlers.DashboardHandler())
}
router.Run(":" + constants.PORT)
router.Run(":" + constants.EnvData.PORT)
}