Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ recipients, so cron can call it:

```sh
fe ls c0upons.com
fe ensure submit@c0upons.com https://c0upons.com/api/webhooks/email --key-from-vault c0upons--prod:INBOUND_EMAIL_SECRET
fe ensure submit@c0upons.com https://c0upons.pwa.pit.world/api/webhooks/email --key-from-vault c0upons--prod:INBOUND_EMAIL_SECRET
```

`dealsubs` subscribes one inbox to the coupon and deal newsletters in
Expand Down Expand Up @@ -1916,7 +1916,7 @@ left alone, it seeds indefinitely.

### `submitfleet`

[SubmitFleet](https://submitfleet.com)'s CLI, wrapped so it is a command on every box:
[SubmitFleet](https://submitfleet.pwa.pit.world)'s CLI, wrapped so it is a command on every box:

```bash
submitfleet login # browser sign-in (OAuth 2.1 + PKCE)
Expand Down Expand Up @@ -2076,7 +2076,7 @@ so and tries anyway, since that floor is theirs to move.

The job board where the applying is done by agents, from the terminal:
[@profullstack/agenticjobs](https://www.npmjs.com/package/@profullstack/agenticjobs),
the same board that runs at [agenticjobs.work](https://agenticjobs.work).
the same board that runs at [agenticjobs.work](https://agenticjobs.pwa.pit.world).

```sh
agenticjobs signup # an account, and this box signed in
Expand Down Expand Up @@ -2118,7 +2118,7 @@ pointed at with `AGENTICJOBS_BIN`, keeps upstream's behaviour exactly.
That last case is not hypothetical. Upstream's installer writes a real shell
script to `~/.local/bin/agenticjobs`, which is the same directory this repo
links into, and `install-links.mjs` never takes over a real file even with
`--force`. On a box that already ran `curl -fsSL https://agenticjobs.work/install.sh | sh`
`--force`. On a box that already ran `curl -fsSL https://agenticjobs.pwa.pit.world/install.sh | sh`
you will see `SKIP … is a real file` and keep the board you already had. Remove
that script first if you want this wrapper to own the name.

Expand Down
2 changes: 1 addition & 1 deletion bin/fe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* fe — Forward Email aliases without the dashboard.
*
* fe ls c0upons.com
* fe ensure submit@c0upons.com https://c0upons.com/api/webhooks/email \
* fe ensure submit@c0upons.com https://c0upons.pwa.pit.world/api/webhooks/email \
* --key-from-vault c0upons--prod:INBOUND_EMAIL_SECRET
* fe rm old@c0upons.com --yes
*
Expand Down
2 changes: 1 addition & 1 deletion scripts/coupons-intake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export PATH="$HOME/.local/bin:$HOME/.local/share/mise/shims:/usr/local/bin:/usr/

INBOX=${INBOX:-submit@c0upons.com}
EXTRA=${EXTRA_ALIASES:-coupons@profullstack.com}
HOOK=https://c0upons.com/api/webhooks/email
HOOK=https://c0upons.pwa.pit.world/api/webhooks/email
KEYSPEC=c0upons--prod:INBOUND_EMAIL_SECRET
STATE="${XDG_DATA_HOME:-$HOME/.local/share}/cli-tools/dealsubs"
VERIFIED="$STATE/inbox-verified"
Expand Down
2 changes: 1 addition & 1 deletion src/forwardemail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function client(token: string, doFetch: Fetch = fetch, base = API_BASE):
};
}

/** "submit@c0upons.com" -> { name: "submit", domain: "c0upons.com" }. */
/** "submit@c0upons.com" -> { name: "submit", domain: "c0upons.pwa.pit.world" }. */
export function splitAddress(address: string): { name: string; domain: string } {
const m = /^([^@\s]+)@([a-z0-9.-]+\.[a-z]{2,})$/i.exec(address.trim());
if (!m) throw new ForwardEmailError(`not an email address: ${JSON.stringify(address)}`);
Expand Down
12 changes: 6 additions & 6 deletions test/forwardemail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ function fakeApi(initial: Array<Record<string, unknown>>) {

describe('forwardemail', () => {
it('splits an address and refuses a non-address', () => {
expect(splitAddress('Submit@C0upons.com')).toEqual({ name: 'submit', domain: 'c0upons.com' });
expect(splitAddress('Submit@C0upons.com')).toEqual({ name: 'submit', domain: 'c0upons.pwa.pit.world' });
expect(() => splitAddress('submit')).toThrow(ForwardEmailError);
});

it('sends the token as the Basic-auth username with an empty password', async () => {
const { api, calls } = fakeApi([]);
await ensureAlias(api, 'submit@c0upons.com', ['https://c0upons.com/api/webhooks/email?key=s3cret']);
await ensureAlias(api, 'submit@c0upons.com', ['https://c0upons.pwa.pit.world/api/webhooks/email?key=s3cret']);
expect(calls[0]!.auth).toBe(`Basic ${Buffer.from('tok:').toString('base64')}`);
});

it('creates a missing alias, then leaves it alone', async () => {
const { api, calls } = fakeApi([]);
const hook = 'https://c0upons.com/api/webhooks/email?key=s3cret';
const hook = 'https://c0upons.pwa.pit.world/api/webhooks/email?key=s3cret';
expect((await ensureAlias(api, 'submit@c0upons.com', [hook])).outcome).toBe('created');
expect((await ensureAlias(api, 'submit@c0upons.com', [hook])).outcome).toBe('unchanged');
expect(calls.filter((c) => c.method !== 'GET')).toHaveLength(1);
});

it('adds a recipient without removing the ones already there', async () => {
const { api, aliases } = fakeApi([{ id: 'a1', name: 'submit', recipients: ['anthony@profullstack.com'], is_enabled: true }]);
const r = await ensureAlias(api, 'submit@c0upons.com', ['https://c0upons.com/api/webhooks/email?key=k']);
const r = await ensureAlias(api, 'submit@c0upons.com', ['https://c0upons.pwa.pit.world/api/webhooks/email?key=k']);
expect(r.outcome).toBe('updated');
expect(aliases[0]!.recipients).toEqual(['anthony@profullstack.com', 'https://c0upons.com/api/webhooks/email?key=k']);
expect(aliases[0]!.recipients).toEqual(['anthony@profullstack.com', 'https://c0upons.pwa.pit.world/api/webhooks/email?key=k']);
});

it('re-enables a disabled alias', async () => {
Expand All @@ -69,6 +69,6 @@ describe('forwardemail', () => {
});

it('masks webhook keys when printing', () => {
expect(maskRecipient('https://c0upons.com/api/webhooks/email?key=s3cret&x=1')).toBe('https://c0upons.com/api/webhooks/email?key=…&x=1');
expect(maskRecipient('https://c0upons.pwa.pit.world/api/webhooks/email?key=s3cret&x=1')).toBe('https://c0upons.pwa.pit.world/api/webhooks/email?key=…&x=1');
});
});
2 changes: 1 addition & 1 deletion test/submitfleet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe('credential probes', () => {
it('sees a saved sign-in from submitfleet login', () => {
const dir = mkdtempSync(join(tmpdir(), 'sf-cfg-'));
const file = join(dir, 'auth.json');
writeFileSync(file, '{"url":"https://submitfleet.com","access_token":"x"}');
writeFileSync(file, '{"url":"https://submitfleet.pwa.pit.world","access_token":"x"}');
try {
expect(hasToken({ SUBMITFLEET_AUTH_FILE: file })).toBe(true);
expect(hasToken({ XDG_CONFIG_HOME: join(dir, 'nope'), HOME: dir })).toBe(false);
Expand Down
Loading