Use a tunneled transport when necessary
This commit is contained in:
parent
f8f815c340
commit
106dbac6b6
4 changed files with 13 additions and 0 deletions
|
@ -7,6 +7,7 @@ const String kSentryDSN =
|
||||||
"https://2235e5c99219488ea93da34b9ac1cb68@sentry.ente.io/4";
|
"https://2235e5c99219488ea93da34b9ac1cb68@sentry.ente.io/4";
|
||||||
const String kSentryDebugDSN =
|
const String kSentryDebugDSN =
|
||||||
"https://ca5e686dd7f149d9bf94e620564cceba@sentry.ente.io/3";
|
"https://ca5e686dd7f149d9bf94e620564cceba@sentry.ente.io/3";
|
||||||
|
const String kSentryTunnel = "https://sentry-reporter.ente.io";
|
||||||
const String kRoadmapURL = "https://roadmap.ente.io";
|
const String kRoadmapURL = "https://roadmap.ente.io";
|
||||||
const int kMicroSecondsInDay = 86400000000;
|
const int kMicroSecondsInDay = 86400000000;
|
||||||
const int kAndroid11SDKINT = 30;
|
const int kAndroid11SDKINT = 30;
|
||||||
|
|
|
@ -7,11 +7,13 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:path/path.dart';
|
import 'package:path/path.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:photos/core/error-reporting/tunneled_transport.dart';
|
||||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||||
|
|
||||||
typedef FutureOrVoidCallback = FutureOr<void> Function();
|
typedef FutureOrVoidCallback = FutureOr<void> Function();
|
||||||
|
@ -74,6 +76,8 @@ class LogConfig {
|
||||||
/// If this is [null], Sentry logger is completely disabled (default).
|
/// If this is [null], Sentry logger is completely disabled (default).
|
||||||
String sentryDsn;
|
String sentryDsn;
|
||||||
|
|
||||||
|
String tunnel;
|
||||||
|
|
||||||
/// A built-in retry mechanism for sending errors to sentry.
|
/// A built-in retry mechanism for sending errors to sentry.
|
||||||
///
|
///
|
||||||
/// This parameter defines the time to wait for, before retrying.
|
/// This parameter defines the time to wait for, before retrying.
|
||||||
|
@ -118,6 +122,7 @@ class LogConfig {
|
||||||
|
|
||||||
LogConfig({
|
LogConfig({
|
||||||
this.sentryDsn,
|
this.sentryDsn,
|
||||||
|
this.tunnel,
|
||||||
this.sentryRetryDelay = const Duration(seconds: 30),
|
this.sentryRetryDelay = const Duration(seconds: 30),
|
||||||
this.logDirPath,
|
this.logDirPath,
|
||||||
this.maxLogFiles = 10,
|
this.maxLogFiles = 10,
|
||||||
|
@ -175,6 +180,11 @@ class SuperLogging {
|
||||||
await SentryFlutter.init(
|
await SentryFlutter.init(
|
||||||
(options) {
|
(options) {
|
||||||
options.dsn = config.sentryDsn;
|
options.dsn = config.sentryDsn;
|
||||||
|
options.httpClient = http.Client();
|
||||||
|
if (config.tunnel != null) {
|
||||||
|
options.transport =
|
||||||
|
TunneledTransport(Uri.parse(config.tunnel), options);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
appRunner: () => config.body(),
|
appRunner: () => config.body(),
|
||||||
);
|
);
|
||||||
|
|
|
@ -159,6 +159,7 @@ Future _runWithLogs(Function() function, {String prefix = ""}) async {
|
||||||
logDirPath: (await getTemporaryDirectory()).path + "/logs",
|
logDirPath: (await getTemporaryDirectory()).path + "/logs",
|
||||||
maxLogFiles: 5,
|
maxLogFiles: 5,
|
||||||
sentryDsn: kDebugMode ? kSentryDebugDSN : kSentryDSN,
|
sentryDsn: kDebugMode ? kSentryDebugDSN : kSentryDSN,
|
||||||
|
tunnel: kSentryTunnel,
|
||||||
enableInDebugMode: true,
|
enableInDebugMode: true,
|
||||||
prefix: prefix,
|
prefix: prefix,
|
||||||
));
|
));
|
||||||
|
|
1
thirdparty/sentry-dart
vendored
Submodule
1
thirdparty/sentry-dart
vendored
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 1ba4085ad44496f37392ae9172393d741fe65b75
|
Loading…
Add table
Reference in a new issue