Hi there,
I've got a webrev of the http-depot work ready for review, if anyone has
bandwidth:
https://cr.opensolaris.org/action/browse/pkg/timf/http-depot-webrev-0/http-depot-webrev/
Everything is pretty much as per the original proposal I sent out a few
months ago (
https://cr.opensolaris.org/action/browse/pkg/timf/apache-depot-proposal/apache-depot.html
) with a few exceptions:
* it's called http-depot now, instead of apache-depot[1]
* we have the concept of a 'repository prefix', essentially separating
the web server namespace into different repositories - this turns out to
be much easier to read than scattering SHA-1 hashes throughout the
webserver namespace.
By default, the repository prefix maps directly to the SMF instance name
of the corresponding pkg:/application/pkg/server instance, though you
can also run pkg.http-depot with -R options, making it to ignore SMF.
* The root of the http-depot serves a page showing a list of all
repositories available, and links to the publishers inside that repository
* the mod_wsgi application that serves search/* requests now also
serves the BUI application, including info, p5i and admin requests
I've included a draft man page in the workspace, but I'll happily remove
that prior to putback and file a docs bug to get that cleaned up. For
convenience, I've attached a plaintext rendering of the man page.
Comments or questions would be most welcome,
cheers,
tim
[1] I'm happy to bikeshed on the name, so long as there's beer involved :-)
System Administration Commands pkg.http-depot(1M)
NAME
pkg.http-depot - image packaging system http depot confi-
guration generator
SYNOPSIS
/usr/lib/pkg.http-depot ( -R repository_dir | -a ) -r runtime_dir
[-c cache_dir] [-s cache_size] [-p port] [-h hostname]
[-l logs_dir] [-T template_dir] [-A]
[-t server_type] ( [-F] [-S server_prefix] )
DESCRIPTION
pkg.http-depot(1) is used to generate the configuration
files for the Image Packaging System (IPS) http-depot.
pkg.http-depot is called by the svc:/application/pkg/http-
depot:default Service Management Facility (SMF) service.
Changes in the configuration should be made to the proper-
ties in the SMF service.
The http-depot provides a scalable, read-only depot server
for IPS which is accessible over HTTP (XXX no HTTPS support
yet). A read/write depot server which supports HTTP and
HTTPS for individual repositories is provided by
pkg.depotd(1M) and instances of the
svc:/application/pkg/server SMF service.
The http-depot is capable of serving the contents of several
pkg(5) repositories provided they have file permissions such
that the files and directories in the repositories can be
read by the 'pkg5srv' user.
The depot can be configured as a standalone web server, with
the configuration generated automatically from a set of SMF
properties and the Apache web server processes managed by
the svc:/application/pkg/http-depot:default service.
The depot can also be configured manually by using the -F
option to produce a web-server configuration file which can
be added to an existing web server. In this case, the depot
runs with reduced functionality: pkg(1) search support and
the depot browser user interface are not available, however
all other functionality required by pkg(5) clients, such as
pkg(1) or packagemanager(1) to install and update Solaris 11
systems is available.
Repositories are made available to the depot server in two
ways. The first way is using the -a option, which causes the
depot server to query the system for all instances of the
svc:/application/pkg/server SMF service which are marked as
'online' and have the SMF properties 'pkg/standalone' set to
'false' and 'pkg/readonly' set to 'true'.
SunOS 5.12 Last change: 21 Nov 2012 1
System Administration Commands pkg.http-depot(1M)
The second way repositories can be made available to the
depot server is to use the -R option, providing a path to
the pkg(5) repository that should be used. Multiple -R
options are accepted. The svc:/application/pkg/http-depot
SMF service does not use the -R option.
OPTIONS
The following options are supported:
-R prefix:repository_dir
Mutually exclusive with the -a option,
-R takes a colon separated pair of
values. The first value is used as a
prefix into the http-depot web server
namespace where this repository can be
accessed. The second value is a direc-
tory containing the v4 pkg(5) file
repository, which is included in the
the depot server configuration. Multi-
ple -R options are allowed. At least
one -R option is required if the -a
option is not used.
-a Mutually exclusive with the -R option,
-a causes pkg.depotd(1M) to query the
system for all online instances of
svc:/application/pkg/server that have
the properties 'pkg/readonly' set to
'true' and 'pkg/standalone' set to
'false', allowing the http-depot to run
alongside svc:/application/pkg/server
instances which do not have these pro-
perties set.
-r runtime_dir The default output directory where con-
figuration files are written. This
option is set in the SMF service using
the 'config/runtime_dir' property. When
using the SMF service, the contents of
this directory are recreated during
service startup.
-c cache_dir The cache directory where the depot
stores its cache. The cache directory
is also used to store server-side
pkg(5) search indexes if the -A option
is also used. This option is set in
the SMF service using the
'config/cache_dir' property.
SunOS 5.12 Last change: 21 Nov 2012 2
System Administration Commands pkg.http-depot(1M)
-s cache_size An integer value in megabytes that
defines the maximum cache size for the
http-depot. This setting should be con-
figured using the 'config/cache_max'
SMF property. If set to 0, which is the
default, no caching is performed by the
web server. If all file-repositories
being served by the server are local to
the server itself (ie. not accessed
over NFS) the default value of 0 is
sufficient.
-p port The port number that depot will listen
to. It defaults to port 80. This option
is set in the SMF service using the
'config/port' property.
-h hostname The hostname used as the argument to
the Apache ServerName directive. It
defaults to '127.0.0.1'. This option is
set in the SMF service using the
'config/host' property.
-l logs_dir The log directory used by the depot to
store log files. It defaults to
'/var/log/pkg/depot'. This option is
set in the SMF service using the
'config/log_dir' property.
-T template_dir The -T option sets the template direc-
tory used to build the depot configura-
tion and access additional files needed
to run the depot. It defaults to
'/etc/pkg/depot' and should not nor-
mally need to be changed. This option
is set in the SMF service using the
'config/template_dir' property.
-A Whether the depot should respond to
"pkgrepo refresh" operations, allowing
any search indices maintained by the
depot to be refreshed. This option is
set in the SMF service using the
'config/allow_refresh' property. It
defaults to the value 'false'. It is
recommended to disallow index rebuild-
ing on production servers: the search
SunOS 5.12 Last change: 21 Nov 2012 3
System Administration Commands pkg.http-depot(1M)
index will be refreshed automatically
when the depot starts.
-t server_type The -t option is intended for
forwards-compatibility, allowing
pkg.http-depot to potentially output
configuration for different web servers
in the future. The only value accepted
at present is 'apache2'. This option is
not yet exposed through the SMF ser-
vice.
-F Whether pkg.http-depot should produce a
partial configuration for a web server,
allowing that web server to serve basic
pkg(5) install operations for clients.
In the case of the Apache web server
running on Solaris, it could be dropped
into /etc/apache2/2.2/conf.d - users of
other operating systems should consult
their OS documentation to determine how
to use this file. This option is not
exposed using the SMF service, as that
service does not control the web
server.
As noted in the introduction, some
depot operations are not available when
using this configuration. The -F
option is mutually exclusive with the
-p and -A options.
-S server_prefix The prefix prefix used to map the depot
into the web server namespace, intended
for use with the -F option.
PROVIDING ADDITIONAL SERVER CONFIGURATION
When the -F option is not used, and the default '-t apache2'
is set, the svc:/application/pkg/http-depot service looks in
/etc/pkg/depot/conf.d at startup for additional Apache con-
figuration files which may be used to extend the server con-
figuration. Consult the Apache web server documentation for
details on the directives that are used to configure the
web server.
EXAMPLES
SunOS 5.12 Last change: 21 Nov 2012 4
System Administration Commands pkg.http-depot(1M)
Example 1: Running pkg.http-depot
$ pkg.http-depot XXX need more examples here
Example 2: More interesting stuff with pkg.http-depot
$ XXX need more examples
EXIT STATUS
The following exit values are returned:
0
Command succeeded.
1
Command failed.
2
Invalid command line options were specified.
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
/usr/lib/pkg.http-depot
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | pkg:/package/pkg |
|_____________________________|_____________________________|
| Interface Stability | None / Under Development |
|_____________________________|_____________________________|
SEE ALSO
pkg(1), pkg.depotd(1M), pkgsend(1), pkg(5)
NOTES
The image packaging system is an under-development feature.
Command names, invocation, formats, and operations are all
subject to change. Development is hosted in the OpenSolaris
SunOS 5.12 Last change: 21 Nov 2012 5
System Administration Commands pkg.http-depot(1M)
community at:
http://hub.opensolaris.org/bin/view/Project+pkg/
SunOS 5.12 Last change: 21 Nov 2012 6
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss