Skip to content
Snippets Groups Projects
Commit 4f7c072d authored by Travis Ralston's avatar Travis Ralston
Browse files

Move away from gopass now that it's broken

parent ce141c6a
No related branches found
No related tags found
No related merge requests found
...@@ -6,11 +6,11 @@ import ( ...@@ -6,11 +6,11 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"os"
"strconv" "strconv"
"sync" "sync"
"time" "time"
"github.com/howeyc/gopass"
"github.com/Jeffail/tunny" "github.com/Jeffail/tunny"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"github.com/turt2live/matrix-media-repo/common" "github.com/turt2live/matrix-media-repo/common"
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"github.com/turt2live/matrix-media-repo/controllers/upload_controller" "github.com/turt2live/matrix-media-repo/controllers/upload_controller"
"github.com/turt2live/matrix-media-repo/storage" "github.com/turt2live/matrix-media-repo/storage"
"github.com/turt2live/matrix-media-repo/synapse" "github.com/turt2live/matrix-media-repo/synapse"
"golang.org/x/crypto/ssh/terminal"
) )
type fetchRequest struct { type fetchRequest struct {
...@@ -48,8 +49,14 @@ func main() { ...@@ -48,8 +49,14 @@ func main() {
var realPsqlPassword string var realPsqlPassword string
if *postgresPassword == "" { if *postgresPassword == "" {
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
fmt.Println("Sorry, your terminal does not support reading passwords. Please supply a -dbPassword or use a different terminal.")
fmt.Println("If you're on Windows, try using a plain Command Prompt window instead of a bash-like terminal.")
os.Exit(1)
return // for good measure
}
fmt.Printf("Postgres password: ") fmt.Printf("Postgres password: ")
pass, err := gopass.GetPasswd() pass, err := terminal.ReadPassword(int(os.Stdin.Fd()))
if err != nil { if err != nil {
panic(err) panic(err)
} }
......
...@@ -26,7 +26,7 @@ require ( ...@@ -26,7 +26,7 @@ require (
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/gorilla/mux v1.7.4 github.com/gorilla/mux v1.7.4
github.com/h2non/filetype v1.0.12 github.com/h2non/filetype v1.0.12
github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c github.com/ipfs/go-cid v0.0.3
github.com/ipfs/go-ipfs-http-client v0.0.5 github.com/ipfs/go-ipfs-http-client v0.0.5
github.com/ipfs/interface-go-ipfs-core v0.2.6 github.com/ipfs/interface-go-ipfs-core v0.2.6
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
...@@ -37,8 +37,6 @@ require ( ...@@ -37,8 +37,6 @@ require (
github.com/lib/pq v1.3.0 github.com/lib/pq v1.3.0
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/minio/minio-go v6.0.14+incompatible github.com/minio/minio-go v6.0.14+incompatible
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/olebedev/emitter v0.0.0-20190110104742-e8d1457e6aee github.com/olebedev/emitter v0.0.0-20190110104742-e8d1457e6aee
github.com/patrickmn/go-cache v2.1.0+incompatible github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea // indirect github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea // indirect
...@@ -52,9 +50,9 @@ require ( ...@@ -52,9 +50,9 @@ require (
github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus v1.4.2
github.com/smartystreets/goconvey v1.6.4 // indirect github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/tebeka/strftime v0.1.3 // indirect github.com/tebeka/strftime v0.1.3 // indirect
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
golang.org/x/image v0.0.0-20200119044424-58c23975cae1 golang.org/x/image v0.0.0-20200119044424-58c23975cae1
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.4.0 // indirect
gopkg.in/ini.v1 v1.52.0 // indirect gopkg.in/ini.v1 v1.52.0 // indirect
gopkg.in/yaml.v2 v2.2.8 gopkg.in/yaml.v2 v2.2.8
) )
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment