@@ -35,8 +35,6 @@ func main() {
3535 }
3636 }
3737
38- // TODO - This is just for dev'ing and will need to change. Additional users will be added by users
39- // and this will break things.
4038 if err := setDefaultHBA (); err != nil {
4139 PanicHandler (err )
4240 }
@@ -109,42 +107,6 @@ func setDirOwnership() {
109107 }
110108}
111109
112- // func setDefaultConfiguration() error {
113-
114- // mem, err := memTotal()
115- // if err != nil {
116- // return errors.Wrap(err, "error fetching total system memory")
117- // }
118-
119- // workMem := max(4, (mem / 64))
120- // maintenanceWorkMem := max(64, (mem / 20))
121-
122- // pgConfig := map[string]string{
123- // "listen_addresses": "fdaa:0:2e26:a7b:ab8:0:5fd4:2",
124- // "max_connections": "100",
125- // "port": "5432",
126- // "shared_buffers": fmt.Sprintf("%dMB", mem/4),
127- // "effective_cache_size": fmt.Sprintf("%dMB", 3*mem/4),
128- // "maintenance_work_mem": fmt.Sprintf("%dMB", maintenanceWorkMem),
129- // "work_mem": fmt.Sprintf("%dMB", workMem),
130- // "dynamic_shared_memory_type": "posix",
131- // "max_wal_size": "1GB",
132- // "min_wal_size": "80MB",
133- // }
134-
135- // file, err := os.OpenFile("/data/postgres/postgresql.conf", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)
136- // if err != nil {
137- // log.Fatal(err)
138- // }
139- // defer file.Close()
140- // for key, value := range pgConfig {
141- // str := fmt.Sprintf("%s = '%s'\n", key, value)
142- // file.WriteString(str)
143- // }
144-
145- // return nil
146- // }
147-
148110type HBAEntry struct {
149111 Type string
150112 Database string
@@ -163,22 +125,6 @@ func setDefaultHBA() error {
163125 Method : "trust" ,
164126 })
165127
166- entries = append (entries , HBAEntry {
167- Type : "host" ,
168- Database : "all" ,
169- User : "postgres" ,
170- Address : "0.0.0.0/0" ,
171- Method : "md5" ,
172- })
173-
174- entries = append (entries , HBAEntry {
175- Type : "host" ,
176- Database : "all" ,
177- User : "postgres" ,
178- Address : "::0/0" ,
179- Method : "md5" ,
180- })
181-
182128 entries = append (entries , HBAEntry {
183129 Type : "host" ,
184130 Database : "all" ,
0 commit comments