From 34c2a048cc98327b6f6dcee549b780c87a4750ed Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Fri, 27 Dec 2024 02:31:43 +0000 Subject: [PATCH 01/11] Name variable, mods to compose file --- .env.example | 0 .github/workflows/buildandpublishtoghcr.yml | 0 .gitignore | 0 Dockerfile | 0 LICENSE | 0 README.md | 0 docker-compose.yml | 7 ++++++- makefile | 0 package.json | 0 src/index.ts | 4 ++-- 10 files changed, 8 insertions(+), 3 deletions(-) mode change 100644 => 100755 .env.example mode change 100644 => 100755 .github/workflows/buildandpublishtoghcr.yml mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Dockerfile mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 docker-compose.yml mode change 100644 => 100755 makefile mode change 100644 => 100755 package.json mode change 100644 => 100755 src/index.ts diff --git a/.env.example b/.env.example old mode 100644 new mode 100755 diff --git a/.github/workflows/buildandpublishtoghcr.yml b/.github/workflows/buildandpublishtoghcr.yml old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/docker-compose.yml b/docker-compose.yml old mode 100644 new mode 100755 index dd1cb4e..4a76aeb --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,12 +9,14 @@ services: - ./sessionData:/sessionData env_file: - .env + environment: + - NAME=bork networks: - bun jetstream: - image: "ghcr.io/juni-b-queer/jetstream-new:personal-branch" + image: "ghcr.io/bluesky-social/jetstream:sha-ea96859b93d1790ff20bb168e5fc442d462cea1e" container_name: jetstream restart: unless-stopped environment: @@ -29,3 +31,6 @@ services: networks: bun: driver: bridge + ipam: + config: + - subnet: 10.10.0.0/16 diff --git a/makefile b/makefile old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 diff --git a/src/index.ts b/src/index.ts old mode 100644 new mode 100755 index d18ef3f..86f214c --- a/src/index.ts +++ b/src/index.ts @@ -59,7 +59,7 @@ let handlers = { // @ts-ignore [ActionTakenByUserValidator.make(Bun.env.USER_DID)], [ - CreateSkeetAction.make("Aaron liked:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => { + CreateSkeetAction.make(Bun.env.NAME +" liked:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => { return commit.commit.record.subject as JetstreamSubject; }), LogInputTextAction.make("Like") @@ -74,7 +74,7 @@ let handlers = { // @ts-ignore [ActionTakenByUserValidator.make(Bun.env.USER_DID)], [ - CreateSkeetAction.make("Aaron reposted:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => { + CreateSkeetAction.make(Bun.env.NAME + " reposted:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => { return commit.commit.record.subject as JetstreamSubject; }), LogInputTextAction.make("Repost") From 3589cae58480cb7ee4aea2779472cfe906a417b2 Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Fri, 27 Dec 2024 02:33:23 +0000 Subject: [PATCH 02/11] gitignore? fuck i don't know --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 345320f..8145cfe 100755 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ .idea node_modules sessionData -data \ No newline at end of file +data +bun.lockb +data From e4881d29d4335e0b3525e0eef970baa2e9cb0aac Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Fri, 27 Dec 2024 03:31:15 +0000 Subject: [PATCH 03/11] Got high and forgot what I did. The diff probably speaks for itself --- bun.lockb | Bin 8930 -> 0 bytes docker-compose.yml | 3 ++- src/index.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) delete mode 100755 bun.lockb diff --git a/bun.lockb b/bun.lockb deleted file mode 100755 index 281a6b05b20ed78c17f5747e31d9b5480334560a..0000000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BS1mTlEse&wg4IHbs)Q2oU23VD<hoqx#hY}$zasewy zu0vg;#Q6!2%q669zSK5W5NL+)&3+gc>0zx7S+7fqY z4)uNu-mizmLr9zf*uXmt`{4b0-rv&qw}(V#NW=py5Yph!hTZ~+?vSX7v5||e^ETjv zcfM0sY$=KHkl2Z_QHm$+MhgWLi3X7<3zUeUyNPH|5+5RQ7btO~Mfe*2i1`fqCQ5;R zY}V9`QSNNXNMqxrYPxqKD^)8ciXp68u8b1f3hRfjXZ`S{SSC`-x&K$owd#eLmKeap zXDzO+@qT1IaW~5_QZ?|6{@HfgU|Ii~OE59vc%1I(R$`QB@wR&>Eu89SuS;Q$g}Flb zuBk#>K?8JrRxOE)k*e9GI4KjUmdCLeD%9ruBy5~o#j2boadHtYqy>CkU?_r#N#aZ6 zA%w?|mMF(7q-rLbW#bqxXJ@rEO3twABw864JAt89>L}-T)OO~->nWeBgJz?Wb%UJG z%44O;Dy6gm9SICjCNO;6jDpw*jZ7w0YgoBL!^-%c{CHTK#>14?0Lkyv0pstU@CDF; zT-}krQJQ+Rh<1VA)d+~|YJh^nL78?IMxZ1?B4@SX+gOc)mFvQ{OdTdt6&tHk@)M*H zb&nL%M0uo2S(j&$l&mDNE}N*1i)^3?zo`f2V0Ewu27;l@(CY`R{tnkt(GJ;)Ujd4 z1S0t7!;;|Is2vhv;vVs__lY z6`Wc?h?V)eHAJW#A{ym*d8Ax7i#E`&xz&J%o8@a49=Aq3QfD=wwbLIgaN0qpTRC*A ZMFR%ZPx?Smp8@3_y7#ABNB;Z%{|y_w8!i9< diff --git a/docker-compose.yml b/docker-compose.yml index 4a76aeb..04c4c9a 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,8 @@ services: env_file: - .env environment: - - NAME=bork + - NAME=Aaron + - USER_DID=did:plc:ksjfbda7262bbqmuoly54lww networks: - bun diff --git a/src/index.ts b/src/index.ts index 86f214c..b152b6f 100755 --- a/src/index.ts +++ b/src/index.ts @@ -115,7 +115,7 @@ async function initialize() { initialize().then(() => { jetstreamSubscription.createSubscription() - DebugLog.info("INIT", 'Initialized!') + DebugLog.info("INIT", 'Initialized and watching ' + Bun.env.NAME + ' (' + Bun.env.USER_DID + ')') }); From 873150ddae40076d2111116b08743990f5882eec Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Fri, 27 Dec 2024 03:35:51 +0000 Subject: [PATCH 04/11] qol improvements to compose file re:env --- docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 04c4c9a..69f3b42 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,12 @@ services: environment: - NAME=Aaron - USER_DID=did:plc:ksjfbda7262bbqmuoly54lww + #- TRACKER_BSKY_HANDLE= + #- TRACKER_BSKY_PASSWORD= + #- DEBUG_LOG_ACTIVE=true + #- DEBUG_LOG_LEVEL=info + #- JETSTREAM_URL='ws://jetstream:6008/subscribe' + #- SESSION_DATA_PATH='/sessionData' networks: - bun From a9c38cc14144e97f1cfa9d11b14fea074cb26cdf Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 28 Dec 2024 02:10:33 +0000 Subject: [PATCH 05/11] Added name in post behavior, fixed an aaron I missed before --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index b152b6f..6f45c0b 100755 --- a/src/index.ts +++ b/src/index.ts @@ -33,7 +33,7 @@ let handlers = { CreateSkeetAction.make( (handler: HandlerAgent, commit: JetstreamEventCommit): string => { // @ts-ignore - let text = "\"" + commit.commit.record?.text + "\""; + let text = Bun.env.NAME + " posted \"" + commit.commit.record?.text + "\""; if(text.length > 300){ text = text.substring(1, 301) } @@ -93,7 +93,7 @@ let handlers = { [ CreateSkeetAction.make((handler: HandlerAgent, event: JetstreamEventCommit): string => { const blockedDid = event.commit.record.subject - return "Aaron blocked a user: " + blockedDid; + return Bun.env.NAME + " blocked a user: " + blockedDid; }, undefined, undefined), LogInputTextAction.make("Block"), ], From 73f6c4c074842a9246c3752d01f0bb0b510be115 Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 28 Dec 2024 02:19:47 +0000 Subject: [PATCH 06/11] added dockerignore --- .dockerignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b84600d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +data* +session* From 61b967c5ff4a848c2497968dbea889e610eed17e Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 28 Dec 2024 02:23:56 +0000 Subject: [PATCH 07/11] Updated readme with docker instructions and compose file --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index b871023..bfa56e6 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,37 @@ # user-tracker Tracks and reports on a users actions + +## Docker +Docker image available on Dockerhub: +https://hub.docker.com/r/bradganley/buab + +``` +services: + bskybot_1: + image: bradganley/buab:0.0.1 + restart: unless-stopped + volumes: + - ./sessionData:/sessionData + environment: + - NAME=Brad + - USER_DID=did:plc:pi3zhvcqttk2hrdpmkynqrfi + - TRACKER_BSKY_HANDLE= + - TRACKER_BSKY_PASSWORD= + - DEBUG_LOG_ACTIVE=true + - DEBUG_LOG_LEVEL=info + - JETSTREAM_URL=ws://:6008/subscribe + - SESSION_DATA_PATH=/sessionData + + + jetstream: + image: "ghcr.io/bluesky-social/jetstream:sha-ea96859b93d1790ff20bb168e5fc442d462cea1e" + container_name: jetstream1 + restart: unless-stopped + environment: + - CURSOR_FILE=/data/cursor.json + ports: + - "6008:6008" + volumes: + - ./data:/data +``` From 35ebab179183bb9acdc205cc14c701b60fdef830 Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Fri, 27 Dec 2024 20:54:12 -0600 Subject: [PATCH 08/11] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..b67a9f0 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: oven/bun:latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag buab:$(date +%s) From e95105944c8c02424d26a4f219f49bfc41cf2373 Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Fri, 27 Dec 2024 21:01:24 -0600 Subject: [PATCH 09/11] Delete .github/workflows/buildandpublishtoghcr.yml --- .github/workflows/buildandpublishtoghcr.yml | 68 --------------------- 1 file changed, 68 deletions(-) delete mode 100755 .github/workflows/buildandpublishtoghcr.yml diff --git a/.github/workflows/buildandpublishtoghcr.yml b/.github/workflows/buildandpublishtoghcr.yml deleted file mode 100755 index b874538..0000000 --- a/.github/workflows/buildandpublishtoghcr.yml +++ /dev/null @@ -1,68 +0,0 @@ -# -name: Create and publish the bot container - -# Configures this workflow to run every time a change is pushed to the branch called `release`. -on: - push: - branches: ['main'] - -# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. -jobs: - build-and-push-image: - runs-on: ubuntu-latest - # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. - permissions: - contents: read - packages: write - # - steps: - - name: Checkout repository - uses: actions/checkout@v4 - # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GHCR_PAT }} - # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. - # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. - # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - - name: Build and push Docker image - id: push - uses: docker/build-push-action@v5 - with: - platforms: linux/amd64, linux/arm64 - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. - # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. - # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. -# - name: Build and push Docker image -# uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 -# with: -# context: . -# push: true -# tags: ${{ steps.meta.outputs.tags }} -# labels: ${{ steps.meta.outputs.labels }} From da8baa0fad3fca4381d9d7bd166a33ed5ef56781 Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Fri, 27 Dec 2024 21:02:17 -0600 Subject: [PATCH 10/11] Delete .github/workflows directory --- .github/workflows/docker-image.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index b67a9f0..0000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - - build: - - runs-on: oven/bun:latest - - steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag buab:$(date +%s) From fef792e89a68161f1544106bea1c70f93b2d890c Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 28 Dec 2024 20:12:18 +0000 Subject: [PATCH 11/11] re-adding workflow --- .github/workflows/buildandpublishtoghcr.yml | 68 +++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/buildandpublishtoghcr.yml diff --git a/.github/workflows/buildandpublishtoghcr.yml b/.github/workflows/buildandpublishtoghcr.yml new file mode 100644 index 0000000..b874538 --- /dev/null +++ b/.github/workflows/buildandpublishtoghcr.yml @@ -0,0 +1,68 @@ +# +name: Create and publish the bot container + +# Configures this workflow to run every time a change is pushed to the branch called `release`. +on: + push: + branches: ['main'] + +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. +jobs: + build-and-push-image: + runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + # + steps: + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GHCR_PAT }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v5 + with: + platforms: linux/amd64, linux/arm64 + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. +# - name: Build and push Docker image +# uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 +# with: +# context: . +# push: true +# tags: ${{ steps.meta.outputs.tags }} +# labels: ${{ steps.meta.outputs.labels }}