Commit ba784350 authored by Hasang Cho's avatar Hasang Cho
Browse files

feat(cli/inbox): implement actor customizations for inbox command

- Use --actor-name and --actor-summary values in Application object
- Add actorOptions global object to store custom values
- Replace hardcoded actor name and summary with dynamic values
parent 1437627f
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -53,6 +53,11 @@ export const TunnelConfig = {
  },
} as const;

const actorOptions = {
  name: "Fedify Ephemeral Inbox",
  summary: "An ephemeral ActivityPub inbox for testing purposes.",
};

export const command = new Command()
  .description(
    "Spins up an ephemeral server that serves the ActivityPub inbox with " +
@@ -87,7 +92,10 @@ export const command = new Command()
    "Customize the actor description.",
    { default: "An ephemeral ActivityPub inbox for testing purposes." },
  )
  .action(async (options: InboxOptions) => {
  .action(async (options) => {
    actorOptions.name = options.actorName;
    actorOptions.summary = options.actorSummary;

    const spinner = ora({
      text: "Spinning up an ephemeral ActivityPub server...",
      discardStdin: false,
@@ -168,8 +176,8 @@ federation
    return new Application({
      id: ctx.getActorUri(identifier),
      preferredUsername: identifier,
      name: "Fedify Ephemeral Inbox",
      summary: "An ephemeral ActivityPub inbox for testing purposes.",
      name: actorOptions.name,
      summary: actorOptions.summary,
      inbox: ctx.getInboxUri(identifier),
      endpoints: new Endpoints({
        sharedInbox: ctx.getInboxUri(),