mirror of
https://github.com/openzim/zimit.git
synced 2025-09-24 04:30:11 -04:00
Add configuration insntructions
This commit is contained in:
parent
e87f4a1e4e
commit
d2a26db898
97
README.rst
97
README.rst
@ -29,20 +29,15 @@ To test it::
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Ubuntu dependencies
|
Debian dependencies
|
||||||
###################
|
####################
|
||||||
|
|
||||||
You will need to install the following packages:
|
|
||||||
|
|
||||||
- zimwriterfs
|
|
||||||
- httrack
|
|
||||||
|
|
||||||
Installing the dependencies
|
Installing the dependencies
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
sudo apt-get install httrack libzim-dev libmagic-dev liblzma-dev libz-dev build-essential
|
sudo apt-get install httrack libzim-dev libmagic-dev liblzma-dev libz-dev build-essential libtool redis-server automake pkg-config
|
||||||
|
|
||||||
Installing zimwriterfs
|
Installing zimwriterfs
|
||||||
======================
|
======================
|
||||||
@ -61,4 +56,90 @@ Then upgrade the path to zimwriterfs executable in zimit.ini
|
|||||||
|
|
||||||
$ rqworker & pserve zimit.ini
|
$ rqworker & pserve zimit.ini
|
||||||
|
|
||||||
|
How to deploy?
|
||||||
|
##############
|
||||||
|
|
||||||
|
There are multiple ways to deploy such service, so I'll describe how I do it
|
||||||
|
with my own best-practices.
|
||||||
|
|
||||||
|
First of all, get all the dependencies and the code. I like to have everything
|
||||||
|
available in /home/www, so let's consider this will be the case here::
|
||||||
|
|
||||||
|
$ mkdir /home/www/zimit.notmyidea.org
|
||||||
|
$ cd /home/www/zimit.notmyidea.org
|
||||||
|
$ git clone https://github.com/almet/zimit.git
|
||||||
|
|
||||||
|
Create a virtual environment and activate it::
|
||||||
|
|
||||||
|
$ virtualenv venv
|
||||||
|
$ activate venv/bin/activate
|
||||||
|
|
||||||
|
Then, you can change the configuration file, by creating a new one::
|
||||||
|
|
||||||
|
$ cd zimit
|
||||||
|
$ cp zimit.ini local.ini
|
||||||
|
|
||||||
|
From there, you need to update the configuration to point to the correct
|
||||||
|
binaries and locations.
|
||||||
|
|
||||||
|
Nginx configuration
|
||||||
|
===================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# the upstream component nginx needs to connect to
|
||||||
|
upstream zimit_upstream {
|
||||||
|
server unix:///tmp/zimit.sock;
|
||||||
|
}
|
||||||
|
|
||||||
|
# configuration of the server
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name zimit.ideascube.org;
|
||||||
|
charset utf-8;
|
||||||
|
|
||||||
|
client_max_body_size 200M;
|
||||||
|
|
||||||
|
location /zims {
|
||||||
|
alias /home/ideascube/zimit.ideascube.org/zims/;
|
||||||
|
autoindex on;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Finally, send all non-media requests to the Pyramid server.
|
||||||
|
location / {
|
||||||
|
uwsgi_pass zimit_upstream;
|
||||||
|
include /var/ideascube/uwsgi_params;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UWSGI configuration
|
||||||
|
===================
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
[uwsgi]
|
||||||
|
uid = ideascube
|
||||||
|
gid = ideascube
|
||||||
|
chdir = /home/ideascube/zimit.ideascube.org/zimit/
|
||||||
|
ini = /home/ideascube/zimit.ideascube.org/zimit/local.ini
|
||||||
|
# the virtualenv (full path)
|
||||||
|
home = /home/ideascube/zimit.ideascube.org/venv/
|
||||||
|
|
||||||
|
# process-related settings
|
||||||
|
# master
|
||||||
|
master = true
|
||||||
|
# maximum number of worker processes
|
||||||
|
processes = 4
|
||||||
|
# the socket (use the full path to be safe
|
||||||
|
socket = /tmp/zimit.sock
|
||||||
|
# ... with appropriate permissions - may be needed
|
||||||
|
chmod-socket = 666
|
||||||
|
# stats = /tmp/ideascube.stats.sock
|
||||||
|
# clear environment on exit
|
||||||
|
vacuum = true
|
||||||
|
plugins = python
|
||||||
|
|
||||||
|
|
||||||
That's it!
|
That's it!
|
||||||
|
24
app.wsgi
Normal file
24
app.wsgi
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
try:
|
||||||
|
import ConfigParser as configparser
|
||||||
|
except ImportError:
|
||||||
|
import configparser
|
||||||
|
import logging.config
|
||||||
|
import os
|
||||||
|
|
||||||
|
from zimit import main
|
||||||
|
|
||||||
|
here = os.path.dirname(__file__)
|
||||||
|
|
||||||
|
ini_path = os.environ.get('ZIMIT_INI')
|
||||||
|
if ini_path is None:
|
||||||
|
ini_path = os.path.join(here, 'local.ini')
|
||||||
|
|
||||||
|
# Set up logging
|
||||||
|
logging.config.fileConfig(ini_path)
|
||||||
|
|
||||||
|
# Parse config and create WSGI app
|
||||||
|
config = configparser.ConfigParser()
|
||||||
|
config.read(ini_path)
|
||||||
|
|
||||||
|
application = main(config.items('DEFAULT'), **dict(config.items('app:main'
|
||||||
|
)))
|
@ -1,36 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Roboto'), local('Roboto-Regular'), url(http://fonts.gstatic.com/s/roboto/v15/CWB0XYA8bzo0kSThX0UTuA.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 500;
|
|
||||||
src: local('Roboto Medium'), local('Roboto-Medium'), url(http://fonts.gstatic.com/s/roboto/v15/RxZJdnzeo3R5zSexge8UUVtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 700;
|
|
||||||
src: local('Roboto Bold'), local('Roboto-Bold'), url(http://fonts.gstatic.com/s/roboto/v15/d-6IYplOFocCacKzxwXSOFtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Roboto Italic'), local('Roboto-Italic'), url(http://fonts.gstatic.com/s/roboto/v15/vPcynSL0qHq_6dX7lKVByfesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 500;
|
|
||||||
src: local('Roboto Medium Italic'), local('Roboto-MediumItalic'), url(http://fonts.gstatic.com/s/roboto/v15/OLffGBTaF0XFOW1gnuHF0Y4P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
@font-face {
|
|
||||||
font-family: 'Roboto';
|
|
||||||
font-style: italic;
|
|
||||||
font-weight: 700;
|
|
||||||
src: local('Roboto Bold Italic'), local('Roboto-BoldItalic'), url(http://fonts.gstatic.com/s/roboto/v15/t6Nd4cfPRhZP44Q5QAjcC44P5ICox8Kq3LLUNMylGO4.woff2) format('woff2');
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
@font-face {
|
|
||||||
font-family: 'Material Icons';
|
|
||||||
font-style: normal;
|
|
||||||
font-weight: 400;
|
|
||||||
src: local('Material Icons'), local('MaterialIcons-Regular'), url(https://fonts.gstatic.com/s/materialicons/v10/2fcrYFNaTjcS6g4U3t-Y5ZjZjT5FdEJ140U2DJYC3mY.woff2) format('woff2');
|
|
||||||
}
|
|
||||||
|
|
||||||
.material-icons {
|
|
||||||
font-family: 'Material Icons';
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 1;
|
|
||||||
letter-spacing: normal;
|
|
||||||
text-transform: none;
|
|
||||||
display: inline-block;
|
|
||||||
white-space: nowrap;
|
|
||||||
word-wrap: normal;
|
|
||||||
direction: ltr;
|
|
||||||
-moz-font-feature-settings: 'liga';
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 8.8 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -5,11 +5,11 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
<title>Zim It!</title>
|
<title>Zim It!</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="KoomBook_fichiers/material.css">
|
<link rel="stylesheet" href="assets/material.css">
|
||||||
<script src="KoomBook_fichiers/material.js"></script>
|
<script src="assets/material.js"></script>
|
||||||
<link rel="stylesheet" href="KoomBook_fichiers/icon.css">
|
<link rel="stylesheet" href="assets/icon.css">
|
||||||
<link href="KoomBook_fichiers/css.css" rel="stylesheet" type="text/css">
|
<link href="assets/css.css" rel="stylesheet" type="text/css">
|
||||||
<link rel="stylesheet" href="KoomBook_fichiers/main.html">
|
<link rel="stylesheet" href="assets/main.html">
|
||||||
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<header class="mdl-layout__header is-casting-shadow">
|
<header class="mdl-layout__header is-casting-shadow">
|
||||||
<div class="mdl-layout__header-row">
|
<div class="mdl-layout__header-row">
|
||||||
<span class="mdl-layout-title0"><a href="#"><img src="KoomBook_fichiers/koombook-nb.png" height="30"></a></span>
|
<span class="mdl-layout-title0"><a href="#"><img src="assets/koombook-nb.png" height="30"></a></span>
|
||||||
<div class="mdl-layout-spacer"></div>
|
<div class="mdl-layout-spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
12
zimit.ini
12
zimit.ini
@ -20,6 +20,18 @@ port = 6543
|
|||||||
|
|
||||||
# Begin logging configuration
|
# Begin logging configuration
|
||||||
|
|
||||||
|
[uwsgi]
|
||||||
|
wsgi-file = app.wsgi
|
||||||
|
http-socket = :8000
|
||||||
|
enable-threads = true
|
||||||
|
master = true
|
||||||
|
processes = 1
|
||||||
|
virtualenv = .
|
||||||
|
module = zimit
|
||||||
|
lazy = true
|
||||||
|
lazy-apps = true
|
||||||
|
|
||||||
|
|
||||||
[loggers]
|
[loggers]
|
||||||
keys = root, gplayproxy
|
keys = root, gplayproxy
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user