{"id":23943961,"url":"https://github.com/mark-hartmann/vera","last_synced_at":"2025-02-24T05:44:42.724Z","repository":{"id":50650132,"uuid":"388219392","full_name":"mark-hartmann/vera","owner":"mark-hartmann","description":"vera allows to mount veracrypt volumes with go","archived":false,"fork":false,"pushed_at":"2022-08-05T12:13:27.000Z","size":838,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T06:16:03.171Z","etag":null,"topics":["cli","go","golang","third-party-api","veracrypt","veracrypt-cli"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mark-hartmann.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-21T19:05:33.000Z","updated_at":"2022-08-02T18:45:44.000Z","dependencies_parsed_at":"2022-08-22T08:30:57.905Z","dependency_job_id":null,"html_url":"https://github.com/mark-hartmann/vera","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-hartmann%2Fvera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-hartmann%2Fvera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-hartmann%2Fvera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-hartmann%2Fvera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mark-hartmann","download_url":"https://codeload.github.com/mark-hartmann/vera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240427193,"owners_count":19799466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","go","golang","third-party-api","veracrypt","veracrypt-cli"],"created_at":"2025-01-06T06:16:09.282Z","updated_at":"2025-02-24T05:44:42.693Z","avatar_url":"https://github.com/mark-hartmann.png","language":"Go","readme":"## Overview\n\nThis package relies on the exported `ExecCommand` function and `Param` structs which are passed. Internally, the corresponding \nVeraCrypt command is assembled and then executed.  \n\n`vera` provides some predefined functions that try to simplify common commands, such as `List()`, `Mount()` and \n`DismountSlot()`. For a complete list of all exported functions, see the list below:\n\n* List\n* DismountAll\n* DismountSlot\n* DismountVolume\n* PropertiesSlot\n* PropertiesVolume\n* Installed\n* Mount\n\nEach of the above uses the `ExecCommand`, so the user may choose to implement some of these functions by \nthemselves. However, this can quickly become a mess: \n```go\nstdout, err := vera.ExecCommand(vera.Param{Name: \"list\", IsFlag: true})\n\nif err == nil {\n    // code to actually parse the stdout buffer and turn it into an actual list\n}\n```\nThe shorter version for the above code would be:\n```go\nmounts, err := vera.List() // the stdout buffer is already parsed and \"mounts\" contains a list of MountProperties\n```\n\n### MountProperties\n\nThe MountProperties struct is returned when calling `List`, `PropertiesSlot`, `PropertiesVolume` and `Mount`. It \nprovides some details about the mounted volume. The structure is as follows:\n\n```go\ntype MountProperties struct {\n  Slot       uint8  // the slot the volume is mounted at\n  Volume     string // the volume path\n  MountPoint string // the directory the volume is mounted to\n}\n```\n\n###### Slot\n\nVeraCrypt uses \"slots\" to mount volumes to. These slots are limited and VeraCrypt only allow up to 64 mounted volumes. \nThe slots range from **1** to **64**\n\n###### Volume\n\nVolume contains the absolute path of the mounted volume, even if a relative path was used to mount it\n\n###### MountPoint\n\nThe mount directory of this volume. If not provided by the user, VeraCrypt / the operating system will choose one. On \nLinux Mint for example, the default mount directories are named \"veracrypt\" + the used slot, e.g. `/media/veracrypt1` or \n`/media/veracrypt3`\n\n---\n\n### Param\n\nParam is a simple struct used for all kinds of arguments one might want to use:\n\n```go\ntype Param struct {\n   Name   string\n   Value  string // Leaving the Value empty doesn't indicate the param is a flag, use IsFlag instead\n   IsFlag bool   // IsFlag must be set to true for flags, e.g. --truecrypt or --version\n}\n```\n###### Usage\n```go\n// create a flag\ntc := vera.Param{Name: \"truecrypt\", IsFlag: true} // --truecrypt\n\n// create a normal parameter\npwd := vera.Param{Name: \"password\", Value: \"\u003cyour password\u003e\"} // --password=\"\u003cyour password\u003e\"\n\n// create an argument\nvolume := vera.Param{Value: \"./stuff.vc\"} // \"./stuff.vc\"\n\n// mount volume\n_, err := vera.ExecCommand(tc, volume, pwd)\n```\n\nDepending on the application requirements, it may be helpful to set up frequently used parameters as variables:\n```go\nvar NoFileSystem := vera.Param{Name: \"filesystem\", Value: \"none\"}\nvar DefaultPassword := vera.Param{Name: \"p\", Value: \"\u003cyour password\u003e\"} // please don't do this\n\nfunc mountNoFs() {\n    _, err := vera.Mount(\"./container.vc\", 1, NoFileSystem, DefaultPassword)\n    if err != nil { \n        // do something\n    }\n}\n```\n\n---\n#### Notes\n\n1. A program using this package may need extended permissions to mount volumes\n2. Mounted volumes may not be visible in the VeraCrypt GUI if the volumes have been mounted with different permissions\n3. When running the tests, depending on the settings, error messages may appear stating that the directory could\n   not be found. This is because some operating systems (e.g. Ubuntu) try to open newly mounted devices in file\n   explorer. Since the tests dismount the mounted volumes after the tests are done, they are then no longer to be found.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-hartmann%2Fvera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark-hartmann%2Fvera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-hartmann%2Fvera/lists"}