{"id":36606968,"url":"https://github.com/daniloarcidiacono/remark42-mongodb","last_synced_at":"2026-01-12T08:46:16.152Z","repository":{"id":159761313,"uuid":"541692673","full_name":"daniloarcidiacono/remark42-mongodb","owner":"daniloarcidiacono","description":"Remark42 MongoDB Server","archived":false,"fork":false,"pushed_at":"2025-08-11T08:08:19.000Z","size":2426,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-11T10:19:04.309Z","etag":null,"topics":["commenting","commenting-system","mongodb","remark42"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/daniloarcidiacono.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-26T16:57:44.000Z","updated_at":"2022-10-22T13:31:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"af476489-0740-4d27-8ea2-7cc04946e993","html_url":"https://github.com/daniloarcidiacono/remark42-mongodb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/daniloarcidiacono/remark42-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniloarcidiacono%2Fremark42-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniloarcidiacono%2Fremark42-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniloarcidiacono%2Fremark42-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniloarcidiacono%2Fremark42-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniloarcidiacono","download_url":"https://codeload.github.com/daniloarcidiacono/remark42-mongodb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniloarcidiacono%2Fremark42-mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["commenting","commenting-system","mongodb","remark42"],"created_at":"2026-01-12T08:46:16.073Z","updated_at":"2026-01-12T08:46:16.135Z","avatar_url":"https://github.com/daniloarcidiacono.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remark42 MongoDB Server\n\n![GitHub Workflow Status](https://github.com/daniloarcidiacono/remark42-mongodb/actions/workflows/workflow.yml/badge.svg)\n![Known Vulnerabilities](https://snyk.io/test/github/daniloarcidiacono/remark42-mongodb/badge.svg)\n[![codecov](https://codecov.io/github/daniloarcidiacono/remark42-mongodb/branch/main/graph/badge.svg?token=TBMTIG2F2U)](https://codecov.io/github/daniloarcidiacono/remark42-mongodb) \n![Remark42 compatiblity](https://img.shields.io/static/v1.svg?label=Remark42\u0026message=v1.10.1\u0026color=red)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nStore [Remark42](https://remark42.com/) comments, images and avatars on MongoDB. \\\nTested with [Remark42 v1.10.1](https://github.com/umputun/remark42/releases/tag/v1.10.1).\n\n\u003e **Warning**\n\u003e The fix for the following issues on Remark42 are required for Remark42 MongoDB Server to work:\n\u003e \n\u003e - [Type cast panic when using RPC](https://github.com/umputun/remark42/issues/1475)\n\u003e - [Key() method invoked with wrong siteID](https://github.com/umputun/remark42/issues/1499)\n\u003e \n\u003e Until version v1.10.2 is released it's mandatory to build Remark42 from its `master` branch.\n\n## Setup\nInitialize the server with `remark42-mongodb.js init`:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"700\" src=\"docs/asciinema/init.svg\"\u003e\n\u003c/p\u003e\n\nA configuration file `remark42-mongodb.json` is created: \n\n```json\n{\n    \"port\": 9000,\n    \"hostname\": \"localhost\",\n    \"database\": \"mongodb://localhost:27017/remark42-mongodb\",\n    \"avatars\": \"remark_avatars\",\n    \"bodyLimit\": \"8mb\",\n    \"dynamicPosts\": true,\n    \"logDir\": \"logs\",\n    \"logMaxSize\": \"8m\",\n    \"logMaxFiles\": 30\n}\n```\n\nThe following options are available:\n- **`port`**: the TCP port on which the Remark42 MongoDB Server listens for client connections;\n- **`hostname`**: the hostname where to listen for client connections;\n- **`database`**: the MongoDB connection URI;\n- **`avatars`**: Remark42 can be configured to store avatars in a GridFS bucket. This optional setting is the name of the GridFS bucket; once configured, remark42-mongodb periodically cleans up unused avatars;\n- **`bodyLimit`**: maximum size of request bodies, should be calibrated accordingly to the maximum image size accepted by Remark42 (`IMAGE_MAX_SIZE`);\n- **`dynamicPosts`**: if `true`, any post referenced by comments is created if not existing; if `false`, comments referencing a non-existing post are rejected: in that case, available sites/posts must be initialized either by hand or by using `sites create`  and `posts create` commands;\n- **`logDir`**: logs folder path;\n- **`logMaxSize`**: the maximum size for each log file (e.g. `32k`, `8m`, `2g`).\n- **`logMaxFiles`** (optional): maximum number of days the logs are kept; if omitted, logs are kept indefinitely;\n\nAll options can be overridden via `REMARK42_MONGODB_XXX` environment variables, for example `REMARK42_MONGODB_DATABASE`\nor `REMARK42_MONGODB_LOG_MAX_SIZE`.\n\n## Running\nStart the server with `remark42-mongodb.js serve`.\n\nThree log files are created:\n- **`access-YYYY-MM-DD.log`**: collecting information about served requests;\n- **`error-YYYY-MM-DD.log`**: collecting errors;\n- **`main-YYYY-MM-DD.log`**: collecting general information;\n\nLog files are rotated daily and are limited both in size (`logMaxSize`) and number (`logMaxFiles`).\n\n## Health check\nService health can be checked by sending a `GET /health` request, that will respond with `200 OK` or `503 Service Unavailable` depending on the state of the server and database connection.\n\n## Managing sites\nNew sites can be created with `remark42-mongodb.js sites create [name]`:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"700\" src=\"docs/asciinema/add_site.svg\"\u003e\n\u003c/p\u003e\n\nSites **must be created** regardless of whether `dynamicPosts` is set to `true` or `false`. \\\nThe encryption key and email are described on [Remark42 documentation](https://remark42.com/docs/configuration/parameters/),\nrespectively `SECRET` and `ADMIN_SHARED_EMAIL`. \\ \nNote that Remark42 MongoDB Server handles different values for each site (i.e. they are not \"shared\").\n\nCurrent sites can be listed with `remark42-mongodb.js sites list`:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"700\" src=\"docs/asciinema/list_sites.svg\"\u003e\n\u003c/p\u003e\n\n## Managing posts\nNew posts can be created with `remark42-mongodb.js posts create [site] [url]`:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"700\" src=\"docs/asciinema/add_post.svg\"\u003e\n\u003c/p\u003e\n\nThis is useful for initializing the database when `dynamicPosts` is set to `false`. \\\nThe posts on a specific site can be listed with `remark42-mongodb.js posts list [site]`:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"700\" src=\"docs/asciinema/list_posts.svg\"\u003e\n\u003c/p\u003e\n\n## Remark42 configuration\nSet the following environment variables in Remark42 to enable integration with Remark42 MongoDB Server (adjust values according to your configuration):\n\n```properties\nSTORE_TYPE=rpc\nSTORE_RPC_API=http://localhost:9000\n\nADMIN_TYPE=rpc\nADMIN_RPC_API=http://localhost:9000\n\nIMAGE_TYPE=rpc\nIMAGE_RPC_API=http://localhost:9000\n```\n\nRemark42 can also store avatars in a GridFS bucket with the following configuration:\n\n```properties\nAVATAR_TYPE=uri\nAVATAR_URI=mongodb://localhost:27017/remark42-mongodb?ava_db=remark42-mongodb\u0026ava_coll=remark_avatars\n```\n\n\u003e **Warning**\n\u003e At the moment `mongodb+srv` URIs (used by MongoDB Atlas) are not handled correctly ([open issue](https://github.com/go-pkgz/auth/issues/127)).\n\nRemark42 MongoDB Server can periodically clean up unused avatars by configuring `avatars` to `remark_avatars`. \n\nMore information on how to configure Remark42 available at [Remark42 documentation](https://remark42.com/docs/configuration/parameters/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniloarcidiacono%2Fremark42-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniloarcidiacono%2Fremark42-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniloarcidiacono%2Fremark42-mongodb/lists"}