Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
github.com/zavla/upload
Key features:
go get -v github.com/zavla/upload
or build.bat
or build.sh
This will run 'go build' for every /cmd/... with commit id compiled in.
you may upload files using specialized uploader (which supports continue of upload) :
uploader.exe -username zahar -file .\testdata\testbackups\sendfile.rar -passwordfile .\logins.json -cacert ./mkcertCA.pem -service https://127.0.0.1:64000/upload
or uploading the whole directory (no recursion) :
uploader.exe --username zahar --dir .\testdata\testbackups -passwordfile .\logins.json -cacert ./mkcertCA.pem -service https://127.0.0.1:64000/upload
You will need two files in PEM format with service's certificate e.x. 127.0.0.1.pem, 127.0.0.1-key.pem. You need to generate certificate pair by yourself.
I prefer https://github.com/FiloSottile/mkcert for this.
uploadserver.exe -log .\testdata\service.log -root .\testdata\storageroot\ -config ./ -listenOn 127.0.0.1:64000
servicecreate.ps1
Usage:
uploadserver -root dir [-log file] -config dir -listenOn ip:port [-listenOn2 ip:port] [-debug] [-asService]
uploadserver -adduser name -config dir
-adduser string
will add a login and save a password to logins.json file in -config dir.
-asService
start as a Windows service.
-config directory
directory with logins.json file (required).
-debug
debug, make available /debug/pprof/* URLs in service for profile
-listenOn address:port
listen on specified address:port. (default "127.0.0.1:64000")
-listenOn2 address:port
listen on specified address:port.
-log file
log file name.
-root path
storage root path for files.
-version version
print version
func ExampleSendAFile() {
// a jar to hold our cookies
jar, _ := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})
// specify where to connect
config := uploadclient.ConnectConfig{
ToURL: "https://127.0.0.1:64000/upload/testuser",
Password: "testuser",
//PasswordHash: string, // you better to use a hash of a password
Username: "testuser",
InsecureSkipVerify: true, // skips certificates chain test, don't use 'true' in production, of course use a CAPool!
//CApool: *x509.CertPool, // a root CA public certificate that signed a service's certificate
}
// use context to have a cancel of a long running upload process
ctx, callmetofreeresources := context.WithDeadline(
context.Background(),
time.Now().Add(time.Second*10),
)
defer callmetofreeresources()
const filename = "./testdata/testfile.txt"
// compute sha1
sha1file := sha1get(filename)
err := uploadclient.SendAFile(ctx, &config, filename, jar, sha1file)
if err != nil {
println(err.Error())
return
}
println("Normal OK:")
// Output:
// Normal OK:
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.