if a restauth key is missing in config
file or if restauth is set to true,
glusterd2 will do token authentication.
Authentication can be disabled by
by setting restauth key in the configuration
to false.
updated test cases to use authentication
if auth file is present
added default rest authentication in glustercli
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
The current all/build targets do quite a bit more than compile
the golang binaries. This change adds a new target "binaries"
that builds the server and cli binaries.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
I tried to run 'make test' out of a clean repo and it failed
due to missing source files that were being generated as
part of the build. I have tweaked the Makefile so that a
new target 'generated' is a prerequisite for the tests and
build.
In the future we might consider switching to calling something
like 'go generate' here. But I'm trying to keep this change
small.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
If `PREFIX` is `/usr` then `logdir`, `rundir` and `localstatedir`
should not contain the prefix.
**Global default configuration**: Based on the `--prefix` used during
installation/make global config should be installed in
`$PREFIX/etc/glusterfs/glusterd2.toml`. All the default values from
code should be moved to this file.
**Removed logic to pick config file from current directory**: Since
Glusterd2 will be run as daemon or background process, automatically
picking config file from current directory will add confusion to
users. For development, if global config file not exists then it loads
config file from the current directory.
**Config file as argument**: Glusterd2 applies global configurations
first and then applies this configuration to overwrite the values
if any.
Signed-off-by: Aravinda VK <avishwan@redhat.com>
This removes the now-empty verify target.
The linting and formatting checks are now
at the 020 level in the test directory.
Signed-off-by: Michael Adam <obnox@redhat.com>
This new test script 100-gotest.sh, adopted from heketi,
replaces the original go test line from the "test" make target.
It has the capability of reacting to environment variables:
stopping as soon as an error is hit, creating test coverage
reports, etc.
Signed-off-by: Michael Adam <obnox@redhat.com>
- Specfile has been updated to build Fedora packages without bundled
dependencies
- Specfile has been updated to fix issues for EL7 builds. Fixes #596.
- The Makefile has been updated to set proper mode for non-executable
files on `make install`
make dist creates source tarballs of the GD2 source directory.
make dist-vendor creates tarballs including the vendor directory.
The generated tarballs contain a VERSION file, which is used by the
build script to set proper versions, gitsha and build-ids when building
GD2 from tarballs.
'dep' is the official dependency management experiment of the Golang
community. It is expected to become the official tool and the latest
glide release encourages users to switch to dep.
Some quick help,
- `dep ensure` installs dependencies that have been locked
- `dep ensure -upate` updates dependencies to the latest versions and
updates the lock file
- `dep ensure -add <package>` adds a new package.
`make vendor-install` and `make vendor-update` still work as expected.
[1]: https://github.com/golang/dep
[2]: https://github.com/Masterminds/glide/releases/tag/v0.13.0
`make vendor-install` installs the pinned packages from `glide.lock`,
performing the same function as the previous `make vendor-update`.
Now `make vendor-update` updates vendored packages to the latest
available versions.
Both commands, strip the `vendor/` from any vendored packages.
This is initial code which enables creation of plugins for glusterd2.
Plugin interface is
type GlusterdPlugin interface{
Name() string
SunRPCProgram() sunrpc.Program
RestRoutes() route.Routes
RegisterStepFuncs()
}
Plugin can register sunrpc procedure, REST route and can register step
functions required for Transaction(Transaction APIs are not stable
yet)
Included hello plugin, which plugs following REST routes into
glusterd2 REST server.
GET /v1/hello
POST /v1/hello
To add new Plugin,
- Create a plugin package and add to import and plugin list in the
file `$SRC/plugins/plugins.go`
- Create a struct and implement the above interfaces
To disable building plugins,
PLUGINS=no make
Closes #131
Signed-off-by: Aravinda VK avishwan@redhat.com
- The Makefile has been updated to use these scripts to build, install
and release
- Run `make release` to create build, create and sign a release archive,
useful for releasing on Github.