-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdeployment-notes
57 lines (38 loc) · 2.13 KB
/
deployment-notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
This app uses a number of CPAN modules. Not all modules are available via
Debian packages, so for expediency (i.e.: laziness) I installed all the
dependencies direct from CPAN into a subdirectory called 'local' using
local::lib and cpanm. These command should do the business:
sudo apt-get install liblocal-lib-perl sqlite3
perl -Mlocal::lib=$(pwd)/local
eval $(perl -I$(pwd)/local/lib -Mlocal::lib=$(pwd)/local)
curl -L http://cpanmin.us | perl - App::cpanminus
cpanm --installdeps .
It's probably a good idea to repeat the last command until the output looks
error-free.
Create some directories:
mkdir -p var/db
mkdir -p var/dev-sessions
Create an initial development database:
sqlite3 var/db/tksweb-dev.db < data/schema-lite.sql
You'll need a user account record to log in. Edit data/add_user.sql to add
an account with your email address, full name and a random hex string in the
api_key column. Then run it with:
sqlite3 var/db/tksweb-dev.db < data/add_user.sql
To spin up a local development instance listening on port 3000, simply run:
./bin/app.pl
And browse to it on http://localhost:3000/
Use the password reset link to set up a new password. If for some reason email
delivery is not set up on your host, the password reset email will not be
delivered, but you can fake it by browsing to:
http://localhost:3000/reset/XXXXX
Where XXXXX is the random hex string that the app put in the 'reset_key' column
in the database which you can read with this command:
echo "SELECT reset_key FROM app_user;" | sqlite3 var/db/tksweb-dev.db
The development instance may do everything you need. I've chosen to run my
'production' environment in the 'Starman' app server with Nginx in front to
handle SSL and client connections, proxying back to Starman on port 5001. The
bin/exec_starman script is intended to be called from an init script (running
as root) to launch the Starman process as the app user, with the appropriate
local::lib environment settings. The file bin/init-sample should work as an
init script once you adjust the pathnames and username. The production
environment uses a database file called: var/db/tksweb-dev.db