An efficient blahging server with LaTeX-like syntax

#21 CMake Deprecation Warning (cmake_minimum_required)

~jeffpc commented on blahgd todo

a month ago

#24 Consider not using the file cache

~jeffpc commented on blahgd todo

2 months ago
CMake variables


In addition to standard CMake variables, the following can be set to tweak
blahgd's behavior:

	DEFAULT_SCGI_PORT	- default port to listen on for SCGI requests

				- default number of posts per page (index,
				- default number of posts per page (Atom/RSS

				- default maximum number of seconds of think
				  time after which a submission is
				  considered a spam
				- default minimum number of seconds of think
				  time before which a submission is
				  considered a spam

	DEFAULT_DATA_DIR	- default path to the data directory
	DEFAULT_THEME_DIR	- default path to the theme directory

	VAR_MAX_SCOPES		- maximum number of internal scopes
	VAR_NAME_MAXLEN		- maximum length of a variable name

	COND_STACK_DEPTH	- template engine function stack size

				- default min font size of tag cloud entries
				- default max font size of tag cloud entries

	PREVIEW_SECRET		- key used to previewing unpublished posts


To build blahgd you must have:

  - gcc/clang or other C99 compiler with compatible arguments
  - flex & bison
  - libjeffpc (http://hg.31bits.net/libjeffpc/)

Building and Installing

$ cmake . -DCMAKE_INSTALL_PREFIX=/prefix
$ make
$ make install

This will install the binaries under the specified prefix.

Note: If libjeffpc is not installed in a location that's part of the
compiler and linker search path, you'll have to give cmake a hint where to
find it.  You do this by defining these as necessary:

  - WITH_JEFFPC_LIB=x      - directory containing libjeffpc.so
  - WITH_JEFFPC_INCLUDES=x - directory containing jeffpc/jeffpc.h
  - WITH_JEFFPC=x          - same as setting WITH_JEFFPC_LIB=x/lib and

For example:

$ cmake . -DWITH_JEFFPC=/opt/jeffpc <...other cmake args...>


You can start the blahg daemon (blahgd):

$ ./blahgd

At this point, blahgd is listening on port 2014 for SCGI connections.  Now,
you need to configure your webserver to pass requests to blahgd.  For example,
for nginx, use a config stanza similar to:

        server {
                listen       80;
                server_name  blahg.example.com;

                location / {
                        include scgi_params;
                        scgi_pass localhost:2014;

The scgi_params file should include:

scgi_param  REQUEST_METHOD     $request_method;
scgi_param  REQUEST_URI        $request_uri;
scgi_param  QUERY_STRING       $query_string;
scgi_param  CONTENT_TYPE       $content_type;

scgi_param  DOCUMENT_URI       $document_uri;
scgi_param  DOCUMENT_ROOT      $document_root;
scgi_param  SCGI               1;
scgi_param  SERVER_PROTOCOL    $server_protocol;
scgi_param  HTTPS              $https if_not_empty;

scgi_param  REMOTE_ADDR        $remote_addr;
scgi_param  REMOTE_PORT        $remote_port;
scgi_param  SERVER_PORT        $server_port;
scgi_param  SERVER_NAME        $server_name;