Comments (3)
Current situation of system info related logic
Currently, due to various historical reasons, the following system information is involved in the entire cyfs-services
1. stack.util.get_system_info logic
Support the same zone query system info, using the global single instance SYSTEM_INFO_MANAGER
to get the system information
CYFS/src/component/cyfs-util/src/util/system_info.rs
Lines 6 to 37 in 3cd354a
2. ood-control's system info logic
This logic is consistent with the above, both use the global singleton SYSTEM_INFO_MANAGER
CYFS/src/service/ood-control/src/http_server.rs
Lines 178 to 189 in 3cd354a
3. ood-control's check logic
It is used to check whether the current stack has bound the identity(device.desc & device.sec), and return some information about the current system, but the difference is that a new structure is used to express the information
CYFS/src/service/ood-control/src/request.rs
Lines 6 to 18 in 3cd354a
It partially uses the fields in the system info, but does not use the SYSTEM_INFO_MANAGER global singleton, and there are some fields and the above two points in the system info is not the same
Solutions to consider
So from the above logic can be seen, if we need to support external custom information, then it is better to improve the implementation of the global singleton SYSTEM_INFO_MANAGER
, users can report part of the custom information, so consider the following changes may be involved
1. SYSTEM_INFO_MANAGER support for adding custom information
When used externally, the existing fields in the custom information will take precedence over the fields generated by the internal logic
2. improve the device_info returned by the check logic of ood-control
device_info involves system info related fields, which also need to follow SYSTEM_INFO_MANAGER
3. SYSTEM_INFO_MANAGER
return system info need to add some fields
Add the fields in device_info that are available now but not in system_info
4. Support external update, the following two interfaces need to add the corresponding update logic
a. stack.util.set_system_info
b. set_system_info of ood-control component
5. Permission issues
Who has permission to update this information? Theoretically, only the administrator can
a. stack.util.set_system_info requires the system dec identity of the same zone's device
b. ood-control needs to be cyfs://static
or internal to the browser's plugin to be called
from cyfs.
The user-defined system information part of the fields, we can consider two approaches
-
Through static configuration method
For example, in{cyfs}/etc/system_info
, configure custom fields, this scale can be used for fixed information, because the configuration file is generally pre-installed, no subsequent changes; the disadvantage is that it can only be used to configure fixed fields in system info, such as hardware information, etc., while some dynamic fields are difficult to configure with this mode -
Through the interface
The advantage of this mode is the greater freedom, and for some real-time refresh information inside the system info, it can also be updated in a timely manner; the disadvantage is that additional RPC calls are required to update the program or web page. Operation
At present, according to the product feedback on the use of scenarios, the second mode can be supported first, and then consider adding the first mode as needed
from cyfs.
The user-defined system information part of the fields, we can consider two approaches
- Through static configuration method
For example, in{cyfs}/etc/system_info
, configure custom fields, this scale can be used for fixed information, because the configuration file is generally pre-installed, no subsequent changes; the disadvantage is that it can only be used to configure fixed fields in system info, such as hardware information, etc., while some dynamic fields are difficult to configure with this mode- Through the interface
The advantage of this mode is the greater freedom, and for some real-time refresh information inside the system info, it can also be updated in a timely manner; the disadvantage is that additional RPC calls are required to update the program or web page. OperationAt present, according to the product feedback on the use of scenarios, the second mode can be supported first, and then consider adding the first mode as needed
Already based on mode 2, add update_system_info
related implementation
The sample code used is as follows
CYFS/src/tests/cyfs-stack-test/src/case/util.rs
Lines 204 to 222 in 9eaf33f
from cyfs.
Related Issues (20)
- After App-manager restarted the DEC APP installation process, the DEC APP was not started HOT 3
- Linux app-manager restore installation failed when app-manager breaks down when DEC APP is running "npm i" HOT 4
- Optimize service publishing process HOT 1
- How to config handler`s filter? HOT 3
- If ACL Handler response error,satck.root_state_accessor_stub.get_object_by_path() will not return HOT 8
- The `ping` with `sn` is stopped? HOT 2
- Systemctl status of ood-daemon.service is error HOT 8
- Create restore task not save archive file to disk HOT 1
- Connection problem between runtime and gateway HOT 3
- Stable sort for HashSet HOT 4
- Only web dec_app install failed HOT 1
- Backup service supports conditional filtering of key data HOT 2
- Release schedule for 84
- Test schedule for 84 Release
- Problems with ood-daemon restore backup data HOT 3
- Query task group state failed in rust. HOT 3
- Method to get an object from MetaChain by body-hash to get a specific version. HOT 1
- Unsound `transmute` in safe method
- `ChunkId::new` panic with misaligned pointer dereference HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cyfs.