basic updates for pushing fork
This commit is contained in:
10
README.md
10
README.md
@@ -1,14 +1,16 @@
|
|||||||
# VixBluesky 🛠️ (Inspired by [FixTweet](https://github.com/FixTweet/FixTweet))
|
# girlcockbsky Fork of VixBluesky 🛠️ (Inspired by [FixTweet](https://github.com/FixTweet/FixTweet))
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> This is a fork of [FixBluesky](https://github.com/ThornbushHQ/FixBluesky) by [@ItsRauf](https://www.github.com/ItsRauf).
|
> This is a fork of VixBluesky which is a fork of [FixBluesky](https://github.com/ThornbushHQ/FixBluesky) by [@ItsRauf](https://www.github.com/ItsRauf).
|
||||||
> All credits go to them for the original idea and implementation.
|
> All credits go to them for the original idea and implementation.
|
||||||
|
|
||||||
|
Converted to nodejs cause serverless design's proprietary-ness annoys me and i wanted to make a funny joke after seeing girlcockx for twitter.
|
||||||
|
|
||||||
Embed Bluesky links in Discord.
|
Embed Bluesky links in Discord.
|
||||||
|
|
||||||
## How To Use?
|
## How To Use?
|
||||||
|
|
||||||
#### Simply append `x` at the end of `bsky.app`.
|
#### Simply append `girlcock` at the front of `bsky.app`.
|
||||||
|
|
||||||
## Direct Links
|
## Direct Links
|
||||||
|
|
||||||
@@ -18,4 +20,4 @@ You want to link to a media directly? You can prepend `r.` to the URL to get a d
|
|||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
- [@ItsRauf](https://www.github.com/ItsRauf) - Original author
|
- [@ItsRauf](https://www.github.com/ItsRauf) - Original author
|
||||||
- [@Lexedia](https://www.github.com/Rapougnac)
|
- [@Lexedia](https://www.github.com/Rapougnac) - Also Original author
|
||||||
|
|||||||
28
docker-compose.yaml
Normal file
28
docker-compose.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
services:
|
||||||
|
api:
|
||||||
|
build:
|
||||||
|
context: ./pkgs/api/.
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "2598:3000"
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- PORT=3000
|
||||||
|
- EMPTY_REDIR=https://bsky.app/profile/juni.pet/post/3l3e53fzazy2n
|
||||||
|
restart: unless-stopped
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: ./pkgs/app/.
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "2599:3000"
|
||||||
|
environment:
|
||||||
|
- BSKY_SERVICE_URL=https://bsky.social
|
||||||
|
- VIXBLUESKY_APP_DOMAIN=girlcockbsky.app
|
||||||
|
- VIXBLUESKY_API_URL=http://localhost:2598/
|
||||||
|
- BSKY_AUTH_USERNAME=YOUR_OWN_USERNAME
|
||||||
|
- BSKY_AUTH_PASSWORD=YOUR_APP_PASSWORD_SHOULD_COME_FROM_ENV
|
||||||
|
- PORT=3000
|
||||||
|
- EMPTY_REDIR=https://bsky.app/profile/juni.pet/post/3l3e53fzazy2n
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
@@ -6,7 +6,8 @@
|
|||||||
"@atcute/bluesky": "^1.0.7",
|
"@atcute/bluesky": "^1.0.7",
|
||||||
"@atcute/client": "^2.0.3",
|
"@atcute/client": "^2.0.3",
|
||||||
"hono": "^4.5.1",
|
"hono": "^4.5.1",
|
||||||
"@hono/node-server": "^1.13.2"
|
"@hono/node-server": "^1.13.2",
|
||||||
|
"node-cache": "^5.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cloudflare/workers-types": "^4.20230628.0",
|
"@cloudflare/workers-types": "^4.20230628.0",
|
||||||
|
|||||||
@@ -8,19 +8,36 @@ import { getOEmbed } from './routes/getOEmbed';
|
|||||||
import { getProfileData } from './routes/getProfileData';
|
import { getProfileData } from './routes/getProfileData';
|
||||||
import { getProfile } from './routes/getProfile';
|
import { getProfile } from './routes/getProfile';
|
||||||
import { HTTPException } from 'hono/http-exception';
|
import { HTTPException } from 'hono/http-exception';
|
||||||
|
const NodeCache = require( "node-cache" );
|
||||||
|
|
||||||
const app = new Hono();
|
const app = new Hono();
|
||||||
const bskyxC: any = {};
|
const myCache = new NodeCache();
|
||||||
|
|
||||||
app.use('*', async (c, next) => {
|
app.use('*', async (c, next) => {
|
||||||
const creds = new CredentialManager({service: process.env.BSKY_SERVICE_URL});
|
const creds = new CredentialManager({
|
||||||
|
service: process.env.BSKY_SERVICE_URL,
|
||||||
|
onRefresh(session) {
|
||||||
|
return myCache.set('session', JSON.stringify(session));
|
||||||
|
},
|
||||||
|
onExpired(session) {
|
||||||
|
return myCache.del('session');
|
||||||
|
},
|
||||||
|
onSessionUpdate(session) {
|
||||||
|
return myCache.set('session', JSON.stringify(session));
|
||||||
|
},
|
||||||
|
});
|
||||||
const agent = new XRPC({ handler: creds });
|
const agent = new XRPC({ handler: creds });
|
||||||
try {
|
try {
|
||||||
await creds.login({
|
const rawSession = myCache.get('session');
|
||||||
identifier: process.env.BSKY_AUTH_USERNAME,
|
if(rawSession) {
|
||||||
password: process.env.BSKY_AUTH_PASSWORD,
|
const session = JSON.parse(rawSession) as AtpSessionData;
|
||||||
});
|
await creds.resume(session);
|
||||||
console.log(creds.session);
|
} else {
|
||||||
|
await creds.login({
|
||||||
|
identifier: process.env.BSKY_AUTH_USERNAME,
|
||||||
|
password: process.env.BSKY_AUTH_PASSWORD,
|
||||||
|
});
|
||||||
|
}
|
||||||
c.set('Agent', agent);
|
c.set('Agent', agent);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const err = new Error('Failed to login to Bluesky!', {
|
const err = new Error('Failed to login to Bluesky!', {
|
||||||
|
|||||||
Reference in New Issue
Block a user