]> Shamusworld >> Repos - ardour-manual/commitdiff
Remove dependency on external http server for local viewing
authorDamien Zammit <damien@zamaudio.com>
Tue, 5 May 2020 00:42:28 +0000 (10:42 +1000)
committerDamien Zammit <damien@zamaudio.com>
Tue, 5 May 2020 01:11:12 +0000 (11:11 +1000)
README.md
servit.py [new file with mode: 0755]

index 6a86a03c2eaef6f93a06acac80322e3a166242a0..33a92c23df404470ac301991c42b2159646af8eb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -81,7 +81,7 @@ notes just in case you decide to anyway.
 ### Run it locally
 
 You may want the manual available on a machine that doesn't have constant
-internet access. You will need `git`, and `python3` installed.
+internet access. You will need `git`, `python3` and `cherrypy` python module installed.
 
 1. Download code and build manual
 
@@ -91,29 +91,14 @@ internet access. You will need `git`, and `python3` installed.
   ./build.py
   ```
 
-2. Install and configure a web server on your machine. Any web server should
-work,  Apache, nginx, etc... The following steps are for nginx, using another
-server means following the same procedure for the server you decide to use.
-
-3. Install [nginx](http://wiki.nginx.org/Install)
-
-4. Configure nginx server block in `/etc/nginx/sites-available/default`
-
+2. Run the following:
   ```
-  server {
-      listen 80;
-      server_name localhost;
-
-      root ...path_to_.../ardour-manual/website;
-      index index.html;
-  }
+  ./servit.py
   ```
 
-5. Restart nginx server
-
-        service nginx restart
+3. The manual will now be available at http://127.0.0.1:8080
 
-6. The manual will now be available at http://localhost
+  (Ctrl-c to quit the server).
 
 ### Helper scripts: `implode` and `explode`
 
diff --git a/servit.py b/servit.py
new file mode 100755 (executable)
index 0000000..0b7f701
--- /dev/null
+++ b/servit.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+#
+# Script to locally host the manual as a simple http site
+
+import os
+import cherrypy
+
+PATH = os.path.abspath(os.path.dirname(__file__))
+
+class Root(object):
+       pass
+
+cherrypy.tree.mount(Root(), '/', config={
+       '/': {
+               'tools.staticdir.on': True,
+               'tools.staticdir.dir': os.path.join(PATH, 'website'),
+               'tools.staticdir.index': 'index.html',
+       },
+})
+
+cherrypy.engine.start()
+cherrypy.engine.block()