Commit Graph

2871 Commits

Author SHA1 Message Date
Dietmar Maurer
8cb07ac905 bump proxmox version to 0.3.8-1 2020-09-14 13:41:14 +02:00
Dietmar Maurer
c295aa961c remove chrono dependency and related code 2020-09-14 13:38:53 +02:00
Dietmar Maurer
3efc4d244b check year in epoch_to_rfc3339, new helpers strftime_local and strftime_utc 2020-09-14 12:43:49 +02:00
Dietmar Maurer
557cce7ae0 new helpers epoch_i64 and epoch_f64
These helpers use rust std SystemTime. Removed the libc time() binding.
2020-09-14 10:45:34 +02:00
Dietmar Maurer
e3b62ae3b2 proxmox/src/tools/serde.rs: fix epoch_as_rfc3339 doctest 2020-09-13 16:20:56 +02:00
Dietmar Maurer
99351a7752 bump proxmox version to 0.3.7 2020-09-13 16:16:37 +02:00
Dietmar Maurer
b975317a47 fix epoch_as_rfc3339 serializer 2020-09-13 16:13:19 +02:00
Dietmar Maurer
d42fc47c4d src/tools/serde.rs: implement epoch_as_rfc3339 serializer 2020-09-13 11:52:46 +02:00
Dietmar Maurer
b164904a4f src/tools/time.rs: rename rfc_3339 to rfc3339 2020-09-13 11:42:15 +02:00
Dietmar Maurer
317d1a78fb src/tools/email.rs: avoid chrono dependency 2020-09-13 11:31:31 +02:00
Dietmar Maurer
8405dd740c src/tools/time.rs: add parse_rfc_3339 2020-09-13 11:09:20 +02:00
Dietmar Maurer
11ef587edd src/tools/time/tm_editor.rs: copied from proxmox backup 2020-09-13 11:02:52 +02:00
Dietmar Maurer
3aa8e22b0c proxmox/src/tools/time.rs: add epoch_to_rfc_3339 2020-09-13 10:51:27 +02:00
Dietmar Maurer
fb4e426a0a proxmox/src/tools/time.rs: fix previous commit 2020-09-12 15:07:12 +02:00
Dietmar Maurer
5eb5b21044 bump proxmox version to 0.3.6-1 2020-09-12 15:01:46 +02:00
Dietmar Maurer
9f837a4333 proxmox/src/tools/time.rs: add strftime bindings 2020-09-12 14:59:31 +02:00
Fabian Grünbichler
28aef354ca don't truncate DateTime nanoseconds
where we don't care about them anyway..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-09-11 15:48:10 +02:00
Thomas Lamprecht
1b79d5d5a5 ui: add translation support
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-08 08:54:33 +02:00
Thomas Lamprecht
7917e89426 tools: rename extract_auth_cookie to extract_cookie
It does nothing specific to authentication..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-09-08 08:54:33 +02:00
Dietmar Maurer
dcf220db80 bump proxmox version to 0.3.5-1 2020-09-04 06:37:16 +02:00
Dominik Csapak
db1da0f645 tools/time: give tm struct as mut reference
mktime/timegm can modify the timestruct (to normalize the time, e.g.
convert the january 40 to february 9)

to use that feature, we have to give a mutable reference, else the
struct will be copied and the original left untouched

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-09-04 06:27:58 +02:00
Wolfgang Bumiller
c0d2165d75 and run rustfmt over another big chunk of code
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-28 08:59:26 +02:00
Wolfgang Bumiller
ba7c389142 more formatting fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-28 08:56:54 +02:00
Wolfgang Bumiller
bbc94222f5 formatting fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-28 08:55:16 +02:00
Dietmar Maurer
001f2525fa bump proxmox to 0.3.4-1 2020-08-28 06:25:36 +02:00
Hannes Laimer
66004f22c6 email: add small function to send multi-part emails using sendmail
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2020-08-28 06:23:54 +02:00
Wolfgang Bumiller
3c8cb5129e replace and remove old ticket functions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-12 14:28:21 +02:00
Wolfgang Bumiller
906ea7a45b introduce Username, Realm and Userid api types
and begin splitting up types.rs as it has grown quite large
already

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-10 12:05:01 +02:00
Wolfgang Bumiller
aef02efce3 bump proxmox to 0.3.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-10 11:30:49 +02:00
Wolfgang Bumiller
6cd1aac558 add serde forwarding convenience macros
* forward_deserialize_to_from_str
* forward_serialize_to_display

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-10 09:38:50 +02:00
Wolfgang Bumiller
6da4dd5bbb clippy: use matches for if let -> bool
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-04 16:24:13 +02:00
Wolfgang Bumiller
66ae742cb3 bump proxmox dep to 0.3.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-04 11:12:11 +02:00
Wolfgang Bumiller
9da029a8c3 tools/mod.rs: sort modules
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-04 10:29:03 +02:00
Wolfgang Bumiller
570f89f6a5 add lock_file and open_file_locked
to proxmox::tools::fs

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-04 09:31:15 +02:00
Wolfgang Bumiller
401ba6f927 add proxmox::sys::timer module (moved from proxmox-backup)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-04 09:27:59 +02:00
Wolfgang Bumiller
d34e00af0c move uuid serde code to uuid.rs
And avoid the temporary string allocation where possible.

Implementing foreign traits in external modules is bad
practice. The `serde` module is for implementations which
deviate from the expected default.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-08-03 11:25:25 +02:00
Dietmar Maurer
f2230ad2ab bump version to 0.3.1-1 2020-08-02 11:52:25 +02:00
Dietmar Maurer
a7390a3d0e Uuid: implement Serlialize/Deserialize 2020-08-02 11:50:26 +02:00
Wolfgang Bumiller
df9109d493 bump proxmox to 0.3, cleanup http_err macro usage
Also swap the order of a couple of `.map_err().await` to
`.await.map_err()` since that's generally more efficient.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-29 09:38:36 +02:00
Wolfgang Bumiller
c8e6462cc7 bump proxmox version to 0.3.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-29 09:37:02 +02:00
Wolfgang Bumiller
7d3ffe9b8d add http_bail macro
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-29 09:34:25 +02:00
Wolfgang Bumiller
c4febcd773 http_err macro: imply format!()
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-29 09:26:22 +02:00
Wolfgang Bumiller
f165dee496 switch to using mod.rs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-28 15:11:38 +02:00
Stefan Reiter
0c868c7dd9 fix #2882: correctly parse optional fields from mountinfo
As per the linux kernel documentation[0], the "optional fields" (called
"tags" in our parser) are not comma-separated, but are a variable number
(0 or more) of space-separated fields, always followed by a dash to mark
the end.

Fix the /proc/<pid>/mountinfo parser to correctly parse these and add
test cases (l3 is the line that produced the original warning from the
bug report).

[0] https://www.kernel.org/doc/html/latest/filesystems/proc.html#proc-pid-mountinfo-information-about-mounts

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2020-07-28 07:20:43 +02:00
Thomas Lamprecht
67294d4796 followup: server/state: rename task_count to internal_task_count
so that the relation with spawn_internal_task is made more clear

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-24 12:11:39 +02:00
Dominik Csapak
8588c41f3c server/state: add spawn_internal_task and use it for websockets
is a helper to spawn an internal tokio task without it showing up
in the task list

it is still tracked for reload and notifies the last_worker_listeners

this enables the console to survive a reload of proxmox-backup-proxy

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-24 11:17:33 +02:00
Dominik Csapak
054951682d server/rest: add console to index
register the console template and render it when the 'console' parameter
is given

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-23 12:06:38 +02:00
Thomas Lamprecht
459a99d150 bump proxmox version to 0.2.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-07-23 12:04:12 +02:00
Dominik Csapak
9993f4d099 server/config: add mechanism to update template
instead of exposing handlebars itself, offer a register_template and
a render_template ourselves.

render_template checks if the template file was modified since
the last render and reloads it when necessary

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-07-23 11:55:00 +02:00
Dominik Csapak
78a0a0ee1d proxmox/tools/byte_buffer: improve read_from example
'norun' was not a valid attribute, so cargo doc ignored it completely

instead, write a proper example that can be compiled

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-17 14:35:02 +02:00