mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 08:21:50 -06:00
Remove legacy mode.
- Deleted the legacy WebSocket client implementation (`wstoclient.go`) and its test file (`wstoclient_test.go`). - Removed legacy handling from the HTTP manager, including legacy proxy setup and routing. - Cleaned up session management by removing legacy host checks and related functions. - Eliminated the legacy WebRTC handler and its associated logic. - Updated session interface to remove legacy methods. - Removed legacy API documentation and configuration options from migration guide and help files.
This commit is contained in:
@@ -13,7 +13,6 @@ import (
|
||||
|
||||
type Root struct {
|
||||
Config string
|
||||
Legacy bool
|
||||
|
||||
LogLevel zerolog.Level
|
||||
LogTime string
|
||||
@@ -34,14 +33,6 @@ func (Root) Init(cmd *cobra.Command) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// whether legacy configs and api should be enabled.
|
||||
// - if not specified, it will be automatically enabled if at least one legacy config entry is found.
|
||||
// - if it is specified, it will be enabled/disabled regardless of the presence of legacy config entries.
|
||||
cmd.PersistentFlags().Bool("legacy", true, "enable legacy mode")
|
||||
if err := viper.BindPFlag("legacy", cmd.PersistentFlags().Lookup("legacy")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("log.level", "info", "set log level (trace, debug, info, warn, error, fatal, panic, disabled)")
|
||||
if err := viper.BindPFlag("log.level", cmd.PersistentFlags().Lookup("log.level")); err != nil {
|
||||
return err
|
||||
@@ -81,10 +72,6 @@ func (Root) InitV2(cmd *cobra.Command) error {
|
||||
|
||||
func (s *Root) Set() {
|
||||
s.Config = viper.GetString("config")
|
||||
s.Legacy = viper.GetBool("legacy")
|
||||
if s.Legacy {
|
||||
log.Info().Msg("legacy configuration is enabled")
|
||||
}
|
||||
|
||||
logLevel := viper.GetString("log.level")
|
||||
level, err := zerolog.ParseLevel(logLevel)
|
||||
@@ -121,8 +108,6 @@ func (s *Root) Set() {
|
||||
}
|
||||
|
||||
func (s *Root) SetV2() {
|
||||
enableLegacy := false
|
||||
|
||||
if viper.IsSet("logs") {
|
||||
if viper.GetBool("logs") {
|
||||
logs := filepath.Join(".", "logs")
|
||||
@@ -134,12 +119,5 @@ func (s *Root) SetV2() {
|
||||
s.LogDir = ""
|
||||
}
|
||||
log.Warn().Msg("you are using v2 configuration 'NEKO_LOGS' which is deprecated, please use 'NEKO_LOG_DIR=/path/to/logs' instead")
|
||||
enableLegacy = true
|
||||
}
|
||||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, visit https://neko.m1k1o.net/docs/v3/migration-from-v2 for more details")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user