GithubHelp home page GithubHelp logo

scragg0x / realms-wiki Goto Github PK

View Code? Open in Web Editor NEW
834.0 30.0 91.0 2.63 MB

Git based wiki inspired by Gollum

Home Page: http://realms.io

License: GNU General Public License v2.0

Shell 0.80% Python 67.26% CSS 2.82% JavaScript 12.09% HTML 15.98% Dockerfile 1.06%

realms-wiki's Introduction

Realms Wiki Beta

Git based wiki written in Python Inspired by Gollum, Ghost, and Dillinger. Basic authentication and registration included.

Demo: http://realms.io

Source: https://github.com/scragg0x/realms-wiki

Features

  • Built with Bootstrap 3.
  • Markdown (w/ HTML Support).
  • Syntax highlighting (Ace Editor).
  • Live preview.
  • Collaboration (TogetherJS / Firepad).
  • Drafts saved to local storage.
  • Handlebars for templates and logic.

Screenshots

     

Requirements

  • Python 2.7 (Python 3.x is a WIP)

Optional

  • 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.

Installation

You will need the following packages to get started:

Ubuntu 16.04

sudo apt-get install -y python-pip python-dev libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libyaml-dev libssl-dev libsasl2-dev libldap2-dev

CentOS / RHEL

yum install -y python-pip python-devel.x86_64 libxslt-devel.x86_64 libxml2-devel.x86_64 libffi-devel.x86_64 libyaml-devel.x86_64 libxslt-devel.x86_64 zlib-devel.x86_64 openssl-devel.x86_64 openldap2-devel cyrus-sasl-devel python-pbr gcc

OSX / Windows

This app is designed for Linux. Vagrant can be used to run on OSX/Windows host.

Realms Wiki installation via PyPI

The easiest way. Install it using Python Package Index:

pip install realms-wiki

Realms Wiki installation via Git

Ubuntu

git clone https://github.com/scragg0x/realms-wiki
cd realms-wiki

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

sudo apt-get install -y python-pip python-dev libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libyaml-dev libssl-dev libsasl2-dev libldap2-dev
sudo npm install -g bower
bower install

sudo pip install -U pipenv
pipenv install --two

# development
pipenv run python realms-wiki dev

# install / start
pipenv run python setup.py install
pipenv run realms-wiki start

NodeJS is required for installing bower and it's used for pulling front end dependencies.

Vagrant

Vagrantfile is included for development and testing with compatible backends. To get started with Vagrant, download and install Vagrant and VirtualBox for your platform with the links provided:

Realms Wiki via 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

The Dockerfile is located in docker/Dockerfile

Config and Setup

You should be able to run the wiki without configuration using 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 realms-wiki.json file. You can manually edit this file as well. Any config value set in realms-wiki.json will override values set in realms/config/__init__.py.

Nginx Setup

sudo apt-get install -y nginx

Create a file called realms.conf in /etc/nginx/conf.d

sudo nano /etc/nginx/conf.d/realms.conf

Put the following sample configuration in that file:

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/;
  }
    
  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;
  }
}

Test Nginx config:

sudo nginx -t

Reload Nginx:

sudo service nginx reload

Apache + mod_wsgi Setup

sudo apt-get install -y apache2 libapache2-mod-wsgi

Create a virtual host configuration in /etc/apache2/sites-available/realms_vhost

<VirtualHost *:80>
    ServerName wiki.example.org

    WSGIDaemonProcess realms_wsgi display-name=%{GROUP}
    WSGIProcessGroup realms_wsgi
    WSGIScriptAlias / /var/www/my-realms-dir/wsgi.py

    Alias /static /full/path/to/realms/static
</VirtualHost>

Create /var/www/my-realms-dir/wsgi.py

import os
import site

# Uncomment the following lines if you are using a virtual environment

# ----------------------------------
# Enter path to your virtualenv's site-packages directory
# VENV_SITE_DIR = ".venv/lib/python2.7/site-packages"
# PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
# site.addsitedir(os.path.abspath(os.path.join(PROJECT_ROOT, VENV_SITE_DIR)))
# ----------------------------------

from realms import create_app
application = create_app()

Enable the virtual host:

sudo a2ensite realms_vhost

Test your configuration:

apache2ctl configtest

Reload apache:

sudo service apache2 reload

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 Setup

sudo apt-get install -y libpq-dev postgresql postgresql-contrib postgresql-client
realms-wiki pip install psycopg2

Don't forget to create your database.

Search

Realms wiki comes with basic search capabilities, however this is not recommended for large wikis or if you require more advanced search capabilities. We currently support Elasticsearch and Whoosh as alternative backend.

Elasticsearch Setup

Installing Elasticsearch

https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html

Configuring Elasticsearch

In your Realms Config, have the following options set:

"SEARCH_TYPE": "elasticsearch"
"ELASTICSEARCH_URL": "http://127.0.0.1:9200"

Optionally, also set the following option to configure which fields are searchable:

"ELASTICSEARCH_FIELDS": ["name"]

Allowable values are "name", "content", "username", "message". The default is ["name"].

Whoosh Setup

Simply install Whoosh to your Python environment, e.g.

pip install Whoosh

Configuring Whoosh

To use Whoosh, set the following in your Realms config:

"SEARCH_TYPE": "whoosh"
"WHOOSH_INDEX": "/path/to/your/whoosh/index"
"WHOOSH_LANGUAGE": "en"

WHOOSH_INDEX has to be a path readable and writeable by Realm's user. It will be created automatically if it doesn't exist.

Whoosh is set up to use language optimization, so set WHOOSH_LANGUAGE to the language used in your wiki. For available languages, check whoosh.lang.languages. If your language is not supported, Realms will fall back to a simple text analyzer.

Authentication

Local

Local default will be done using a backend database as defined in the config. To disable local authentication, put the following your config.

"AUTH_LOCAL_ENABLE": false

LDAP (beta)

Realms can authenticate users with a LDAP directory. It supports "direct bind" and "bind by search".

Use these examples as a guide and place it in your realms-wiki.json config.

An optional KEY_MAP can be used to map LDAP attributes to the Realms user object.

"Bind by search" example

In this example, BIND_DN and BIND_AUTH are used to bind to the LDAP directory (omit them for anonymous bind). After binding, a LDAP SEARCH is performed using the template "USER_SEARCH". In this template, %(username)s is the UserID that the user entered in the Realms authentication form. If the user is found in LDAP, a final BIND is tried with his credentials to check the password.

"LDAP": {
    "URI": "ldap://127.0.0.1:389",
    "BIND_DN": "cn=realms,ou=apps,dc=realms,dc=io",
    "BIND_AUTH": "wlvksdfknv:dsqc9893",
    "USER_SEARCH": {"base": "ou=users, dc=realms,dc=io", "filter": "(uid=%(username)s)"},
    "KEY_MAP": {
        "username": "cn",
        "email": "mail"
    }
}

"Direct bind" example

Here authentication is just a simple BIND using the user's credentials. The user DN is given by the BIND_DN template. In this template, %(username)s is the UserID that the user entered in the Realms authentication form.

"LDAP": {
    "URI": "ldap://127.0.0.1:389",
    "BIND_DN": "uid=%(username)s,ou=People,dc=realms,dc=io",
    "KEY_MAP": {
        "username": "cn",
        "email": "mail",
    }
}

LDAP/TLS

(for brevity we don't repeat the Bind By Search configurations or the KEY_MAP, but they can be used with TLS too)

LDAP over TLS is typically done like this:

"LDAP": {
    "URI": "ldaps://127.0.0.1:686",
    "BIND_DN": "uid=%(username)s,ou=People,dc=realms,dc=io",
    "TLS_OPTIONS": {
        "CA_CERTS_FILE": "PATH TO THE CERTIFICATE PEM OF THE AUTHORITY THAT SIGNED THE LDAP SERVER CERTIFICATE"
    }
}

If the LDAP server certificate has been emitted by an authority that's trusted at system-level (and your Python version is not too old), it might be possible to omit CA_CERTS_FILE.

If you don't want Realms to validate at all the LDAP server certificate (don't do that in production), pass an additional VALIDATE option:

"LDAP": {
    "URI": "ldaps://127.0.0.1:686",
    "BIND_DN": "uid=%(username)s,ou=People,dc=realms,dc=io",
    "TLS_OPTIONS": {
        "VALIDATE": "NONE"
    }        
}

LDAP with START_TLS

It is similar to LDAP/TLS. Just add a START_TLS option:

"LDAP": {
    "URI": "ldap://127.0.0.1:389",
    "BIND_DN": "uid=%(username)s,ou=People,dc=realms,dc=io",
    "CA_CERTS_FILE": "PATH TO THE CERTIFICATE PEM OF THE AUTHORITY THAT SIGNED THE LDAP SERVER CERTIFICATE",
    "TLS_OPTIONS": {
        "CA_CERTS_FILE": "PATH TO THE CERTIFICATE PEM OF THE AUTHORITY THAT SIGNED THE LDAP SERVER CERTIFICATE"
    }
    "START_TLS": true
}

The VALIDATE option can be used here too.

Configuration change for TLS

Please note that the TLS/START_TLS configuration changed from previous versions of Realms. The old way that was from flask-ldap-login using LDAP options like OPT_X_TLS_REQUIRE_CERT does not work anymore.

OAuth (beta)

Realms currently supports Github, Twitter, Facebook and Google. Each provider requires a key and secret. Put them in your realms-wiki.json config file. Use the example below.

"OAUTH": {
    "twitter": {
        "key": "",
        "secret": ""
    },
    "github": {
        "key": "",
        "secret": ""
    },
    "google": {
        "key": "",
        "secret": "",
        "domain": ""    # this is optional if you want to restrict to a GSuite domain
}

Authentication by reverse proxy

If you configured realms behind a reverse-proxy or a single-sign-on, it is possible to delegate authentication to the proxy.

"AUTH_PROXY": true

Note: of course with that setup you must ensure that Realms is only accessible through the proxy.

Example Nginx configuration:

location / {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
    
    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_set_header REMOTE_USER $remote_user;

    proxy_pass http://127.0.0.1:5000/;
    proxy_redirect off;
}    

By default, Realms will look for the user ID in REMOTE_USER HTTP header. You can specify another header name with:

"AUTH_PROXY_HEADER_NAME": "LOGGED_IN_USER"

Running

realms-wiki start

Upstart (Ubuntu 14.04)

Setup upstart with this command:

sudo realms-wiki setup_upstart

This command requires root priveleges because it creates an upstart script. Also note that ports below 1024 require user root. After your config is in place use the following commands:

sudo start realms-wiki
sudo stop realms-wiki
sudo restart realms-wiki

Systemd (Ubuntu 16.04)

Setup systemd by creating the file /etc/systemd/system/realms-wiki.service:

[Unit]
Description=Realms Wiki

[Service]
User=ubuntu
Group=ssl-cert
Type=forking

ExecStart=/home/ubuntu/realms-wiki/.venv/bin/python /home/ubuntu/realms-wiki/.venv/bin/gunicorn \
--certfile=/etc/ssl/certs/ssl-cert-snakeoil.pem   \
--keyfile=/etc/ssl/private/ssl-cert-snakeoil.key  \
--name realms-wiki     \
--access-logfile -     \
--error-logfile -      \
--worker-class gevent  \
--workers 5            \
--bind 0.0.0.0:5000    \
--user ubuntu          \
--group ssl-cert       \
--chdir /home/ubuntu/realms-wiki/.venv  \
'realms:create_app()'

Restart=on-failure
LimitNOFILE=65335
WorkingDirectory=/home/ubuntu/realms-wiki/.venv
Environment=PATH=/home/ubuntu/realms-wiki/.venv/bin:/usr/local/bin:/usr/bin:/bin:$PATH
Environment=LC_ALL=en_US.UTF-8
Environment=GEVENT_RESOLVER=ares

[Install]
WantedBy=multi-user.target

This file must be created as user root. Also note that ports below 1024 require user root.

Globally replace /home/ubuntu/realms-wiki/ in the example above with your local Realms-wiki install path.

Note that this example uses the HTTPS (SSL) support built in to gunicorn. It references the self-signed certificate that gets created if you run sudo apt-get install ssl-cert. The private key is only visible to the group ssl-cert, so in this example gunicorn runs with group ssl-cert.

Finally, let systemd know about the new config file:

sudo systemctl daemon-reload

After your config is in place use the following commands:

sudo systemctl start realms-wiki.service
sudo systemctl stop realms-wiki.service
sudo systemctl restart realms-wiki.service

# Enable auto-start of this service on reboot:
sudo systemctl enable realms-wiki.service

Development mode

This will start the server in the foreground with auto reloaded enabled:

realms-wiki dev

Other commands

Usage: realms-wiki [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  auth
  configure      Set config.json, expects JSON encoded string
  create_db      Creates DB tables
  dev            Run development server
  drop_db        Drops DB tables
  pip            Execute pip commands, useful for virtualenvs
  restart        Restart server
  run            Run production server (alias for start)
  setup          Start setup wizard
  setup_upstart  Start upstart conf creation wizard
  start          Run server daemon
  status         Get server status
  stop           Stop server
  test           Run tests
  version        Output version

Access from your browser:

http://localhost:5000

Templating

Realms uses Handlebars partials to create templates. Each page that you create can be imported as a partial.

This page imports and uses a partial:

http://realms.io/_edit/hbs

This page contains the content of the partial:

http://realms.io/_edit/example-tmpl

I locked these pages to preserve them.
You can copy and paste into a new page for testing purposes.

Contributing

Issues and pull requests are welcome. Please follow the code style guide.

Python style guide

Author

Matthew Scragg [email protected]

realms-wiki's People

Contributors

alvinchow86 avatar darkindex avatar dereks avatar freebien avatar gazpachoking avatar ghtyrant avatar knovoselic avatar kseistrup avatar l-vincent-l avatar lanrat avatar larsimmisch avatar leek avatar magic890 avatar mudasirmirza avatar nakato avatar pavgup avatar pokeball99 avatar scragg0x avatar stephane-martin avatar swablab-bot avatar uxdaniel avatar zsiddiqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realms-wiki's Issues

Docker locks up in my_init

When running the current Docker build, the VM endlessly cycles in /sbin/my_init, with log messages like:

./run: line 33: setuid: command not found
./run: line 34: setgid: command not found
./run: line 39: respawn: command not found

It seemed something is amiss with the base image? I tried swapping out realms-base for:

FROM phusion/baseimage:0.9.15
RUN useradd -M deploy

But that had no effect.

Ability to make Wiki Private

It would be very nice be able to control who can view and log into the wiki. an invite system would be gravy.

If there is interest i would contribute to a bountysource to make it happen.

Errors when editing with ALLOW_ANON=false

Hey!

When editing/creating pages as a registered user in a realms-wiki with ALLOW_ANON set to false, publishing will always fail with "Anonymous posting not allowed".

In realms/modules/wiki/views.py, line 39 and 113 you do:

    if not current_app.config.get('ALLOW_ANON') and current_user.is_anonymous: 
      return dict(error=True, message="Anonymous posting not allowed"), 403

current_user.is_anonymous is a method, not a property, this statement will always be True if ALLOW_ANON is False. adding parentheses helps.

    if not current_app.config.get('ALLOW_ANON') and current_user.is_anonymous(): 
      return dict(error=True, message="Anonymous posting not allowed"), 403

500 error in _history when wiki has no pages

Hi, as said in the title, i got a 500 error in the history when the wiki is empty.

Here is the traceback message in my logs.

Sep 27 15:36:27 bananium realms-wiki[24223]: KeyError: 'HEAD'
Sep 27 15:36:27 bananium realms-wiki[24223]: raise KeyError(name)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/dulwich/refs.py", line 223, in __getitem__
Sep 27 15:36:27 bananium realms-wiki[24223]: return self.refs['HEAD']
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/dulwich/repo.py", line 306, in head
Sep 27 15:36:27 bananium realms-wiki[24223]: include = [self.head()]
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/dulwich/repo.py", line 427, in get_walker
Sep 27 15:36:27 bananium realms-wiki[24223]: walker = self.repo.get_walker(paths=[file_path], max_entries=100)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/realms/modules/wiki/models.py", line 181, in get_history
Sep 27 15:36:27 bananium realms-wiki[24223]: return render_template('wiki/history.html', name=name, history=wiki.get_history(name))
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/realms/modules/wiki/views.py", line 48, in history
Sep 27 15:36:27 bananium realms-wiki[24223]: return self.view_functions[rule.endpoint](**req.view_args)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
Sep 27 15:36:27 bananium realms-wiki[24223]: rv = self.dispatch_request()
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
Sep 27 15:36:27 bananium realms-wiki[24223]: reraise(exc_type, exc_value, tb)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
Sep 27 15:36:27 bananium realms-wiki[24223]: rv = self.handle_user_exception(e)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
Sep 27 15:36:27 bananium realms-wiki[24223]: response = self.full_dispatch_request()
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
Sep 27 15:36:27 bananium realms-wiki[24223]: reraise(exc_type, exc_value, tb)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
Sep 27 15:36:27 bananium realms-wiki[24223]: response = self.make_response(self.handle_exception(e))
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
Sep 27 15:36:27 bananium realms-wiki[24223]: return self.wsgi_app(environ, start_response)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
Sep 27 15:36:27 bananium realms-wiki[24223]: return super(Application, self).__call__(environ, start_response)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/realms/__init__.py", line 48, in __call__
Sep 27 15:36:27 bananium realms-wiki[24223]: self.result = self.application(self.environ, self.start_response)
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/gevent/pywsgi.py", line 494, in run_application
Sep 27 15:36:27 bananium realms-wiki[24223]: self.run_application()
Sep 27 15:36:27 bananium realms-wiki[24223]: File "/home/wiki/realms-wiki/.venv/lib/python2.7/site-packages/gevent/pywsgi.py", line 508, in handle_one_respons
Sep 27 15:36:27 bananium realms-wiki[24223]: Traceback (most recent call last):

The urls are not standard RESTful

I have seen the changes of urls when I click create and edit. It's not the standard RESTful API which treats the documents as resources.

Git storage?

Sorry for creating an issue to ask questions, but I couldn't find a mailing list for the realms-wiki project.

Thanks for realms-wiki which sounds great and has a very appealing web interface!

I was wondering why realms-wiki needs a database (sqlite, mysql or postgres) if it is a Git based wiki: does realms-wiki really use a Git repository as storage?

I'm also interested in updating realms-wiki pages directly from Git cli (without using the web interface): does realms-wiki supports updating the wiki when we git push our changes to a repository (like Gollum)?

Last question, on http://realms.io/ the title is "Realms Wiki Beta": do you consider it as beta software, or can it be run in production? Is the project still active, and is there a roadmap somewhere?

Thanks!

The README should have ".md" suffix

Now I'm reading the raw README file in realms-wiki github page. We should rename it as "README.md" so that Github will render the markdown file into HTML.

File name extension

This may be related to the Relative Links issue #18 - Now, when I have a link like:

[test](test.md)

And click on it, it creates a file names

testmd.md

Shouldn't strip the dot in my opinion.

Thanks,
Bruce

Working diff on drafts

I regularly get the message "your draft differs .." but am confused by what's going on. Am I looking at the draft saved on my local machine, or remote? What's the difference between the buttons? The non-functioning diff button does not help. If you could explain what's going on a little, maybe we could come up with a better UI.

How to list all documents

It redirects to the home document automatically but I want to see all my documents. How can I review the other documents without remembering their titles?

Reseting cursor position within edit box

If person A is typing something in the edit box and person B begins typing somewhere else in the edit box, person A's cursor resets its position to the top left most corner of the edit box. This is unintuitive and likely a bug.

The same-name document will be overrided without alert

When I try to create a new document with the same name of the previous one, it successes and the previous one is overrided with no alert. I think we should prevent from creating the same-name document and it would be better to remind us of editting the existing one.

Enable custom backends via libgit2

Libgit2 supports different backends. See https://github.com/libgit2/libgit2-backends

This wiki uses dulwich which is a python git implementation, not libgit2 bindings like PyGit2. I can adapt the site to use either library I'm sure, but I don't believe either one support different backends besides filesystem and memory.

Solving this will enable this to become a 12-factor app, but I don't know how to do it.

Delete a page

This would be quite important for keeping things sane, since renaming a page clones it, and things are flat now. Yes, deleting via git seems to work fine (any issues to watch out for?) Yes, the question of undelete will come up (a log filter trashcan?) But, nonfunctioning buttons do not inspire user trust.

Editing Broken?

Creating a new page seems to work great, but then I can't get any edits to save. Pressing save redirects as if everything worked fine, but the changes are not there.

Index to use timestamps from Git log

In my fix for #44 (changing owner), the filesystem dates are changed. So the creation/modification times in the Index are no longer accurate. Would it be possible to use the more reliable timestamps in the Git log instead? It would also be nice if the Index only showed Markdown files.

Localstorage draft is unaware if page has changed

This can happen easily if more than on browser is open or an edit occurs on a page where you have a draft. The user should be informed that a change occurred and given a choice to discard draft, keep, or, gulp, merge with the latest version (at least see the changes).

Add HTTP Basic authentication

An option to choose HTTP Basic authentication bypassing the built-in.

Also, when a user is successfully authenticated and not exists, will be created.

Another nice feature could be that realms-wiki manages the authentication file.

ALLOW_ANON is ignored

Setting "ALLOW_ANON": false in the configuration file does not actually prevent anonymous users from editing or creating pages in the wiki. The "new" and "edit" buttons still appear in the UI and anonymous edits are saved and commited in git as [email protected].

Manage subpages

It would be nice to manage subpages and/or subdirectories with realms-wiki.
E.g.: http://realms.io/asdf is a page and http://realms.io/asdf/subpage would be a subpage.

C

Images and other assets with relative paths

If you (like me, due to re-publishing needs) use relative paths to images in your wiki, you may notice that they (1) break in the editor due to the /_edit/ URL scheme. This is similar to travs/markdown-pdf#8. They also (2) needlessly appear in the Index, along with files like .gitignore.

Is there a preferred development route to resolve this, or are users advised not to store assets in their wiki repo?

Relative links

Do relative links (i.e. no http and domain - test ) not work, or am I don't something wrong?

Was trying to not have to have the full domain, etc. in all the links.

Thanks!
Bruce

RSS support

Realms looks really good - great work!!

Is it possible to have RSS for Realms?

Why,

  • so can feed feeds of a page or group of pages
    -- and also limit the rss scope
  • so you can host a blog using realms

This is probably not what you expect people to use realms for, but they will :)

Thanks

Justin

question

Error messages are displayed incorrectly

Upon discovering the error mentioned in #33, I also discovered that error messages are displayed incorrectly:

realms_error

I've installed realms-wiki using pip on Debian 7.7 (Python 2.7.3). This happens in Firefox and Chrome.

Unable to install: no module pbr.pbr_json

Hi,

I'm trying to install the wiki and I'm getting this error after running pip install realms-wiki:

Installed /tmp/easy_install-OsO0yD/traceback2-1.4.0/pbr-1.2.0-py2.6.egg



Installed /tmp/pip-build-root/unittest2/traceback2-1.4.0-py2.6.egg

Searching for six>=1.4

Reading http://pypi.python.org/simple/six/

Best match: six 1.9.0

Downloading https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz#md5=476881ef4012262dfc8adc645ee786c4

Processing six-1.9.0.tar.gz

Running six-1.9.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Ubg0Jy/six-1.9.0/egg-dist-tmp-kANAIq

Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/tmp/pip-build-root/unittest2/setup.py", line 87, in <module>

    setup(**params)

  File "/usr/lib64/python2.6/distutils/core.py", line 113, in setup

    _setup_distribution = dist = klass(attrs)

  File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 221, in __init__

    self.fetch_build_eggs(attrs.pop('setup_requires'))

  File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 245, in fetch_build_eggs

    parse_requirements(requires), installer=self.fetch_build_egg

  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 538, in resolve

    dist = best[req.key] = env.best_match(req, self, installer)

  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 780, in best_match

    return self.obtain(req, installer) # try and download/install

  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 792, in obtain

    return installer(requirement)

  File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 293, in fetch_build_egg

    return cmd.easy_install(req)

  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 472, in easy_install

    return self.install_item(spec, dist.location, tmpdir, deps)

  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 502, in install_item

    dists = self.install_eggs(spec, download, tmpdir)

  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 681, in install_eggs

    return self.build_and_install(setup_script, setup_base)

  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 958, in build_and_install

    self.run_setup(setup_script, setup_base, args)

  File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 947, in run_setup

    run_setup(setup_script, args)

  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 29, in run_setup

    lambda: execfile(

  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 70, in run

    return func()

  File "/usr/lib/python2.6/site-packages/setuptools/sandbox.py", line 31, in <lambda>

    {'__file__':setup_script, '__name__':'__main__'}

  File "setup.py", line 31, in <module>



  File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup

    dist.run_commands()

  File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands

    self.run_command(cmd)

  File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command

    cmd_obj.run()

  File "/usr/lib/python2.6/site-packages/setuptools/command/bdist_egg.py", line 167, in run

    self.run_command("egg_info")

  File "/usr/lib64/python2.6/distutils/cmd.py", line 333, in run_command

    self.distribution.run_command(command)

  File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command

    cmd_obj.run()

  File "<string>", line 11, in replacement_run

  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load

    entry = __import__(self.module_name, globals(),globals(), ['__name__'])

ImportError: No module named pbr.pbr_json

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/unittest2
Storing complete log in /root/.pip/pip.log

Here the full log.

How can I solve this issue?

Namespaces/Tags/Categories

Do you plan on implementing namespaces (or similar features like tags or categories)?
Wikis with a lot of pages can get quite messy if everything is in the same namespace.

Using sub folders in the base git repository would be the easiest way to achieve some sort of categories/namespaces, although limiting the flexibility by allowing a page to be in one category only. But imho it's the only way to reproduce the wiki's structure in the file system.

Storing this information in a page's metadata on the other hand forces realms to look into each file - meh.

What are your thoughts on this?

Renaming pages cause some history anomalies

When changing the page name, the wiki attempts to do a rename operation in git (or move). This history for said page contains history entries that simple doesn't seem right. I have to work on recreating the issue.

Plain text area editing option

It would be nice to have a workaround, turning off preview and just a TEXTAREA for the wiki to be editable on tablets (e.g. iPad iOS 7). Scrolling, selecting, arrow keys, are broken right now. Or is there a better plan?

Private wiki

First of all I like this wiki system, it's really nice 😄 👍

But when I installed it, i found two things, that are improvable.

It would be nice, to use realms-wiki as a "private" wiki. So nobody can sees anything until he is logged in. This way I like to use it. So I solved this problem by adding to every route in the views.py @login_required. Maybe theres a way to make this configurable?

And after all the installation is a bit complicated. Are there ways to simplify this?

Lost content on failed writes

Realms should return to the Edit screen in case there is any problem saving the content, notifying the user (as with the logged out message) to avoid data loss.

In my installation a user began reporting lost content. No errors, no popups, just edits that were gone as soon as she clicked Publish. In trying to reproduce the problem, I noticed erroneous permissions in the filesystem. Instead of deploy:deploy the owner became root:root on some of the files.

This is likely because I am synchronising the Git repository using an external git process as well as Realms. To me the ability to do this is one of the top features of the wiki. I am now ensuring that permissions are being correctly set, however the wiki interface must do everything possible to avoid data loss: in this case, at least alerting the user if the save did not succeed.

Unable to add user because 'application not registered on db instance'

I installed realms-wiki with pip, created a realms-wiki.json using realms-wiki setup, realms-wiki start to start service and it seems to be fine in the browser. But when I tried to create a user by command ...

realms-wiki auth create_user username [email protected]

It returned:

raise RuntimeError('application not registered on db ' 
RuntimeError: application not registered on db instance and no application bound to current context

How should I solve this problem? Thanks!

Explode metadata into a separate tab / editor / file?

Metadata can be separated from the Markdown and does have it's advantages. It can have a dedicated editor with YAML syntax highlighting. Also, less crowding of the main editor.

The metadata could even be it a separate file with separate revision history as opposed to prepending it.

home.md
home.yaml

When home is loaded, home.md is loaded, and if home.yaml exists, it's loaded as metadata. A branch worthy feature with implications I probably haven't thought of.

Any plans for improved navigation?

Really slick project! One thing I noticed (unless I'm mistaken) is right now it doesn't seem like there is much facility for structured navigation around a wiki with multiple pages.

Some ideas for things that might help:

  • Ability to add a sidebar to some pages (a common feature with some wikis, like Gollum)
  • Some way to generate a list of links to all pages? (I.e. in the Github wiki)
  • Subpages (or categories, tags) would probably be helpful with generating any sort of auto-generated nav links. The left sidebar at https://torchpad.com/ might be an example to consider

Implement search feature

As a wiki system, search is really important. I think ElasticSearch could be the powerful and easy way to do that.

Unable to run realms-wiki in production mode

I'm trying to run realms-wiki as root using realms-wiki run or realms-wiki start. I get this output:

Server started. Port: 5000
Using default configuration

or

Server started. Port: 5000
Using config: ./realms-wiki.json

Now If I try to go on http://localhost:5000 I get: ERR_CONNECTION_REFUSED.

If I run the same wiki using realms-wiki dev, this is the output:

Starting development server
Using config: ./realms-wiki.json
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
Starting development server
Using config: ./realms-wiki.json

and the wiki is working.

Another strange behaviour is that after started the server, if I check its status, the server is turned off:

root@MACHINE:/opt# realms-wiki start
Server started. Port: 5000
Using config: ./realms-wiki.json
root@MACHINE:/opt# realms-wiki status
Server is not running

Python 2.7.9 and pip 1.5.6.

What is going wrong here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.