~ubuntu-branches/ubuntu/maverick/couchdb/maverick

« back to all changes in this revision

Viewing changes to src/couchdb/couch_server.erl

  • Committer: Bazaar Package Importer
  • Author(s): Chad Miller, Ken VanDine
  • Date: 2009-09-25 19:18:26 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090925191826-km9018omfgxosvah
Tags: 0.10.0~svn818859-0ubuntu1
* Import code from pre-release branch.  (LP: #427860, #408909)
        + Build and System Integration:
          * Changed `couchdb` script configuration options.
          * Added default.d and local.d configuration directories to load
      sequence.
        + HTTP Interface:
          * Added optional cookie-based authentication handler.
          * Added optional two-legged OAuth authentication handler.
* Packaging of couchdb-bin must replace pre-split couchdb.
  (LP: #432219)
* Move all of /etc and /var out of the couchdb-bin package, to the
  couchdb package. 
* /etc/couchdb must be in couchdb-bin, as config files are needed
  by all servers.
  + So the couchdb user must be managed by couchdb-bin.
  + Split postinst/postrm files to manage different files.
  + Set Replaces of couchdb-bin by couchdb so that config files
    migrate.
* Update the version number in postrm.  (!)
* Use the new "Breaks" field in control file to help split pkg.

[Ken VanDine]
* debian/couchdb.install:
  - removed /var
* debian/rules:
  - removed bootstrap 
* debian/couchdb.postinst:
  - Added the debhelper tag

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
    filename:join([Server#server.root_dir, "./" ++ DbName ++ ".couch"]).
117
117
 
118
118
hash_admin_passwords() ->
 
119
    hash_admin_passwords(true).
 
120
 
 
121
hash_admin_passwords(Persist) ->
119
122
    lists:foreach(
120
123
        fun({_User, "-hashed-" ++ _}) ->
121
124
            ok; % already hashed
122
125
        ({User, ClearPassword}) ->
123
126
            Salt = ?b2l(couch_util:new_uuid()),
124
127
            Hashed = couch_util:to_hex(crypto:sha(ClearPassword ++ Salt)),
125
 
            couch_config:set("admins", User, "-hashed-" ++ Hashed ++ "," ++ Salt)
 
128
            couch_config:set("admins", 
 
129
                User, "-hashed-" ++ Hashed ++ "," ++ Salt, Persist)
126
130
        end, couch_config:get("admins")).
127
131
 
128
132
init([]) ->
146
150
        end),
147
151
    hash_admin_passwords(),
148
152
    ok = couch_config:register(
149
 
        fun("admins") ->
 
153
        fun("admins", _Key, _Value, Persist) ->
150
154
            % spawn here so couch_config doesn't try to call itself
151
 
            spawn(fun() -> hash_admin_passwords() end)
152
 
        end),
 
155
            spawn(fun() -> hash_admin_passwords(Persist) end)
 
156
        end, false),
153
157
    {ok, RegExp} = re:compile("^[a-z][a-z0-9\\_\\$()\\+\\-\\/]*$"),
154
158
    ets:new(couch_dbs_by_name, [set, private, named_table]),
155
159
    ets:new(couch_dbs_by_pid, [set, private, named_table]),