aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/conf/store.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* global: bump dateJason A. Donenfeld2022-01-061-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: apply gofumptJason A. Donenfeld2021-12-091-3/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: list unencrypted conf filesJason A. Donenfeld2021-06-251-6/+2
| | | | | | | | By ignoring unencrypted ones, the tunnel tracker would miss running configurations at startup. Reported-by: Станислав Мацак <smatsak@mail.ru> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: move away from ioutilJason A. Donenfeld2021-02-011-4/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyright dateJason A. Donenfeld2021-02-011-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: separate out migration and print errorsJason A. Donenfeld2020-11-271-76/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* manager: move legacy store from confJason A. Donenfeld2020-11-271-4/+0
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: rework migration flows around a single Save()Jason A. Donenfeld2020-11-271-14/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: when migrating, write out reserialized configJason A. Donenfeld2020-11-271-3/+4
| | | | | | This catches encoding gotchas earlier. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: do exponential back off for sharing violation in hotfolderJason A. Donenfeld2020-11-271-8/+19
| | | | | | | | | | | | | | | | | Windows gives us notifications about writes to files in a directory, but it does not give us notifications on when file handles are closed and when we can expect to be able to grab a handle to it; this would be racey at best. So, there always exists a race between the writer's last call to WriteFile() and its eventual CloseHandle(). Work around this by implementing a basic exponential back off of retrying the open call. While we're at it, clean up the "file already exists" logic to remove a basic toctou situation, and switch to using random temp file names in order to handle better the case of saving a new file from two different administrators at once. Reported-by: Jim Salter <jim@jrs-s.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update headersJason A. Donenfeld2020-11-221-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: allow administrators to add and remove configs easilyJason A. Donenfeld2020-11-221-11/+2
| | | | | | | | | | We loosen the permissions a little bit while tightening the restrictions on encrypted files. This should allow administrators to easily drop unencrypted files into Data\Configurations\ and get them encrypted and made read-only, while also allowing them to delete unwanted configurations. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: do not create config folder and migrate if presetJason A. Donenfeld2019-09-231-1/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* tunnel: extract owner of config file for pipe daclJason A. Donenfeld2019-07-191-0/+4
| | | | | | | | If the config file is unencrypted and its owner is not Local System, then we allow the runtime named pipe to be accessed by that owner, since generally the private key is already stored in the config file. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: manually migrate from windows.oldJason A. Donenfeld2019-06-131-0/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: read files potentially with UTF16Jason A. Donenfeld2019-05-221-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: regroup all importsJason A. Donenfeld2019-05-141-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: expose configuration root directoryJason A. Donenfeld2019-03-201-6/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: validate tunnel nameJason A. Donenfeld2019-03-051-1/+17
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* conf: introduce configuration managementJason A. Donenfeld2019-02-281-0/+199
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>