-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update for latest beta * feature: Added additional templates and gh action * minor: update versions and remove comments * major: Update to 2.0.0-beta.19 * patch: update dependencies * update to 2.0.0
- Loading branch information
1 parent
558e633
commit f21a04d
Showing
22 changed files
with
474 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TEST_BSKY_HANDLE= | ||
TEST_BSKY_PASSWORD= | ||
DEBUG_LOG_ACTIVE=true | ||
DEBUG_LOG_LEVEL=info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM oven/bun:latest as base | ||
WORKDIR /usr/src/app | ||
|
||
# install dependencies into temp directory | ||
# this will cache them and speed up future builds | ||
FROM base AS install | ||
RUN mkdir -p /temp/dev | ||
COPY package.json bun.lockb /temp/dev/ | ||
RUN cd /temp/dev && bun install --frozen-lockfile | ||
|
||
# install with --production (exclude devDependencies) | ||
RUN mkdir -p /temp/prod | ||
COPY package.json bun.lockb /temp/prod/ | ||
RUN cd /temp/prod && bun install --frozen-lockfile --production | ||
|
||
# copy node_modules from temp directory | ||
# then copy all (non-ignored) project files into the image | ||
FROM install AS prerelease | ||
COPY --from=install /temp/dev/node_modules node_modules | ||
COPY . . | ||
|
||
# [optional] tests & build | ||
ENV NODE_ENV=production | ||
RUN bun test | ||
RUN bun run build | ||
|
||
# copy production dependencies and source code into final image | ||
FROM base AS release | ||
COPY --from=install /temp/prod/node_modules node_modules | ||
COPY --from=prerelease /usr/src/app/build/index.ts . | ||
COPY --from=prerelease /usr/src/app/package.json . | ||
|
||
# run the app | ||
USER bun | ||
ENTRYPOINT [ "bun", "run", "index.ts" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# {{name}} | ||
|
||
{{description}} | ||
|
||
# Quickstart | ||
- [ ] Install Bun | ||
- [ ] Install Docker | ||
- [ ] Fill in .env with your handle and **app** password (do not use your real password) | ||
- [ ] Run `make up` | ||
- [ ] Be free and create to your hearts content! | ||
|
||
|
||
## Development | ||
|
||
Check out the bsky-event-handler docs [here](https://github.com/juni-b-queer/bsky-event-handlers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: "3.8" | ||
services: | ||
bskybot: | ||
build: . | ||
restart: unless-stopped | ||
volumes: | ||
- ./sessionData:/sessionData | ||
env_file: | ||
- .env | ||
networks: | ||
- bun | ||
|
||
networks: | ||
bun: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.PHONY: * | ||
|
||
dev: | ||
bun run src/index.ts | ||
|
||
build: | ||
docker compose build | ||
|
||
up: | ||
docker compose up -d | ||
|
||
down: | ||
docker compose down | ||
|
||
logs: | ||
docker compose logs -f | ||
|
||
install: | ||
bun install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "{{kebab name}}", | ||
"description": "{{description}}", | ||
"version": "0.0.0", | ||
"author": "{{contact}}", | ||
"module": "src/index.ts", | ||
"type": "module", | ||
"scripts": { | ||
"build": "bun build --target=bun ./src/index.ts --outfile=./build/index.ts" | ||
}, | ||
"devDependencies": { | ||
"bun-types": "latest" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"bsky-event-handlers": "^2.0.0", | ||
"@atproto/api": "^0.13.19" | ||
}, | ||
"license": "{{license}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { | ||
DebugLog, | ||
HandlerAgent, | ||
IntervalSubscription, | ||
IntervalSubscriptionHandlers, | ||
AbstractHandler, | ||
IsSpecifiedTimeValidator, | ||
CreateSkeetAction | ||
} from 'bsky-event-handlers'; | ||
|
||
const testAgent = new HandlerAgent( | ||
'test-bot', | ||
<string>Bun.env.TEST_BSKY_HANDLE, | ||
<string>Bun.env.TEST_BSKY_PASSWORD | ||
); | ||
|
||
let intervalSubscription: IntervalSubscription; | ||
|
||
const intervalSubscriptionHandlers: IntervalSubscriptionHandlers = [ | ||
{ | ||
intervalSeconds: 60, | ||
handlers:[ | ||
new AbstractHandler( | ||
[IsSpecifiedTimeValidator.make("04:20", "16:20")], | ||
[CreateSkeetAction.make("It's 4:20 somewhere!")], | ||
testAgent) | ||
] | ||
} | ||
] | ||
|
||
|
||
async function initialize() { | ||
await testAgent.authenticate() | ||
intervalSubscription = new IntervalSubscription( | ||
intervalSubscriptionHandlers | ||
) | ||
} | ||
|
||
initialize().then(() =>{ | ||
intervalSubscription.createSubscription() | ||
DebugLog.info("INIT", 'Initialized!') | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
TEST_BSKY_HANDLE= | ||
TEST_BSKY_PASSWORD= | ||
DEBUG_LOG_ACTIVE=true | ||
DEBUG_LOG_LEVEL=info | ||
|
||
JETSTREAM_URL='ws://jetstream:6008/subscribe' | ||
|
||
SESSION_DATA_PATH='/sessionData' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM oven/bun:1.0.15 as base | ||
WORKDIR /usr/src/app | ||
|
||
# install dependencies into temp directory | ||
# this will cache them and speed up future builds | ||
FROM base AS install | ||
RUN mkdir -p /temp/dev | ||
COPY package.json bun.lockb /temp/dev/ | ||
RUN cd /temp/dev && bun install --frozen-lockfile | ||
|
||
# install with --production (exclude devDependencies) | ||
RUN mkdir -p /temp/prod | ||
COPY package.json bun.lockb /temp/prod/ | ||
RUN cd /temp/prod && bun install --frozen-lockfile --production | ||
|
||
# copy node_modules from temp directory | ||
# then copy all (non-ignored) project files into the image | ||
FROM install AS prerelease | ||
COPY --from=install /temp/dev/node_modules node_modules | ||
COPY . . | ||
|
||
# [optional] tests & build | ||
ENV NODE_ENV=production | ||
RUN bun test | ||
RUN bun run build | ||
|
||
# copy production dependencies and source code into final image | ||
FROM base AS release | ||
COPY --from=install /temp/prod/node_modules node_modules | ||
COPY --from=prerelease /usr/src/app/build/index.ts . | ||
COPY --from=prerelease /usr/src/app/package.json . | ||
|
||
# run the app | ||
USER bun | ||
ENTRYPOINT [ "bun", "run", "index.ts" ] |
Oops, something went wrong.