Skip to content

Commit c7d79e2

Browse files
Shaun DavisShaun Davis
authored andcommitted
Cleanup
1 parent 6744dae commit c7d79e2

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

cmd/main.go

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
148110
type 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",

pkg/flypg/node.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ type Credentials struct {
2121
type Node struct {
2222
AppName string
2323
PrivateIP net.IP
24-
Region string
2524
DataDir string
2625
SUCredentials Credentials
2726
OperatorCredentials Credentials
@@ -32,14 +31,9 @@ func NewNode() (*Node, error) {
3231
node := &Node{
3332
AppName: "local",
3433
PGPort: 5432,
35-
Region: "local",
3634
DataDir: "/data",
3735
}
3836

39-
if region := os.Getenv("FLY_REGION"); region != "" {
40-
node.Region = region
41-
}
42-
4337
if appName := os.Getenv("FLY_APP_NAME"); appName != "" {
4438
node.AppName = appName
4539
}

0 commit comments

Comments
 (0)