官方文档
https://develop.sentry.dev/self-hosted/
一、前提
服务器配置至少4C16G,否则起不来
二、安装docker
https://blog.csdn.net/weixin_45112997/article/details/134532660
三、安装docker-compose
docker-compose版本有要求,必须大于2.17
https://github.com/docker/compose/releases
wget https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64
mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
chmod +x docker-compose
四、下载源码包
https://github.com/getsentry/self-hosted/releases
wget https://codeload.github.com/getsentry/self-hosted/zip/refs/tags/24.7.1
unzip self-hosted-24.7.1.zip -d /data
五、安装并配置账号密码
问题1:安装过程中卡在 updating Docker images
解决:注释/data/self-hosted-24.7.1/install.sh中的更新脚本命令
或者ctrl + c 跳过,如果是结束安装的话,则需要按上面的注释掉
开始安装
cd /data/self-hosted-24.7.1
./install.sh
选择Y后,输入管理员登录的账号和密码,密码需要输入两次
六、修改配置
问题2:浏览器访问报错
查看容器sentry-self-hosted-web-1日志
django.security.csrf: Forbidden (Origin checking failed - http://sentry:9000 does not match any trusted origins.): /auth/login/sentry/ (status_code=403 request=<WSGIRequest:
解决
配置 CSRF_TRUSTED_ORIGINS:在 Sentry 的配置文件 sentry.conf.py 中,您可以设置 CSRF_TRUSTED_ORIGINS 变量,添加访问 Sentry 的域名或 IP 地址
vim /data/self-hosted-24.7.1/sentry/sentry.conf.py
CSRF_TRUSTED_ORIGINS = ["https://example.com", "http://127.0.0.1:9000"]
七、配置smtp
vim /data/self-hosted-24.7.1/sentry/config.yml
mail.backend: 'smtp' # Use dummy if you want to disable email entirely
mail.host: 'smtp.exmail.qq.com'
mail.port: 465
mail.username: 'mail@com.cn'
mail.password: 'mail@password'
mail.use-tls: false
# mail.use-ssl: false
mail.from: 'mail@com.cn'
八、启动
docker-compose up -d
九、访问验证,配置中文
浏览器访问上面CSRF_TRUSTED_ORIGINS配置的sentry地址