1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00

11 Commits

Author SHA1 Message Date
Prashanth Pai
6689c82a4d Illustrate default value of restauth in sample config
...and remove examples from e2e test configurations.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-17 12:03:13 +05:30
Madhu Rajanna
0190411220 Enable Rest Authentication by default
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>
2018-07-10 13:52:48 +05:30
Prashanth Pai
dd2a8f7507 Remove 'workdir' config in favour of 'localstatedir'
For all practical purposes, in real usage and in tests, the configurable
paths `workdir` and `localstatedir` are set to the same directory which
defaults to `/var/lib/glusterd2` or `/user/local/var/lib/glusterd2`

Unlike glusterd1, glusterd2 does not daemonize itself. The working
directory of the process can be meaningfully set to either current
working directory from where glusterd2 process is started or to
`localstatedir` where glusterd2 stores all its data. We choose the
latter.

This change also reduces ambiguity for users and one less thing to
configure.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-02 09:44:30 +05:30
Aravinda VK
a565046e6f Configuration improvements
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>
2018-05-22 11:41:24 +05:30
John Mulligan
9e9baeee5e e2e: make a central, configurable, base workdir
Previously, e2e tests were hard-coding the base workdir in
the main_test.go file and in the config toml files. This change
centralizes the base path in a top-level variable and makes
it possible to specify custom values for the workdir. This
can be useful if /tmp is inappropriate for this task on a
particular system or if multiple e2e tests are to be run in
parallel so that the caller may specify unique paths for
each test.
The toml files are adjusted to contain relative paths.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2018-04-24 16:47:10 -04:00
Prashanth Pai
3dd7e680fa Default rundir to /var/run/gluster
...except for the tests.

Rundir should be in a place like /var/run which doesn't persist across
reboots. Further some socket files and pid files were in '/var/run' and
few others in '/var/run/gluster'. With this change, everything goes into
the same rundir.

See this bug and fix for some historical context:
https://bugzilla.redhat.com/show_bug.cgi?id=1258561

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-03-29 09:58:56 +05:30
Aravinda VK
ae0fe1b65a Default configuration for glusterd2 when run using systemctl
systemctl enable glusterd2
    systemctl start glusterd2
    systemctl status glusterd2

Limited config file extension to `TOML` to avoid confusions with
multiple config extensions.

Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-02-27 12:39:33 +05:30
Aravinda VK
f9c851ec26 rest: Authentication middleware
Added REST API authentication middleware. On Glusterd2 start, it
generates `$WORKDIR/auth` file with random string if not exists.

Local CLI/Curl can use that auth file and add Authorization request.

Note: User management is not covered in this patch. Limited to local
consumers only who can access `$WORKDIR/auth`. Auth is disabled by
default which can be enabled using config file option `restauth=true`

CLI needs new flag `--auth-file` to accept path for auth file similar
to Glusterd1 CLI flag `glusterd-sock`

Updates: #252
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2017-11-08 17:22:11 +05:30
Kaushal M
7115582a53 e2e: Add 3rd peer to TestPeerAddRemove 2017-07-26 19:45:39 +05:30
Kaushal M
d1127b43ba Update etcd opts in e2e config 2017-06-29 18:32:06 +05:30
Prashanth Pai
d11033c505 Rename func_test package to e2e
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2017-05-24 14:17:29 +05:30