@@ -3,7 +3,6 @@ echo "${_group}Setting up error handling ..."
33export SENTRY_DSN=
' https://[email protected] /3' 44export SENTRY_ORG=self-hosted
55export SENTRY_PROJECT=installer
6- export REPORT_ERRORS=0
76
87function send_event {
98 local sentry_cli=" docker run --rm -v $basedir :/work -e SENTRY_ORG=$SENTRY_ORG -e SENTRY_PROJECT=$SENTRY_PROJECT -e SENTRY_DSN=$SENTRY_DSN getsentry/sentry-cli"
@@ -12,67 +11,69 @@ function send_event {
1211 command popd > /dev/null
1312}
1413
15- reporterrors=" $basedir /.reporterrors"
16- if [[ -f $reporterrors ]]; then
17- echo -n " Found a .reporterrors file. What does it say? "
18- cat $reporterrors
19- if [[ " $( cat $reporterrors ) " == " yes" ]]; then
20- export REPORT_ERRORS=1
21- else
22- export REPORT_ERRORS=0
23- fi
24- else
14+ if [[ -z " ${REPORT_SELF_HOSTED_ISSUES:- } " ]]; then
2515 if [[ $PROMPTABLE == " 0" ]]; then
2616 echo
27- echo " Hey, so ... we would love to find out when you hit an issue with this here"
28- echo " installer you are running. Turns out there is an app for that, called Sentry."
29- echo " Would you be willing to let us automatically send data to Sentry from this "
30- echo " installer? If so, add this to your automation:"
17+ echo " Hey, so ... we would love to automatically find out about issues with your"
18+ echo " Sentry instance so that we can improve the product. Turns out there is an app"
19+ echo " for that, called Sentry. Would you be willing to let us automatically send data"
20+ echo " about your instance upstream to Sentry for development and debugging purposes?"
21+ echo " If so, rerun with:"
22+ echo
23+ echo " ./install.sh --report-self-hosted-issues"
24+ echo
25+ echo " or"
3126 echo
32- echo " echo yes > /path/to/sentry/.reporterrors "
27+ echo " REPORT_SELF_HOSTED_ISSUES=1 ./install.sh "
3328 echo
3429 echo " (Btw, we send this to our own self-hosted Sentry instance, not to Sentry SaaS,"
3530 echo " so that we can be in this together.)"
3631 echo
37- echo " Here's the info we may collect in order to help us improve the installer :"
32+ echo " Here's the info we may collect:"
3833 echo
3934 echo " - OS username"
4035 echo " - IP address"
4136 echo " - install log"
37+ echo " - runtime errors"
4238 echo " - performance data"
4339 echo
4440 echo " Thirty (30) day retention. No marketing. Privacy policy at sentry.io/privacy."
4541 echo
46- echo " For now we are defaulting to not sending data , but our plan is to hard-require "
47- echo " a choice from you starting in version 22.10.0, because let's be honest, none of "
48- echo " you will act on this otherwise. To avoid disruption you can use one of these "
49- echo " flags:"
42+ echo " For now we are defaulting to not reporting upstream , but our plan is to"
43+ echo " hard-require a choice from you starting in version 22.10.0, because let's be"
44+ echo " honest, none of you will act on this otherwise. To avoid disruption you can use"
45+ echo " one of these flags:"
5046 echo
51- echo " echo no > /path/to/sentry/.reporterrors"
47+ echo " --report-self-hosted-issues"
48+ echo " --no-report-self-hosted-issues"
5249 echo
53- echo " We'll probably also add an env var and/ or CLI flag before then, too. See :"
50+ echo " or the REPORT_SELF_HOSTED_ISSUES environment variable :"
5451 echo
55- echo " https://github.com/getsentry/team-ospo/issues/36"
52+ echo " REPORT_SELF_HOSTED_ISSUES=1 to send data"
53+ echo " REPORT_SELF_HOSTED_ISSUES=0 to not send data"
5654 echo
5755 echo " Thanks for using Sentry."
5856 echo
57+ export REPORT_SELF_HOSTED_ISSUES=0 # opt-in for now
5958 else
6059 echo
61- echo " Hey, so ... we would love to find out when you hit an issue with this here"
62- echo " installer you are running. Turns out there is an app for that, called Sentry."
63- echo " Are you okay with us sending info to Sentry when you run this installer?"
60+ echo " Hey, so ... we would love to automatically find out about issues with your"
61+ echo " Sentry instance so that we can improve the product. Turns out there is an app"
62+ echo " for that, called Sentry. Would you be willing to let us automatically send data"
63+ echo " about your instance upstream to Sentry for development and debugging purposes?"
6464 echo
6565 echo " y / yes / 1"
6666 echo " n / no / 0"
6767 echo
6868 echo " (Btw, we send this to our own self-hosted Sentry instance, not to Sentry SaaS,"
6969 echo " so that we can be in this together.)"
7070 echo
71- echo " Here's the info we may collect in order to help us improve the installer :"
71+ echo " Here's the info we may collect:"
7272 echo
7373 echo " - OS username"
7474 echo " - IP address"
7575 echo " - install log"
76+ echo " - runtime errors"
7677 echo " - performance data"
7778 echo
7879 echo " Thirty (30) day retention. No marketing. Privacy policy at sentry.io/privacy."
8384 do
8485 read -p " y or n? " yn
8586 case $yn in
86- y | yes | 1) export REPORT_ERRORS=1 ; echo " yes " > $reporterrors ; echo ; echo -n " Thank you." ;;
87- n | no | 0) export REPORT_ERRORS=0 ; echo " no " > $reporterrors ; echo ; echo -n " Understood." ;;
87+ y | yes | 1) export REPORT_SELF_HOSTED_ISSUES=1 ; echo ; echo -n " Thank you." ;;
88+ n | no | 0) export REPORT_SELF_HOSTED_ISSUES=0 ; echo ; echo -n " Understood." ;;
8889 * ) yn=" " ;;
8990 esac
9091 done
9192
92- echo " Your answer is cached in '.reporterrors', remove it to see this"
93- echo " prompt again."
93+ echo " To avoid this prompt in the future, use one of these flags:"
94+ echo
95+ echo " --report-self-hosted-issues"
96+ echo " --no-report-self-hosted-issues"
97+ echo
98+ echo " or the REPORT_SELF_HOSTED_ISSUES environment variable:"
99+ echo
100+ echo " REPORT_SELF_HOSTED_ISSUES=1 to send data"
101+ echo " REPORT_SELF_HOSTED_ISSUES=0 to not send data"
94102 echo
95103 sleep 5
96104 fi
97105fi
98106
99107# Make sure we can use sentry-cli if we need it.
100- if [ " $REPORT_ERRORS " == 1 ]; then
108+ if [ " $REPORT_SELF_HOSTED_ISSUES " == 1 ]; then
101109 if ! docker pull getsentry/sentry-cli:latest; then
102- echo " Failed to pull sentry-cli, won't report errors after all."
103- export REPORT_ERRORS =0
110+ echo " Failed to pull sentry-cli, won't report to Sentry after all."
111+ export REPORT_SELF_HOSTED_ISSUES =0
104112 fi ;
105113fi ;
106114
@@ -139,7 +147,7 @@ cleanup () {
139147 fi
140148 echo " $traceback "
141149
142- if [ " $REPORT_ERRORS " == 1 ]; then
150+ if [ " $REPORT_SELF_HOSTED_ISSUES " == 1 ]; then
143151 local traceback_hash=$( echo -n $traceback | docker run --rm busybox md5sum | cut -d' ' -f1)
144152 send_event " $traceback_hash " " $cmd_exit "
145153 fi
0 commit comments