Browse Source

Using new sentry project thanks for sponsoring

Also removing unnecessary importing public keys
pull/296/head
Zhiyuan Zheng 7 months ago
parent
commit
9c1d18c7f0
  1. 3
      .envrc.example
  2. 2
      .github/workflows/build.yml
  3. 4
      app.config.ts
  4. 9
      src/startup/sentry.ts
  5. 3
      src/utils/slices/instances/push/register.ts

3
.envrc.example

@ -3,9 +3,6 @@ export ENVIRONMENT="development"
export SENTRY_ORGANIZATION=""
export SENTRY_PROJECT=""
export SENTRY_AUTH_TOKEN=""
export SENTRY_DSN=""
export TOOOT_PUSH_KEY_PUBLIC=""
# Fastlane start
export LC_ALL=""

2
.github/workflows/build.yml

@ -43,8 +43,6 @@ jobs:
SENTRY_ORGANIZATION: ${{ secrets.SENTRY_ORGANIZATION }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
TOOOT_PUSH_KEY_PUBLIC: ${{ secrets.TOOOT_PUSH_KEY_PUBLIC }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}

4
app.config.ts

@ -12,10 +12,6 @@ export default (): ExpoConfig => ({
version: toootVersion,
privacy: 'hidden',
assetBundlePatterns: ['assets/*'],
extra: {
sentryDSN: process.env.SENTRY_DSN,
toootPushKeyPublic: process.env.TOOOT_PUSH_KEY_PUBLIC
},
hooks: {
postPublish: [
{

9
src/startup/sentry.ts

@ -1,14 +1,13 @@
import { isDevelopment } from '@utils/checkEnvironment'
import Constants from 'expo-constants'
import { isRelease } from '@utils/checkEnvironment'
import * as Sentry from 'sentry-expo'
import log from './log'
const sentry = () => {
log('log', 'Sentry', 'initializing')
Sentry.init({
dsn: Constants.manifest?.extra?.sentryDSN,
enableInExpoDevelopment: false,
debug: isDevelopment
dsn: 'https://53348b60ff844d52886e90251b3a5f41@o917354.ingest.sentry.io/6410576',
enableInExpoDevelopment: true,
debug: !isRelease
})
}

3
src/utils/slices/instances/push/register.ts

@ -3,7 +3,6 @@ import apiTooot, { TOOOT_API_DOMAIN } from '@api/tooot'
import i18n from '@root/i18n/i18n'
import { RootState } from '@root/store'
import { getInstance, Instance } from '@utils/slices/instancesSlice'
import Constants from 'expo-constants'
import * as Notifications from 'expo-notifications'
import * as Random from 'expo-random'
import { Platform } from 'react-native'
@ -57,7 +56,7 @@ const pushRegister = async (
formData.append('subscription[endpoint]', endpoint)
formData.append(
'subscription[keys][p256dh]',
Constants.manifest?.extra?.toootPushKeyPublic
'BO3P7Fe/FxPNijeXayVYViCoLicnnACc+a55wzcS0qIjYU++dtAl2XltgEfU5qPuXrFg5rnxBzbwQG4cAmdNLK4='
)
formData.append('subscription[keys][auth]', auth)
Object.keys(alerts).map(key =>

Loading…
Cancel
Save