Drop the M0 no-deps skeleton preset and all VOICECAT_HAS_NET/AUDIO/OPUS/NS guards that it required. Every subsystem is fully implemented; the stub #else paths were dead code that added noise to every header and source file. - CMakePresets.json: remove skeleton configure/build/test entries - CMakeLists.txt (root/core/tests): remove VOICECAT_USE_VCPKG_DEPS option and guards; all targets now build unconditionally - 17 C++ source files: unwrap HAS_* guards, delete stub #else blocks - apm_processor.cpp: delete ApmPassthrough no-op class; create() always returns RnnoiseProcessor - 18 test files: remove HAS_* guards and stub int main() skip bodies - docs/building.md: remove skeleton from preset table and prose VOICECAT_HAS_LOOPBACK (Windows WASAPI loopback platform gate) unchanged. 29/29 ctest green. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#include "identity.h"
|
|
|
|
#include <filesystem>
|
|
#include <stdexcept>
|
|
|
|
namespace voicecat::server {
|
|
|
|
bool ServerIdentityManager::init(const std::filesystem::path& data_dir,
|
|
const std::string& server_name, std::string& error) {
|
|
try {
|
|
std::filesystem::create_directories(data_dir);
|
|
|
|
auto id_path = data_dir / "identity.key";
|
|
auto cert_path = data_dir / "server.crt";
|
|
auto key_path = data_dir / "server.key";
|
|
|
|
if (std::filesystem::exists(id_path) &&
|
|
std::filesystem::exists(cert_path) &&
|
|
std::filesystem::exists(key_path)) {
|
|
identity_ = crypto::ServerIdentity::load(id_path);
|
|
cert_ = crypto::ServerCert::load(cert_path, key_path);
|
|
} else {
|
|
identity_ = crypto::ServerIdentity::generate();
|
|
cert_ = crypto::ServerCert::generate(server_name);
|
|
identity_.save(id_path);
|
|
cert_.save(cert_path, key_path);
|
|
}
|
|
return true;
|
|
} catch (const std::exception& ex) {
|
|
error = ex.what();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
} // namespace voicecat::server
|