Wolfgang Bumiller
d18292192d
bump proxmox-api-macro to 1.0.1-1
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:51:35 +02:00
Wolfgang Bumiller
5988a1adf1
drop automatically_derived attribute for now
...
new rustc seems to *sometimes* complain about it
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:49:11 +02:00
Wolfgang Bumiller
f63ce12b66
lang: prepare c_str for const fns with 1.56
...
provides an api compatible const-fn-compatible c_str
alternative working on 1.56
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:29:03 +02:00
Wolfgang Bumiller
8f89f9ad60
lang: get offsetof const fn ready
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:14:25 +02:00
Wolfgang Bumiller
af33a97547
lang: deprecate ops::ControlFlow
...
as we now have rustc 1.55
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:13:59 +02:00
Wolfgang Bumiller
4ccd6256a8
update proxmox-http to 0.5 for the split
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 12:34:14 +02:00
Wolfgang Bumiller
336dab0177
update proxmox crate to the current split
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 12:34:14 +02:00
Wolfgang Bumiller
09046671ed
update to first proxmox crate split
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 11:58:49 +02:00
Wolfgang Bumiller
1d24555b28
drop u2f-api file
...
used to be used by examples at some point
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 11:39:59 +02:00
Wolfgang Bumiller
f35dbbd651
add proxmox-section-config crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 11:39:59 +02:00
Wolfgang Bumiller
41f3fdfeb9
add proxmox-schema and proxmox-router crates
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 11:39:59 +02:00
Wolfgang Bumiller
01a8b6f1bf
add proxmox-io crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 10:07:53 +02:00
Wolfgang Bumiller
91f59f9f59
add proxmox-lang crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 15:22:17 +02:00
Wolfgang Bumiller
9b6fe4aceb
add proxmox-time crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 15:22:17 +02:00
Wolfgang Bumiller
7db0a3c6df
add proxmox-borrow crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 15:22:17 +02:00
Wolfgang Bumiller
bd67ccc1b3
add proxmox-uuid crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 15:22:17 +02:00
Wolfgang Bumiller
77dc52c047
add proxmox-tfa crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 15:22:17 +02:00
Wolfgang Bumiller
2859858f59
fix systemd::escape_unit's hex encoding
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 15:22:17 +02:00
Wolfgang Bumiller
6ad1bcaf89
bump proxmox dependency to 0.14.0 and proxmox-http to 0.5.0
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 11:18:22 +02:00
Dominik Csapak
fb6823b54b
rest-server: add cleanup_old_tasks
...
this is a helper that removes task log files that are not referenced
by the task archive anymore
it gets the oldest task archive file, gets the first endtime (the
oldest) and removes all files in the taskdir where the mtime is older
than that
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-10-08 06:38:52 +02:00
Wolfgang Bumiller
b89c56b96e
start checklist for adding crates in README.rst
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-06 10:37:17 +02:00
Dietmar Maurer
3ffe2ebc64
proxmox-rest-server: use new ServerAdapter trait instead of callbacks
...
Async callbacks are a PITA, so we now pass a single trait object which
implements check_auth and get_index.
2021-10-05 11:13:10 +02:00
Dietmar Maurer
2c09017045
proxmox-rest-server: pass owned RestEnvironment to get_index
...
This way we avoid pointers with lifetimes.
2021-10-05 11:12:53 +02:00
Dietmar Maurer
591a32ecd4
proxmox-rest-server: cleanup, access api_auth using a method
2021-10-05 11:12:53 +02:00
Wolfgang Bumiller
f189895cef
fix deprecated use of std::u16 module
...
integer primitive type modules are deprecated, use
associated constants instead
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-04 15:03:50 +02:00
Thomas Lamprecht
4348c807f7
rest: daemon: group systemd FFI together
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-02 11:45:34 +02:00
Thomas Lamprecht
62b226e9c4
rest: daemon: sd notify: code cleanup
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-02 11:45:34 +02:00
Thomas Lamprecht
7fac98519c
rest: daemon: sd notify barrier: avoid barging in between SystemdNotify enum and systemd_notify
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-02 11:45:34 +02:00
Thomas Lamprecht
83f15413fd
rest: daemon: sd notify barrier: allow caller to set timeout
...
else it's rather to subtle and not a nice interface considering that
we only want to have a thin wrapper for sd_notify_barrier..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-02 11:44:20 +02:00
Thomas Lamprecht
947f4c78a7
rest: daemon: comment why using a systemd barrier is important for main PID handover
...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-02 11:44:20 +02:00
Dominik Csapak
5027727fc5
rest-server/daemon: use sd_notify_barrier for service reloading
...
until now, we manually polled the systemd service state during a reload
so that the sd_notify messages get processed in the correct order
(RELOAD(old) -> MAINPID(old) -> READY(new))
with systemd >= 246 there is now 'sd_notify_barrier' which
blocks until systemd processed all prior messages
with that change, the daemon does not need to know the service name anymore
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-02 11:44:20 +02:00
Dietmar Maurer
89766c4f95
proxmox-rest-server: make get_index async
2021-10-01 09:38:10 +02:00
Dietmar Maurer
58a6e5f512
proxmox-rest-server: add comment why ApiService needs to be 'pub'
2021-10-01 08:35:51 +02:00
Dietmar Maurer
2b023101f7
proxmox-rest-server: make check_auth async
2021-10-01 07:53:59 +02:00
Dietmar Maurer
a6c0ec35a3
proxmox-rest-server: fix spelling errors
2021-10-01 06:43:30 +02:00
Dietmar Maurer
be98d3156d
proxmox-rest-server: improve ApiService docs
2021-09-30 17:18:47 +02:00
Dietmar Maurer
58eba821e6
proxmox-rest-server: start module docs
2021-09-30 13:49:29 +02:00
Dietmar Maurer
ad449a5780
rename CommandoSocket to CommandSocket
2021-09-30 12:52:35 +02:00
Wolfgang Bumiller
249aae1f05
drop fd_change_cloexec from proxmox-rest-server
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-09-30 12:43:22 +02:00
Dietmar Maurer
6d4e47fb09
proxmox-rest-server: improve docs
...
And rename enable_file_log to enable_access_log.
2021-09-30 12:29:15 +02:00
Dietmar Maurer
9cb2c97c77
proxmox-rest-server: improve docs
...
And renames abort_worker_async to abort_worker_nowait (avoid confusion,
because the function itself is not async).
2021-09-30 10:51:41 +02:00
Dietmar Maurer
50c62be82c
proxmox-rest-server: cleanup FileLogger docs
2021-09-30 10:51:31 +02:00
Dietmar Maurer
f23aeff910
cleanup: move use clause to top
2021-09-30 08:42:37 +02:00
Dietmar Maurer
2ed2c0334c
proxmox-rest-server: allow to catch SIGINT and SIGHUP separately
...
And make ServerState private.
2021-09-30 08:41:30 +02:00
Dietmar Maurer
93802ec2ef
proxmox-rtest-server: make Reloader and Reloadable private
2021-09-30 07:44:19 +02:00
Dietmar Maurer
abfac6738c
proxmox-rest-server: improve logging
...
And rename server_state_init() into catch_shutdown_and_reload_signals().
2021-09-29 14:48:46 +02:00
Dietmar Maurer
5b72478077
proxmox-rest-server: avoid useless call to request_shutdown
...
Also avoid unsafe code.
2021-09-29 14:37:07 +02:00
Dietmar Maurer
aedc1db9e2
daemon: simlify code (make it easier to use)
2021-09-29 12:04:48 +02:00
Dietmar Maurer
a8c75df695
cleanup: make BoxedStoreFunc private
...
There is no need to export this type.
2021-09-29 09:55:43 +02:00
Dominik Csapak
15dcfbf162
examples: add example for a simple rest server with a small api
...
show how to generally start a daemon that serves a rest api + index page
api calls are (prefixed with either /api2/json or /api2/extjs):
/ GET listing
/ping GET returns "pong"
/items GET lists existing items
POST lets user create new items
/items/{id} GET returns the content of a single item
PUT updates an item
DELETE deletes an item
Contains a small dummy user/authinfo
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-29 09:48:47 +02:00