Linked Data server for Go

Andrei 86ef104115 Merge pull request #99 from err0r500/fix/issue92 2 months ago
server 49fca2dcb7 rename bold.db -> bolt.db 2 months ago
tests 8721515570 Added support for multipart/form-data uploads (multiple files and multiple chunks). 4 years ago
.gitignore f9573511a2 update README & add vendoring 2 months ago
.travis.yml 09af8e154e new travis config 2 months ago
CHANGES 9065f80123 Version bump to 1.0.1 3 years ago
Dockerfile 49fca2dcb7 rename bold.db -> bolt.db 2 months ago
Gopkg.lock 5f384be6e4 remove magicmime dependency 2 months ago
Gopkg.toml 5f384be6e4 remove magicmime dependency 2 months ago
Makefile 09ac31f10c Changed the URL for the cover tools. 4 years ago
README.md 83c79138d2 Merge branch 'master' into fix/issue92 2 months ago
VERSION 9065f80123 Version bump to 1.0.1 3 years ago
acl.go 268fc6d0c4 adds support for external proxy with auth 2 years ago
acl_test.go 56bc9f9a31 added both types of typeIndexes 1 year ago
auth.go 0bdd8d34c3 fixed auth waterfall (cookie -> webid-rsa -> webid-tls) 1 year ago
auth_test.go b028784848 url-encode/decode the tokens 1 year ago
autoneg.go d41e036a08 Fixed linting errors 3 years ago
autoneg_test.go ecd32b8eaf added token info page and revokation support 1 year ago
config.go 4ff3c1727c add flag to toggle WebID-TLS auth on/off 1 year ago
cors_test.go 3557fc074e Add "Vary: Origin" to prevent caching CORS origin header 2 years ago
crypto.go a97ee8ea03 Fixed WebID-RSA login; improved logging for auth 3 years ago
crypto_test.go a97ee8ea03 Fixed WebID-RSA login; improved logging for auth 3 years ago
gold.conf-example 8542e7ac32 Rename 'skins' to 'apps' 2 years ago
graph.go 5f384be6e4 remove magicmime dependency 2 months ago
graph_test.go fbc6d1b27b clean the graph files 2 months ago
init.go 1f60d21159 add log.Lshortfile 3 years ago
ldp.go d43c97b766 Removed the unused err reporting from NewUUID() 3 years ago
ldp_test.go d43c97b766 Removed the unused err reporting from NewUUID() 3 years ago
locks.go 79edb03269 add request locking 4 years ago
mime.go 5f384be6e4 remove magicmime dependency 2 months ago
mime_test.go fc9c78a178 Fix Content-Type header for empty resources 2 years ago
pathinfo.go 40e5ee4172 Uncommented test for raw file; removed debugging 3 years ago
pathinfo_test.go ecd32b8eaf added token info page and revokation support 1 year ago
proxy.go 1e0a9e67e7 exposes more headers for CORS in the proxy 1 year ago
proxy_test.go 1769db4677 expose Content-Type to CORS 1 year ago
push.sh 54d3070d53 Minor fix 3 years ago
rdf.go 6578388e70 Reverted to w3.org namespace for Solid terms 1 year ago
rdf_test.go dcb3b8ad75 Added a new test for defrag(). 4 years ago
server.go 5f384be6e4 remove magicmime dependency 2 months ago
server_test.go 2c39f9024b merged two err catchers 1 year ago
smtp.go 47015dce9a removed error debug 1 year ago
smtp_test.go 7503137754 commenting out TestFakeSMTPSecureDial 2 months ago
sparqlupdate.go 61a9dda80f Return 500 for bnodes in SPARQL DELETE, and 409 for missing triple 3 years ago
sparqlupdate_test.go 61a9dda80f Return 500 for bnodes in SPARQL DELETE, and 409 for missing triple 3 years ago
spkac.go 646b868c08 Clean up code; enabled keyUsage in certs 3 years ago
spkac_test.go 2124f085bc disables SPKAC test (to be deprecated) 2 years ago
system.go 239e9350f1 rebuild the redirect URL in case it contains other params 1 year ago
system_test.go 582ea1cd8c renamed account/info to account/tokens 1 year ago
templates.go 41fc679a34 Update databrowser to latest version fixes #91 7 months ago
term.go d41e036a08 Fixed linting errors 3 years ago
term_test.go 6d10c95090 Added tests for Term. 4 years ago
triple.go d41e036a08 Fixed linting errors 3 years ago
triple_test.go 0350ecef65 more granular locking 4 years ago
webid.go 5f384be6e4 remove magicmime dependency 2 months ago
webid_test.go 56bc9f9a31 added both types of typeIndexes 1 year ago
websocket.go 42e885fbdb Added unsub command 3 years ago
websocket_test.go 42e885fbdb Added unsub command 3 years ago

README.md

gold

gold is a reference Linked Data Platform server for the Solid platform.

Written in Go, based on initial work done by William Waites.

Build Status

Installing

From docker repository:

sudo docker pull linkeddata/gold
sudo docker run -p ip:port:443 linkeddata/gold

Replace ip and port with your host computer's IP address and port number.

To check the status of the container, type:

sudo docker ps

IMPORTANT: if you want to mount a host directory into the container, you can use the -v parameter:

sudo docker run -p ip:port:443 -v /home/user/data:/data linkeddata/gold

This will mount the host directory, /home/user/data, into the container as the /data/ directory. Doing this will allow you to reuse the data directory without worrying about persistence inside the container.

From Github:

  1. Setup Go:

    • Mac OS X: brew install go
    • Ubuntu: sudo apt-get install golang-go
    • Fedora: sudo dnf install golang
  2. Set the GOPATH variable (required by Go):

      mkdir ~/go
      export GOPATH=~/go
    

    (Optionally consider adding export GOPATH=~/go to your .bashrc or profile).

  3. Check that you have the required Go version (Go 1.4 or later):

      go version
    

    If you don't, please install a more recent version.

  4. Use the go get command to install the server and all the dependencies:

    go get github.com/linkeddata/gold/server
    
  5. Install dependencies:

    • Mac OS X: brew install raptor libmagic
    • Ubuntu: sudo apt-get install libraptor2-dev libmagic-dev
    • Fedora: sudo dnf install raptor2-devel file-devel
  6. (Optional) Install extra dependencies used by the tests:

    go get github.com/stretchr/testify/assert
    

Running the Server

IMPORTANT: Among other things, gold is a web server. Please consider running it as a regular user instead of root. Since gold treats all files equally, and even though uploaded files are not made executable, it will not prevent clients from uploading malicious shell scripts.

Pay attention to the data root parameter, -root. By default, it will serve files from its current directory (so, for example, if you installed it from Github, its data root will be $GOPATH/src/github.com/linkeddata/gold/). Otherwise, make sure to pass it a dedicated data directory to serve, either using a command-line parameter or the config file. Something like: -root=/var/www/data/ or -root=~/data/.

  1. If you installed it from package via go get, you can run it by:
  $GOPATH/bin/server -http=":8080" -https=":8443" -debug
  1. When developing locally, you can cd into the repo cloned by go get:
  cd $GOPATH/src/github.com/linkeddata/gold

And launch the server by:

  go run server/*.go -http=":8080" -https=":8443" -debug -boltPath=/tmp/bolt.db

Alternatively, you can compile and run it from the source dir in one command:

  go run $GOPATH/src/github.com/linkeddata/gold/server/*.go -http=":8080" -https=":8443" \
    -root=/home/user/data/ -debug -boltPath=/tmp/bolt.db

Configuration

You can use the provided gold.conf-example file to create your own configuration file, and specify it with the -conf parameter.

cd $GOPATH/src/github.com/linkeddata/gold/
cp gold.conf-example server/gold.conf

# edit the configuration file
nano server/gold.conf

# pass the config file when launching the gold server
$GOPATH/bin/server -conf=$GOPATH/src/github.com/linkeddata/gold/server/gold.conf

To see a list of available options:

~/go/bin/server -help

Some important options and defaults:

  • -conf - Optional path to a config file.

  • -debug - Outputs config parameters and extra logging. Default: false.

  • -root - Specifies the data root directory which gold will be serving. Default: . (so, likely to be $GOPATH/src/github.com/linkeddata/gold/).

  • -http - HTTP port on which the server listens. For local development, the default HTTP port, 80, is likely to be reserved, so pass in an alternative. Default: ":80". Example: -http=":8080".

  • -https - HTTPS port on which the server listens. For local development, the default HTTPS port, 443, is likely to be reserved, so pass in an alternative. Default: ":443". Example: -https=":8443".

Testing

To run the unit tests (assuming you've installed assert via go get github.com/stretchr/testify/assert):

make test

Notes

License

MIT