Web-based tool to author and check ISO 19944-style data use statements
Перейти к файлу
microsoft-github-policy-service[bot] 076fe769f5
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2023-06-27 13:07:21 +00:00
RuleBases updated rulebase for location rules 2018-09-06 15:00:53 +02:00
backend Merge branch 'master' into tja-dev 2018-08-29 14:20:23 +02:00
docs Merge pull request #108 from kant/patch-1 2018-07-19 10:22:02 +02:00
frontend/src removed/changed some explanation labels 2018-09-06 15:02:26 +02:00
.babelrc initial commit 2016-04-26 15:25:14 +02:00
.bowerrc Added fields to normalizer to save the location 2018-06-06 17:59:01 +02:00
.gitignore added carneades & GoCHR to the vendor folder & removed PROLOG references 2017-07-18 12:42:22 +02:00
.travis.yml specify node version 2016-05-11 14:13:41 +02:00
License.txt changed license file 2017-06-28 18:52:09 +02:00
README.md added carneades & GoCHR to the vendor folder & removed PROLOG references 2017-07-18 12:42:22 +02:00
SECURITY.md Microsoft mandatory file 2023-06-12 19:12:03 +00:00
bower.json explicitly set dependency 2016-12-19 08:05:20 +01:00
config.yml fixes for Internet Explorer 2016-12-11 01:21:21 +01:00
configuration.json Update configuration.json 2017-03-13 18:22:00 +01:00
coverage.out dictionary tests 2016-09-29 09:19:38 +02:00
gulpfile.babel.js change gulp-go dependecy to one that wokrs on windows which fixes #20 2018-04-11 17:20:14 +02:00
licenses.md Update licenses.md 2017-06-07 21:08:59 +02:00
npm-shrinkwrap.json Added fields to normalizer to save the location 2018-06-06 17:59:01 +02:00
package.json Added fields to normalizer to save the location 2018-06-06 17:59:01 +02:00
testdata.json fix nullpointer error in putDictItemHandler 2016-09-15 09:51:24 +02:00

README.md

DUCK Application

Attention: These are Instructions for Developers. If you just want to try DUCK, you might want to download it here. A user manual can be found here, the DUCK architecture is described here.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

This is a Gulp-powered build system with the following features:

  • Sass compilation and prefixing
  • JavaScript transpilation based on Babel and concatenation
  • Go compilation
  • Dynamic browser reloading using BrowserSync
  • For production builds:
    • CSS compression
    • JavaScript compression
    • Image compression

Installation

The project build requires:

  • Git
  • Go (1.7 or later)
  • NodeJS (0.12 or greater, LTS version >4.0.0 recommended)
  • CouchDB (1.6 or greater)

Setup

First clone the project repository. Make sure it is under the GOPATH directory, for example if your GOPATH is:

/gocode

DUCK should be checked out to:

/gocode/src/github.com/Microsoft/DUCK

To clone the codebase, use:

git clone https://github.com/Microsoft/DUCK DUCK

Then, from the cloned directory, install the required dependencies:

cd DUCK
npm install
npm install -g bower
npm install -g gulp
bower install

Make sure Couch DB is running.

Finally, run npm start to execute the build. The application will be accessible at:

http://localhost:8000

Dynamic reloading will be enabled. Both frontend (Javascript, CSS, HTML) and backend (go) assets are watched for changes, which will automatically trigger an application update.

To create compressed, production-ready assets, run npm run build.

Building a Distrubution

Execute the distribution build using:

npm run distro

A binary archive will be generated in the /image directory

Configuration

This project reads its configuration from the file backend/configuration.json, environment variables and also command-line flags. The following precendence order is used. Each item takes precedence over the item below it:

  • flag
  • env
  • config
  • default

Default

The default configuration has these values:

  database: 
      location: "http://127.0.0.1"
      port: 5984
      name: "duck"
	  username: ""
	  password: ""
  jwtkey: "c2VjcmV0"
  webdir: "/src/github.com/Microsoft/DUCK/frontend/dist"
  rulebasedir: "/src/github.com/Microsoft/DUCK/RuleBases"
jwtkey

The field jwtkey is a base64 encoded string. If this field is empty, a random key will be generated.

regarding path variables

If rulebasedir or webdir have an absolute path it is used as an absolute path. If it is a relative path it will be assumed to be relative to the GOPATH environment variable if present. If GOPATH is not found, the path is assumed to be relative to the go executable.

env

The environment variable names are prefixed with DUCK_ and all uppercase. Fields in the database object are referenced using the . operator, e.g. DUCK_DATABASE.NAME.

flags

The flags are handled in the go standard way described in https://golang.org/pkg/flag/. Main points are:

Command line flag syntax:

-flag -flag=x -flag x // non-boolean flags only

>One or two minus signs may be used; they are equivalent. The last form is not permitted for boolean flags because the meaning of the command
>
>`cmd -x *`
>
>will change if there is a file called 0, false, etc. You must use the -flag=false form to turn off a boolean flag.
>
>Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags may be:
>
>`1, 0, t, f, T, F, true, false, TRUE, FALSE, True, False`

It is *not* possible to configure the database connection via flags.