blib/lib/PGXN/Site.pm

filter: Statementstmt 87.5% 7 / 8 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 100% 1 / 1 totaltotal 83.3% 10 / 12 SCAR 0.0
CC
1
Cov
88%
version_string
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/PGXN/Site/Router.pm ↑ Summary blib/lib/PGXN/Site/Locale/en.pm »
1 package PGXN::Site;
2  
3 2 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 our $VERSION = v0.22.1;
6  
7 sub version_string {
8 0 ▶ sprintf 'v%vd', $VERSION;
Subroutine version_string: not called CC=1 SCAR=6.9
Pod documented
9 }
10  
11 2 1;
12  
13 =head1 Name
14  
15 PGXN::Site - Maintain and serve a PGXN web site
16  
17 =head1 Synopsis
18  
19 pgxn_site_server --api-url https://api.pgxn.org/ \
20 --errors-from oops@example.com \
21 --errors-to alerts@example.com \
22 --feedback-to feedback@example.com
23  
24 =head1 Description
25  
26 L<PGXN|https://pgxn.org> is a L<CPAN|https://cpan.org>-inspired network for
27 distributing extensions for the L<PostgreSQL RDBMS|https://www.postgresql.org>.
28 All of the infrastructure tools, however, have been designed to be used to
29 create networks for distributing any kind of release distributions and for
30 providing a lightweight static file JSON REST API.
31  
32 This module provides a simple PGXN web site. All it needs is a
33 L<PGXN::API>-powered API to get the data it needs. Such an API can be accessed
34 either remotely or via the local file system.
35  
36 To run your own PGXN web server, just install this module and run the included
37 L<<pgxn_site_server> L<Plack> server, passing it the following options:
38  
39 =over
40  
41 =item C<api_url>
42  
43 The URL to use to access the L<PGXN::API> server. Required.
44  
45 =item C<private_api_url>
46  
47 A private URL to use to access the L<PGXN::API>-powered API. Optional. Useful
48 if you're serving the site and the API from the same box (or with access to
49 the same file system) and want it to be fast: just specify a C<file:> URL here
50 and the API will be read directly from the file system. The C<api_url> option
51 will still be used for public URLs pointing to the API in the UI.
52  
53 =item C<proxy_url>
54  
55 If you need to access C<private_api_url> via a proxy server, provide the URL for that
56 proxy server in this option.
57  
58 =item C<errors_to>
59  
60 An email address to which error emails should be sent. In the event of an
61 internal server error, the server will send an email to this address with
62 diagnostic information.
63  
64 =item C<errors_from>
65  
66 An email address from which alert emails should be sent.
67  
68 =item C<feedback_to>
69  
70 An email address to which feedback emails should be sent. This email address
71 will be provided as a clickable link.
72  
73 =back
74  
75 =head1 Interface
76  
77 The PGXN::Site class itself consists of a single class method.
78  
79 =head2 Class Method
80  
81 =head3 C<version_string>
82  
83 say 'PGXN::Site ', PGXN::Site->version_string;
84  
85 Returns a string representation of the PGXN::Site version.
86  
87 =head1 Author
88  
89 David E. Wheeler <david@justatheory.com>
90  
91 =head1 Copyright and License
92  
93 Copyright (c) 2010-2021 David E. Wheeler.
94  
95 This module is free software; you can redistribute it and/or modify it under
96 the L<PostgreSQL License|https://www.opensource.org/licenses/postgresql>.
97  
98 Permission to use, copy, modify, and distribute this software and its
99 documentation for any purpose, without fee, and without a written agreement is
100 hereby granted, provided that the above copyright notice and this paragraph
101 and the following two paragraphs appear in all copies.
102  
103 In no event shall David E. Wheeler be liable to any party for direct,
104 indirect, special, incidental, or consequential damages, including lost
105 profits, arising out of the use of this software and its documentation, even
106 if David E. Wheeler has been advised of the possibility of such damage.
107  
108 David E. Wheeler specifically disclaims any warranties, including, but not
109 limited to, the implied warranties of merchantability and fitness for a
110 particular purpose. The software provided hereunder is on an "as is" basis,
111 and David E. Wheeler has no obligations to provide maintenance, support,
112 updates, enhancements, or modifications.
113  
114 =cut
115  
« blib/lib/PGXN/Site/Router.pm ↑ Summary blib/lib/PGXN/Site/Locale/en.pm »