Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adopt to /api/v2/instance to fetch app vapid_key #3193

Merged
merged 2 commits into from
Mar 2, 2025

Conversation

shuuji3
Copy link
Member

@shuuji3 shuuji3 commented Feb 7, 2025

Currently, the vapid key in AppInfo (needed for push notification) is retrieved from the response of POST /api/v1/apps and stored permanently to the server storage, when someone first tries to log in to the server from the Elk. But it was deprecated since Mastodon v4.3.0 (ref. https://docs.joinmastodon.org/methods/apps/#create). This change uses the recommended GET /api/v2/instance value.

This also updates the key of the storage for AppInfo (servers:v3:${server}: -> servers:v4:${server}:) because some (non-Mastodon) servers may return different values with this change. As a side effect, this will partially solve the existing lock-out issue (ref. #3150).

Mastodon server returns the exact same vapid key value from POST /api/v1/apps and GET /api/v2/instance, so there should not be any difference for Mastodon.

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 121a16f
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/67c41d8a30a0780008340b96
😎 Deploy Preview https://deploy-preview-3193--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for elk-docs canceled.

Name Link
🔨 Latest commit 121a16f
🔍 Latest deploy log https://app.netlify.com/sites/elk-docs/deploys/67c41d8a7ca5b10008cc3e7a

@shuuji3 shuuji3 force-pushed the shuuji3/feat/prefer-v2-instance-for-vapid-key branch from 839e188 to 4766467 Compare February 7, 2025 13:28
@shuuji3 shuuji3 marked this pull request as ready for review February 7, 2025 14:33
@shuuji3 shuuji3 changed the title feat: adopt to /api/v2/instance for fetching app vapid_key feat: adopt to /api/v2/instance to fetch app vapid_key Feb 8, 2025
@ayoayco ayoayco closed this Feb 9, 2025
@ayoayco ayoayco deleted the shuuji3/feat/prefer-v2-instance-for-vapid-key branch February 9, 2025 14:24
@ayoayco ayoayco restored the shuuji3/feat/prefer-v2-instance-for-vapid-key branch February 9, 2025 14:49
@ayoayco ayoayco reopened this Feb 9, 2025
@shuuji3 shuuji3 force-pushed the shuuji3/feat/prefer-v2-instance-for-vapid-key branch from f74b5d9 to 121a16f Compare March 2, 2025 08:57
@shuuji3
Copy link
Member Author

shuuji3 commented Mar 2, 2025

I also added ttl option cached for 1 week, which is used for some storage drivers.

ref. #3193

@shuuji3 shuuji3 added this pull request to the merge queue Mar 2, 2025
Merged via the queue into main with commit 7d9712c Mar 2, 2025
15 checks passed
@shuuji3 shuuji3 deleted the shuuji3/feat/prefer-v2-instance-for-vapid-key branch March 2, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants