Skip to content

Commit

Permalink
Merge branch 'master' into sictiru
Browse files Browse the repository at this point in the history
* master:
  Updating Sentry
  • Loading branch information
samuelclay committed Apr 29, 2024
2 parents 93d9612 + 56cd514 commit ffec600
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
14 changes: 11 additions & 3 deletions ansible/roles/sentry/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
---
- name: Ensure /srv exists and is owned by user
become: yes
file:
path: /srv
state: directory
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
mode: 0755

- name: Pull sentry self-hosted github
git:
repo: https://github.com/getsentry/self-hosted.git
dest: /srv/sentry/
version: master
version: 24.4.1

- name: Updating Sentry
command:
chdir: /srv/sentry/
cmd: ./install.sh
cmd: ./install.sh --no-report-self-hosted-issues

- name: docker-compuse up -d
command:
Expand All @@ -24,4 +33,3 @@
notify:
- reload consul
when: disable_consul_services_ie_staging is not defined

2 changes: 1 addition & 1 deletion ansible/roles/sentry/templates/consul_service.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"service": {
"name": "{{ inventory_hostname|regex_replace('\d+', '') }}",
"name": "{{ inventory_hostname|regex_replace('\-?\d+', '')|regex_replace("hdb-", "db-") }}",
"id": "{{ inventory_hostname }}",
"tags": [
"sentry"
Expand Down
3 changes: 2 additions & 1 deletion apps/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ def ip_addresses(request):
with open('/srv/newsblur/apps/api/ip_addresses.txt', 'r') as f:
addresses = f.read()

mail_admins(f"IP Addresses accessed from {request.META['REMOTE_ADDR']} by {request.user}", addresses)
if request.user.is_authenticated:
mail_admins(f"IP Addresses accessed from {request.META['REMOTE_ADDR']} by {request.user}", addresses)

return HttpResponse(addresses, content_type='text/plain')

0 comments on commit ffec600

Please sign in to comment.