错误日志sentry搭

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/PersonalM/article/details/82716156
看了网上的文章感觉千篇一律,决定自己随笔一下,怕以后忘了

 

环境依赖:

docker,docker-composer(官网推荐用docker安装)

pip install docker-compose
找到一个安装目录,当前假定为 /opt/sentry,并进入此目录。

首先拉取配置和构建文件仓库:
git clone https://github.com/getsentry/onpremise.git
然后进入目录仓库目录,默认为 onpremise。
Assuming you've just cloned this repository, the following steps will get you up and running in no time!

There may need to be modifications to the included docker-compose.yml file to accommodate your needs or your environment. These instructions are a guideline for what you should generally do.

1. mkdir -p data/{sentry,postgres} 
2. docker-compose build 
3. docker-compose run --rm web config generate-secret-key - Generate a secret key. Add it to docker-compose.yml in base as SENTRY_SECRET_KEY.
4. docker-compose run --rm web upgrade - Build the database. Use the interactive prompts to create a user account.
5. docker-compose up -d - Lift all services (detached/background mode).

如果不成功多试几下,第三步吧secret key 粘到docker-compose.yml中,发送邮件的时候需要配置config.yml,

还有一个注意的是重启docker-compose的时候,

1. docker-compose down
2. docker-compose build
3. docker-composer up -d 
这样才能重启服务

配置nginx文件

因为docker已经帮我们配置好端口,所以只需要在服务器做个反向代理监听9000端口即可

upstream sentry  {
    server 127.0.0.1:9000; #Apache
}
server {
  listen 80;


}

完工.

当然可能这里面有一点小坑

1.要配置你的邮箱服务 在config.yml
mail.backend: 'django_smtp_ssl.SSLEmailBackend'  # Use dummy if you want to disable email entirely
mail.host: 'smtp.163.com'
mail.port: 465
mail.username: '[email protected]'
mail.password: 'xxxxxx'
mail.use-tls: false
# The email address to send on behalf of
mail.from: '[email protected]'
2.执行 pip install django-smtp-ssl 命令,安装 django-smtp-ssl将邮件的 backend 替换为 django_smtp_ssl.SSLEmailBackend
3.在requirements.txt文件中加入django-smtp-ssl~=1.0,重新编译就好了(这些是要启用邮箱发送服务)

猜你喜欢

转载自blog.csdn.net/PersonalM/article/details/82716156