INSTALL wip
This commit is contained in:
parent
12b8f797c5
commit
e84ebaee7a
|
@ -0,0 +1,58 @@
|
||||||
|
There are numerous ways of deploying a Mojolicious app, so this
|
||||||
|
is just one way.
|
||||||
|
|
||||||
|
0. Dependencies
|
||||||
|
|
||||||
|
pgc-db <https://tildegit.org/barnold/pgc-db>
|
||||||
|
|
||||||
|
1. Create a user to run the perl process.
|
||||||
|
|
||||||
|
# adduser --no-create-home --home-dir /var/www \
|
||||||
|
--shell /usr/sbin/nologin --disabled-login pgc-www
|
||||||
|
|
||||||
|
2. Configure postgres.
|
||||||
|
|
||||||
|
Create a postgres user for pgc-www.
|
||||||
|
|
||||||
|
# su - postgres
|
||||||
|
## Add a user with readonly access to the tables, named as you like.
|
||||||
|
$ createuser --connection-limit=10 --role=pgc_user pgc-www
|
||||||
|
|
||||||
|
If you're using the simplest case, 'peer' authentication, then add a
|
||||||
|
line in pg_ident.conf into the map you used for pgc-db.
|
||||||
|
|
||||||
|
# MAPNAME SYSTEM-USERNAME PG-USERNAME
|
||||||
|
... ... ...
|
||||||
|
irulanmap pgc-www pgc-www
|
||||||
|
|
||||||
|
Tell postgres about your edit.
|
||||||
|
|
||||||
|
# systemctl reload postgres
|
||||||
|
|
||||||
|
At this point, pgc-www should have access to the database. Test with
|
||||||
|
|
||||||
|
# sudo -u pgc-www psql pg_book_catalog
|
||||||
|
|
||||||
|
3. Install the source code.
|
||||||
|
|
||||||
|
# cd /opt
|
||||||
|
# git clone https://tildegit.org/barnold/pgc-www.git
|
||||||
|
|
||||||
|
At this point, the user 'pgc-www' should be able to run the app. Test with
|
||||||
|
|
||||||
|
# sudo -u pgc-www morbo /opt/pgc-www/script/my_app
|
||||||
|
|
||||||
|
and visit <http://localhost:3000> in your browser.
|
||||||
|
|
||||||
|
4. Optionally, provide your email address to site visitors.
|
||||||
|
|
||||||
|
Add /opt/pgc-www/local-override.yml containing e.g.
|
||||||
|
|
||||||
|
email-address: webmaster@example.net?Subject=Love your site!
|
||||||
|
email-name: webmaster@example.net
|
||||||
|
|
||||||
|
After you restart the app, your address should appear on the 'about' page.
|
||||||
|
|
||||||
|
5. ...
|
||||||
|
|
||||||
|
|
7
README
7
README
|
@ -1,9 +1,9 @@
|
||||||
ABOUT
|
ABOUT
|
||||||
|
|
||||||
This is a Mojolicious web site app for looking through the catalog
|
This is a Mojolicious web site app for looking through the catalog
|
||||||
provided by Project Gutenberg <https://www.gutenberg.org/>. It uses
|
provided by Project Gutenberg <https://www.gutenberg.org/>. It has no
|
||||||
the database and perl modules provided by
|
affiliation with Project Gutenberg, it just gratefully uses the
|
||||||
<https://tildegit.org/barnold/pgc-db>.
|
catalog they provide.
|
||||||
|
|
||||||
COPYING
|
COPYING
|
||||||
|
|
||||||
|
@ -12,4 +12,3 @@ Public License, version 3
|
||||||
<https://www.gnu.org/licenses/agpl-3.0.html>.
|
<https://www.gnu.org/licenses/agpl-3.0.html>.
|
||||||
|
|
||||||
Comments are welcome at <barnold@tilde.club>.
|
Comments are welcome at <barnold@tilde.club>.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue