Commit Graph

2520 Commits

Author SHA1 Message Date
Wolfgang Bumiller 23fba9d777 tools/fs: add FileIterOps trait and FileTypeFilter
FileIterOps will provide operations on file entry iterators.
For now this provides a file type filter.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-14 10:09:59 +01:00
Wolfgang Bumiller 1db416150d tools/fs: let ReadDir iterator yield ReadDirEntry
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-14 10:09:59 +01:00
Wolfgang Bumiller b12505da69 tools/fs: add ReadDirEntry helper
This wraps nix::dir::Entry with the parent and additionally
exposes the parent directory file descriptor since we need
it to perform openat().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-14 10:09:59 +01:00
Wolfgang Bumiller a25f863afd tools/fs: add scan_subdir helper
This filters the results of read_subdir with a regex.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-14 10:09:59 +01:00
Wolfgang Bumiller b4d5787de9 tools: start fs submodule, add read_subdir
This creates an iterator relative to a RawFd via
nix::dir::Dir over nix::dir::Entrys.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-14 10:09:59 +01:00
Dietmar Maurer 0dffe3f99a src/client/http_client.rs: try to login
use an environment var to store passphrase (PBS_PASSWORD)
2019-02-13 14:31:43 +01:00
Dietmar Maurer 33d64b81e0 src/bin/proxmox-backup-client.rs: define and use BackupRepository 2019-02-13 12:30:52 +01:00
Wolfgang Bumiller 4a3f65172c client: use hyper-tls for now
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-13 11:03:09 +01:00
Wolfgang Bumiller 42d6e4fb05 tools: borrow: implement Deref for Tied
Eg. if you have an x: Tied<Dir, Iterator> now you can simply
call x.next() as it'll dereference to the Iterator.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-13 11:03:09 +01:00
Dietmar Maurer 541a302224 api2/admin/datastore/catar.rs: use nested file extensions
i.e. archive.catar.didx
2019-02-13 10:37:00 +01:00
Dietmar Maurer e5064ba607 simplify backup lib structure (pub use xxx:*), improve doc 2019-02-12 14:13:31 +01:00
Dietmar Maurer d78345bcfc src/backup.rs - improve doc 2019-02-12 13:27:11 +01:00
Dietmar Maurer 93d5d77952 rename ArchiveIndex to DynamicIndex
also changed the file extension from .aidx to .didx
2019-02-12 12:05:33 +01:00
Dietmar Maurer 91a905b6dd rename ImageIndex to FixedIndex
also changed the file extension fron .iidx to .fidx
2019-02-12 11:50:45 +01:00
Wolfgang Bumiller 82bc0ad40c backup: fixup warnings and readd lost file type check
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-12 10:43:43 +01:00
Wolfgang Bumiller 9349d2a1d2 backup: cleanup long lines
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-12 10:39:11 +01:00
Wolfgang Bumiller fdd71f5286 backup: use ChunkIterator for sweep_unused_chunks
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-12 10:39:11 +01:00
Wolfgang Bumiller c9e7f4dc8b backup: add optional progress callback to ChunkIterator
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-12 10:39:11 +01:00
Wolfgang Bumiller 4070096c6a backup: add ChunkIterator
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-12 10:39:11 +01:00
Wolfgang Bumiller 6ed25cbe3a tools: add Tied value
Tie two dependent values together, such as a nix::Dir with
its nix::dir::Iter<'a> where 'a is tied to the Dir's
lifetime, making it otherwise impossible to return them or
store them in a struct.

Alternatively we could try the 'rental' crate.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-12 10:39:11 +01:00
Wolfgang Bumiller 9ac1045c7b bin: manager: fixup datastore parameter name
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-12 10:39:11 +01:00
Dietmar Maurer 8f8d5a420c avoid compiler warning 2019-02-11 15:12:01 +01:00
Dietmar Maurer aa5a4060ab bin/proxmox-backup-api.rs: improve error handling 2019-02-11 15:11:42 +01:00
Dietmar Maurer 4223d9f800 bin/proxmox-backup-proxy.rs: improve error handling 2019-02-11 14:43:26 +01:00
Wolfgang Bumiller ace9e3531a access: use proxmox-backup-auth for pam
allows customization via /etc/pam.d/proxmox-backup-auth

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-07 13:40:22 +01:00
Wolfgang Bumiller 517dfc4258 add generated files to .gitignore
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-05 14:17:30 +01:00
Wolfgang Bumiller 13f8310cac api2: time: use /etc/localtime as fallback
in case there is no /etc/timezone

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-05 14:14:56 +01:00
Wolfgang Bumiller a7cac14ed9 tools: use std::fs::read for file_get_contents
Until we add the extra options like we have in pve, just use
the already existing (since 1.26) shortcut.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-04 15:35:32 +01:00
Wolfgang Bumiller e937034c86 remove some rather inconvenient debug output
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-04 15:34:38 +01:00
Wolfgang Bumiller 9d02e5c38a proxy: use <configdir>/server.pfx for tls
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-04 15:19:32 +01:00
Wolfgang Bumiller 9f4962d396 introduce buildcfg module and PROXMOX_CONFIGDIR
buildcfg.rs should contain convenience variables or macros
for using build-time configured variables

For now we replace hardcoded "/etc/proxmox-backup/<foo>"
with configdir!("<foo>").

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-04 15:13:08 +01:00
Wolfgang Bumiller 0d176f3681 proxy: use TLS via tokio-tls
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-04 14:56:07 +01:00
Wolfgang Bumiller b369f720f5 buildsys: don't cache non-binary data
etc/ and www/ should be clean in the build/ dir

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:09:34 +00:00
Wolfgang Bumiller 844d13326b etc: remove obsolete syslog.target dependency
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:02:56 +00:00
Wolfgang Bumiller 0ae7ac1545 make deb: use --no-pre-clean
We create a clean build/ directory anyway.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:01:57 +00:00
Wolfgang Bumiller 1a9cb80c44 make clean: cleanup source package files
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 7406f6260a debian: add debian/source/format file
We need 1.0: We have a native package with a revision, so
anything >1.0 doesn't work...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 418f3a5f48 add missing build depends
lintian complains about a missing bash-completion dependency
which is implied required the bash completion debhelper...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 7ba5fb4aef buildsys: re-enable build caching for deb target
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 18fad34433 make: add dsc target and use lintian
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 304db5da3d use libexecdir for service binaries
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller bed78ccd63 use BUILD_MODE via the environment
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 069f2d16bf also apply cargo build flags to tests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 13b77d1060 buildsys: fixup package building
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller a10bb8b941 ignore casync test by default
because there's no casync package we can build-depend on to
actually run the tests on normal systems...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller e0a5d1ca2f tests: chunk_store: cleanup .testdir
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller a4f9188300 tests: import lazy_static as needed
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 6285b251e7 don't hardcode /usr/share paths
Add a defines.mk file defining the standard default layout
for installation (PREFIX, DATAROOTDIR, LIBDIR etc.).

Add a $(JSDIR) variable and use env!("JSDIR") in place of
the hardcoded /usr/share/javascript/proxmox-backup path.

Have defines.mk include an *optional* local.mak to override
JSDIR to www/ during local development.

Add `make install` targets and remove debian/install.

Note that service files are now in $libdir/proxmox-backup/
as there's usually no point in starting them from the
command line, so /usr/sbin makes no sense.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 9fa03fa2d3 www: build proxmox-backup-gui.js into the js/ subdir
The server expects an images/ subdir and a js/ subdir, so we
should also compile our files using the same structure.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00
Wolfgang Bumiller 8e4df103dd remove useless command option from daemons
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-01 10:41:54 +01:00