mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 20:31:30 +02:00
replace ENABLE_SENTRY by SENTRY_DSN
This commit is contained in:
parent
03ce470cea
commit
66091b4f9e
@ -1,8 +1,8 @@
|
|||||||
# Server url
|
# Server url
|
||||||
URL=http://localhost:7777
|
URL=http://localhost:7777
|
||||||
|
|
||||||
# Enable sentry
|
# If you want to enable sentry for error tracking, put your sentry dsn here.
|
||||||
ENABLE_SENTRY=true
|
# SENTRY_DSN=your_sentry_dsn
|
||||||
|
|
||||||
# apply colored log
|
# apply colored log
|
||||||
COLOR_LOG=true
|
COLOR_LOG=true
|
||||||
|
@ -34,8 +34,7 @@ PROMO_CODE = "SIMPLEISBETTER"
|
|||||||
URL = os.environ["URL"]
|
URL = os.environ["URL"]
|
||||||
print(">>> URL:", URL)
|
print(">>> URL:", URL)
|
||||||
|
|
||||||
# Whether sentry is enabled
|
SENTRY_DSN = os.environ.get("SENTRY_DSN")
|
||||||
ENABLE_SENTRY = "ENABLE_SENTRY" in os.environ
|
|
||||||
|
|
||||||
# Email related settings
|
# Email related settings
|
||||||
NOT_SEND_EMAIL = "NOT_SEND_EMAIL" in os.environ
|
NOT_SEND_EMAIL = "NOT_SEND_EMAIL" in os.environ
|
||||||
|
@ -17,7 +17,7 @@ from app.auth.base import auth_bp
|
|||||||
from app.config import (
|
from app.config import (
|
||||||
DB_URI,
|
DB_URI,
|
||||||
FLASK_SECRET,
|
FLASK_SECRET,
|
||||||
ENABLE_SENTRY,
|
SENTRY_DSN,
|
||||||
URL,
|
URL,
|
||||||
SHA1,
|
SHA1,
|
||||||
PADDLE_MONTHLY_PRODUCT_ID,
|
PADDLE_MONTHLY_PRODUCT_ID,
|
||||||
@ -42,10 +42,10 @@ from app.models import (
|
|||||||
from app.monitor.base import monitor_bp
|
from app.monitor.base import monitor_bp
|
||||||
from app.oauth.base import oauth_bp
|
from app.oauth.base import oauth_bp
|
||||||
|
|
||||||
if ENABLE_SENTRY:
|
if SENTRY_DSN:
|
||||||
LOG.d("enable sentry")
|
LOG.d("enable sentry")
|
||||||
sentry_sdk.init(
|
sentry_sdk.init(
|
||||||
dsn="https://ad2187ed843340a1b4165bd8d5d6cdce@sentry.io/1478143",
|
dsn=SENTRY_DSN,
|
||||||
integrations=[FlaskIntegration()],
|
integrations=[FlaskIntegration()],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ def jinja2_filter(app):
|
|||||||
@app.context_processor
|
@app.context_processor
|
||||||
def inject_stage_and_region():
|
def inject_stage_and_region():
|
||||||
return dict(
|
return dict(
|
||||||
YEAR=arrow.now().year, URL=URL, ENABLE_SENTRY=ENABLE_SENTRY, VERSION=SHA1
|
YEAR=arrow.now().year, URL=URL, SENTRY_DSN=SENTRY_DSN, VERSION=SHA1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,10 +92,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
{% if ENABLE_SENTRY %}
|
{% if SENTRY_DSN %}
|
||||||
console.log("Init sentry");
|
console.log("Init sentry");
|
||||||
try {
|
try {
|
||||||
Sentry.init({dsn: 'https://ad2187ed843340a1b4165bd8d5d6cdce@sentry.io/1478143'});
|
Sentry.init({dsn: '{{SENTRY_DSN}}'});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Sentry error, probably due to AdBlocker ...")
|
console.log("Sentry error, probably due to AdBlocker ...")
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
# Server url
|
# Server url
|
||||||
URL=http://localhost
|
URL=http://localhost
|
||||||
|
|
||||||
# Enable sentry
|
|
||||||
# ENABLE_SENTRY=true
|
|
||||||
|
|
||||||
# Email related settings
|
# Email related settings
|
||||||
# Only print email content, not sending it
|
# Only print email content, not sending it
|
||||||
NOT_SEND_EMAIL=true
|
NOT_SEND_EMAIL=true
|
||||||
|
Loading…
Reference in New Issue
Block a user