Compare commits

..

No commits in common. "db639339a5d7f49df9046f9710ef956873dcaf15" and "4c23eb77f35842b88ff57ab3d89282b8167168ba" have entirely different histories.

6 changed files with 13 additions and 88 deletions

View File

@ -1,84 +1,5 @@
# piki # piki
Piki is a minimal wiki. Piki is a minimal wiki
# TODO: Add an installation instruction
## Installation
### Get the repository
####Go to the subfolder, where you want to create your new Piki-Application (here ~/tmp)
cd ~/tmp
#### Clone the repository
git clone https://git.mount-mockery.de/application/piki.git
#### Change to your repository and initialise it completely
cd piki
git submodule init
git submodule update
### Create your virtual environment
#### Create python3 environment
python3 -m venv venv
#### Activate the environment
source venv/bin/activate
#### Install PaTT Requirements
pip install -r requirements.txt
## Configuration and Initialisation of Piki
### Create your config File
#### Copy the config example
cp config_example/config.py .
chmod 700 config.py
#### Set a secret key
Edit config.py and add a SECRET_KEY. Generate the secret e.g by executing the following command:
python manage.py
At the End of the error message you'll see a random secret:
KeyError: "You need to create a config.py file including at least a SECRET_KEY definition (e.g.: --> **'HERE IS THE RANDOM SECRET ;-)'** <--)."
### Create your initial database and first user for Patt
python manage.py migrate
python manage.py createsuperuser
### Finalise Configuration
Now there are two ways to finalise your configuration. The first way is for a test or development system. The other is for a production System.
1. **Test or development System:** Edit config.py and set the Variable DEBUG to True.
2. **Production System:** Edit config.py and set the Variable ALLOWED_HOSTS. Execute "python manage.py collectstatic" to create a folder including all static files. Then add PaTT to your server configuration. See also [Django Documnetation](https://docs.djangoproject.com/en/3.1/howto/deployment/) for further information.
## Start the Test or development System
### Go to the folder, where your PaTT-Application is locates (here ~/tmp/piki)
cd ~/tmp/piki
###Activate your Virtual Environment
source activate
###Start the Server
python manage.py runserver
## Backup
### Create Backup files
source venv/bin/activate
python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions -e patt --indent 2 > dump_base.json
python manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e sessions -e auth.Permission -e sessions piki --indent 2 > dump_piki.json
tar -cvzf dump_data.tgz data/media data/pages
### Restore Backup
source venv/bin/activate
If you are starting without a database, you need to create one
python manage.py migrate
Afterward add data step by step to the database.
python manage.py loaddata dump_base.json
python manage.py loaddata dump_patt.json
tar -xvzf dump_data.tgz

View File

@ -1,3 +1,5 @@
# TODO: Implement access control for pages
def read_page(request, rel_path): def read_page(request, rel_path):
return "private" not in rel_path or write_page(request, rel_path) return "private" not in rel_path or write_page(request, rel_path)
@ -7,10 +9,10 @@ def write_page(request, rel_path):
def read_attachment(request, rel_path): def read_attachment(request, rel_path):
# /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\ # TODO: /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\
return True return True
def modify_attachment(request, rel_path): def modify_attachment(request, rel_path):
# /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\ # TODO: /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\
return request.user.is_authenticated and request.user.username in ['root', 'dirk'] return request.user.is_authenticated and request.user.username in ['root', 'dirk']

View File

@ -1,5 +1,8 @@
from django.conf import settings from django.conf import settings
# TODO: PRIO: Add wildcards for subpages filter
# TODO: Add whoosh and search
import fstools import fstools
from pages import messages, url_page from pages import messages, url_page
import mycreole import mycreole

View File

@ -21,6 +21,9 @@ except ImportError:
ROOT_LOGGER_NAME = 'root' ROOT_LOGGER_NAME = 'root'
logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
# TODO: /!\ Deactivate self registration
# TODO: /!\ Remove config and add config_example with data from mm_tmux /!\
def root(request): def root(request):
return HttpResponseRedirect(url_page(request, config.STARTPAGE)) return HttpResponseRedirect(url_page(request, config.STARTPAGE))

View File

@ -24,18 +24,14 @@ import pages.views
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
# #
# page
path('', pages.views.root, name='page-root'), path('', pages.views.root, name='page-root'),
path('page/', pages.views.root, name='page-root'), path('page/', pages.views.root, name='page-root'),
path('page/<path:rel_path>', pages.views.page, name='page-page'), path('page/<path:rel_path>', pages.views.page, name='page-page'),
path('pageedit/<path:rel_path>/', pages.views.edit, name='page-edit'), path('pageedit/<path:rel_path>/', pages.views.edit, name='page-edit'),
path('helpview/', pages.views.helpview, name='page-helpview'), path('helpview/', pages.views.helpview, name='page-helpview'),
path('helpview/<str:page>', pages.views.helpview, name='page-helpview'), path('helpview/<str:page>', pages.views.helpview, name='page-helpview'),
# theme
path('search/', pages.views.search, name='search'), path('search/', pages.views.search, name='search'),
# mycreole
path('mycreole/', include('mycreole.urls')), path('mycreole/', include('mycreole.urls')),
# users
path('users/', include('users.urls')), path('users/', include('users.urls')),
] ]

2
users

@ -1 +1 @@
Subproject commit 6b55e81816ace1583051c8c62298c8a7281e2fcb Subproject commit 57852e6ec8867543fbcd9915ae5b6d092aafe339