remove ppi

This commit is contained in:
Travis Shears 2024-07-06 10:42:15 +02:00
parent a481626e47
commit 979196c50c
7 changed files with 39 additions and 20 deletions

16
.env.sample Normal file
View file

@ -0,0 +1,16 @@
POCKET_BASE_PW=xxxxxxxx
POCKET_BASE_USER=micro_blog_fetchers
POCKET_BASE_HOST=https://pocketbase.test.com
BLUE_SKY_API_KEY=xxxx-xxxx-xxxx-xxxx
BLUE_SKY_USERNAME=johndoe.bsky.social
MASTODON_BASE_URL=https://mastodon.social
MASTODON_ACCOUNT_ID=111111111111111111
PIXELFED_BASE_URL=https://pics.social/api/pixelfed/v1/accounts/
PIXELFED_ACCOUNT_ID=111111111111111111
NOSTR_FETCHER_NPUB=npub1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NOSTR_ID=5e3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NOSTR_RELAY=wss://relay.test.com

View file

@ -1,17 +1,15 @@
# Micro Blog Repo Fetchers
The Micro Blog Repo is made up of a PocketBase db and these lambda functions. Together they aggregate, backup, and make my various social media posts available to my personal site.
The Micro Blog Repo is a personal project of mine to aggregate, backup, and make
my various social media posts. It is made up of a self-hosted [PocketBase](https://pocketbase.io/)
and these lambda function.
## Progress
- [X] [BlueSky](https://bsky.app/profile/travisshears.bsky.social)
- [ ] Old Pleroma formally social.travisshears.xyz
- [ ] Video support
- [X] Post support
- [X] Post with image support
- [X] [Pixelfed via gram.social](https://gram.social/i/web/profile/703621281309160235)
- [X] [Mastodon via dice.camp](https://dice.camp/@travisshears)
- [X] [Nostr profile1qqs9....](https://snort.social/nprofile1qqs9udcv9uhqggjz87js9rtaph4lajlxnxsvwvm7zwdjt6etzyk52rgpypmhxue69uhkummnw3ezuetfde6kuer6wasku7nfvuh8xurpvdjj7qgkwaehxw309ajkgetw9ehx7um5wghxcctwvshszrnhwden5te0dehhxtnvdakz7z94haj)
- [X] BlueSky
- [X] Pixelfed
- [X] Mastodon
- [X] Nostr
## Deployment

View file

@ -15,6 +15,14 @@ provider:
POCKET_BASE_USER: ${env:POCKET_BASE_USER}
BLUE_SKY_API_KEY: ${env:BLUE_SKY_API_KEY}
BLUE_SKY_USERNAME: ${env:BLUE_SKY_USERNAME}
POCKET_BASE_HOST: ${env:POCKET_BASE_HOST}
MASTODON_BASE_URL: ${env:MASTODON_BASE_URL}
MASTODON_ACCOUNT_ID: ${env:MASTODON_ACCOUNT_ID}
PIXELFED_BASE_URL: ${env:PIXELFED_BASE_URL}
PIXELFED_ACCOUNT_ID: ${env:PIXELFED_ACCOUNT_ID}
NOSTR_FETCHER_NPUB: ${env:NOSTR_FETCHER_NPUB}
NOSTR_ID: ${env:NOSTR_ID}
NOSTR_RELAY: ${env:NOSTR_RELAY}
functions:
nostr:

View file

@ -9,9 +9,8 @@ const withRequest = lambdaRequestTracker();
const pb = new MicroBlogBackend(logger);
const baseURL = "https://dice.camp";
const accountId = "112364858295724350";
const username = "travisshears";
const baseURL = process.env.MASTODON_BASE_URL;
const accountId = process.env.MASTODON_ACCOUNT_ID;
type MastodonPost = {
media_attachments: {

View file

@ -10,10 +10,8 @@ const withRequest = lambdaRequestTracker();
const pb = new MicroBlogBackend(logger);
const fetcherNpub =
"npub1qqqqqqp350slvdds7028l4yre5cuh8v38zseert25mxf7lkr2trsy0j2m8";
const myNpub =
"5e370c2f2e0422423fa5028d7d0debfecbe699a0c7337e139b25eb2b112d450d";
const fetcherNpub = process.env.NOSTR_FETCHER_NPUB!;
const myNpub = process.env.NOSTR_ID!;
type NostrTag = ["t" | "r" | "imeta", string];
type NostrEvent = [
@ -42,7 +40,7 @@ exports.run = async (event: any, context: any) => {
}
// listen for new events for 30 seconds
logger.info("trying to connecting to nostr relay");
const ws = new WebSocket("wss://travis-shears-nostr-relay-v2.fly.dev/");
const ws = new WebSocket(process.env.NOSTR_RELAY!);
// Other Relay URLs
// "wss://nos.lol",
// "wss://nostr.wine",

View file

@ -7,8 +7,8 @@ const destination = pinoLambdaDestination();
const logger = pino({}, destination);
const withRequest = lambdaRequestTracker();
const baseURL = `https://gram.social/api/pixelfed/v1/accounts/`;
const accountID = `703621281309160235`;
const baseURL = process.env.PIXELFED_BASE_URL;
const accountID = process.env.PIXELFED_ACCOUNT_ID;
const pb = new MicroBlogBackend(logger);

View file

@ -40,7 +40,7 @@ export class MicroBlogBackend {
private pb: PocketBase;
private clientSetTime?: Date;
constructor(private logger: Logger) {
this.pb = new PocketBase("https://personal-pocket-base.fly.dev");
this.pb = new PocketBase(process.env.POCKET_BASE_HOST);
}
private async login() {