Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
recoll-webui
Commits
f26a04e0
Commit
f26a04e0
authored
Jul 09, 2014
by
koniu
Browse files
Merge pull request #27 from jobe451/master
Headless setup under apache2 / ubuntu 12.04
parents
51aa2f67
9590821c
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.rst
View file @
f26a04e0
...
...
@@ -40,7 +40,7 @@ Run standalone
--------------
Run ``webui-standalone.py`` and connect to ``http://localhost:8080``.
There's some optional command-line arguments available::
:
There's some optional command-line arguments available::
-h, --help show this help message and exit
-a ADDR, --addr ADDR address to bind to [127.0.0.1]
...
...
@@ -48,7 +48,48 @@ There's some optional command-line arguments available:::
Run as WSGI/CGI
---------------
TODO
Example WSGI/Apache2 config::
WSGIDaemonProcess recoll user=recoll group=recoll threads=5 display-name=%{GROUP} python-path=/var/recoll-webui-master
WSGIScriptAlias /recoll /var/recoll-webui-master/webui-wsgi.py
<Directory /var/recoll-webui-master>
WSGIProcessGroup recoll
Order allow,deny
allow from all
</Directory>
Remarks:
* Without "python-path=" you might see errors that it can't import webui
* Run the WSGIDeamonProcess run under the username (user=xyz) of the user that you want to have exposed via web
Example Upstart-Script for Ubuntu to run the indexer as daemon::
description "recoll indexer"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
pre-start script
exec sudo -u recoll sh -c "/usr/local/share/recoll/examples/rclmon.sh start"
end script
pre-stop script
exec sudo -u recoll sh -c "/usr/local/share/recoll/examples/rclmon.sh stop"
end script
Remarks:
* You need to configure the user for which the indexer should run ("sudo -u [myuser])
Example Crontab entry to have the indexer at least once a day::
22 5 * * * recoll recollindex
Issues
...
...
views/result.tpl
View file @
f26a04e0
...
...
@@ -6,7 +6,9 @@
%for dr, prefix in config['mounts'].items():
%url = url.replace(dr, prefix)
%end
<div
class=
"search-result-title"
id=
"r{
{
d
[
'sha'
]
}
}"
title=
"{
{
d
[
'abstract'
]
}
}"
><a
href=
"{
{
url
}
}"
>
{
{
d
[
'label'
]
}
}
</a></div>
<div
class=
"search-result-title"
id=
"r{
{
d
[
'sha'
]
}
}"
title=
"{
{
d
[
'abstract'
]
}
}"
>
<a
href=
"download/{
{
number
-
1
}
}?{
{
query_string
}
}"
>
{
{
d
[
'label'
]
}
}
</a>
</div>
%if len(d['ipath']) > 0:
<div
class=
"search-result-ipath"
>
[{
{
d
[
'ipath'
]
}
}]
</div>
%end
...
...
@@ -22,8 +24,7 @@
</div>
%if hasrclextract:
<div
class=
"search-result-links"
>
<a
href=
"/preview/{
{
number
-
1
}
}?{
{
query_string
}
}"
target=
"_blank"
>
Preview
</a>
<a
href=
"/download/{
{
number
-
1
}
}?{
{
query_string
}
}"
>
Download
</a>
<a
href=
"preview/{
{
number
-
1
}
}?{
{
query_string
}
}"
target=
"_blank"
>
Preview
</a>
</div>
%end
<div
class=
"search-result-date"
>
{
{
d
[
'time'
]
}
}
</div>
...
...
webui.py
View file @
f26a04e0
...
...
@@ -295,7 +295,7 @@ def edit(resnum):
pathismine
=
True
bottle
.
response
.
headers
[
'Content-Disposition'
]
=
\
'attachment; filename="%s"'
%
os
.
path
.
basename
(
path
).
encode
(
'utf-8'
)
p
rint
>>
sys
.
stderr
,
"Sending %s with mimetype %s"
%
(
path
,
doc
.
mimetype
)
p
ath
=
path
.
encode
(
'utf-8'
)
f
=
open
(
path
,
'r'
)
if
pathismine
:
os
.
unlink
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment