Class: ClaudeAgentServer::Config
- Inherits:
-
Object
- Object
- ClaudeAgentServer::Config
- Defined in:
- lib/claude_agent_server/config.rb
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#cors_origins ⇒ Object
Returns the value of attribute cors_origins.
-
#default_sdk_options ⇒ Object
Returns the value of attribute default_sdk_options.
-
#host ⇒ Object
Returns the value of attribute host.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#max_sessions ⇒ Object
Returns the value of attribute max_sessions.
-
#port ⇒ Object
Returns the value of attribute port.
-
#session_ttl ⇒ Object
Returns the value of attribute session_ttl.
Instance Method Summary collapse
- #allowed_origins ⇒ Object
- #auth_enabled? ⇒ Boolean
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/claude_agent_server/config.rb', line 8 def initialize @host = ENV.fetch('CLAUDE_SERVER_HOST', '0.0.0.0') @port = ENV.fetch('CLAUDE_SERVER_PORT', '9292').to_i @auth_token = ENV.fetch('CLAUDE_SERVER_AUTH_TOKEN', nil) @cors_origins = ENV.fetch('CLAUDE_SERVER_CORS_ORIGINS', '*') @session_ttl = ENV.fetch('CLAUDE_SERVER_SESSION_TTL', '3600').to_i @max_sessions = ENV.fetch('CLAUDE_SERVER_MAX_SESSIONS', '100').to_i = {} @log_level = ENV.fetch('CLAUDE_SERVER_LOG_LEVEL', 'info') end |
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def auth_token @auth_token end |
#cors_origins ⇒ Object
Returns the value of attribute cors_origins.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def cors_origins @cors_origins end |
#default_sdk_options ⇒ Object
Returns the value of attribute default_sdk_options.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def end |
#host ⇒ Object
Returns the value of attribute host.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def host @host end |
#log_level ⇒ Object
Returns the value of attribute log_level.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def log_level @log_level end |
#max_sessions ⇒ Object
Returns the value of attribute max_sessions.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def max_sessions @max_sessions end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def port @port end |
#session_ttl ⇒ Object
Returns the value of attribute session_ttl.
5 6 7 |
# File 'lib/claude_agent_server/config.rb', line 5 def session_ttl @session_ttl end |
Instance Method Details
#allowed_origins ⇒ Object
23 24 25 26 27 |
# File 'lib/claude_agent_server/config.rb', line 23 def allowed_origins return ['*'] if @cors_origins == '*' @cors_origins.split(',').map(&:strip) end |
#auth_enabled? ⇒ Boolean
19 20 21 |
# File 'lib/claude_agent_server/config.rb', line 19 def auth_enabled? !@auth_token.nil? && !@auth_token.empty? end |