Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
MCMS is a fast Minimal CMS written in server side JavaScript. It uses only the file system and as such runs without a database. Mustache is used for defining the templates and GitHub flavored Markdown for the pages. It includes support for creating a list of links to all pages, making it possible to use it as a simple blog.
By being built on top of the CommonJS Filesystem/A and JSGI 0.3 specs, it runs on multiple server side JavaScript platforms, such as Node.js (via Common Node) and RingoJS (and as a result runs on Google's AppEngine and other Java hosting platforms).
If you have any questions about using mcms
, please post them to the Common Node mailing list.
Install MCMS with npm install mcms
. Also make sure that you have Common Node installed as a global package (via npm install -g common-node
). Run common-node node_modules/mcms
to start the server.
Install the Markdown package with ringo-admin install https://github.com/isaacs/giub-flavored-markdown/zipball/master
.
Install MCMS with git clone git://github.com/olegp/mcms.git
, then cd mcms
and start the server with ringo ./lib/mcms.js
.
Once the server is running, open http://localhost:8080 with your browser - you should see the contents of this README. Note that by default MCMS caches the generated HTML in memory, so if you update the template or pages, you will need to restart your server.
The easiest way to get started with a new site is to clone an already existing one and modify it to get the site you want (TODO: add link to repo). Alternatively, if you're starting from scratch you can also create a directory for your site. Inside it, add a single file named index.js
with the following line:
exports.app = require('mcms').mcms();
In the same directory, create the following sub-directories:
static
- Contains our static resources such as JavaScript served to the browser and CSStemplates
- For the page templates - usually just one called index.html
. Templates are defined using HTML and Mustache.pages
- For the actual pages in Markdown format, e.g. index.md
.For an example, take a look at the source for this package - the MCMS project itself includes the same directories that make up a site that serves this README file.
The name of the file in the ./pages
directory becomes the page title, and is accessible via {{title}}
inside templates.
The name of the file is converted to an SEO friendly format which involves:
So, for example Really Long & Weird Example!
becomes really-long-weird-example
.
This SEO friendly URL is then used to access the given page. To get a list of all the page titles and URLs, see the "List of Pages" section below.
It is possible to place pages in sub-directories. For example a page in the file ./pages/hello/world.md
is accessible at /hello/world
.
By default, every page uses the templates/index.html
template. It is possible to override this template on a per page basis by creating a template with a name that matches that of the page, e.g. a page at ./pages/custom.md
can have a custom template provided via ./templates/custom.html
.
It is possible to include reusable blocks of HTML across different templates by placing .html
or .md
files in the optional ./includes
directory. For example an include ./includes/footer.html
can be included via {{{footer}}}
(triple mustaches are needed to ensure that the HTML is not escaped). Markdown (.md) files are automatically converted to HTML.
It is possible to get a list of all the pages on the site via the {{#ascending}}
array. For example, this renders a bunch of links to all the pages:
{{#ascending}} <a href="{{link}}">{{title}}</a> {{/ascending}}
The pages above are listed in an ascending lexicographic order. To get them in reverse use {{#descending}}
. If you have a list of blog posts which you would like to list in reverse chronological order, you can add an additional prefix used for sorting to the file name, e.g. 20101010|First post!.md
and use descending order to display a list of posts in reverse chronological order. Everything up to and including the |
separator is used for sorting, but ignored when constructing page titles.
It is possible to provide custom pages for HTTP file not found (404) errors. Simply create a file ./pages/404.md
.
github-flavored-markdown
package(The MIT License)
Copyright (c) 2011+ Oleg Podsechin
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.
FAQs
CommonJS compatible Minimal CMS
The npm package mcms receives a total of 0 weekly downloads. As such, mcms popularity was classified as not popular.
We found that mcms demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.