Skip to content

Commit

Permalink
Merge v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeppe Zapp committed Jul 30, 2019
2 parents 51d0680 + 1542626 commit 5668048
Show file tree
Hide file tree
Showing 583 changed files with 11,981 additions and 124,085 deletions.
19 changes: 15 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@
node_modules/*
package-lock.json
.sass-cache/*
/remote
/docker/db/*
/docker/remote

# Storage directories
storage/*
db/*
/storage/*

# Config directories
config/*
/config/*

# Plugin directories
/plugins/*

# Generated files
/public/css/*
/public/js/*
!/public/js/login.js
!/public/js/setup.js
!/public/js/test.js
!/public/js/browser-check.js
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
The MIT License (MIT)

Copyright (c) 2017 Putaitu Productions
Copyright (c) 2015-2019 Jeppe Zapp
Copyright (c) 2017-2019 HashBrown CMS contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
83 changes: 51 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,74 @@
# HashBrown CMS
A free and open-source headless CMS built with Node.js and MongoDB

## The centralised approach
Ever wonder why you have to run a completely separate CMS for every single project? We did too, and that's why HashBrown exists today. This is the new central brain for your extended project structure.
## NOTICE: Updating to v1.2
- The `/db` folder for the `mongodb` docker volume has been moved, along with all other docker related files, to the `/docker` folder. After you pull the latest changes, make sure to manually move your `/db` folder to `/docker/db` before you restart the container.
- The `/plugins` folder has been unversioned, so please remove all content in this directory (except for custom plugins you want to keep, of course)

## Installing and running HashBrown
First make sure you have these dependencies met:
- node.js >= v10
- mongodb >= v4
- imagemagick

Then checkout the code and install the dependencies:
- node.js
- mongodb
- imagemagick
- optional:
- docker & docker-compose
- nodemon

Then clone the code and install the dependencies:
```
git clone https://github.com/HashBrownCMS/hashbrown-cms.git -b stable --single-branch --recursive
cd ./hashbrown-cms
npm install --production
npm install
```

Building and starting the server for production:
```
npm start
```

Building/watching frontend files:
```
npm run build:frontend
npm run watch:frontend
```

Configuring MongoDB:
Using Docker:
```
npm run start:docker
npm run watch:docker
npm run stop:docker
```

- by environment variables:
Using nodemon:
```
npm run watch:nodemon
```

## Updating HashBrown
To update the core HashBrown version and all of its dependencies:
```
npm run update
```

Or manually:
```
cd /to/your/hashbrown/dir
git pull
git submodule update --recursive --init
npm install
webpack
```

## Configuring MongoDB
Using environment variables:
- `MONGODB_HOST`: host(s), split by comma, default value is `localhost`
- `MONGODB_PORT`: port(s), split by comma
- `MONGODB_USERNAME`: username
- `MONGODB_PASSWORD`: password
- `MONGODB_PREFIX`: database name prefix, default value is `hb_`
- `MONGODB_OPTIONS`: connection options, JSON string containing key/value pairs.

- or by `/config/database.cfg`

Using `/config/database.cfg`
```
{
"host": "host" | ["host1", "host2"] | "host1,host2",
Expand All @@ -44,25 +83,6 @@ Configuring MongoDB:
}
```

Running with docker:
```
docker-compose up --build -d
```

Running standalone:
```
node hashbrown.js
```

## Updating HashBrown
To update the core HashBrown version and all of its dependencies:
```
cd /to/your/hashbrown/dir
git pull
git submodule update --recursive --init
npm install --production
```

## Getting started
- [Guides](http://hashbrown.rocks/guides)
- [Documentation](http://hashbrown.rocks/docs)
Expand All @@ -71,7 +91,6 @@ npm install --production
If you'd like to contribute to HashBrown development, you can make a pull request to [our repo](https://github.com/HashBrownCMS/hashbrown-cms) or contact us about becoming a collaborator

## Talk to us

Matrix: #hashbrowncms:matrix.org

## Report issues
Expand Down
7 changes: 7 additions & 0 deletions docker/docker-compose.watch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.4"

services:
node:
environment:
- WATCH=true
- DEBUG_VERBOSITY=5
4 changes: 2 additions & 2 deletions docker-compose.yml → docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ services:
networks:
- hashbrown-cms--network
restart: unless-stopped
command: "node /opt/hashbrown-cms"
command: "node /opt/hashbrown-cms/hashbrown.js"
environment:
- MONGODB_HOST=mongodb
volumes:
- "./:/opt/hashbrown-cms"
- "../:/opt/hashbrown-cms"
- "./remote:/remote"

mongodb:
Expand Down
22 changes: 1 addition & 21 deletions hashbrown.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
'use strict';

/**
* @namespace HashBrown
*/

/**
* @namespace HashBrown.Common
*/

const AppModulePath = require('app-module-path');
const Path = require('path');

// Set app root
global.APP_ROOT = Path.resolve(__dirname);

// Make sure we can require our source files conveniently
AppModulePath.addPath(__dirname);
AppModulePath.addPath(Path.resolve(__dirname, './src'));

// Use bluebird promise
global.Promise = require('bluebird');

Promise.onPossiblyUnhandledRejection((error, promise) => {
throw error;
});

// Include main server module
require(APP_ROOT + '/src/Server');
require(Path.join(APP_ROOT, 'src', 'Server'));
27 changes: 12 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
{
"name": "hashbrown-cms",
"repository": "https://github.com/HashBrownCMS/hashbrown-cms.git",
"version": "1.1.4",
"version": "1.2.0",
"description": "A free and open-source headless CMS",
"main": "hashbrown.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build:frontend": "webpack --progress",
"watch:frontend": "webpack --watch --watch-poll --progress",
"start": "npm run build:frontend && node hashbrown.js",
"watch:nodemon": "nodemon hashbrown.js",
"start:docker": "npm run build:frontend && cd ./docker && docker-compose up --build -d",
"stop:docker": "cd ./docker && docker-compose down",
"watch:docker": "cd ./docker && docker-compose -f docker-compose.yml -f docker-compose.watch.yml up --build -d && docker-compose logs -f node",
"update": "git pull && git submodule update --recursive --init && npm install && npm run build:frontend"
},
"author": "Putaitu",
"license": "MIT",
"dependencies": {
"app-module-path": "^2.2.0",
"bluebird": "^3.5.3",
"body-parser": "^1.18.3",
"cookie-parser": "^1.4.3",
"express": "^4.16.4",
"express-ws": "^4.0.0",
"glob": "^7.1.3",
"js-beautify": "^1.8.9",
"marked": "^0.6.0",
"json-loader": "^0.5.4",
"mongodb": "^3.1.10",
"multer": "^1.4.1",
"path-to-regexp": "^2.4.0",
"pug": "^2.0.3",
"rimraf": "^2.6.3",
"sass": "^1.16.0",
"semver": "^5.6.0",
"webpack": "^4.28.1",
"yamljs": "^0.3.0"
},
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.2.3",
"babel-loader": "^8.0.5",
"json-loader": "^0.5.4",
"sass": "^1.16.0"
"webpack-cli": "^3.3.0"
}
}
73 changes: 0 additions & 73 deletions plugins/api/client/DeployerEditor.js

This file was deleted.

17 changes: 0 additions & 17 deletions plugins/api/index.js

This file was deleted.

Loading

0 comments on commit 5668048

Please sign in to comment.