mirror of
https://github.com/go-i2p/onramp.git
synced 2025-07-12 19:04:52 -04:00
don't log in GetJoinedWD for now because it is called prior to
This commit is contained in:
13
common.go
13
common.go
@ -4,12 +4,13 @@
|
||||
package onramp
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
//go:generate go run -tags gen ./gen.go
|
||||
@ -18,23 +19,23 @@ import (
|
||||
func GetJoinedWD(dir string) (string, error) {
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Failed to get working directory")
|
||||
//log.WithError(err).Error("Failed to get working directory")
|
||||
return "", err
|
||||
}
|
||||
jwd := filepath.Join(wd, dir)
|
||||
ajwd, err := filepath.Abs(jwd)
|
||||
if err != nil {
|
||||
log.WithError(err).WithField("path", jwd).Error("Failed to get absolute path")
|
||||
//log.WithError(err).WithField("path", jwd).Error("Failed to get absolute path")
|
||||
return "", err
|
||||
}
|
||||
if _, err := os.Stat(ajwd); err != nil {
|
||||
log.WithField("path", ajwd).Debug("Directory does not exist, creating")
|
||||
//log.WithField("path", ajwd).Debug("Directory does not exist, creating")
|
||||
if err := os.MkdirAll(ajwd, 0755); err != nil {
|
||||
log.WithError(err).WithField("path", ajwd).Error("Failed to create directory")
|
||||
//log.WithError(err).WithField("path", ajwd).Error("Failed to create directory")
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
log.WithField("path", ajwd).Debug("Successfully got joined working directory")
|
||||
//log.WithField("path", ajwd).Debug("Successfully got joined working directory")
|
||||
return ajwd, nil
|
||||
}
|
||||
|
||||
|
@ -7,12 +7,13 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"github.com/sirupsen/logrus"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/go-i2p/i2pkeys"
|
||||
"github.com/go-i2p/sam3"
|
||||
)
|
||||
|
@ -2,10 +2,14 @@ package onramp
|
||||
|
||||
import "github.com/go-i2p/sam3"
|
||||
|
||||
var OPT_DEFAULTS = sam3.Options_Default
|
||||
var OPT_WIDE = sam3.Options_Wide
|
||||
var (
|
||||
OPT_DEFAULTS = sam3.Options_Default
|
||||
OPT_WIDE = sam3.Options_Wide
|
||||
)
|
||||
|
||||
var OPT_HUGE = sam3.Options_Humongous
|
||||
var OPT_LARGE = sam3.Options_Large
|
||||
var OPT_MEDIUM = sam3.Options_Medium
|
||||
var OPT_SMALL = sam3.Options_Small
|
||||
var (
|
||||
OPT_HUGE = sam3.Options_Humongous
|
||||
OPT_LARGE = sam3.Options_Large
|
||||
OPT_MEDIUM = sam3.Options_Medium
|
||||
OPT_SMALL = sam3.Options_Small
|
||||
)
|
||||
|
3
log.go
3
log.go
@ -1,11 +1,12 @@
|
||||
package onramp
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var (
|
||||
|
3
onion.go
3
onion.go
@ -7,11 +7,12 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"github.com/sirupsen/logrus"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/cretz/bine/tor"
|
||||
"github.com/cretz/bine/torutil/ed25519"
|
||||
)
|
||||
|
3
proxy.go
3
proxy.go
@ -1,10 +1,11 @@
|
||||
package onramp
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"io"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type OnrampProxy struct {
|
||||
|
Reference in New Issue
Block a user