1
0
mirror of https://gitlab.com/depesz/explain.depesz.com.git synced 2025-07-17 01:42:34 +02:00

server runs, not fully tested

This commit is contained in:
John Poole
2014-10-31 06:04:52 -07:00
parent cd980e2c24
commit cb3a519766
4 changed files with 48 additions and 11 deletions

34
explain-json-notes.txt Normal file
View File

@ -0,0 +1,34 @@
$Id$
$HeadURL$
This file provides comments and documentation to the file "explain.json".
There are values in explain.json that you need to specify
for the operation of your "explain" server.
Why this file?
Because JSON does not support comments, the specification for
JSON format specifically excludes comments,
JSON files may only to contain data. See
http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
title => I do not know where this variable is used
secret => I do not know what this variable is for
database.dsn => the standard connection information
A) database name (case sensitive),
B) server or host
C) port - standard port for postgresql is 5432
database.username => you created this when you set up a role in postgresql
for this explain server
database.password => the password for database.username
mail_sender.from =
mail_sender.to =
mail_sender.subject =
hypnotoad.pid_file = /var/run is the standard place to store your pid files;
if you do not have access to /var/run,
then create in your home directory a branch
var/run and place it there.
Example ~/var/run/explain.pid.
Make sure you create the directories,
~/var/run, before specifying this alternate location.

View File

@ -1,11 +1,12 @@
{
"title" : "explain.depesz.com",
"title" : "jlpoole explain test",
"secret" : "|Erp--Wjgb)+eiB/|H=|V7!#+M|L{a8=J2|pd+N1=M|&pJWq|M&,f3q^XS",
"secret" : "test",
"database" : {
"dsn" : "dbi:Pg:database=depesz_explain;host=127.0.0.1;port=5930",
"username" : "depesz_explain",
"dsn" : "dbi:Pg:database=explain;host=localhost;port=5432",
"username" : "explaind",
"password" : "test",
"options" : {
"auto_commit" : 1,
"pg_server_prepare" : 0,
@ -15,14 +16,14 @@
},
"mail_sender" : {
"from" : "explain.depesz.com <depesz@depesz.com>",
"to" : "metys <depesz@depesz.com>",
"subject" : "Message from: explain.depesz.com/contact"
"from" : " <jlpoole56@gmail.com>",
"to" : "John Poole <jlpoole56@gmail.com>",
"subject" : "Message from: jlpoole explain/contact"
},
"hypnotoad" : {
"listen" : ["http://*:12004"],
"workers" : 2,
"pid_file" : "/home/depesz/sites/explain.depesz.com.pid"
"pid_file" : "/home/jlpoole/pids/explain.pid"
}
}

View File

@ -13,7 +13,7 @@ use lib File::Spec->catfile( File::Spec->splitdir( dirname( __FILE__ ) ), 'lib'
eval 'use Mojolicious::Commands';
die <<EOF if $EVAL_ERROR;
It looks like you don't have the Mojolicious Framework installed.
It looks like you do not have the Mojolicious Framework installed.
Please visit http://mojolicio.us for detailed installation instructions.
EOF

View File

@ -17,8 +17,10 @@ sub startup {
# load configuration
my $config = $self->plugin( 'JSONConfig' );
# setup secret passphrase
$self->secret( $config->{ secret } || 'Xwyfe-_d:yGDr+p][Vs7Kk+e3mmP=c_|s7hvExF=b|4r4^gO|' );
# setup secret passphrase - later versions of
# mojolicious require secrets to be multiple in an
# array format
$self->secrets( [$config->{ secret } || 'test'] );
# startup database connection
$self->plugin( 'database', $config->{ database } || {} );