-
Notifications
You must be signed in to change notification settings - Fork 4
NixOS Module Configuration #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d0a282d to
2bcebd0
Compare
|
This PR isn't very clear. This is related to the service configuration using Also, do we have a specification for this anywhere? is #143 related? |
|
@brynblack please make sure you got an issue in |
|
Ok, so after setting up the password file and restarting the service it just works. Running agent status works too. so its using the correct default path. Note, that the service is running in root, so I have to sodo the command to have it get the correct default path. That's not ideal right now. So there are a few things I'd like to point out.
|
|
Not a problem with the service per se, but the agent still has issues with connections dropping out. I can trigger this by disabling wifi on the laptop. I thought I had fixed this in quic where send failures are thrown back to the connection making the send. The error codes it handles this way is very focused so it may be a new error code which is getting bubbled up to an internal error in stead. I'll need to look into this. |
|
This needs to be rock solid. We are going live for the next application.
6 Mar 2024 16:51:16 Brian Botha ***@***.***>:
…
Not a problem with the service per se, but the agent still has issues with connections dropping out.
*Mar 07 09:35:59 matrix-precision-3480-syzygy polykey[44478]: WARN:polykey.PolykeyAgent:Moving Task v0pf803kstlo0180keei7clko5c from Active to Queued
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: (node:44478) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: (Use `node --trace-deprecation ...` to show where the warning was created)
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: WARN:polykey.PolykeyAgent.NodeManager:Duplicate refreshBucket task was found for bucket 255, cancelling
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: WARN:polykey.PolykeyAgent.NodeManager:Duplicate refreshBucket task was found for bucket 254, cancelling
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: pid 44478
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: nodeId vu5gloq1a1abnf07q47vl74seln1haf5leeeck8dah58d198mf750
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: clientHost ::1
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: clientPort 41049
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: agentHost ::
Mar 07 09:36:01 matrix-precision-3480-syzygy polykey[44478]: agentPort 36307
Mar 07 09:40:12 matrix-precision-3480-syzygy polykey[44478]: ErrorQUICClientInternal: Failed to send data on the QUICSocket
Mar 07 09:40:12 matrix-precision-3480-syzygy systemd[1]: polykey.service: Main process exited, code=exited, status=70/SOFTWARE
Mar 07 09:40:12 matrix-precision-3480-syzygy systemd[1]: polykey.service: Failed with result 'exit-code'.
Mar 07 09:40:12 matrix-precision-3480-syzygy systemd[1]: polykey.service: Consumed 35.082s CPU time, 315.7M memory peak, 0B memory swap peak, no IO, received 154.9K IP traffic, sent 270.3K IP traffic.
*
I can trigger this by disabling wifi on the laptop.
I thought I had fixed this in quic where send failures are thrown back to the connection making the send. The error codes it handles this way is very focused so it may be a new error code which is getting bubbled up to an internal error in stead. I'll need to look into this.
—
Reply to this email directly, view it on GitHub[#138 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAE4OHKUBN3MCVNSC4MB4DTYW6MWHAVCNFSM6AAAAABDYO2HZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBRHE4TANJXGA].
You are receiving this because you commented.
[Tracking image][https://github.com/notifications/beacon/AAE4OHLMP7PVR7NR4DSM47LYW6MWHA5CNFSM6AAAAABDYO2HZOWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTWELDKU.gif]
|
1a1a255 to
638d394
Compare
a743dbd to
af18f72
Compare
|
I'm going to do another review of this in a sec. Since I'm not directly working on this I usually don't have a full picture of all the decisions made and what the final constraints are. It's clear that what we thought was needed has evolved over time and we've made some changes to that. But I don't think you've updated the spec in #143 so I don't have a clear reference to todo to compare against for working out if this is done or not. Remember that we refer to the spec while implementing, reviewing and even much later when writing up the R&D report. So it needs to be updated as the constraints change. |
I want to just add on to this, there never really was a specification issue per say pertaining to the entire specification of this, issue #143 was more related to the secret zero problem itself. I have instead mostly been using this PR as the specification. |
|
Something else to note I noticed CI has been failing, something to do with the identities and discovering gestalts by node. Investigating. |
|
@brynblack can you update the spec - and describe at a high level what this will do - as well as provide excalidraw diagram. |
tegefaulkes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using mkOptional for required fields seems weird. Is there any alternative?
Otherwise it looks fine to my un-trained eye. So long as everything works with manual testing then I think we're good.
Where exactly is this? Are you referring to |
tegefaulkes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if it works and you think it's good then I think we're good.
|
Needs to be made ready to merge @tegefaulkes. |
|
This must start being used now. I'm reviewing the implementation along with the new platform profiles in our Orchestrator. |
|
Working on this now. It just needs review comments addressed and then merge? |
feat: initial module feat: added service wip: changed from programs to services wip: removed ExecStop wip: changing from /root/... to /run/keys/... for secret zero wip: module configuration refactoring feat: improved module configuration feat: added recovery option feat: added -dsf CLI option fix: ignore bootstarp failure fix: renamed option to recoveryCodeOutFile fix: minor fixes Refactored code and clarified agent service intentions fix: removed defaults feat: added file permissions checker
- Fixed importing `* as fs` to just `fs`. - Fixed descriptions of the recovery code file options. Made the distinction between them clear.
5d34165 to
02de5c6
Compare
|
Rebased on staging. |
|
@CryptoTotalWar the above spec would need to be adapted for the Polykey-Docs too. It would come under deployment usage or service usage. |
@CMCDragonkai Polykey-Docs Issue created to track documentation request. MatrixAI/Polykey-Docs#40 |
Description
This PR adds a module to Polykey-CLI that allows for the automated activation of the Polykey Agent through a
systemdservice, both in user-space and system-wide space.Two module configurations are provided, both a
programsmodule and aservicesmodule. Fundamentally, both have the same configuration options. The main difference here is that the programs module gives each user their own unit service that can be enabled on a per-user basis, while the system service can be managed by a root user, or members of the grouppolykey(a lot like Docker daemon).At the moment, the module will require the user to provide a path to the password/recovery-code files, and will otherwise fail if not provided.
In the future by default, the system level service will read from a directory under
/var/lib/polykeyfor the relevant password and recovery code files, and under the user-level service, will read from~/.config/polykey. These paths may be overwritten in the module configuration.Issues Fixed
flake.nix#143Tasks
Final checklist