-
Notifications
You must be signed in to change notification settings - Fork 3
Connect inbox POST handling to feder-core for supported Follow activities
#37
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d0ba5d9
Refactor runtime server into reusable crate
sij411 4c46310
Add HTTP inbox route skeleton
sij411 4eab215
Set default body limit to 1MB
sij411 15c0b73
Handle received follow acitivity
sij411 22ceb3f
Add inbox follow core and rejection tests
sij411 28f0957
Add inbox unsigned auth policy
sij411 d5428f8
Set the demo server to explicit insecure unsigned inbox mode after ad…
sij411 30939a6
Fix document since inbox handling is implemented
sij411 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,54 +1,49 @@ | ||
| Feder Runtime Server | ||
| ==================== | ||
|
|
||
| Runnable server runtime for Feder on standard operating systems. | ||
|
|
||
| This crate currently starts a local development server with one configured | ||
| actor and a health check endpoint. ActivityPub discovery, inbox handling, | ||
| storage, signing, and delivery are intentionally left to later issues. | ||
|
|
||
|
|
||
| Run | ||
| --- | ||
|
|
||
| On Unix shells: | ||
|
|
||
| ~~~~ sh | ||
| RUST_LOG=info cargo run -p feder-runtime-server | ||
| Reusable Axum/Tokio server integration for Feder on standard operating | ||
| systems. | ||
|
|
||
| This crate builds an Axum router from caller-provided runtime configuration. | ||
| It provides a health check endpoint, WebFinger discovery, and a local actor | ||
| route. The caller chooses concrete bind addresses, actor IRIs, usernames, and | ||
| handle hosts. | ||
|
|
||
| ActivityPub inbox handling for supported Follow activities is included. Storage, | ||
| signature verification, and delivery are intentionally left to later issues. | ||
|
|
||
|
|
||
| Example | ||
| ------- | ||
|
|
||
| ~~~~ rust | ||
| use feder_runtime_server::{InboxAuthPolicy, RuntimeConfig, build_router}; | ||
|
|
||
| let config = RuntimeConfig { | ||
| bind: "127.0.0.1:3000".parse().expect("valid bind address"), | ||
| actor_id: "http://127.0.0.1:3000/users/alice" | ||
| .parse() | ||
| .expect("valid actor IRI"), | ||
| inbox: "http://127.0.0.1:3000/users/alice/inbox" | ||
| .parse() | ||
| .expect("valid inbox IRI"), | ||
| outbox: "http://127.0.0.1:3000/users/alice/outbox" | ||
| .parse() | ||
| .expect("valid outbox IRI"), | ||
| username: "alice".to_string(), | ||
| handle_host: "127.0.0.1:3000".to_string(), | ||
| inbox_auth_policy: InboxAuthPolicy::AllowUnsignedInsecureDev, | ||
| }; | ||
|
|
||
| let app = build_router(config); | ||
| ~~~~ | ||
|
|
||
| On PowerShell: | ||
|
|
||
| ~~~~ powershell | ||
| $env:RUST_LOG = "info"; cargo run -p feder-runtime-server | ||
| ~~~~ | ||
|
|
||
| On cmd.exe: | ||
|
|
||
| ~~~~ bat | ||
| set RUST_LOG=info && cargo run -p feder-runtime-server | ||
| ~~~~ | ||
| Demo | ||
| ---- | ||
|
|
||
| The default local actor is: | ||
|
|
||
| ~~~~ text | ||
| http://127.0.0.1:3000/users/alice | ||
| ~~~~ | ||
|
|
||
| The server listens on: | ||
|
|
||
| ~~~~ text | ||
| 127.0.0.1:3000 | ||
| ~~~~ | ||
|
|
||
| Check the process: | ||
| A runnable single-user demo lives in `examples/single-user-server`: | ||
|
|
||
| ~~~~ sh | ||
| curl -i http://127.0.0.1:3000/healthz | ||
| ~~~~ | ||
|
|
||
| Expected response: | ||
|
|
||
| ~~~~ text | ||
| HTTP/1.1 204 No Content | ||
| RUST_LOG=info cargo run -p single-user-server | ||
| ~~~~ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.