You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by robertkowalski <gi...@git.apache.org> on 2015/04/04 16:33:24 UTC

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

GitHub user robertkowalski opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/360

    Cluster configuration fixes for 2.0

    In CouchDB 2.0 we don't have `_config` on the clustered interface. As user/admin management also uses _config, also hide it on a cluster.
    
    We still support it on the backdoor ports.
    
    closes COUCHDB-2601 COUCHDB-2599 COUCHDB-2390
    COUCHDB-2390

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robertkowalski/couchdb-fauxton 2601-2390-config-backdoor

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/360.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #360
    
----
commit b376bcaee66a605e9bb7bfc179fa797f8288f0b3
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2015-04-03T20:18:13Z

    test: remove confirmdialog
    
    when running the testsuite in the browser tests were stopped unti
    confirming with `OK`

commit b026a0d85fd9e1251954ce588f7329318312d595
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2015-04-02T19:52:23Z

    config: just show config where it is available
    
    In CouchDB 2.0 we don't have `_config` on the clustered interface.
    
    We still support it on the backdoor ports.
    
    closes COUCHDB-2601
    COUCHDB-2390

commit 28f6a12a103fdf98b2719ccd0eb4ae96e1059279
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2015-04-04T00:02:41Z

    login: remove dead code

commit a2e499bc979c6eb46e6ec2cac9bb086ce5c5a810
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2015-04-04T00:05:09Z

    move usermanagement which uses `_config` to config

commit 9340260d00caf1256d25e83d846b6dadca43f857
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2015-04-04T12:46:34Z

    admin: do not show up on a cluster
    
    `_config` is not available on a cluster, so don't offer to alter
    it for creating admins, changing passwords and fixing the party
    mode.
    
    closes COUCHDB-2601 COUCHDB-2599 COUCHDB-2390

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#discussion_r27966709
  
    --- Diff: app/addons/config/routes.js ---
    @@ -76,11 +81,114 @@ function (app, FauxtonAPI, Config, Views, CORS) {
         },
     
         establish: function () {
    -      return [this.configs.fetch()];
    +      var deferred = FauxtonAPI.Deferred(),
    +          checked = FauxtonAPI.isRunningOnBackdoorPort();
    +
    +      FauxtonAPI.when(checked).then(function (res) {
    +        if (!res.runsOnBackportPort) {
    +          FauxtonAPI.navigate('_config/backdoorportinfo');
    +          deferred.resolve();
    +          return;
    +        }
    +
    +        this.fetchConfig(deferred);
    +      }.bind(this));
    +
    +      return [deferred];
    +    },
    +
    +    fetchConfig: function (deferred) {
    +      this.configs
    +        .fetch()
    +        .then(function () {
    +          deferred.resolve();
    +        });
         }
       });
     
    -  Config.RouteObjects = [ConfigRouteObject];
    +  var CreateAdminRouteObject = FauxtonAPI.RouteObject.extend({
    +    layout: 'one_pane',
    +
    +    routes: {
    +      'createAdmin': 'createAdmin'
    +    },
    +
    +    establish: function () {
    +      var deferred = FauxtonAPI.Deferred(),
    +          checked = FauxtonAPI.isRunningOnBackdoorPort();
    +
    +      FauxtonAPI.when(checked).then(function (res) {
    --- End diff --
    
    Same here, `FauxtonAPI.when` isn't needed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#discussion_r27966674
  
    --- Diff: app/addons/config/routes.js ---
    @@ -76,11 +81,114 @@ function (app, FauxtonAPI, Config, Views, CORS) {
         },
     
         establish: function () {
    -      return [this.configs.fetch()];
    +      var deferred = FauxtonAPI.Deferred(),
    +          checked = FauxtonAPI.isRunningOnBackdoorPort();
    +
    +      FauxtonAPI.when(checked).then(function (res) {
    --- End diff --
    
    You don't need `FauxtonAPI.when` here. You only doing one fetch


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#issuecomment-98138978
  
    though I didn't run it I like it - and it's a big step 2wards a usable 2.0


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#discussion_r27966753
  
    --- Diff: app/addons/config/templates/infoscreen.html ---
    @@ -0,0 +1,28 @@
    +<% /*
    +Licensed under the Apache License, Version 2.0 (the "License"); you may not
    +use this file except in compliance with the License. You may obtain a copy of
    +the License at
    +
    +  http://www.apache.org/licenses/LICENSE-2.0
    +
    +Unless required by applicable law or agreed to in writing, software
    +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    +WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
    +License for the specific language governing permissions and limitations under
    +the License.
    +*/ %>
    +
    +<div class="config-cluster-warning">
    +  Configuration is just available on the so called Backdoor-Ports for each single node of
    --- End diff --
    
    Would it be possible to list the available backdoor port urls?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#issuecomment-90915366
  
    @robertkowalski this looks good once you remove the caching.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#discussion_r29502164
  
    --- Diff: app/addons/auth/test/baseSpec.js ---
    @@ -35,20 +48,45 @@ define([
       describe('auth session change', function () {
     
         afterEach(function () {
    -      FauxtonAPI.updateHeaderLink.restore && FauxtonAPI.updateHeaderLink.restore();
    -      FauxtonAPI.session.isAdminParty.restore && FauxtonAPI.session.isAdminParty.restore();
    +      testUtils.restore(FauxtonAPI.updateHeaderLink);
    +      testUtils.restore(FauxtonAPI.session.isAdminParty);
    +      testUtils.restore(FauxtonAPI.isRunningOnBackdoorPort);
    +      testUtils.restore(FauxtonAPI.session.isLoggedIn);
    +      testUtils.restore(FauxtonAPI.session.user);
    +      testUtils.restore(FauxtonAPI.removeHeaderLink);
    +      FauxtonAPI.session.off('change');
         });
     
         it('for admin party changes title to admin party', function () {
           var spy = sinon.spy(FauxtonAPI, 'updateHeaderLink');
           var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(true);
    +      var deferred = FauxtonAPI.Deferred();
    +      sinon.stub(FauxtonAPI, 'isRunningOnBackdoorPort').returns(deferred);
    +      Base.initialize();
    +      deferred.resolve({runsOnBackportPort: true});
    +
           FauxtonAPI.session.trigger('change');
     
           assert.ok(spy.calledOnce);
           var args = spy.getCall(0).args[0];
     
           assert.ok(args.title.match(/Admin Party/));
    -      FauxtonAPI.session.isAdminParty.restore();
    +    });
    +
    +    it('for admin party on cluster do not show admin-party-fix-link', function () {
    +      var spy = sinon.spy(FauxtonAPI, 'removeHeaderLink');
    +      var stub = sinon.stub(FauxtonAPI.session, 'isAdminParty').returns(true);
    +      var deferred = FauxtonAPI.Deferred();
    +      sinon.stub(FauxtonAPI, 'isRunningOnBackdoorPort').returns(deferred);
    +      Base.initialize();
    +      deferred.resolve({runsOnBackportPort: false});
    +
    +      FauxtonAPI.session.trigger('change');
    +
    +      assert.ok(spy.calledOnce);
    +      var args = spy.getCall(0).args[0];
    --- End diff --
    
    add-then-remove is hard 2 test, quite possibly this is the best way. The only alternative I can think of is overwriting add and remove, keeping track of the "list" and checking auth is not in it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski closed the pull request at:

    https://github.com/apache/couchdb-fauxton/pull/360


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by sebastianrothbucher <gi...@git.apache.org>.
Github user sebastianrothbucher commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#discussion_r29501552
  
    --- Diff: app/core/utils.js ---
    @@ -124,7 +124,41 @@ function ($, _) {
             }
           }
           return data;
    -    }
    +    },
    +
    +    sessionStorageGet: function (key) {
    +      var data;
    +      if (!window.sessionStorage) {
    +        return;
    +      }
    +
    +      data = window.sessionStorage.getItem(key);
    +      try {
    +        return JSON.parse(data);
    +      } catch (e) {
    +        return data;
    +      }
    +
    +      return data;
    --- End diff --
    
    minor - but: unreachable statement (can just be left out?)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#issuecomment-101181827
  
    this got stale as user management was converted to react


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-fauxton pull request: Cluster configuration fixes for 2.0

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/360#issuecomment-90911560
  
    todo: remove the caching
    
    just "cache" the promise


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---