realms-wiki/README

195 lines
5 KiB
Plaintext
Raw Normal View History

2014-09-04 06:25:48 +03:00
# Realms Wiki Beta
Git based wiki written in Python
2014-09-10 22:37:48 +03:00
Inspired by [Gollum][gollum], [Ghost][ghost], and [Dillinger][dillinger].
2014-09-04 06:25:48 +03:00
Basic authentication and registration included.
2014-09-04 16:06:22 +03:00
Demo: http://realms.io
This domain is being used temporarily as a demo so expect it to change.
2014-09-04 06:25:48 +03:00
## Features
- Built with Bootstrap 3
- Currently Markdown (w/ HTML) only
- Syntax highlighting (Ace Editor)
- Live preview
- Collaboration (TogetherJS)
- Drafts saved to localstorage
2014-09-04 15:57:52 +03:00
- Handlebars
2014-09-04 06:25:48 +03:00
## Screenshots
2014-09-10 19:35:11 +03:00
[<img src="https://db.tt/Q2XHGRnT" width=340 />](https://db.tt/Q2XHGRnT)&nbsp;[<img width=340 src="https://db.tt/pIZ4w2oN" />](https://db.tt/pIZ4w2oN)&nbsp;[<img width=340 src="https://db.tt/ERLmDHrk" />](https://db.tt/ERLmDHrk)&nbsp;[<img width=340 src="https://db.tt/Ls08ocLh" />](https://db.tt/Ls08ocLh)&nbsp;[<img width=340 src="https://db.tt/7QVfXFQ4" />](https://db.tt/7QVfXFQ4)&nbsp;[<img width=340 src="https://db.tt/Lna3BOm1" />](https://db.tt/Lna3BOm1)
2014-09-04 06:25:48 +03:00
## Requirements
- Python 2.7
- Git
- NodeJS (needed for bower, distro packages shouldn't need this in future)
2014-09-04 06:25:48 +03:00
2014-09-04 06:32:40 +03:00
**Optional**
2014-09-04 06:25:48 +03:00
- Nginx (if you want proxy requests, this is recommended)
- Memcached or Redis, default is memonization
- MariaDB, MySQL, Postgresql, or another database supported by SQLAlchemy, default is sqlite.
Anon or single user does not require a database.
2014-09-02 17:29:04 +03:00
## Installation
2014-09-04 06:25:48 +03:00
### Ubuntu
If you are using Ubuntu 14.04, you can use install.sh.
2014-09-04 06:25:48 +03:00
```
git clone https://github.com/scragg0x/realms-wiki
cd realms-wiki
sudo bash install.sh
```
### OSX / Windows
This app is designed to run in Linux and I recommend using Vagrant to install on OSX or Windows.
### Vagrant
Vagrantfile is included for development or running locally.
To get started with Vagrant, download and install Vagrant and Virtualbox for your platform with the links provided
https://www.vagrantup.com/downloads.html
https://www.virtualbox.org/wiki/Downloads
Then execute the following in the terminal:
git clone https://github.com/scragg0x/realms-wiki
cd realms-wiki
vagrant up
vagrant ssh
realms-wiki dev
Check ```http://127.0.0.1:5000/``` to make sure it's running.
2014-09-21 01:30:34 +03:00
### Docker
Make sure you have docker installed. http://docs.docker.com/installation/
Here is an example run command, it will pull the image from docker hub initially.
docker run --name realms-wiki -p 5000:5000 -d realms/realms-wiki
You can build your own image if you want. Mine is based off https://github.com/phusion/baseimage-docker
The Dockerfile is located in [docker/Dockerfile](docker/Dockerfile) realms/base just creates the deploy user.
## Config and Setup
You should be able to run this right out of the box with the default config values.
You may want to customize your app and the easiest way is the setup command.
realms-wiki setup
This will ask you questions and create a config.json file in the app root directory.
Of course you can manually edit this file as well.
Any config value set in config.json will override values set in ```realms/config/__init__.py```
### Nginx Setup
2014-09-04 06:25:48 +03:00
sudo apt-get install -y nginx
2014-09-02 17:29:04 +03:00
2014-09-09 23:36:23 +03:00
Create a file called realms.conf in /etc/nginx/conf.d
sudo nano /etc/nginx/conf.d/realms.conf
2014-09-09 23:36:23 +03:00
Put the following sample configuration in that file.
2014-09-09 23:46:41 +03:00
server {
listen 80;
# Your domain here
server_name wiki.example.org;
# Settings to by-pass for static files
location ^~ /static/ {
# Example:
root /full/path/to/realms/static/;
}
2014-09-09 23:46:41 +03:00
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:5000/;
proxy_redirect off;
}
}
2014-09-09 23:36:23 +03:00
Test Nginx config
sudo nginx -t
2014-09-09 23:36:23 +03:00
Reload Nginx
sudo service nginx reload
2014-09-02 17:29:04 +03:00
### Mysql Setup
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
realms-wiki pip install python-memcached
### MariaDB Setup
sudo apt-get install -y mariadb-server mariadb-client libmariadbclient-dev
realms-wiki pip install MySQL-Python
### Postgres
sudo apt-get install -y libpq-dev postgresql postgresql-contrib postgresql-client
realms-wiki pip install psycopg2
_Don't forget to create your database._
2014-09-04 06:25:48 +03:00
## Running
Current there are different ways.
- Daemon mode using upstart
```sudo start realms-wiki```
- Foreground mode
```realms-wiki run```
- Debug mode
```realms-wiki dev```
2014-09-04 06:25:48 +03:00
Access from your browser
2014-09-04 16:59:19 +03:00
http://localhost:5000
2014-09-04 06:25:48 +03:00
2014-10-02 01:14:54 +03:00
## Templating
2014-09-04 16:06:22 +03:00
2014-10-02 01:14:54 +03:00
Realms uses handlebars partials to create templates.
Each page that you create can be imported as a partial.
2014-10-02 01:14:54 +03:00
This page imports and uses a partial:
2014-10-02 01:14:54 +03:00
http://realms.io/_edit/hbs
2014-10-02 01:14:54 +03:00
This page contains the content of the partial:
2014-10-02 01:14:54 +03:00
http://realms.io/_edit/example-tmpl
I locked these pages to preserve them.
You may copy and paste into a new page to test.
2014-10-02 01:14:54 +03:00
2014-09-04 16:06:22 +03:00
## Author
Matthew Scragg <scragg@gmail.com>
2014-09-10 22:37:48 +03:00
[gollum]: https://github.com/gollum/gollum
[ghost]: https://github.com/tryghost/Ghost
[dillinger]: https://github.com/joemccann/dillinger/