Compare commits
11 Commits
wireVersio
...
r1.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2add01f37d | ||
|
|
0775d99ea1 | ||
|
|
d6d9ce8ffe | ||
|
|
306c8c6b98 | ||
|
|
87f324edf8 | ||
|
|
89b0957a41 | ||
|
|
05c32be539 | ||
|
|
c0b78e37b5 | ||
|
|
cb39613c0f | ||
|
|
ad7fc89083 | ||
|
|
3c6a8cf7b7 |
29
SConstruct
29
SConstruct
@@ -604,6 +604,29 @@ except OSError:
|
||||
|
||||
# --- check system ---
|
||||
|
||||
def getGitBranch():
|
||||
if not os.path.exists( ".git" ):
|
||||
return None
|
||||
|
||||
version = open( ".git/HEAD" ,'r' ).read().strip()
|
||||
if not version.startswith( "ref: " ):
|
||||
return version
|
||||
version = version.split( "/" )
|
||||
version = version[len(version)-1]
|
||||
return version
|
||||
|
||||
def getGitBranchString( prefix="" , postfix="" ):
|
||||
t = re.compile( '[/\\\]' ).split( os.getcwd() )
|
||||
if len(t) > 2 and t[len(t)-1] == "mongo":
|
||||
t = re.compile( ".*_([vV]\d+\.\d+)$" ).match( t[len(t)-2] )
|
||||
if t is not None:
|
||||
return prefix + t.group(1).lower() + postfix
|
||||
|
||||
b = getGitBranch()
|
||||
if b == None or b == "master":
|
||||
return ""
|
||||
return prefix + b + postfix
|
||||
|
||||
def getGitVersion():
|
||||
if not os.path.exists( ".git" ):
|
||||
return "nogitversion"
|
||||
@@ -1240,7 +1263,9 @@ def getDistName( sofar ):
|
||||
distName = version
|
||||
return version
|
||||
|
||||
return today.strftime( "%Y-%m-%d" )
|
||||
|
||||
return getGitBranchString( "" , "-" ) + today.strftime( "%Y-%m-%d" )
|
||||
|
||||
|
||||
if distBuild:
|
||||
from datetime import date
|
||||
@@ -1361,7 +1386,7 @@ def s3push( localName , remoteName=None , remotePrefix=None , fixName=True , pla
|
||||
|
||||
if remotePrefix is None:
|
||||
if distName is None:
|
||||
remotePrefix = "-latest"
|
||||
remotePrefix = getGitBranchString( "-" ) + "-latest"
|
||||
else:
|
||||
remotePrefix = "-" + distName
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace mongo {
|
||||
|
||||
if( strstr(from_name, ".system.") ) {
|
||||
/* system.users is cloned -- but nothing else from system. */
|
||||
if( strstr(from_name, ".system.users") == 0 ){
|
||||
if( legalClientSystemNS( from_name , true ) == 0 ){
|
||||
log(2) << "\t\t not cloning because system collection" << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -97,11 +97,17 @@ namespace mongo {
|
||||
stringstream digestBuilder;
|
||||
|
||||
{
|
||||
bool reject = false;
|
||||
nonce *ln = lastNonce.release();
|
||||
digestBuilder << hex << *ln;
|
||||
|
||||
if( ln == 0 || digestBuilder.str() != received_nonce ) {
|
||||
log() << "auth: bad nonce received. could be a driver bug or a security attack. db:" << cc().database()->name << '\n';
|
||||
if ( ln == 0 ) {
|
||||
reject = true;
|
||||
} else {
|
||||
digestBuilder << hex << *ln;
|
||||
reject = digestBuilder.str() != received_nonce;
|
||||
}
|
||||
|
||||
if ( reject ) {
|
||||
log() << "auth: bad nonce received or getnonce not called. could be a driver bug or a security attack. db:" << cc().database()->name << '\n';
|
||||
errmsg = "auth fails";
|
||||
sleepmillis(30);
|
||||
return false;
|
||||
|
||||
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -1,4 +1,4 @@
|
||||
mongodb (1.1.3) unstable; urgency=low
|
||||
mongodb (1.2.0) stable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = MongoDB
|
||||
PROJECT_NUMBER = 1.1.3
|
||||
PROJECT_NUMBER = 1.2.0
|
||||
OUTPUT_DIRECTORY = docs
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
|
||||
11
jstests/auth2.js
Normal file
11
jstests/auth2.js
Normal file
@@ -0,0 +1,11 @@
|
||||
db2 = new Mongo( db.getMongo().host ).getDB( db.getName() );
|
||||
|
||||
users = db2.getCollection( "system.users" );
|
||||
users.remove( {} );
|
||||
|
||||
pass = "a" + Math.random();
|
||||
//print( "password [" + pass + "]" );
|
||||
|
||||
db2.addUser( "eliot" , pass );
|
||||
|
||||
assert.commandFailed( db2.runCommand( { authenticate: 1, user: "eliot", nonce: "foo", key: "bar" } ) );
|
||||
@@ -134,7 +134,7 @@ if ( true ){
|
||||
print( "t1: " + Date.timeFunc(
|
||||
function(){
|
||||
var out = db.runCommand( { mapreduce : "mr1" , map : m , reduce : r } );
|
||||
if ( ks == "_id" ) assert( out.ok , "XXX" );
|
||||
if ( ks == "_id" ) assert( out.ok , "XXX : " + tojson( out ) );
|
||||
db[out.result].drop();
|
||||
} , 10 ) + " (~500 on 2.8ghz) - itcount: " + Date.timeFunc( function(){ db.mr1.find().itcount(); } , 10 ) );
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@
|
||||
93A6E10D0F24CFB100DA4EBF /* flushtest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = flushtest.cpp; sourceTree = "<group>"; };
|
||||
93A6E10E0F24CFD300DA4EBF /* security.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = security.h; sourceTree = "<group>"; };
|
||||
93A6E10F0F24CFEA00DA4EBF /* security_commands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = security_commands.cpp; sourceTree = "<group>"; };
|
||||
93A71D2D10D04D15003C9E90 /* auth2.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = auth2.js; sourceTree = "<group>"; };
|
||||
93A8CD170F33B78D00C92B85 /* mmap_mm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mmap_mm.cpp; path = util/mmap_mm.cpp; sourceTree = SOURCE_ROOT; };
|
||||
93A8CD180F33B7A000C92B85 /* mmap_posix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mmap_posix.cpp; path = util/mmap_posix.cpp; sourceTree = SOURCE_ROOT; };
|
||||
93A8CD190F33B7AF00C92B85 /* mmap_win.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mmap_win.cpp; path = util/mmap_win.cpp; sourceTree = SOURCE_ROOT; };
|
||||
@@ -641,6 +642,7 @@
|
||||
93A8D1D10F37544800C92B85 /* jstests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
93A71D2D10D04D15003C9E90 /* auth2.js */,
|
||||
935E7B8A0FCF37D40024B2E5 /* sharding */,
|
||||
936D937F0FCC67C700004410 /* index9.js */,
|
||||
936D931B0FCC58C900004410 /* regex.js */,
|
||||
|
||||
63
rpm/init.d-mongod
Normal file
63
rpm/init.d-mongod
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
# mongod - Startup script for mongod
|
||||
|
||||
# chkconfig: 35 85 15
|
||||
# description: Mongo is a scalable, document-oriented database.
|
||||
# processname: mongod
|
||||
# config: /etc/mongod.conf
|
||||
# pidfile: /var/run/mongo/mongo.pid
|
||||
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# things from mongod.conf get there by mongod reading it
|
||||
|
||||
OPTIONS=" -f /etc/mongod.conf"
|
||||
|
||||
mongod=${MONGOD-/usr/bin/mongod}
|
||||
pidfile=${PIDFILE-/var/run/mongod.pid}
|
||||
lockfile=${LOCKFILE-/var/lock/subsys/mongod}
|
||||
|
||||
start()
|
||||
{
|
||||
echo -n $"Starting mongod: "
|
||||
#daemon --pidfile=${pidfile} $mongod $OPTIONS > /var/log/mongod
|
||||
$mongod $OPTIONS > /var/log/mongod 2>&1 &
|
||||
RETVAL=$?
|
||||
[ $RETVAL = 0 ] && touch ${lockfile}
|
||||
echo OK
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
echo -n $"Stopping mongod: "
|
||||
#killproc -p ${pidfile} -d 10 $mongod
|
||||
#RETVAL=$?
|
||||
killall mongod > /dev/null 2>&1
|
||||
#[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
|
||||
echo OK
|
||||
}
|
||||
|
||||
ulimit -n 12000
|
||||
RETVAL=0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
# status)
|
||||
# status -p ${pidfile} $mongod
|
||||
# ;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart}"
|
||||
RETVAL=1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
128
rpm/mongo.spec
Normal file
128
rpm/mongo.spec
Normal file
@@ -0,0 +1,128 @@
|
||||
Name: mongo
|
||||
Version: 1.2.0
|
||||
Release: mongodb_1%{?dist}
|
||||
Summary: mongo client shell and tools
|
||||
License: AGPL 3.0
|
||||
URL: http://www.mongodb.org
|
||||
Group: Applications/Databases
|
||||
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
BuildRequires: js-devel, readline-devel, boost-devel, pcre-devel
|
||||
BuildRequires: gcc-c++, scons
|
||||
|
||||
%description
|
||||
Mongo (from "huMONGOus") is a schema-free document-oriented database.
|
||||
It features dynamic profileable queries, full indexing, replication
|
||||
and fail-over support, efficient storage of large binary data objects,
|
||||
and auto-sharding.
|
||||
|
||||
This package provides the mongo shell, import/export tools, and other
|
||||
client utilities.
|
||||
|
||||
%package server
|
||||
Summary: mongo server, sharding server, and support scripts
|
||||
Group: Applications/Databases
|
||||
|
||||
%description server
|
||||
Mongo (from "huMONGOus") is a schema-free document-oriented database.
|
||||
|
||||
This package provides the mongo server software, mongo sharding server
|
||||
softwware, default configuration files, and init.d scripts.
|
||||
|
||||
%package devel
|
||||
Summary: Headers and libraries for mongo development.
|
||||
Group: Applications/Databases
|
||||
|
||||
%description devel
|
||||
Mongo (from "huMONGOus") is a schema-free document-oriented database.
|
||||
|
||||
This package provides the mongo static library and header files needed
|
||||
to develop mongo client software.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
scons --prefix=$RPM_BUILD_ROOT/usr all
|
||||
# XXX really should have shared library here
|
||||
|
||||
%install
|
||||
scons --prefix=$RPM_BUILD_ROOT/usr install
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1
|
||||
cp debian/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
|
||||
cp rpm/init.d-mongod $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
|
||||
chmod a+x $RPM_BUILD_ROOT/etc/rc.d/init.d/mongod
|
||||
mkdir -p $RPM_BUILD_ROOT/etc
|
||||
cp rpm/mongod.conf $RPM_BUILD_ROOT/etc/mongod.conf
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/mongo
|
||||
mkdir -p $RPM_BUILD_ROOT/var/log
|
||||
touch $RPM_BUILD_ROOT/var/log/mongo
|
||||
|
||||
%clean
|
||||
scons -c
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%pre server
|
||||
#/usr/sbin/useradd -M -o -r -d /var/mongo -s /bin/bash \
|
||||
# -c "mongod" mongod > /dev/null 2>&1 || :
|
||||
|
||||
%post server
|
||||
if test $1 = 1
|
||||
then
|
||||
/sbin/chkconfig --add mongod
|
||||
fi
|
||||
|
||||
%preun server
|
||||
if test $1 = 0
|
||||
then
|
||||
/sbin/chkconfig --del mongod
|
||||
fi
|
||||
|
||||
%postun server
|
||||
if test $1 -ge 1
|
||||
then
|
||||
/sbin/service mongod stop >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc README GNU-AGPL-3.0.txt
|
||||
|
||||
%{_bindir}/mongo
|
||||
%{_bindir}/mongodump
|
||||
%{_bindir}/mongoexport
|
||||
%{_bindir}/mongofiles
|
||||
%{_bindir}/mongoimport
|
||||
%{_bindir}/mongorestore
|
||||
|
||||
%{_mandir}/man1/mongo.1*
|
||||
%{_mandir}/man1/mongodump.1*
|
||||
%{_mandir}/man1/mongoexport.1*
|
||||
%{_mandir}/man1/mongofiles.1*
|
||||
%{_mandir}/man1/mongoimport.1*
|
||||
%{_mandir}/man1/mongorestore.1*
|
||||
|
||||
%files server
|
||||
%defattr(-,root,root,-)
|
||||
%config(noreplace) /etc/mongod.conf
|
||||
%{_bindir}/mongod
|
||||
%{_bindir}/mongos
|
||||
#%{_mandir}/man1/mongod.1*
|
||||
%{_mandir}/man1/mongos.1*
|
||||
/etc/rc.d/init.d/mongod
|
||||
/etc/sysconfig/mongod
|
||||
#/etc/rc.d/init.d/mongos
|
||||
%attr(0755,root,root) %dir /var/mongo
|
||||
%attr(0640,root,root) %config(noreplace) %verify(not md5 size mtime) /var/log/mongo
|
||||
|
||||
%files devel
|
||||
/usr/include/mongo
|
||||
%{_libdir}/libmongoclient.a
|
||||
#%{_libdir}/libmongotestfiles.a
|
||||
|
||||
%changelog
|
||||
* Sat Oct 24 2009 Joe Miklojcik <jmiklojcik@shopwiki.com> -
|
||||
- Wrote mongo.spec.
|
||||
|
||||
86
rpm/mongod.conf
Normal file
86
rpm/mongod.conf
Normal file
@@ -0,0 +1,86 @@
|
||||
# mongo.conf
|
||||
|
||||
#where to log
|
||||
logpath=/var/log/mongod
|
||||
|
||||
#port = 27017
|
||||
|
||||
dbpath=/var/lib/mongo
|
||||
|
||||
# Enables periodic logging of CPU utilization and I/O wait
|
||||
#cpu = true
|
||||
|
||||
# Turn on/off security. Off is currently the default
|
||||
#noauth = true
|
||||
#auth = true
|
||||
|
||||
# Verbose logging output.
|
||||
#verbose = true
|
||||
|
||||
# Inspect all client data for validity on receipt (useful for
|
||||
# developing drivers)
|
||||
#objcheck = true
|
||||
|
||||
# Enable db quota management
|
||||
#quota = true
|
||||
|
||||
# Set oplogging level where n is
|
||||
# 0=off (default)
|
||||
# 1=W
|
||||
# 2=R
|
||||
# 3=both
|
||||
# 7=W+some reads
|
||||
#oplog = 0
|
||||
|
||||
# Diagnostic/debugging option
|
||||
#nocursors = true
|
||||
|
||||
# Ignore query hints
|
||||
#nohints = true
|
||||
|
||||
# Disable the HTTP interface (Defaults to localhost:27018).
|
||||
#nohttpinterface = true
|
||||
|
||||
# Turns off server-side scripting. This will result in greatly limited
|
||||
# functionality
|
||||
#noscripting = true
|
||||
|
||||
# Turns off table scans. Any query that would do a table scan fails.
|
||||
#notablescan = true
|
||||
|
||||
# Disable data file preallocation.
|
||||
#noprealloc = true
|
||||
|
||||
# Specify .ns file size for new databases.
|
||||
# nssize = <size>
|
||||
|
||||
# Accout token for Mongo monitoring server.
|
||||
#mms-token = <token>
|
||||
|
||||
# Server name for Mongo monitoring server.
|
||||
#mms-name = <server-name>
|
||||
|
||||
# Ping interval for Mongo monitoring server.
|
||||
#mms-interval = <seconds>
|
||||
|
||||
# Replication Options
|
||||
|
||||
# in replicated mongo databases, specify here whether this is a slave or master
|
||||
#slave = true
|
||||
#source = master.example.com
|
||||
# Slave only: specify a single database to replicate
|
||||
#only = master.example.com
|
||||
# or
|
||||
#master = true
|
||||
#source = slave.example.com
|
||||
|
||||
# Address of a server to pair with.
|
||||
#pairwith = <server:port>
|
||||
# Address of arbiter server.
|
||||
#arbiter = <server:port>
|
||||
# Automatically resync if slave data is stale
|
||||
#autoresync
|
||||
# Custom size for replication operation log.
|
||||
#oplogSize = <MB>
|
||||
# Size limit for in-memory storage of op ids.
|
||||
#opIdMem = <bytes>
|
||||
@@ -171,7 +171,7 @@ int main(int argc, char* argv[], char *envp[] ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
log() << argv[0] << " v0.3- (alpha 3r) starting (--help for usage)" << endl;
|
||||
log() << argv[0] << " v0.2.6 (alpha 2f) starting (--help for usage)" << endl;
|
||||
printGitVersion();
|
||||
printSysInfo();
|
||||
|
||||
|
||||
@@ -32,6 +32,6 @@
|
||||
|
||||
namespace mongo {
|
||||
|
||||
const char versionString[] = "1.1.4-";
|
||||
const char versionString[] = "1.2.0";
|
||||
|
||||
} // namespace mongo
|
||||
|
||||
Reference in New Issue
Block a user