#include #include #include #include #include #include #include "messmer/fspp/fuse/Fuse.h" #include "messmer/fspp/impl/FilesystemImpl.h" #include "filesystem/CryDevice.h" #include "config/CryConfigLoader.h" #include namespace bf = boost::filesystem; using blockstore::ondisk::OnDiskBlockStore; using blockstore::inmemory::InMemoryBlockStore; using cpputils::make_unique_ref; using std::cout; using std::endl; void showVersion() { cout << "CryFS Version " << version::VERSION_STRING << endl; if (version::IS_DEV_VERSION) { cout << "WARNING! This is a development version based on git commit " << version::GIT_COMMIT_ID << ". Please do not use in production!" << endl; } else if (!version::IS_STABLE_VERSION) { cout << "WARNING! This is an experimental version. Please backup your data frequently!" << endl; } cout << endl; } void runFilesystem(int argc, char *argv[]) { auto config = cryfs::CryConfigLoader().loadOrCreate(bf::path("/home/heinzi/cryfstest/config.json")); auto blockStore = make_unique_ref(bf::path("/home/heinzi/cryfstest/root")); cryfs::CryDevice device(std::move(config), std::move(blockStore)); fspp::FilesystemImpl fsimpl(&device); fspp::fuse::Fuse fuse(&fsimpl); fuse.run(argc, argv); } int main(int argc, char *argv[]) { showVersion(); runFilesystem(argc, argv); return 0; }