{"id":13526341,"url":"https://github.com/ScreepsMods/screepsmod-mongo","last_synced_at":"2025-04-01T07:32:03.238Z","repository":{"id":23160717,"uuid":"98309404","full_name":"ScreepsMods/screepsmod-mongo","owner":"ScreepsMods","description":"Replace LokiJS with MongoDB and Redis","archived":false,"fork":false,"pushed_at":"2023-11-02T22:43:02.000Z","size":1109,"stargazers_count":25,"open_issues_count":10,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-15T08:10:44.394Z","etag":null,"topics":["hacktoberfest","mod","mongo","redis","screeps","screeps-modules","screepsmod"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScreepsMods.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"patreon":"ags131","github":["ags131"]}},"created_at":"2017-07-25T13:30:50.000Z","updated_at":"2024-01-09T05:52:50.000Z","dependencies_parsed_at":"2023-01-13T22:51:28.340Z","dependency_job_id":"c138cdeb-701a-42a8-bd11-019f4ef4e466","html_url":"https://github.com/ScreepsMods/screepsmod-mongo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreepsMods%2Fscreepsmod-mongo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreepsMods%2Fscreepsmod-mongo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreepsMods%2Fscreepsmod-mongo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreepsMods%2Fscreepsmod-mongo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScreepsMods","download_url":"https://codeload.github.com/ScreepsMods/screepsmod-mongo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246600768,"owners_count":20803481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","mod","mongo","redis","screeps","screeps-modules","screepsmod"],"created_at":"2024-08-01T06:01:28.260Z","updated_at":"2025-04-01T07:32:02.758Z","avatar_url":"https://github.com/ScreepsMods.png","language":"JavaScript","funding_links":["https://patreon.com/ags131","https://github.com/sponsors/ags131"],"categories":["JavaScript"],"sub_categories":[],"readme":"# screepsmod-mongo\n\n## MongoDB And Redis for the Screeps Private Server\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![CircleCI](https://circleci.com/gh/ScreepsMods/screepsmod-mongo/tree/master.svg?style=shield)](https://circleci.com/gh/ScreepsMods/screepsmod-mongo/tree/master)\n\n## Requirements\n\n* screeps 4.0+\n* mongodb 2.6+\n* redis 3.0.6+  For Windows installs, you can follow these steps: https://github.com/ServiceStack/redis-windows#option-3-running-microsofts-native-port-of-redis\n\n## Installation\n\nInstalling on Ubuntu? Check out the community guide in the official Docs [Private server on Ubuntu using MongoDB and Redis](http://docs.screeps.com/contributed/ps_ubuntu.html) or the newer screeps-launcher guide [Newbie-friendly (ish) private/dedicated server setup guide for Ubuntu 18.04, with automatic startup](https://www.reddit.com/r/screeps/comments/deyq66/newbiefriendly_ish_privatededicated_server_setup/)\n\n1. Ensure both mongodb and redis are already installed and running\n2. `npm install screepsmod-mongo` inside your server's mods folder\n3. Ensure the mod has been added to mods.json. Eg:\n```\n  \"mods\": [\n    \"node_modules\\\\screepsmod-mongo\\\\index.js\"\n  ],\n```\n\n4. Start server!  \n5. DB Population\n    * `mongo.importDB()` in the screeps cli imports your existing DB\n\n        OR\n\n    * `system.resetAllData()` in the screeps cli for a completely fresh DB\n6. Once done restart the server\n7. Done! \n\n## Usage\n\nWith this mod installed you can continue to manage the server as usual,\nall CLI commands behave identically.\nThe original storage module will still run, but is completely ignored.\n\nKeep in mind that RAM requirements are slightly higher, by default mongo\nuses 50% - 1G of your system RAM. Redis on the other hand, uses very little.\n\nMongo and Redis CLIs can be used to see and modify the data as usual,\nbackups and restores should be done via normal mongo and redis tools.\n\nhttps://docs.mongodb.com/manual/tutorial/backup-and-restore-tools/  \nhttps://redis.io/topics/persistence\n\n## Configuration\n\nAll options and defaults are listed below\n\n### Mongo\n\n* host: localhost\n* port: 27017\n* database: screeps\n* uri: mongodb://localhost:27017/screeps\n\nIf the uri Parameter is supplied it will overwrite all other settings. Use it for Authentication, passing extra options, etc.\n\n### Redis\n\n* host: localhost\n* port: 6379\n\n## Examples\n\nConfig can be applied in several ways:\n\n### .screepsrc (Recommended)\n\nAdd to the bottom of your .screepsrc file\n```\n[mongo]\nhost = 192.168.0.222\n\n[redis]\nhost = 192.168.0.222\n```\n\n### ENV Method\n\nPlease note that this method only works when launching modules directly, when launched via the default launcher they will be ignored.\n\n```\nMONGO_HOST='192.168.0.222'\nMONGO_CONN='mongodb://username:password@hostname.com/database_name?ssl=true'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FScreepsMods%2Fscreepsmod-mongo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FScreepsMods%2Fscreepsmod-mongo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FScreepsMods%2Fscreepsmod-mongo/lists"}