Giter VIP home page Giter VIP logo

linksharing's Introduction

THIS PACKAGE IS NO LONGER MAINTAINED - PLEASE SEE GATEWAY-MT'S LINKSHARING CMD


Link Sharing Service

Building

$ go install storj.io/linksharing

Configuring

Development

Default development configuration has the link sharing service hosted on localhost:8080 serving plain HTTP.

$ linksharing setup --defaults dev

Production

To configure the link sharing service for production, run the setup command using the release defaults. An required argument is the location of the geo-location database. You must also provide the public URL for the sharing service, which is used to construct URLs returned to clients. Since there is currently no server affinity for requests, the URL can point to a pool of servers:

$ linksharing setup --defaults release --geo-location-db <PATH TO FILE> --public-url <PUBLIC URL>

NOTE: Please follow this link for instructions how to install/download the geo-location database: https://dev.maxmind.com/geoip/geoipupdate/

Default release configuration has the link sharing service hosted on :8443 serving HTTPS using a server certificate (server.crt.pem) and key (server.key.pem) residing in the working directory where the linksharing service is run.

You can modify the configuration file or use the --cert-file and --key-file flags to configure an alternate location for the server keypair.

In order to run the link sharing service in release mode serving HTTP, you must clear the certificate and key file configurables:

$ linksharing setup --defaults release --public-url <PUBLIC URL> --cert-file="" --key-file="" --address=":8080"

WARNING HTTP is only recommended if you are doing TLS termination on the same machine running the link sharing service as the link sharing service serves unencrypted user data.

Running

After configuration is complete, running the link sharing is as simple as:

$ linksharing run

Anything shared with --url will be readonly and available publicly (no secret key needed).

uplink share --url sj://<path>

results in

https://link.us1.storjshare.io/s/jqaz8xihdea93jfbaks8324jrhq1/<path>

You can use your own domain and host your website on Storj with the following setup.

  1. Upload your static site and other files to Storj using Uplink or S3 gateway. Download the Uplink Binary.

  2. Share an object or path to an object. If you are sharing an entire bucket or sub-folder, you will want to name your home page index.html. Anything shared with --dns will be readonly and available publicly (no secret key needed).

    uplink share --dns <hostname> sj://<path>

    Prints a zone file with the information needed to create 3 dns records. Remember to update the $ORIGIN with your domain name. You may also change the $TTL.

    $ORIGIN example.com.
    $TTL    3600
    <hostname>    	IN	CNAME	link.us1.storjshare.io.
    txt-<hostname> 	IN	TXT  	storj-root:<path>
    txt-<hostname> 	IN	TXT  	storj-access:<access key>
    

    For example uplink share --dns www sj://bucket/prefix will output:

    $ORIGIN example.com.
    $TTL    3600
    www    	IN	CNAME	link.us1.storjshare.io.
    txt-www	IN	TXT  	storj-root:bucket/prefix
    txt-www	IN	TXT  	storj-access:jqaz8xihdea93jfbaks8324jrhq1
    
  3. Create a CNAME record on your hostname using our linksharing common URL link.us1.storjshare.io. as the target name.

  4. Create 2 TXT records, prepending txt- to your hostname.

    a. Root Path: the bucket, object prefix key, or individual object that you want your root domain to resolve to.

    b. Access Key: the readonly and public access key to your root path.

  5. You can check to make sure your dns records are ready with dig @1.1.1.1 txt-<hostname>.<domain> TXT

  6. Without further action, your site will be served with http. You can secure your site by using a https proxy server such as Cloudflare

  7. Optionally, if you create a page titled '404.html' in the root of your shared prefix, it will be served in 404 conditions.

  8. That's it! You should be all set to access your website e.g. http://www.example.test

LICENSE

This project is licensed under the AGPL-v3. See LICENSE for more.

linksharing's People

Contributors

amwolff avatar boshevski avatar calebcase avatar egonelbre avatar grafael avatar halkyon avatar ifraixedes avatar iglesiasbrandon avatar jenlij avatar jtolio avatar kaloyan-raev avatar mniewrzal avatar mobyvb avatar nergdron avatar stefanbenten avatar vinozzz avatar vitaliishpital avatar wthorp avatar zeebo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

filebase

linksharing's Issues

linksharing server running at 127.0.0.1:8080 invalid request: missing access

I am running link sharing server running at 127.0.0.1:8080 at its throwing the error: invalid request: missing access

To reproduce the error, I had done the following :

$ go install storj.io/linksharing

linksharing setup --defaults dev

linksharing run

I am stuck at the invalid request: missing access

in the code I had granted access with the following code :
"

access, err := uplink.RequestAccessWithPassphrase(ctx, satelliteAddress, apiKey, rootPassphrase)
if err != nil {
return err
}

// create an access grant for reading bucket "logs"
permission := uplink.ReadOnlyPermission()
shared := uplink.SharePrefix{Bucket: "logs"}
restrictedAccess, err := access.Share(permission, shared)
if err != nil {
return err
}

// serialize the restricted access grant
serializedAccess, err := restrictedAccess.Serialize()
if err != nil {
return err
}

"

but the issue still persist

Shared .docx/.odt file is downloaded as a zip archive

Description of the issue: Shared .docx/.odt file is downloaded as a zip archive, which is actually so.

Steps to reproduce:

  1. Create a temp.odt file on Libreoffice
  2. uplink mb sj://share
  3. uplink cp temp.odt sj://share
  4. uplink share --url sj://share/temp.odt
  5. Go to the URL of the share file
  6. Click "Download"

Expected result: the file should be downloaded as an opendocument file

Actual result: the file is downloaded as a zip archive

Please feel free to move this issue to a more proper repository if any, thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.