Review comment + return castUrl as part of featureFlag

This commit is contained in:
Neeraj Gupta 2024-12-23 14:19:33 +05:30
parent 4cb11f4b06
commit 62155040da
5 changed files with 16 additions and 12 deletions

View File

@ -92,9 +92,10 @@ func main() {
if err != nil {
panic(err)
}
viper.SetDefault("apps.accounts", "https://accounts.ente.io")
viper.SetDefault("apps.cast-album", "https://cast.ente.io")
viper.SetDefault("apps.public-albums", "https://albums.ente.io")
viper.SetDefault("apps.accounts", "https://accounts.ente.io")
viper.SetDefault("apps.cast", "https://cast.ente.io")
viper.SetDefault("apps.family", "https://family.ente.io")
setupLogger(environment)

View File

@ -80,7 +80,7 @@ apps:
# set this to the URL where your albums web app is running.
public-albums:
# Default is https://cast.ente.io
cast-album:
cast:
# Default is https://accounts.ente.io
# Set this to the URL where your accounts web app is running, primarily used for
# passkey based 2FA.

View File

@ -23,14 +23,15 @@ type AdminUpdateKeyValueRequest struct {
type FeatureFlagResponse struct {
EnableStripe bool `json:"enableStripe"`
// If true, the mobile client will stop using CF worker to download files
DisableCFWorker bool `json:"disableCFWorker"`
MapEnabled bool `json:"mapEnabled"`
FaceSearchEnabled bool `json:"faceSearchEnabled"`
PassKeyEnabled bool `json:"passKeyEnabled"`
RecoveryKeyVerified bool `json:"recoveryKeyVerified"`
InternalUser bool `json:"internalUser"`
BetaUser bool `json:"betaUser"`
EnableMobMultiPart bool `json:"enableMobMultiPart"`
DisableCFWorker bool `json:"disableCFWorker"`
MapEnabled bool `json:"mapEnabled"`
FaceSearchEnabled bool `json:"faceSearchEnabled"`
PassKeyEnabled bool `json:"passKeyEnabled"`
RecoveryKeyVerified bool `json:"recoveryKeyVerified"`
InternalUser bool `json:"internalUser"`
BetaUser bool `json:"betaUser"`
EnableMobMultiPart bool `json:"enableMobMultiPart"`
CastUrl string `json:"castUrl"`
}
type FlagKey string

View File

@ -487,7 +487,7 @@ func (h *UserHandler) GetAccountsToken(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{
"accountsToken": token,
"accountUrl": viper.GetString("apps.account"),
"accountsUrl": viper.GetString("apps.accounts"),
})
}

View File

@ -4,6 +4,7 @@ import (
"database/sql"
"errors"
"fmt"
"github.com/spf13/viper"
"github.com/ente-io/museum/ente"
"github.com/ente-io/museum/pkg/repo/remotestore"
@ -59,6 +60,7 @@ func (c *Controller) GetFeatureFlags(ctx *gin.Context) (*ente.FeatureFlagRespons
// Changing it to false will hide the option and disable multi part upload for everyone
// except internal user.rt
EnableMobMultiPart: true,
CastUrl: viper.GetString("apps.cast"),
}
for key, value := range values {
flag := ente.FlagKey(key)