32namespace svcs::server::ssh {
61 std::shared_ptr<svcs::core::RepositoryManager> repo_manager,
62 std::shared_ptr<svcs::services::ISubject> event_bus);
105 bool isRunning()
const {
return running_; }
130 const std::string& public_key);
144 const std::string& password);
148 void handleClient(svcs::platform::SocketHandle client_fd);
149 bool initializeSSH();
151 void logEvent(
const std::string& message,
bool is_error =
false)
const;
152 bool handleSVCSCommand(
const std::string& command, ssh_channel channel);
155 std::shared_ptr<svcs::core::RepositoryManager> repo_manager_;
156 std::shared_ptr<svcs::services::ISubject> event_bus_;
158 std::atomic<bool> running_{
false};
159 std::thread server_thread_;
161 svcs::platform::SocketHandle server_socket_ = INVALID_SOCKET_HANDLE;
162 ssh_bind ssh_bind_ =
nullptr;
164 mutable std::mutex connections_mutex_;
165 std::vector<std::thread> client_threads_;
166 std::atomic<size_t> active_connections_{0};
Defines the interface for the Subject (Publisher) component of the Observer pattern.
Cross-platform network utilities.
Declaration of the RepositoryManager class, managing all repository-level file operations.
SSH server configuration.
void setUserPassword(const std::string &username, const std::string &password)
Set password for user.
Definition SSHServer.cxx:278
void stop()
Stop server.
Definition SSHServer.cxx:240
~SSHServer()
Destructor.
Definition SSHServer.cxx:203
SSHServer(const SSHConfig &config, std::shared_ptr< svcs::core::RepositoryManager > repo_manager, std::shared_ptr< svcs::services::ISubject > event_bus)
Constructor.
void addUserKey(const std::string &username, const std::string &public_key)
Add public key for user.
Definition SSHServer.cxx:268
bool isRunning() const
Check if running.
Definition SSHServer.hxx:76
size_t getActiveConnections() const
Get active connections.
Definition SSHServer.cxx:264
bool start()
Start server.
Definition SSHServer.cxx:207
SSH server configuration.
Definition SSHConfig.hxx:23