Commit Graph

480 Commits

Author SHA1 Message Date
Dietmar Maurer 34f956bc25 api2/access.rs: add ticket api 2019-01-30 15:16:10 +01:00
Wolfgang Bumiller 1bf446a33e fix timer_delete call
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-30 12:04:20 +01:00
Dietmar Maurer cf671670a0 auth_helpers.rs: add timestamp to csrf token 2019-01-29 17:50:03 +01:00
Dietmar Maurer 1e76cbc6a2 auth_helpers.rs: implement assemble_csrf_prevention_token 2019-01-29 17:41:45 +01:00
Dietmar Maurer d01e2420f7 load auth keys on startup 2019-01-29 17:21:58 +01:00
Dietmar Maurer 6c30068ebf auth_helpers.rs: split code into separate file 2019-01-29 16:55:49 +01:00
Dietmar Maurer 39a90ca6c5 bin/proxmox-backup-api.rs: gererate secret for csrf token 2019-01-29 13:15:33 +01:00
Dietmar Maurer 26027a151e tools/ticket.rs: remove debug statements 2019-01-29 13:04:01 +01:00
Dietmar Maurer 8d04280b29 tools/ticket.rs: add basic ticket support 2019-01-29 12:59:07 +01:00
Dietmar Maurer c8f3f9b1af server/rest.rs: simplify proxy code
Only pass neccessary parameters.
2019-01-28 18:22:16 +01:00
Dietmar Maurer a859fa95a9 add protected flag for some api methods 2019-01-28 18:16:47 +01:00
Dietmar Maurer a3da38ddfd server/rest.rs: implement proxy_sync_api_request 2019-01-28 18:06:42 +01:00
Dietmar Maurer f120483353 server/rest.rs: add proxy_sync_api_request() dummy 2019-01-28 17:30:39 +01:00
Dietmar Maurer 4e4df8e2f0 api/router.rs: add new 'protected' flag to ApiMethod 2019-01-28 17:18:42 +01:00
Dietmar Maurer 5bb3398171 server/formatter.rs: fix extjs error format 2019-01-28 13:44:48 +01:00
Dietmar Maurer 02c7a75520 src/bin/proxmox-backup-proxy.rs: implement unpriviledged server
We want to run the public server as user www-data. Requests needing
root priviledges needs to be proxied to the proxmox-backup.service, which
now listens to 127.0.0.1:82.
2019-01-28 13:29:58 +01:00
Dietmar Maurer 48849593ee api2/node/services.rs: implement service commands 2019-01-27 12:40:31 +01:00
Dietmar Maurer d7d23785f0 RpcEnvironment: implement set_user() and get_user() 2019-01-27 10:52:26 +01:00
Dietmar Maurer 162b979394 RpcEnvironment: add environment type enum RpcEnvironmentType 2019-01-27 10:33:42 +01:00
Dietmar Maurer e82dad9700 also pass rpcenv to async handlers 2019-01-27 10:18:52 +01:00
Dietmar Maurer d2ab5f19e2 api2/node/services.rs: start services api 2019-01-26 17:54:18 +01:00
Dietmar Maurer 0f253593c6 move rpc environment implementation to separate files 2019-01-26 15:08:02 +01:00
Dietmar Maurer 6049b71f41 api: pass RpcEnvirnment to api handlers 2019-01-26 14:50:37 +01:00
Dietmar Maurer d96d82736d use crate log and syslog 2019-01-26 10:56:11 +01:00
Dietmar Maurer e182ab4a4a api2/node/syslog.rs: improve error handling 2019-01-26 10:23:52 +01:00
Dietmar Maurer 0441886842 api2/node/syslog.rs: implement dump journal 2019-01-25 18:20:51 +01:00
Dietmar Maurer 4f9a726833 api2/node/syslog.rs: add syslog api schema 2019-01-25 17:17:30 +01:00
Dietmar Maurer 1631c54fca tools::get_hardware_address - fix FILENAME, use file_get_contents() 2019-01-25 12:23:47 +01:00
Dietmar Maurer af2fddea4f api2/node/dns.rs: implement concurrent update protection 2019-01-25 11:38:59 +01:00
Dietmar Maurer de6b0721fa pi2/node/dns.rs: return file digest 2019-01-25 11:03:41 +01:00
Dietmar Maurer 2296860027 tools.rs: move digest_to_hex() into tools 2019-01-25 10:58:28 +01:00
Dietmar Maurer 53157ca6cf tools.rs: implement file_get_contents() 2019-01-25 10:44:40 +01:00
Dietmar Maurer 46b79b9ee5 api2/node/dns.rs: improve dns api 2019-01-25 10:15:32 +01:00
Dietmar Maurer 332dcc2277 backup/chunk_store.rs: fix test case - use absolute path 2019-01-25 10:14:25 +01:00
Dietmar Maurer 8f973f8181 api2/node/dns.rs: implement resolv.conf parser 2019-01-24 14:59:40 +01:00
Dietmar Maurer 784252dbc5 backup/datastore.rs: use single lazy_static block 2019-01-24 14:58:47 +01:00
Dietmar Maurer e6ffeb918c api2/node/time.rs: implement set timezone 2019-01-24 12:05:06 +01:00
Dietmar Maurer cd8b91f78c api2/node/time.rs: add return schema 2019-01-24 11:07:11 +01:00
Dietmar Maurer 447787ab7c tools.rs: implement file_read_firstline 2019-01-24 10:43:30 +01:00
Dietmar Maurer 0463602a79 api2/node/time.rs: implement read api 2019-01-23 15:14:14 +01:00
Dietmar Maurer b2b3485d5f src/api2/node: start node configuration api 2019-01-23 13:09:17 +01:00
Dietmar Maurer d15009c0ce server/rest.rs: fake login cookie 2019-01-23 12:49:10 +01:00
Dietmar Maurer 248cb51862 add missing api2.rs 2019-01-22 13:56:27 +01:00
Dietmar Maurer 7e13b2d67f api2/subscription.rs: add subscription api class 2019-01-22 12:50:19 +01:00
Dietmar Maurer 576e3bf252 rename api3 back to api2
There is no real need to change the path, so using api2 we can reuse
all helpers (like tools from proxmox widget toolkit).
2019-01-22 12:10:38 +01:00
Dietmar Maurer 1adb353d6f lient/http_client.rs: simplify code 2019-01-22 10:36:04 +01:00
Dietmar Maurer 41c039e143 bin/proxmox-backup-client.rs: implement list command 2019-01-21 18:58:14 +01:00
Dietmar Maurer 1fdb4c6ffa client/http_client.rs: implement get, share common code 2019-01-21 18:56:48 +01:00
Dietmar Maurer 83dbd80bd8 api3/admin/datastore.rs: implement list backups 2019-01-21 11:22:55 +01:00
Dietmar Maurer 7ca80246ea backup/datastore.rs: use DateTime<Utc> to store backup time 2019-01-21 10:51:52 +01:00
Dietmar Maurer be0084b001 white space fix 2019-01-21 10:32:07 +01:00
Dietmar Maurer e25736b4c3 backup/datastore.rs: implement list_backups 2019-01-20 18:02:27 +01:00
Dietmar Maurer cce1676a9e tools.rs: use FnMut for scandir callback 2019-01-20 17:49:11 +01:00
Dietmar Maurer 443f3743bb tools.rs: new scandir() helper 2019-01-20 17:31:43 +01:00
Dietmar Maurer 68469eebb4 backup/chunk_store.rs: verify base path is absolute 2019-01-20 16:49:22 +01:00
Dietmar Maurer 059ca7c3a1 remove crate tokio-codec (seems to be part of tokio now) 2019-01-20 14:28:06 +01:00
Dietmar Maurer 8eeef8492a tools/wrapped_reader_stream.rs: allocate Vec<u8> for buffer 2019-01-20 11:01:18 +01:00
Dietmar Maurer ff8bdf3b64 tools/wrapped_reader_stream.rs: only implement Stream (without AsyncRead)
Looks more efficent ...
2019-01-20 10:41:21 +01:00
Dietmar Maurer 8e89d9cafe tools/wrapped_reader_stream.rs: use tokio_threadpool::blocking 2019-01-20 10:28:51 +01:00
Dietmar Maurer ce7ba139f1 catar: improve bash completion 2019-01-20 09:55:20 +01:00
Dietmar Maurer 29f34b8e1a /api3/admin/datastore.rs: add missing subdir to directory index 2019-01-20 09:47:32 +01:00
Dietmar Maurer 0b05fd5830 api3/admin/datastore/catar.rs: implement download 2019-01-20 09:39:32 +01:00
Dietmar Maurer 7f0d67cf79 tools/wrapped_reader_stream.rs: new helper class
Will use that to download catar files.
2019-01-20 09:38:28 +01:00
Dietmar Maurer 6a4c091616 api3/admin/datastore/catar.rs: start impl. download 2019-01-19 17:27:02 +01:00
Dietmar Maurer 50cfb695ae api/router.rs: rename ApiUploadMethod to ApiAsyncMethod
We can use this for uploads and downloads ...
2019-01-19 16:42:43 +01:00
Dietmar Maurer 379ea0edb6 Revert "/api/schema.rs: implement Schema::Option"
This reverts commit 0a35462c1e.

I am not sure this add much value, and the old approach needs
less memory. If we really need single optional values, we can still
implement such Option while keeping the hash based approach...
2019-01-19 12:53:32 +01:00
Dietmar Maurer 80f069656d Revert "api/schema.rs: avoid Option(Option( nesting"
This reverts commit ffdac1af01.
2019-01-19 12:52:51 +01:00
Dietmar Maurer ca3d861513 remove unused type PropertyMap 2019-01-18 17:54:06 +01:00
Dietmar Maurer ffdac1af01 api/schema.rs: avoid Option(Option( nesting 2019-01-18 17:49:19 +01:00
Dietmar Maurer 0a35462c1e /api/schema.rs: implement Schema::Option 2019-01-18 17:40:37 +01:00
Dietmar Maurer 728797d0c1 reduce compiler warnings 2019-01-18 16:50:15 +01:00
Dietmar Maurer 383e857749 move complete_file_name() helper into tools.rs 2019-01-18 13:42:52 +01:00
Dietmar Maurer 73e844dbfe bin/proxmox-backup-client.rs: improve file name completion 2019-01-18 13:40:05 +01:00
Dietmar Maurer 95cea65b04 backup/datastore.rs: list all index files using walkdir crate 2019-01-18 12:24:58 +01:00
Dietmar Maurer ff3d3100d4 backup/datastore.rs: try to create useful directory layout
store/type/ID/TIME/xxx.yyy
2019-01-18 12:01:37 +01:00
Dietmar Maurer 0d38dcb43c cleanup nodename() 2019-01-18 10:13:45 +01:00
Dietmar Maurer 74a69302a7 tools.rs: new helper nodename() 2019-01-18 09:58:15 +01:00
Dietmar Maurer 5a778d92b3 api3/admin/datastore.rs: rename parameter "name" to "store" 2019-01-18 08:33:11 +01:00
Dietmar Maurer 244d9b17a8 bin/proxmox-backup-client.rs: implement file name completions - first try ... 2019-01-17 14:24:20 +01:00
Dietmar Maurer 83bdac1e3b api3/admin/datastore/upload_catar.rs: verify content type ("application/x-proxmox-backup-catar") 2019-01-17 12:43:29 +01:00
Dietmar Maurer 06aeb76a5c client/catar_backup_stream.rs: remove debug code 2019-01-17 12:16:36 +01:00
Dietmar Maurer 0fe5d605e7 tools.rs: new helper required_string_param()
To extract parameters from Value.
2019-01-17 12:14:02 +01:00
Dietmar Maurer 0ee0ad5bf3 api/router.rs: return Result in upload handler 2019-01-17 12:03:38 +01:00
Dietmar Maurer 23bb8780d4 proxmox-backup-client: implement upload to server 2019-01-17 11:38:22 +01:00
Dietmar Maurer 597641fdd5 client/http_client.rs: new helper class 2019-01-17 11:38:03 +01:00
Dietmar Maurer 264f52cf70 api3/admin/datastore.rs: change api patch for upload_catar 2019-01-17 09:16:50 +01:00
Wolfgang Bumiller 37b98249f4 upload: don't return NotReady
We need to kick (poll) the stream's next element, so simply
reiterate, the try_read!() will then return NotReady from
the next stream item for us.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-16 15:17:26 +01:00
Wolfgang Bumiller 1dcd52e5df cleanup previous commit...
This kind of notation is weird...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-16 14:19:13 +01:00
Wolfgang Bumiller 6a50b77e72 listen on :: instead of 0.0.0.0
Since this supports both ipv6 & ipv4 unless v6only is
explicitly enabled.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-16 14:18:16 +01:00
Dietmar Maurer cf16af2ab3 server/rest.rs: correctly pass query/url parameters 2019-01-16 13:58:36 +01:00
Dietmar Maurer 2085142ed4 reduce compiler warnings 2019-01-16 10:19:49 +01:00
Dietmar Maurer e8edbbd49c client/catar_backup_stream.rs: new helper for catar uploads to server 2019-01-16 10:15:39 +01:00
Dietmar Maurer 150f1bd8f6 backup/datastore.rs: use Arc for chunk_store references 2019-01-15 12:36:16 +01:00
Dietmar Maurer 1629d2ad7b api3/admin/datastore/upload_catar.rs: implement upload future 2019-01-15 11:38:26 +01:00
Dietmar Maurer 7e21da6e23 api/router.rs: allow different types of api methods
Added a prototype for file/backup uploads.
2019-01-14 12:26:04 +01:00
Dietmar Maurer b41d1aab8c catar: define all feature flags 2019-01-12 16:49:02 +01:00
Dietmar Maurer 4c0fd4871e catar/encoder.rs: allow to pass list of devices
We can use this to implement the --one-file-system like options. This
is a bit more convenient, because this way we can select to include
multiple devices (which is required by container backups).
2019-01-12 15:43:20 +01:00
Dietmar Maurer a8a0495612 catar/encoder.rs: disable backup of virtual file systems 2019-01-12 11:56:53 +01:00
Dietmar Maurer d7bfac8605 catar/encoder.rs: only test fat attribute on MSDOS and FUSE file systems 2019-01-12 10:28:26 +01:00
Dietmar Maurer 13d98013b2 /catar/encoder.rs: do not store data from virtual file systems 2019-01-12 10:20:08 +01:00