.editorconfig000066400000000000000000000006371516104664100135450ustar00rootroot00000000000000# EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # Change these settings to your own preference indent_style = space indent_size = 4 # We recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false .gitignore000066400000000000000000000003421516104664100130510ustar00rootroot00000000000000/build /node_modules /node_modules/.yarn-integrity /*.log /*.iws .idea/workspace.xml .idea/tasks.xml .idea/profiles_settings.xml .idea/inspectionProfiles/Project_Default.xml .idea/inspectionProfiles/profiles_settings.xml .travis.yml000066400000000000000000000014561516104664100132010ustar00rootroot00000000000000language: node_js cache: npm: false node_js: - node before_script: - npm install -g grunt-cli npm env: global: secure: WX0K/wzf8TFs19jP+T+Yuzjr94aTQNpCrrCH0jr9MKsbhKverRACKrQnQTiTWv4yij2EIwEcch7mye0ijCMiqyNua2yqZxeRlS6uwY7EXS7JVMyiDuliB6ycZ2D7pUnvp0WUgpFvpZ54jq9M2EnV3Q4qJNzfMu1OEzbkwooBw+UoOee8u5zDL9jjt2lvxq57uTKK1Vk4nQFr33uVwHwW4eoUrDmNXRQzhU4s0A7C7u/PjD8Ujo2ayrYM6gUM3SyK01CYQWAaIxbGJE2ePccA8CpdtFcocx2ImFlERANAnon/6/U+kaH4+ZUXEPk2TjfGJHNLw3Bg6uS3sCxebMKdl5zB9b/lApelIC1prKuD+SoPMz5TgwwLJVqFXTlvGyavuqFR+++xndUiLbiUWGUkk4w+EQnyE6k/iyU4/WT5EXQCAMKMb6dFq6L0uzF/C0kCEvggyoYm/lfBo8BJjZhvxeWoEfoqRZXnzJjg9c0+aob1nfZyPmL+2BDLOseu2kLQyMaNgHNZn2g9VgLrdfBVVcATbfJx/aaw8tpTitxFUStT16l2URfLbTotI4M5/xBPl4EfmEmXJJ1CSgnHpXGE7Ty3o3pcosQtJu3I9+lNNB41IYYgXx8oq27e4NaaDmduMyBjArRdIpUdHEwQtfp6SZecx864hzvPZP9Y4inuB3E= Dockerfile000066400000000000000000000037621516104664100130640ustar00rootroot00000000000000# docker build -t patrikx3/docker-debian-testing-mongodb-stable . # docker container ls # docker exec -it bash # docker attach # docker run -t -i patrikx3/docker-debian-testing-mongodb-stable bash # https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source # https://unix.stackexchange.com/questions/378644/how-to-install-mongodb-3-4-in-debian-stretch-9 # recipe # docker commit ${container_id} patrikx3/docker-debian-testing-mongodb-stable:built # docker commit ${container_id} patrikx3/docker-debian-testing-mongodb-stable:installed FROM debian:testing MAINTAINER patrikx3/docker-debian-testing-mongodb-stable - Patrik Laszlo - alabard@gmail.com ENV DEBIAN_FRONTEND=noninteractive ENV FORCE_UNSAFE_CONFIGURE=1 ENV SHELL=/bin/bash ARG MONGODB_BRANCH=v4.1 ARG MONGODB_RELEASE=r4.1.0 ENV PATH="/build/install:/build/mongo:${PATH}" RUN apt-get -y update RUN apt-get -y upgrade # libboost1.55-dev => libboost-dev # openjdk-8-jdk => openjdk-7-jdk # clang - might not needed RUN apt -y install build-essential gcc python scons git glibc-source libssl-dev python-pip libffi-dev python-dev RUN pip install -U pip RUN mkdir build # clean up RUN apt-get autoremove -y RUN apt-get autoclean -y RUN apt-get clean -y WORKDIR build WORKDIR /build RUN git clone -b ${MONGODB_BRANCH} https://github.com/mongodb/mongo.git WORKDIR /build/mongo RUN git checkout tags/${MONGODB_RELEASE} # hack to old version python pip cryptography from 1.7.2 to use the latest RUN sed -i 's#cryptography == 1.7.2#\#cryptography == 1.7.2#g' buildscripts/requirements.txt # this is only because 4.1.0 uses 1.7.2 and # https://github.com/pyca/cryptography/issues/4193#issuecomment-381236459 # support minimum latest (2.2) RUN pip install cryptography RUN pip install -r buildscripts/requirements.txt RUN pip2 install --user regex RUN scons all --disable-warnings-as-errors -j 8 --ssl #RUN scons core --disable-warnings-as-errors -j 8 --ssl RUN scons install --disable-warnings-as-errors -j 8 --prefix /usr/bin CMD /bin/bash Gruntfile.js000066400000000000000000000004601516104664100133570ustar00rootroot00000000000000module.exports = (grunt) => { const builder = require(`corifeus-builder`); const loader = new builder.loader(grunt); loader.js({ replacer: { type: 'build', npmio: false, }, }); grunt.registerTask('default', builder.config.task.build.js); }; LICENSE000066400000000000000000000024721516104664100120740ustar00rootroot00000000000000 @license p3x-docker-debian-testing-mongodb-stable v2019.10.138 ✨ Debian Buster / Bullseye / Bookworm / Testing / SID MongoDB and MongoDB Tools build stable https://pages.corifeus.com/docker-debian-testing-mongodb-stable Copyright (c) 2019 Patrik Laszlo / P3X / Corifeus and contributors. MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. README.md000066400000000000000000000145211516104664100123440ustar00rootroot00000000000000[//]: #@corifeus-header [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://paypal.me/patrikx3) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Corifeus @ Facebook](https://img.shields.io/badge/Facebook-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Build Status](https://travis-ci.com/patrikx3/docker-debian-testing-mongodb-stable.svg?branch=master)](https://travis-ci.com/patrikx3/docker-debian-testing-mongodb-stable) [![Uptime Robot ratio (30 days)](https://img.shields.io/uptimerobot/ratio/m780749701-41bcade28c1ea8154eda7cca.svg)](https://uptimerobot.patrikx3.com/) # ✨ Debian Buster / Bullseye / Bookworm / Testing / SID MongoDB and MongoDB Tools build stable [//]: #@corifeus-header:end It is basically a built for the latest MongoDB for Debian. **Unfortunately, I never tested it on any other architecture, but `x64`, so, it is possible it will not build other CPU types. [See this link.](https://docs.mongodb.com/manual/installation/#mongodb-supported-platforms)** The current version is the r4.0.13 build (release). There is a newer version `4.1.0`, but given, we use `NoSQLBooster`, it only works with `4.0.0` and the `4.0.x` is the stable, the next stable will be `4.2.0`, `4.4.0` and so on... ### Warning It will remove all ```mongodb*``` apt packages in ```./scripts/build-server.sh``` and ```/etc/systemd/system/mongodb-server.service``` is replaced. It install the required apt dependencies and generates the ```SystemD``` service and makes it enabled. Check, if the build works (building is below). It runs all tests, so if it works, then it really does, actually. If there is an error, of course, you will not deploy on your server. So, if building and testing works, then it puts the binaries as it follows and you are sure and done. For testing, you may build it in Docker, but the live building is on the server in the directory in the GIT repository ```build``` directory and then it puts the files into ```/usr/bin```. ## Scripts for building It can work with `sudo`, but the best if you are ```root```. Of course, you can check the ```code```, there is no ```harm``` for sure! ```bash git clone https://github.com/patrikx3/docker-debian-testing-mongodb-stable cd docker-debian-testing-mongodb-stable ``` If below you get an error, please create an ```issue```, because it is possible, I have not added a package, because my server was already there, but I will add in it for you for sure with ```apt```. ### 1. Build MongoDB Server The command: ```bash sudo ./scripts/build-server.sh ``` From: https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source All defaults are in the config, that MongoDB uses: * /var/log/mongodb - log * /var/lib/mongodb - data It generates everything, all you have to do: ```bash sudo ./scripts/build-server.sh r4.0.13 # if you want to specify how many cores you wanna use do like sudo CORES=4 ./scripts/build-server.sh r4.0.13 ``` ### 2. Build MongoDB Tools The command: ```bash ./scripts/build-tools.sh ``` It generates and install GoLang and builds the tools that you find them in: https://github.com/mongodb/mongo-tools Then, it puts all tools into the default Debian ```/usr/bin``` directories. The exact command is like: ```bash sudo ./scripts/build-tools.sh r4.0.13 ``` ### 3. Start the services Before you start the database, **but after the build** , you are required to create a config (unless, you already have it), a skeleton is here: ```text artifacts/root-filesystem/etc/mongodb.conf ``` #### Add safety to the mongodb config file ```bash sudo cp ./artifacts/root-filesystem/etc/mongodb.conf /etc/mongodb.conf sudo chmod o-rwx /etc/mongodb.conf sudo chown mongodb:mongodb /etc/mongodb.conf ``` After you created the config, you start the database like: ```service mongodb-server start``` or ```service mongodb-server restart``` [//]: #@corifeus-footer --- 🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much! Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up. All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable. **Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme. --- [**P3X-DOCKER-DEBIAN-TESTING-MONGODB-STABLE**](https://pages.corifeus.com/docker-debian-testing-mongodb-stable) Build v2019.10.138 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) ## P3X Sponsors [IntelliJ - The most intelligent Java IDE](https://www.jetbrains.com/?from=patrikx3) [![JetBrains](https://cdn.corifeus.com/assets/svg/jetbrains-logo.svg)](https://www.jetbrains.com/?from=patrikx3) [![NoSQLBooster](https://cdn.corifeus.com/assets/png/nosqlbooster-70x70.png)](https://www.nosqlbooster.com/) [The Smartest IDE for MongoDB](https://www.nosqlbooster.com) [//]: #@corifeus-footer:end artifacts/000077500000000000000000000000001516104664100130425ustar00rootroot00000000000000artifacts/root-filesystem/000077500000000000000000000000001516104664100162075ustar00rootroot00000000000000artifacts/root-filesystem/etc/000077500000000000000000000000001516104664100167625ustar00rootroot00000000000000artifacts/root-filesystem/etc/mongodb.conf000066400000000000000000000061451516104664100212640ustar00rootroot00000000000000net: bindIp: 0.0.0.0 port: 27017 unixDomainSocket: filePermissions: 0770 # ssl: # mode: requireSSL # PEMKeyFile: /etc/ssl/patrikx3.com.pem # CAFile: /etc/ssl/acme/patrikx3.com/ca.cer # allowConnectionsWithoutCertificates: true storage: dbPath: "/var/lib/mongodb" journal: enabled: true systemLog: destination: "file" logAppend: true path: "/var/log/mongodb/mongodb.log" processManagement: timeZoneInfo: /usr/share/zoneinfo # add it after you setup the auth if you need it #security: # authorization: enabled #storage: # dbPath: "/var/lib/mongodb" # directoryPerDB: true # journal: # enabled: true #systemLog: # destination: file # path: "/var/log/mongodb/mongodb.log" # logAppend: true # timeStampFormat: iso8601-utc #processManagement: # fork: true #net: # bindIp: 127.0.0.1,192.168.78.20 # port: 27017 # wireObjectCheck : false # mongodb.conf # Where to store the data. #dbpath=/var/lib/mongodb #where to log #logpath=/var/log/mongodb/mongodb.log #logappend=true #bind_ip = 127.0.0.1,192.168.78.20 #port = 27017 #auth = true # Enable journaling, http://www.mongodb.org/display/DOCS/Journaling #journal=true ############################# # 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 = # Accout token for Mongo monitoring server. #mms-token = # Server name for Mongo monitoring server. #mms-name = # Ping interval for Mongo monitoring server. #mms-interval = # 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 = # Address of arbiter server. #arbiter = # Automatically resync if slave data is stale #autoresync # Custom size for replication operation log. #oplogSize = # Size limit for in-memory storage of op ids. #opIdMem = # SSL options # Enable SSL on normal ports #sslOnNormalPorts = true # SSL Key file and password #sslPEMKeyFile = /etc/ssl/mongodb.pem #sslPEMKeyPassword = pass artifacts/root-filesystem/etc/systemd/000077500000000000000000000000001516104664100204525ustar00rootroot00000000000000artifacts/root-filesystem/etc/systemd/system/000077500000000000000000000000001516104664100217765ustar00rootroot00000000000000artifacts/root-filesystem/etc/systemd/system/mongodb-server.service000066400000000000000000000011541516104664100263120ustar00rootroot00000000000000[Unit] Description=High-performance, schema-free document-oriented database After=network.target Documentation=https://docs.mongodb.org/manual [Service] User=mongodb Group=mongodb RuntimeDirectory=mongodb RuntimeDirectoryMode=0755 EnvironmentFile=-/etc/default/mongodb Environment=CONF=/etc/mongodb.conf Environment=SOCKETPATH=/run/mongodb ExecStart=/usr/bin/mongod --unixSocketPrefix=${SOCKETPATH} --config ${CONF} $DAEMON_OPTS LimitFSIZE=infinity LimitCPU=infinity LimitAS=infinity LimitNOFILE=64000 LimitNPROC=64000 LimitMEMLOCK=infinity TasksMax=infinity TasksAccounting=false [Install] WantedBy=multi-user.target build-configure000077500000000000000000000002151516104664100140640ustar00rootroot00000000000000#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" docker build -t patrikx3/docker-debian-testing-mongodb-stable . docker-debian-testing-mongodb-stable.iml000066400000000000000000000006241516104664100206240ustar00rootroot00000000000000 docker-scripts/000077500000000000000000000000001516104664100140165ustar00rootroot00000000000000docker-scripts/build.sh000077500000000000000000000005311516104664100154530ustar00rootroot00000000000000#!/usr/bin/env bash # https://stackoverflow.com/questions/6481005/how-to-obtain-the-number-of-cpus-cores-in-linux-from-the-command-line # CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu || echo "$NUMBER_OF_PROCESSORS") CORES=$(grep -c ^processor /proc/cpuinfo) scons all --disable-warnings-as-errors -j ${CORES} --ssl docker-scripts/install.sh000077500000000000000000000005511516104664100160240ustar00rootroot00000000000000#!/usr/bin/env bash # https://stackoverflow.com/questions/6481005/how-to-obtain-the-number-of-cpus-cores-in-linux-from-the-command-line # CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu || echo "$NUMBER_OF_PROCESSORS") CORES=$(grep -c ^processor /proc/cpuinfo) scons install -j ${CORES} --disable-warnings-as-errors --prefix /usr/bin package.json000066400000000000000000000026741516104664100133610ustar00rootroot00000000000000{ "name": "p3x-docker-debian-testing-mongodb-stable", "corifeus": { "prefix": "p3x-", "type": "build", "cdn": true, "nodejs": "v12.11.1", "icon": "fas fa-database", "code": "MissOut", "opencollective": false, "reponame": "docker-debian-testing-mongodb-stable", "build": true }, "version": "2019.10.138", "description": "✨ Debian Buster / Bullseye / Bookworm / Testing / SID MongoDB and MongoDB Tools build stable ", "main": "src/index.js", "directories": { "test": "test" }, "scripts": { "test": "grunt", "coverage": "istanbul cover node_modules/mocha/bin/_mocha --report clover -- -R spec test/mocha/**/*.js" }, "repository": { "type": "git", "url": "https://github.com/patrikx3.com/docker-debian-testing-mongodb-stable" }, "keywords": [ "debian", "mongodb", "mongodb tools", "stretch", "buster", "bullseye", "testing", "tools", "mongodb-tools", "build", "linux", "stable", "latest" ], "author": "Patrik Laszlo ", "license": "MIT", "devDependencies": { "corifeus-builder": "^2019.10.249" }, "engines": { "node": ">=10.16.0" }, "homepage": "https://pages.corifeus.com/docker-debian-testing-mongodb-stable", "dependencies": {} }run-built000077500000000000000000000002731516104664100127330ustar00rootroot00000000000000#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" docker run -v $DIR/docker-scripts:/build/scripts -ti patrikx3/docker-debian-testing-mongodb-stable:built bash run-preconfigured000077500000000000000000000002741516104664100144510ustar00rootroot00000000000000#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" docker run -v $DIR/docker-scripts:/build/scripts -ti patrikx3/docker-debian-testing-mongodb-stable:latest bash scripts/000077500000000000000000000000001516104664100125515ustar00rootroot00000000000000scripts/build-server.sh000077500000000000000000000113341516104664100155150ustar00rootroot00000000000000#!/usr/bin/env bash # based on https://github.com/mongodb/mongo/wiki/Build-Mongodb-From-Source # the current directory DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # if an error exit right away, don't continue the build set -e # some info echo #echo "Works like command, use a tag: sudo ./scripts/build-server.sh r4.2.0" echo "Works like command, use a tag: sudo ./scripts/build-server.sh r4.0.13" echo # check if we are root if [[ $EUID -ne 0 ]]; then echo "This script must be ran via root 'sudo' command or using in 'sudo -i'." exit 1 fi # require mongo branch #if [ -z "${1}" ]; then # echo "First argument must be the MONGODB_BRANCH for example 'v4.1'" # exit 1 #fi #MONGODB_BRANCH="${1}" # require mongo release #if [ -z "${2}" ]; then # echo "The second argument must be the MONGODB_RELEASE for example 'r4.1.0'" # exit 1 #fi #MONGODB_RELEASE="${2}" # require mongo release if [ -z "${1}" ]; then echo "The first argument must be the MONGODB_RELEASE for example 'r4.0.13'" exit 1 fi MONGODB_RELEASE="${1}" # delete all mongo other programs, we self compile apt remove --purge mongo* # the required packages for debian apt -y install libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev build-essential gcc python scons git glibc-source libssl-dev python-pip libffi-dev python-dev libcurl4-openssl-dev #libcurl-dev pip install -U pip pyyaml typing # generate build directory variable BUILD=$DIR/../build # delete previous build directory rm -rf $BUILD/mongo # generate new build directory mkdir -p $BUILD # the mongodb.conf and systemd services files in a directory variable ROOT_FS=$DIR/../artifacts/root-filesystem # find out how many cores we have and we use that many if [ -z "$CORES" ]; then CORES=$(grep -c ^processor /proc/cpuinfo) fi echo Using $CORES cores # go to the build directory pushd $BUILD # clone the mongo by branch #git clone -b ${MONGODB_BRANCH} https://github.com/mongodb/mongo.git # clone the mongo by branch git clone https://github.com/mongodb/mongo.git # the mongo directory is a variables MONGO=$BUILD/mongo # go to the mongo directory pushd $MONGO # checkout the mongo release git checkout tags/${MONGODB_RELEASE} # hack to old version python pip cryptography from 1.7.2 to use the latest sed -i 's#cryptography == 1.7.2#\#cryptography == 1.7.2#g' buildscripts/requirements.txt # this is only because 4.0.13 uses 1.7.2 and # https://github.com/pyca/cryptography/issues/4193#issuecomment-381236459 # support minimum latest (2.2) pip install cryptography # install the python requirements #pip install -r etc/pip/dev-requirements.txt pip install -r buildscripts/requirements.txt # somewhere in the build it says if we install this, it is faster to build pip2 install --user regex # build everything scons all --disable-warnings-as-errors -j $CORES --ssl # install the mongo programs all scons install --disable-warnings-as-errors -j $CORES --prefix /usr # create a copy of the old config #TIMESTAMP=$(($(date +%s%N)/1000000)) #cp /etc/mongodb.conf /etc/mongodb.conf.$TIMESTAMP.save # copy the mongodb.conf configured and the systemd service file # dangerous!!! removed # cp -avr $ROOT_FS/. / MONGODB_SERVICE=etc/systemd/system/mongodb-server.service cp $ROOT_FS/$MONGODB_SERVICE /$MONGODB_SERVICE chown root:root /$MONGODB_SERVICE chmod o-rwx /$MONGODB_SERVICE # generate mongodb user and group useradd mongodb -d /var/lib/mongodb -s /bin/false || true # create the required mongodb database directory and add safety mkdir -p /var/lib/mongodb chmod o-rwx -R /var/lib/mongodb chown -R mongodb:mongodb /var/lib/mongodb # create the required mongodb log directory and add safety mkdir -p /var/log/mongodb chmod o-rwx -R /var/log/mongodb chown -R mongodb:mongodb /var/log/mongodb # create the required run socket directory and add safety mkdir -p /run/mongodb chmod o-rwx -R /run/mongodb chown -R mongodb:mongodb /run/mongodb # add safety to the mongodb config file chmod o-rwx /etc/mongodb.conf || true chown mongodb:mongodb /etc/mongodb.conf || true # reload systemd services systemctl daemon-reload # enable the mongodb-server systemctl enable mongodb-server # start the mongodb-server #service mongodb-server start # exit of the mongo directory popd # exit the build directory popd # delete current build directory rm -rf $BUILD/mongo scripts/build-tools.sh000077500000000000000000000037451516104664100153560ustar00rootroot00000000000000#!/usr/bin/env bash # based on https://github.com/mongodb/mongo-tools # the current directory DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # if an error exit right away, don't continue the build set -e # some info echo echo "Works like command: sudo ./scripts/build-tools.sh r4.0.13" echo # check if we are root if [[ $EUID -ne 0 ]]; then echo "This script must be ran via root 'sudo' command or using in 'sudo -i'." exit 1 fi # require mongo release if [ -z "${1}" ]; then echo "The first argument must be the MONGODB_RELEASE for example 'r4.0.13'" exit 1 fi MONGODB_RELEASE="${1}" ## delete all mongo other programs, we self compile ##apt remove --purge mongo* ## the required packages for debian ##apt -y install gcc python scons git glibc-source libssl-dev python-pip apt -y install golang libpcap-dev export GOROOT=$(go env GOROOT) # generate build directory variable BUILD=$DIR/../build/src/github.com/mongodb/ # delete previous build directory rm -rf $BUILD/mongo-tools # generate new build directory mkdir -p $BUILD # find out how many cores we have and we use that many CORES=$(grep -c ^processor /proc/cpuinfo) # go to the build directory pushd $BUILD # clone the mongo by branch git clone https://github.com/mongodb/mongo-tools # the mongo directory is a variables MONGO_TOOLS=$BUILD/mongo-tools # go to the mongo directory pushd $MONGO_TOOLS # checkout the mongo release git checkout tags/${MONGODB_RELEASE} bash ./build.sh chown root:adm -R ./bin chmod o-rwx -R ./bin chmod ug+rx ./bin/* cp -r ./bin/. /usr/bin # for PROGRAM in bsondump mongodump mongoexport mongofiles mongoimport mongoreplay mongorestore mongostat mongotop # do # go build -o bin/${PROGRAM} -tags "ssl sasl" ${PROGRAM}/main/${PROGRAM}.go # done # exit of the mongo directory popd # exit the build directory popd # delete current build directory rm -rf $BUILD/mongo-tools scripts/check-kernel.sh000077500000000000000000000003241516104664100154420ustar00rootroot00000000000000#!/usr/bin/env bash # check if we are root sudo bash -c 'clear && echo && echo MongoDB: && cat /var/log/mongodb/mongodb.log | grep -i kernel | tail -1 | cut -d \" -f12 && echo && echo System: && uname -r && echo'src/000077500000000000000000000000001516104664100116515ustar00rootroot00000000000000src/index.js000066400000000000000000000000431516104664100133130ustar00rootroot00000000000000module.exports = console.log('CI');tag-built000077500000000000000000000004651516104664100127050ustar00rootroot00000000000000#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ -z "${1}" ]; then echo "First argument is unset or set to the empty string, it should be a container_id that is built before installed." exit 1 fi docker commit ${1} patrikx3/docker-debian-testing-mongodb-stable:built tag-installed000077500000000000000000000004541516104664100135430ustar00rootroot00000000000000#!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ -z "${1}" ]; then echo "First argument is unset or set to the empty string, it should be a container_id that is installed." exit 1 fi docker commit ${1} patrikx3/docker-debian-testing-mongodb-stable:installed test/000077500000000000000000000000001516104664100120415ustar00rootroot00000000000000test/arg-first.sh000077500000000000000000000000521516104664100142730ustar00rootroot00000000000000#!/usr/bin/env bash echo ${1} ls -all ${1}