Skip to content

Commit 7f2892e

Browse files
committed
feat: Move https://mastodon.social to env variable for ability to change instances per install
1 parent ee0fa5b commit 7f2892e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ DISCORD_BOT_TOKEN_ID=""
7272
SLACK_ID=""
7373
SLACK_SECRET=""
7474
SLACK_SIGNING_SECRET=""
75+
MASTODON_URL="https://mastodon.social"
7576
MASTODON_CLIENT_ID=""
7677
MASTODON_CLIENT_SECRET=""
7778

libraries/nestjs-libraries/src/integrations/social/mastodon.custom.provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class MastodonCustomProvider extends MastodonProvider {
7474
return this.dynamicPost(
7575
id,
7676
accessToken,
77-
'https://mastodon.social',
77+
process.env.MASTODON_URL || 'https://mastodon.social',
7878
postDetails
7979
);
8080
}

libraries/nestjs-libraries/src/integrations/social/mastodon.provider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class MastodonProvider extends SocialAbstract implements SocialProvider {
3939
async generateAuthUrl() {
4040
const state = makeId(6);
4141
const url = this.generateUrlDynamic(
42-
'https://mastodon.social',
42+
process.env.MASTODON_URL || 'https://mastodon.social',
4343
state,
4444
process.env.MASTODON_CLIENT_ID!,
4545
process.env.FRONTEND_URL!
@@ -102,7 +102,7 @@ export class MastodonProvider extends SocialAbstract implements SocialProvider {
102102
return this.dynamicAuthenticate(
103103
process.env.MASTODON_CLIENT_ID!,
104104
process.env.MASTODON_CLIENT_SECRET!,
105-
'https://mastodon.social',
105+
process.env.MASTODON_URL || 'https://mastodon.social',
106106
params.code
107107
);
108108
}
@@ -179,7 +179,7 @@ export class MastodonProvider extends SocialAbstract implements SocialProvider {
179179
return this.dynamicPost(
180180
id,
181181
accessToken,
182-
'https://mastodon.social',
182+
process.env.MASTODON_URL || 'https://mastodon.social',
183183
postDetails
184184
);
185185
}

0 commit comments

Comments
 (0)