dutchcoders / transfer.sh

Easy and fast file sharing from the command-line.
https://github.com/dutchcoders/transfer.sh
MIT License
15.09k stars 1.54k forks source link

The readme file doesn't explain how to deploy a server for a VPS #528

Closed W01v3n closed 1 year ago

W01v3n commented 1 year ago

I really don't get it, why always make the right documentation for docker and not for a VPS? I am using a VPS and I don't want to use docker, why are you forcing me? How can I deploy it like an oldschooler with nginx?? Please!

aspacca commented 1 year ago

@W01v3n what are the information you are missing in order to deploy?

W01v3n commented 1 year ago

@aspacca Well, I got a VPS with NGINX on it that's using port 443. And I'd like to keep using NGINX with port 443 but I also want to include a virtual host for transfer.sh, even through a reverse proxy. How can I do that? I didn't see anything on the docs that can help with that. Thanks!

aspacca commented 1 year ago

@W01v3n do you already know how to set up a virtual host on nginx, using it as a reverse proxy to a backend service?

W01v3n commented 1 year ago

@aspacca I do know how to set up a virtual host on NGINX, but I have less experience doing it as a reverse proxy. That's why I can really use a guide for that, because I really want to use transfer.sh, but I want to have control on how I serve it via NGINX.

aspacca commented 1 year ago

there's nothing different for using nginx as reverse proxy for transfer.sh than for anything else

here's a template

server {
  listen %YOUR.IP%:443 ssl;
  server_name %YOUR.DOMAIN%;

  access_log %YOUR.ACCESS_LOG_FILE_PATH%;
  error_log %YOUR.ERROR_LOG_FILE_PATH%;

  ssl_certificate %YOUR.FULLCHAIN_PEM_FILE_PATH%;
  ssl_certificate_key %YOUR.PRIVKEY_PEM_FILE_PATH%;

  client_max_body_size %MAX_SIZE_OF_YOUR_TRANSFERSH_UPLOAD%; 

  location / {
    proxy_request_buffering off;
    proxy_set_header Host $host;
    proxy_pass_request_headers      on;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass https://%IP_OF_LOCAL_TRANSFERSH%:%PORT_OF_LOCAL_TRANSFERSH%/;
  }
}

you then start transfer.sh with tls listener, using the same files as the one defined in the nginx configuration

I will add this to the readme as soon as I will have time

W01v3n commented 1 year ago

@aspacca That can work, great. Now I just need to know how can I make it work with the web interface as well. Maybe you can help even further with explaining that too, or am I being a little too greedy? Thanks a lot!

aspacca commented 1 year ago

do you have a dns entry for %YOUR.DOMAIN% pointing to %YOUR.IP%?

that's it

if curl --upload-file etc is working then you can just open https://%YOUR.DOMAIN%

W01v3n commented 1 year ago

@aspacca Oh, I thought that it wouldn't work because there is a different repository for the web interface: https://github.com/dutchcoders/transfer.sh-web

W01v3n commented 1 year ago

I'll definitely try that, thanks a lot @aspacca !!!

W01v3n commented 1 year ago

@aspacca The original repository does not include any HTML files.. I went to this repository https://github.com/dutchcoders/transfer.sh-web and I did everything that was instructed, but it's still not complete, the dist directory was created but nothing inside it but fonts.

W01v3n commented 1 year ago

Look, I'm pretty 100% sure that nobody got this to work. It looks like this entire is project is corrupt and broken to begin with, so before you will completely tarnish the name of go, I'm going to stop trying. Just so you know, running the command go run main.go --web-path /home/transfersh/transfer.sh-web/src --basedir /home/transfersh/basedir gives the following hideous output:

[transfersh@Artemis transfer.sh]$ go run main.go --web-path /home/transfersh/transfer.sh-web/src --basedir /home/transfersh/basedir
server/server.go:47:2: cannot find package "github.com/PuerkitoBio/ghost/handlers" in any of:
        /usr/local/go/src/github.com/PuerkitoBio/ghost/handlers (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/PuerkitoBio/ghost/handlers (from $GOPATH)
server/server.go:48:2: cannot find package "github.com/VojtechVitek/ratelimit" in any of:
        /usr/local/go/src/github.com/VojtechVitek/ratelimit (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/VojtechVitek/ratelimit (from $GOPATH)
server/server.go:49:2: cannot find package "github.com/VojtechVitek/ratelimit/memory" in any of:
        /usr/local/go/src/github.com/VojtechVitek/ratelimit/memory (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/VojtechVitek/ratelimit/memory (from $GOPATH)
server/storage/s3.go:10:2: cannot find package "github.com/aws/aws-sdk-go/aws" in any of:
        /usr/local/go/src/github.com/aws/aws-sdk-go/aws (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/aws/aws-sdk-go/aws (from $GOPATH)
server/storage/s3.go:11:2: cannot find package "github.com/aws/aws-sdk-go/aws/awserr" in any of:
        /usr/local/go/src/github.com/aws/aws-sdk-go/aws/awserr (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/aws/aws-sdk-go/aws/awserr (from $GOPATH)
server/storage/s3.go:12:2: cannot find package "github.com/aws/aws-sdk-go/aws/credentials" in any of:
        /usr/local/go/src/github.com/aws/aws-sdk-go/aws/credentials (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/aws/aws-sdk-go/aws/credentials (from $GOPATH)
server/storage/s3.go:13:2: cannot find package "github.com/aws/aws-sdk-go/aws/session" in any of:
        /usr/local/go/src/github.com/aws/aws-sdk-go/aws/session (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/aws/aws-sdk-go/aws/session (from $GOPATH)
server/storage/s3.go:14:2: cannot find package "github.com/aws/aws-sdk-go/service/s3" in any of:
        /usr/local/go/src/github.com/aws/aws-sdk-go/service/s3 (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/aws/aws-sdk-go/service/s3 (from $GOPATH)
server/storage/s3.go:15:2: cannot find package "github.com/aws/aws-sdk-go/service/s3/s3manager" in any of:
        /usr/local/go/src/github.com/aws/aws-sdk-go/service/s3/s3manager (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/aws/aws-sdk-go/service/s3/s3manager (from $GOPATH)
server/clamav.go:37:2: cannot find package "github.com/dutchcoders/go-clamd" in any of:
        /usr/local/go/src/github.com/dutchcoders/go-clamd (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/dutchcoders/go-clamd (from $GOPATH)
server/virustotal.go:33:2: cannot find package "github.com/dutchcoders/go-virustotal" in any of:
        /usr/local/go/src/github.com/dutchcoders/go-virustotal (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/dutchcoders/go-virustotal (from $GOPATH)
server/handlers.go:57:2: cannot find package "github.com/dutchcoders/transfer.sh-web" in any of:
        /usr/local/go/src/github.com/dutchcoders/transfer.sh-web (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/dutchcoders/transfer.sh-web (from $GOPATH)
server/server.go:56:2: cannot find package "github.com/elazarl/go-bindata-assetfs" in any of:
        /usr/local/go/src/github.com/elazarl/go-bindata-assetfs (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/elazarl/go-bindata-assetfs (from $GOPATH)
cmd/cmd.go:11:2: cannot find package "github.com/fatih/color" in any of:
        /usr/local/go/src/github.com/fatih/color (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/fatih/color (from $GOPATH)
server/utils.go:36:2: cannot find package "github.com/golang/gddo/httputil/header" in any of:
        /usr/local/go/src/github.com/golang/gddo/httputil/header (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/golang/gddo/httputil/header (from $GOPATH)
server/server.go:50:2: cannot find package "github.com/gorilla/handlers" in any of:
        /usr/local/go/src/github.com/gorilla/handlers (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/gorilla/handlers (from $GOPATH)
server/clamav.go:38:2: cannot find package "github.com/gorilla/mux" in any of:
        /usr/local/go/src/github.com/gorilla/mux (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/gorilla/mux (from $GOPATH)
server/handlers.go:59:2: cannot find package "github.com/microcosm-cc/bluemonday" in any of:
        /usr/local/go/src/github.com/microcosm-cc/bluemonday (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/microcosm-cc/bluemonday (from $GOPATH)
server/handlers.go:60:2: cannot find package "github.com/russross/blackfriday/v2" in any of:
        /usr/local/go/src/github.com/russross/blackfriday/v2 (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/russross/blackfriday/v2 (from $GOPATH)
server/handlers.go:61:2: cannot find package "github.com/skip2/go-qrcode" in any of:
        /usr/local/go/src/github.com/skip2/go-qrcode (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/skip2/go-qrcode (from $GOPATH)
server/ip_filter.go:21:2: cannot find package "github.com/tomasen/realip" in any of:
        /usr/local/go/src/github.com/tomasen/realip (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/tomasen/realip (from $GOPATH)
cmd/cmd.go:12:2: cannot find package "github.com/urfave/cli" in any of:
        /usr/local/go/src/github.com/urfave/cli (from $GOROOT)
        /home/transfersh/go_projects/src/github.com/urfave/cli (from $GOPATH)
server/server.go:52:2: cannot find package "golang.org/x/crypto/acme/autocert" in any of:
        /usr/local/go/src/golang.org/x/crypto/acme/autocert (from $GOROOT)
        /home/transfersh/go_projects/src/golang.org/x/crypto/acme/autocert (from $GOPATH)
server/handlers.go:62:2: cannot find package "golang.org/x/net/idna" in any of:
        /usr/local/go/src/golang.org/x/net/idna (from $GOROOT)
        /home/transfersh/go_projects/src/golang.org/x/net/idna (from $GOPATH)
server/storage/gdrive.go:16:2: cannot find package "golang.org/x/oauth2" in any of:
        /usr/local/go/src/golang.org/x/oauth2 (from $GOROOT)
        /home/transfersh/go_projects/src/golang.org/x/oauth2 (from $GOPATH)
server/storage/gdrive.go:17:2: cannot find package "golang.org/x/oauth2/google" in any of:
        /usr/local/go/src/golang.org/x/oauth2/google (from $GOROOT)
        /home/transfersh/go_projects/src/golang.org/x/oauth2/google (from $GOPATH)
server/storage/gdrive.go:18:2: cannot find package "google.golang.org/api/drive/v3" in any of:
        /usr/local/go/src/google.golang.org/api/drive/v3 (from $GOROOT)
        /home/transfersh/go_projects/src/google.golang.org/api/drive/v3 (from $GOPATH)
server/storage/gdrive.go:19:2: cannot find package "google.golang.org/api/googleapi" in any of:
        /usr/local/go/src/google.golang.org/api/googleapi (from $GOROOT)
        /home/transfersh/go_projects/src/google.golang.org/api/googleapi (from $GOPATH)
server/storage/gdrive.go:20:2: cannot find package "google.golang.org/api/option" in any of:
        /usr/local/go/src/google.golang.org/api/option (from $GOROOT)
        /home/transfersh/go_projects/src/google.golang.org/api/option (from $GOPATH)
server/storage/storj.go:10:2: cannot find package "storj.io/common/fpath" in any of:
        /usr/local/go/src/storj.io/common/fpath (from $GOROOT)
        /home/transfersh/go_projects/src/storj.io/common/fpath (from $GOPATH)
server/storage/storj.go:11:2: cannot find package "storj.io/common/storj" in any of:
        /usr/local/go/src/storj.io/common/storj (from $GOROOT)
        /home/transfersh/go_projects/src/storj.io/common/storj (from $GOPATH)
server/storage/storj.go:12:2: cannot find package "storj.io/uplink" in any of:
        /usr/local/go/src/storj.io/uplink (from $GOROOT)
        /home/transfersh/go_projects/src/storj.io/uplink (from $GOPATH)

I've given up, I don't think anyone got this thing to work. You really should work on your documentations and your code, 'cause it doesn't work at all.

aspacca commented 1 year ago

The original repository does not include any HTML files..

because the files are embegged in a go file in the transfer.sh-web package that's used as depdency

unless you want to customise the frontend there's no need for html files

aspacca commented 1 year ago

Look, I'm pretty 100% sure that nobody got this to work.

I have the impression you need much more documentation than just the one about running/seting up transfer.sh

Given your behaviour against the code of conduct, and not being me interested in adding a 101 about go in the documenation I'm going to close this issue