-
-
Notifications
You must be signed in to change notification settings - Fork 98
Update @fedify/cli for Optique 1.0.0 #677
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
+721
−488
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c7c209b
Support Optique 1.0 in the CLI
dahlia 689d861
Cover Optique config loading in CLI tests
dahlia 4b28b9a
Await async CLI command handlers
dahlia 6b2689e
Keep CLI tests runnable across runtimes
dahlia fd47b77
Tighten review follow-ups
dahlia 86a1f54
Polish inbox defaults and test wording
dahlia 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
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| import { bindConfig } from "@optique/config"; | ||
| import { | ||
| command, | ||
| constant, | ||
| group, | ||
| merge, | ||
| message, | ||
| multiple, | ||
| object, | ||
| option, | ||
| string, | ||
| } from "@optique/core"; | ||
| import { configContext } from "../config.ts"; | ||
| import { createTunnelOption } from "../options.ts"; | ||
|
|
||
| const DEFAULT_EPHEMERAL_INBOX_NAME = "Fedify Ephemeral Inbox"; | ||
| const DEFAULT_EPHEMERAL_INBOX_SUMMARY = | ||
| "An ephemeral ActivityPub inbox for testing purposes."; | ||
|
|
||
| export const inboxCommand = command( | ||
| "inbox", | ||
| merge( | ||
| object("Inbox options", { | ||
| command: constant("inbox"), | ||
| follow: bindConfig( | ||
| multiple( | ||
| option("-f", "--follow", string({ metavar: "URI" }), { | ||
| description: | ||
| message`Follow the given actor. The argument can be either an actor URI or a handle. Can be specified multiple times.`, | ||
| }), | ||
| ), | ||
| { | ||
| context: configContext, | ||
| key: (config) => config.inbox?.follow ?? [], | ||
| default: [], | ||
| }, | ||
| ), | ||
| acceptFollow: bindConfig( | ||
| multiple( | ||
| option("-a", "--accept-follow", string({ metavar: "URI" }), { | ||
| description: | ||
| message`Accept follow requests from the given actor. The argument can be either an actor URI or a handle, or a wildcard (${"*"}). Can be specified multiple times. If a wildcard is specified, all follow requests will be accepted.`, | ||
| }), | ||
| ), | ||
| { | ||
| context: configContext, | ||
| key: (config) => config.inbox?.acceptFollow ?? [], | ||
| default: [], | ||
| }, | ||
| ), | ||
| actorName: bindConfig( | ||
| option("--actor-name", string({ metavar: "NAME" }), { | ||
| description: message`Customize the actor display name.`, | ||
| }), | ||
| { | ||
| context: configContext, | ||
| key: (config) => | ||
| config.inbox?.actorName ?? DEFAULT_EPHEMERAL_INBOX_NAME, | ||
| default: DEFAULT_EPHEMERAL_INBOX_NAME, | ||
| }, | ||
| ), | ||
| actorSummary: bindConfig( | ||
| option("--actor-summary", string({ metavar: "SUMMARY" }), { | ||
| description: message`Customize the actor description.`, | ||
| }), | ||
| { | ||
| context: configContext, | ||
| key: (config) => | ||
| config.inbox?.actorSummary ?? | ||
| DEFAULT_EPHEMERAL_INBOX_SUMMARY, | ||
| default: DEFAULT_EPHEMERAL_INBOX_SUMMARY, | ||
| }, | ||
| ), | ||
| authorizedFetch: bindConfig( | ||
| option( | ||
| "-A", | ||
| "--authorized-fetch", | ||
| { | ||
| description: | ||
| message`Enable authorized fetch mode. Incoming requests without valid HTTP signatures will be rejected with 401 Unauthorized.`, | ||
| }, | ||
| ), | ||
| { | ||
| context: configContext, | ||
| key: (config) => config.inbox?.authorizedFetch ?? false, | ||
| default: false, | ||
| }, | ||
| ), | ||
| }), | ||
| group("Tunnel options", createTunnelOption("inbox")), | ||
| ), | ||
| { | ||
| brief: message`Run an ephemeral ActivityPub inbox server.`, | ||
| description: | ||
| message`Spins up an ephemeral server that serves the ActivityPub inbox with a one-time actor, through a short-lived public DNS with HTTPS. You can monitor the incoming activities in real-time.`, | ||
| }, | ||
| ); | ||
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.