mirror of
https://github.com/bradganley/bsky-user-activity-bot.git
synced 2025-04-11 11:36:06 +00:00
Merge pull request #1 from bradganley/main
Changes for multiple deployments (Thank you very much for the contribution!!!)
This commit is contained in:
commit
733d02317e
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
||||
data*
|
||||
session*
|
0
.env.example
Normal file → Executable file
0
.env.example
Normal file → Executable file
4
.gitignore
vendored
Normal file → Executable file
4
.gitignore
vendored
Normal file → Executable file
@ -2,4 +2,6 @@
|
||||
.idea
|
||||
node_modules
|
||||
sessionData
|
||||
data
|
||||
data
|
||||
bun.lockb
|
||||
data
|
||||
|
0
Dockerfile
Normal file → Executable file
0
Dockerfile
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
LICENSE
Normal file → Executable file
34
README.md
Normal file → Executable file
34
README.md
Normal file → Executable file
@ -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://<YOUR JETSREAM SERVER IP>: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
|
||||
```
|
||||
|
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
14
docker-compose.yml
Normal file → Executable file
14
docker-compose.yml
Normal file → Executable file
@ -9,12 +9,21 @@ services:
|
||||
- ./sessionData:/sessionData
|
||||
env_file:
|
||||
- .env
|
||||
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
|
||||
|
||||
|
||||
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 +38,6 @@ services:
|
||||
networks:
|
||||
bun:
|
||||
driver: bridge
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 10.10.0.0/16
|
||||
|
0
makefile
Normal file → Executable file
0
makefile
Normal file → Executable file
0
package.json
Normal file → Executable file
0
package.json
Normal file → Executable file
10
src/index.ts
Normal file → Executable file
10
src/index.ts
Normal file → Executable file
@ -33,7 +33,7 @@ let handlers = {
|
||||
CreateSkeetAction.make(
|
||||
(handler: HandlerAgent, commit: JetstreamEventCommit): string => {
|
||||
// @ts-ignore
|
||||
let text = "\"" + commit.commit.record?.text + "\"";
|
||||
let text = <string>Bun.env.NAME + " posted \"" + commit.commit.record?.text + "\"";
|
||||
if(text.length > 300){
|
||||
text = text.substring(1, 301)
|
||||
}
|
||||
@ -59,7 +59,7 @@ let handlers = {
|
||||
// @ts-ignore
|
||||
[ActionTakenByUserValidator.make(<string>Bun.env.USER_DID)],
|
||||
[
|
||||
CreateSkeetAction.make("Aaron liked:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => {
|
||||
CreateSkeetAction.make(<string>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(<string>Bun.env.USER_DID)],
|
||||
[
|
||||
CreateSkeetAction.make("Aaron reposted:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => {
|
||||
CreateSkeetAction.make(<string>Bun.env.NAME + " reposted:", undefined, (handler: HandlerAgent, commit: JetstreamEventCommit): JetstreamSubject => {
|
||||
return commit.commit.record.subject as JetstreamSubject;
|
||||
}),
|
||||
LogInputTextAction.make("Repost")
|
||||
@ -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 <string>Bun.env.NAME + " blocked a user: " + blockedDid;
|
||||
}, undefined, undefined),
|
||||
LogInputTextAction.make("Block"),
|
||||
],
|
||||
@ -115,7 +115,7 @@ async function initialize() {
|
||||
|
||||
initialize().then(() => {
|
||||
jetstreamSubscription.createSubscription()
|
||||
DebugLog.info("INIT", 'Initialized!')
|
||||
DebugLog.info("INIT", 'Initialized and watching ' + <string>Bun.env.NAME + ' (' + <string>Bun.env.USER_DID + ')')
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user