Fortpress : your fast, simple and secure blog

You know Wordpress, Joomla, Drupal ... But have you tried Fortpress ? Fortpress lets you build a simple and secure blog in less than 5 minutes, without the overload of Apache, Php and MySQL. You can visit Fortpress dedicated website here. You need NodeJS and Git to install and run Fortpress. Let's go.

Install NodeJS

On Debian or Ubuntu, the installation of the lastest version of Nodejs is easy :

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs

If you have another system, you can find how to install NodeJS here

Install Fortpress

To install Fortpress, you need git.

sudo apt-get install git

Then, go to /opt and clone Fortpress :

cd /opt && sudo git clone https://github.com/seraum/fortpress

We use sudo to be sure that a lambda user couldn't modify files. If you clone it with another user, be sure to give the good permissions to Fortpress :

sudo chown -R root: fortpress
sudo chown -R 755 fortpress

Next, go to the fresh cloned Fortpress directory and launch it :

cd fortpress && node fortpress.js

You should see that Fortpress is launching multiple server on port 8080. Try to connect to the blog with your browser at the server url. Example with localhot :

http://localhot:8080/

Make Fortpress persistent

Fortpress is packaged with a Systemd service and a launch script. So, if you cloned Fortpress in /opt, install Fortpress on Debian 8 with these commands :

sudo cp /opt/fortpress/run/fortpress.service /etc/systemd/system/fortpress.service
sudo systemctl enable fortpress
sudo systemctl start fortpress

And that's it ! Fortpress is installed and will start automatically.

If you have decided to install Fortpress elsewhere, you need to adjust fortpress.service and fortpress.sh

Security

By Default, Fortpress downgrade process rights with UID 1000 and GID 1000, the first user created on a Linux system. You can create a new user, fortpress for example :

sudo adduser fortpress

And follow the instructions to create the user. Once done, get the fortpress user UID and GID like this :

echo "UID : `id -u fortpress` - GID : `id -g fortpress`"

Now, open the file security.conf.js in the conf folder, and put the new values.

Check

Restart Fortpress with this command :

sudo systemctl restart fortpress

And check that web process is downgraded to fortpress rights :

ps aux | grep fortpress

You should see 1 process with root rights, the Master process, and other processes with fortpress rights.

Adjust and Optimize

Fortpress is configured to listen on port 8080. Change this in blog.conf.js and set :

"port": 80,

By default, Fortpress launches 2 threads. You can launch a Thread for each core on the server by changing the thread configuration with this :

"thread": os.cpus().length,

You can also choose wich files you want to cache :

cache = [".js", ".css"],

Will cache all .js and .css files. To cache all static files :

cache = ["*"],

If you want that the cache will be auto refreshed, modify cache.conf.js in /conf folder.

Write posts

A blog with posts, it's better. Posts are in post folder and are organised in two parts : the configuration and the content. The configuration is a simple json that explain the configuration of the page :

{
  "author": "adrien",
  "title": "The title",
  "uri": "the-title-uri",
  "description": "The description.",
  "date": "2016-12-23T15:00:00.000Z",
  "tags": ["tag1", "tag2", "tag3"],
  "comments": true,
  "share": true,
  "image": {"src": "http://imagesource.tld"}
}

Nothing too difficult : Author will be mapped with the blog.conf.js named author, title is the title of the post, uri will be the uri of this post, description is the description. The date is in json format, you can get the current "JSON date" with this command :

node -e "console.log(new Date(Date.now()))"

tags is an array of tags. Comment and Share could be true or false, depending if you want it in this post. The image will represent the post big image. You can remove it if you don't want one.

Then, there is a markup <--MARKUP--> that says : JSON is finished. After that markup, you've got your post's content. You can write pure HTML or markdown. Markdown lets you write very quickly and simply a post :

# A H1 title
## A H2 title
* A list
__BOLD__
_ITALIC_
___BOLD AND ITALIC___
[a link](http://blog.seraum.com)

You can learn markdown here

Automatize

Fortpress is intelligent enough to auto publish your post : put a date in the futur, Fortpress will put the post online when the date is reached.

Fortpress generates natively Twitter Card and OpenGraph data. The sitemap.xml file is also automatically generated : publish your post and let the happen.

More

Fortpress is in active development, so if you have questions, a request, or want help, don't hesitate to contact us via comments.

Adrien