Skip to content

Commit aab2c37

Browse files
authored
Merge pull request supabase#34 from supabase/feat/add-logrotate
Feat/add logrotate
2 parents 9c0fef4 + f60b8e8 commit aab2c37

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

amazon-arm.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"aws_access_key": "",
44
"aws_secret_key": "",
55
"region": "ap-northeast-1",
6-
"ami_regions": "us-east-1,eu-central-1,eu-west-1,eu-west-2,ap-south-1,ap-southeast-1,ap-southeast-2,us-west-1,us-east-1,ca-central-1,sa-east-1",
6+
"ami_regions": "eu-central-1,eu-west-1,eu-west-2,ap-south-1,ap-southeast-1,ap-southeast-2,us-west-1,us-east-1,ca-central-1,sa-east-1",
77
"ami": "ami-03345e027f391e3dc",
8-
"ami_name": "supabase-postgres-arm-0.14.1",
8+
"ami_name": "supabase-postgres-arm-0.14.2",
99
"environment": "prod",
1010
"ansible_arguments": "--skip-tags,update-only -v"
1111
},

ansible/files/logrotate-postgres

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/var/lib/postgresql/12/main/pg_log/postgresql.csv {
2+
daily
3+
size 50M
4+
rotate 3
5+
copytruncate
6+
delaycompress
7+
compress
8+
notifempty
9+
missingok
10+
}

ansible/playbook.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@
3737
state: enabled
3838
policy: deny
3939
direction: incoming
40-
40+
41+
- name: Setup logrotate for postgres logs
42+
copy:
43+
src: files/logrotate-postgres
44+
dest: /etc/logrotate.d/postgres
45+
4146
# Install EC2 instance connect
4247
# Only for AWS images
4348
- name: install EC2 instance connect

scripts/91-log_cleanup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
#
44
echo "Clearing all log files"
55
rm -rf /var/log/*
6+
7+
# https://github.com/fail2ban/fail2ban/issues/1593
8+
touch /var/log/auth.log

0 commit comments

Comments
 (0)