feat: redesign project sharing & initial registration
redesigned the project sharing popup to be a multi select dropdown that populates the options by using the input as a fuzzy search filter on the current users & invited users. users can now also be directly invited by email from the project share window. if invited this way, then the user will receive an email that sends them to a registration page, then a confirmation page. the initial registration was always redone so that it uses a similar system to the above in that it now will accept the first registered user if there are no other accounts (besides 'system').
This commit is contained in:
@ -62,10 +62,7 @@ func initConfig() {
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the root cobra command
|
||||
func Execute() {
|
||||
viper.SetDefault("server.hostname", "0.0.0.0:3333")
|
||||
viper.SetDefault("database.host", "127.0.0.1")
|
||||
viper.SetDefault("database.name", "taskcafe")
|
||||
@ -75,6 +72,20 @@ func Execute() {
|
||||
viper.SetDefault("queue.broker", "amqp://guest:guest@localhost:5672/")
|
||||
viper.SetDefault("queue.store", "memcache://localhost:11211")
|
||||
|
||||
}
|
||||
|
||||
// Execute the root cobra command
|
||||
func Execute() {
|
||||
viper.SetDefault("server.hostname", "0.0.0.0:3333")
|
||||
viper.SetDefault("database.host", "127.0.0.1")
|
||||
viper.SetDefault("database.name", "taskcafe")
|
||||
viper.SetDefault("database.user", "taskcafe")
|
||||
viper.SetDefault("database.password", "taskcafe_test")
|
||||
viper.SetDefault("database.port", "5432")
|
||||
|
||||
viper.SetDefault("queue.broker", "amqp://guest:guest@localhost:5672/")
|
||||
viper.SetDefault("queue.store", "memcache://localhost:11211")
|
||||
|
||||
rootCmd.SetVersionTemplate(versionTemplate)
|
||||
rootCmd.AddCommand(newWebCmd(), newMigrateCmd(), newTokenCmd(), newWorkerCmd(), newResetPasswordCmd())
|
||||
rootCmd.Execute()
|
||||
|
@ -34,11 +34,12 @@ func newMigrateCmd() *cobra.Command {
|
||||
Short: "Run the database schema migrations",
|
||||
Long: "Run the database schema migrations",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
connection := fmt.Sprintf("user=%s password=%s host=%s dbname=%s sslmode=disable",
|
||||
connection := fmt.Sprintf("user=%s password=%s host=%s dbname=%s port=%s sslmode=disable",
|
||||
viper.GetString("database.user"),
|
||||
viper.GetString("database.password"),
|
||||
viper.GetString("database.host"),
|
||||
viper.GetString("database.name"),
|
||||
viper.GetString("database.port"),
|
||||
)
|
||||
db, err := sqlx.Connect("postgres", connection)
|
||||
if err != nil {
|
||||
|
@ -32,11 +32,12 @@ func newWebCmd() *cobra.Command {
|
||||
log.SetFormatter(Formatter)
|
||||
log.SetLevel(log.InfoLevel)
|
||||
|
||||
connection := fmt.Sprintf("user=%s password=%s host=%s dbname=%s sslmode=disable",
|
||||
connection := fmt.Sprintf("user=%s password=%s host=%s dbname=%s port=%s sslmode=disable",
|
||||
viper.GetString("database.user"),
|
||||
viper.GetString("database.password"),
|
||||
viper.GetString("database.host"),
|
||||
viper.GetString("database.name"),
|
||||
viper.GetString("database.port"),
|
||||
)
|
||||
var db *sqlx.DB
|
||||
var err error
|
||||
@ -78,8 +79,11 @@ func newWebCmd() *cobra.Command {
|
||||
return http.ListenAndServe(viper.GetString("server.hostname"), r)
|
||||
},
|
||||
}
|
||||
|
||||
cc.Flags().Bool("migrate", false, "if true, auto run's schema migrations before starting the web server")
|
||||
|
||||
viper.BindPFlag("migrate", cc.Flags().Lookup("migrate"))
|
||||
|
||||
viper.SetDefault("migrate", false)
|
||||
return cc
|
||||
}
|
||||
|
Reference in New Issue
Block a user