Skip to content
Linked Data server for Go
Branch: master
Clone or download
deiu Merge pull request #99 from err0r500/fix/issue92
rename bold.db -> bolt.db
Latest commit 86ef104 Oct 10, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
server rename bold.db -> bolt.db Oct 2, 2018
tests Added support for multipart/form-data uploads (multiple files and mul… Apr 3, 2014
.gitignore
.travis.yml new travis config Oct 8, 2018
CHANGES Version bump to 1.0.1 Dec 18, 2015
Dockerfile rename bold.db -> bolt.db Oct 2, 2018
Gopkg.lock remove magicmime dependency Oct 2, 2018
Gopkg.toml remove magicmime dependency Oct 2, 2018
Makefile Changed the URL for the cover tools. Dec 19, 2014
README.md Merge branch 'master' into fix/issue92 Oct 10, 2018
VERSION Version bump to 1.0.1 Dec 18, 2015
acl.go adds support for external proxy with auth Dec 18, 2016
acl_test.go added both types of typeIndexes May 8, 2017
auth.go fixed auth waterfall (cookie -> webid-rsa -> webid-tls) May 5, 2017
auth_test.go url-encode/decode the tokens Apr 27, 2017
autoneg.go
autoneg_test.go added token info page and revokation support May 4, 2017
config.go add flag to toggle WebID-TLS auth on/off May 5, 2017
cors_test.go Add "Vary: Origin" to prevent caching CORS origin header Nov 8, 2016
crypto.go Fixed WebID-RSA login; improved logging for auth Aug 5, 2015
crypto_test.go
gold.conf-example Rename 'skins' to 'apps' Jan 22, 2016
graph.go remove magicmime dependency Oct 2, 2018
graph_test.go clean the graph files Oct 1, 2018
init.go add log.Lshortfile Feb 12, 2015
ldp.go Removed the unused err reporting from NewUUID() Jul 21, 2015
ldp_test.go Removed the unused err reporting from NewUUID() Jul 21, 2015
locks.go add request locking Apr 18, 2014
mime.go remove magicmime dependency Oct 2, 2018
mime_test.go Fix Content-Type header for empty resources Oct 17, 2016
pathinfo.go Uncommented test for raw file; removed debugging Dec 8, 2015
pathinfo_test.go
proxy.go exposes more headers for CORS in the proxy May 1, 2017
proxy_test.go expose Content-Type to CORS Apr 12, 2017
push.sh Minor fix Dec 18, 2015
rdf.go Reverted to w3.org namespace for Solid terms Jun 13, 2017
rdf_test.go Added a new test for defrag(). May 29, 2014
server.go remove magicmime dependency Oct 2, 2018
server_test.go
smtp.go removed error debug Apr 29, 2017
smtp_test.go commenting out TestFakeSMTPSecureDial Oct 8, 2018
sparqlupdate.go
sparqlupdate_test.go
spkac.go Clean up code; enabled keyUsage in certs Feb 13, 2015
spkac_test.go disables SPKAC test (to be deprecated) Nov 22, 2016
system.go rebuild the redirect URL in case it contains other params May 11, 2017
system_test.go renamed account/info to account/tokens May 11, 2017
templates.go Update databrowser to latest version fixes #91 Apr 28, 2018
term.go Fixed linting errors Feb 5, 2015
term_test.go Added tests for Term. May 29, 2014
triple.go Fixed linting errors Feb 5, 2015
triple_test.go more granular locking May 22, 2014
webid.go remove magicmime dependency Oct 2, 2018
webid_test.go added both types of typeIndexes May 8, 2017
websocket.go Added unsub command Oct 5, 2015
websocket_test.go

README.md

gold

Join the chat at https://gitter.im/linkeddata/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

You can’t perform that action at this time.