• Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    Go
  • Created almost 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Linked Data server for Go

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

More Repositories

1

dokieli

💡 dokieli is a clientside editor for decentralised article publishing, annotations and social interactions
JavaScript
795
star
2

rdflib.js

Linked Data API for JavaScript
HTML
566
star
3

cimba

Client-Integrated Micro-Blogging Architecture application
JavaScript
100
star
4

warp

Warp - an LDP file manager
CSS
60
star
5

profile-editor

WebID profile editor
JavaScript
50
star
6

tabulator

Linked Data Browser
JavaScript
46
star
7

contacts

Address book-like application to manage contact information.
JavaScript
39
star
8

ldphp

Linked Data server for PHP
PHP
38
star
9

swap

The Semantic Web Application Platform: cwm etc
Python
34
star
10

gojsonld

Go
26
star
11

ontology-archiver

Copy favorite and commonly used RDF schemas/ontologies to a safe place
Python
26
star
12

tabulator-firefox

Linked Data Browser for Firefox
JavaScript
23
star
13

gpx-ontology

Ontology for GPX data in RDF
Makefile
15
star
14

app-schedule

When can we meet? Scheduling a meeting etc. Llinked Data Platform interactive social app
JavaScript
13
star
15

tabulator-chrome

Linked Data Browser for Google Chrome
CoffeeScript
12
star
16

shacl-check

A subset of the SHACL checking functionality.
JavaScript
9
star
17

ldpy

Linked Data server for Python
Python
8
star
18

spreadsheet

demo app
JavaScript
7
star
19

solid-fitness

Archive your fitness activities in a solid store where they belong
JavaScript
7
star
20

mod_authn_webid

WebID authentication module for Apache 2
C
6
star
21

webizen

Go
6
star
22

project-roadmap

Roadmap and wishlist for the Crosscloud project
5
star
23

solid-recursive-copy

Recursively copy resources across web sites which are solid-compatible
JavaScript
5
star
24

conexus

Decentralized RDF syndication service.
Go
4
star
25

errol

Send notifications to any LDP inbox
PHP
3
star
26

contactorator

An address book app . A 'Solid' App using the tabulator contact pane
JavaScript
3
star
27

webid.mit.edu

Python
2
star
28

solid-dav

Allow solid clients to think of caldav as linked data, and maybe even sync
2
star
29

tabulator-firefox-2

Firefox extension (SDK style)
1
star
30

rwt.js

Read-Write Tests in JavaScript
JavaScript
1
star
31

midichlorian

This is a sample app to demonstrate how serverside and clientside code can be used in conjunction to retrieve solid resources with minimal cert popup interference
PHP
1
star