Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-28 Thread Marvin Renich
* Eric Brown  [220427 20:24]:
> Thank you for the explanation, and thanks for the history and pointer
> towards tftp. Looks like you remembered correctly
> (https://lists.debian.org/debian-devel/2020/02/msg00197.html). I installed
> tftpd-ahp. Interestingly, after all that discussion, it still does create a
> directory /srv/tftp which is its default served directory, like the upstream
> shiny-server behaviour.
> Best,
> Eric

If tftpd-hpa does, it is violating Debian Policy.  However, there is a
significant difference between an FTP server and a web server:  the FTP
server's data directory is dynamic, and can be modified by clients on
other hosts.  /var/lib/package is not a good choice for this directory.

I agree with the others in this thread that you _must not_ step on the
sysadmin's toes by creating directories or files in /srv without
explicit permission.

I see two possible approaches.  The first is to use /srv/shiny-server as
the configuration default, and not place anything there (not even
creating the directory).  You can use README.Debian or (although
possibly a mild abuse) NEWS.Debian to guide the sysadmin on how to fix
things.

The other, which I strongly prefer and follows what other web servers in
Debian have done, is to use /var/lib/shiny-server as the default, and
modify the default web page to give instructions, explaining that for
the package to use /srv/shiny-server as the default without the user's
explicit permission is a violation of both the FHS and Debian Policy.
You can provide a script in /usr/share/doc/shiny-server/examples/ that
will "correct" the default if the user wishes.

The fact is that for shiny-server to be useful, the user must customize
the website anyway.  One extra step that is explained in the default web
page to get it to match the upstream defaults is not onerous.

What would be policy compliant, would be to have a debconf question (as
others have suggested), whose default behavior is to use
/var/lib/shiny-server, but if the user explicitly changes it to
/srv/shiny-server, then it is fine to go ahead and create and populate
the directory.  Asking a debconf question, but defaulting to
/srv/shiny-server would be the same as not asking the question, and is
thus a policy violation.

Also, note that /var/shiny-server is not FHS or Debian Policy compliant,
but /var/lib/shiny-server is (I vaguely remember someone mentioning
/var/shiny-server earlier in this thread, so I thought I would point
this out).

...Marvin



Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-28 Thread Paul Wise
On Wed, 2022-04-27 at 21:40 +0530, Nilesh Patra wrote:

> The default/expected behaviour just after package install is that as
> soon as the user starts it and visits (talking about local setup here)
> localhost: they should be seeing a welcome page.

Since the package manager cannot know at what HTTP domain and path the
sysadmin desires a web app to be accessible from, personally I would
suggest to ask the sysadmin for the relevant parameters via debconf and
then run the vhost setup script for the web app using those parameters.

The files you mention would be stored in /usr and the generated web
server and app be configured to use them from there.

I think the wwwconfig-common package was meant to facilitate that sort
of approach, but it only supports PostgreSQL/MySQL, PHP and Apache.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc
Description: This is a digitally signed message part


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-28 Thread Andreas Tille
Am Wed, Apr 27, 2022 at 11:39:45AM -0700 schrieb Russ Allbery:
> 
> We do try to hold the line on not installing files in /srv and not
> requiring any specific layout of /srv because the FHS is pretty explicit
> that the choice of directory layout in /srv is entirely up to the local
> administrator and distributions should not be messing with it.

I wonder whether we can simply use /var (not sure what might be best out
of /var/www/shiny-server or /var/lib/shiny-server or ???) for the "real"
installation and use a symlink to /srv/shiny-server (which can be even
set via debconf or in prominent documentation).  This puts the files in
the right place per FHS but does not lead to big surprises at user side.

Kind regards

   Andreas.

-- 
http://fam-tille.de



Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Eric Brown
Thank you for the explanation, and thanks for the history and pointer 
towards tftp. Looks like you remembered correctly 
(https://lists.debian.org/debian-devel/2020/02/msg00197.html). I 
installed tftpd-ahp. Interestingly, after all that discussion, it still 
does create a directory /srv/tftp which is its default served directory, 
like the upstream shiny-server behaviour.

Best,
Eric



Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Russ Allbery
Eric Brown  writes:

> The issue is that the documentation, samples and all of the upstream
> online documentation, e.g.
> https://support.rstudio.com/hc/en-us/articles/219002337-Shiny-Server-Quick-Start-Host-a-directory-of-applications
> (or on third party sites like Stack Overflow), refer to
> /srv/shiny-server as the default location for hosting. I doubt
> upstream would want to change all of that without a strong reason.

> From a user's perspective it would be much clearer if Debian could do
> the same, in my opinion, so all of this existing and distributed
> documentation and support still applies to new users of the Debian
> version. Is there a technical solution to enable this, e.g. post
> installation, that satisfies Debian's requirements?

Not really.  This is the same issue that we've had before with other
things.  Given current Policy, you have to choose between pointing at a
file installed with the package or defaulting to the upstream /srv
location without there being a file there.

It's not a great situation, and there was a long discussion a while back
about how to address the same issue with tftp services that I think didn't
arrive at a clear conclusion.

-- 
Russ Allbery (r...@debian.org)  



Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Eric Brown
Thank you all for your advice. I have been helping out to get this
packaged. I agree with Nilesh but am chiming in, but I apologize if I
am just repeated what is already clear.

/srv/shiny-server is upstream's default location for files to serve.
It starts out with the sample files but the user replaces those with
their own. The sample files start there and provide the user proof
that the server is working and an explanation on how to replace the
files.

The server directory is easily changed by modifying the config file to
whatever is desired. So it is not essential to host here, just the
default. Everything would still work if it were another directory
specified in config.

The issue is that the documentation, samples and all of the upstream
online documentation, e.g.
https://support.rstudio.com/hc/en-us/articles/219002337-Shiny-Server-Quick-Start-Host-a-directory-of-applications
(or on third party sites like Stack Overflow), refer to
/srv/shiny-server as the default location for hosting. I doubt
upstream would want to change all of that without a strong reason.

>From a user's perspective it would be much clearer if Debian could do
the same, in my opinion, so all of this existing and distributed
documentation and support still applies to new users of the Debian
version. Is there a technical solution to enable this, e.g. post
installation, that satisfies Debian's requirements?

Many thanks,
Eric

On Wed, Apr 27, 2022 at 1:57 PM Nilesh Patra  wrote:
>
> On Wed, Apr 27, 2022 at 07:42:29PM +0200, Jonas Smedegaard wrote:
> > Following FHS 3.0 is required by Debian Policy, and it says that "no
> > program should rely on a specific subdirectory structure of /srv
> > existing or data necessarily being stored in /srv".
> > So if I understand the situation correctly, leaving the package to
> > depend on filesystem path /srv/shiny-server is a violation of Debian
> > Policy and needs to be fixed,
>
> This was the whole point of my email, and it is the reason I started
> this email thread in the first place.
>
> I would have gone with installing it in /srv w/o seeking advice if it were
> not a violation.
>
> > either by avoiding that code (installing
> > it only as example files) or patching, or convincing upstream to change
> > default path.
>
> Yes, this was discussed in just the previous conversation (w/ me and wookey)
> I am looking for more opinions.
>
> Essentially if someone has a techincal way/solution to bypass this; or if 
> someone on the list
> has had experience of working on a package that had similar reqs as 
> shiny-server, it'd be nice to
> know what they did for their package.
>
> Best, Nilesh



-- 
Eric Brown MD MSc FRCPC
For encryption, OpenPGP public key available on request.



Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Philip Rinn

Hi Nilesh,

On 2022-04-27 21:40 +0530, Nilesh Patra wrote:

But, the welcome page config 
(https://github.com/rstudio/shiny-server/tree/master/samples)
need to be stored in /srv/shiny-server for this welcome display to happen.


Why, you can adjust the path via a config variable, see 
https://github.com/rstudio/shiny-server/blob/master/config/default.config#L12.

How about just changing that default config and point it to 
/usr/share/shiny-server/samples or wherever you install the sample files too?
Or do I miss something here?

Best
Philip


OpenPGP_signature
Description: OpenPGP digital signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Russ Allbery
Ryan Kavanagh  writes:

> From FHS §5.8.1,

> This hierarchy holds state information pertaining to an application
> or the system. State information is data that programs modify while
> they run, and that pertains to one specific host. Users must never
> need to modify files in /var/lib to configure a package's operation,
> and the specific file hierarchy used to store the data must not be
> exposed to regular users.

> So, I think this suggestion of storing shiny-server (presumably
> modifyable) configurations and served data in /var/lib/shiny-server
> would violate policy.

I would expect a workflow similar to that of the Apache packages.  The
default home page is a static file shipped with the package in /var, but
one of the first things that any administrator does after installing the
package is point it at a different docroot that suits their local file
system layout.

That avoids all of these problems, since there is no need to modify the
static home page in order to make the package work.  (Although the
administrator can choose to do so if they want.  I sometimes use /var to
hold various configuration things on my systems.  The actions of the local
administrator are outside the scope of the FHS, which only constrains
distributions.  This is why we use /var rather than /usr, so that
administrators can choose to just use /var if they feel like it without
running into problems with, for example, a read-only /usr.)

This issue comes up occasionally with different packages and we've never
come up with a great solution beyond making it configurable at install
(either via explicit documentation or via a debconf prompt).  It's a bit
of a gap in the FHS, in my opinion, but I'm not sure it's worth developing
local policy to close the gap by, for instance, introducing a new
top-level directory for default docroots for various services (I know of
web, gopher, and tftp with this issue).

We do try to hold the line on not installing files in /srv and not
requiring any specific layout of /srv because the FHS is pretty explicit
that the choice of directory layout in /srv is entirely up to the local
administrator and distributions should not be messing with it.

-- 
Russ Allbery (r...@debian.org)  



Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Ryan Kavanagh
On Wed, Apr 27, 2022 at 01:15:04PM -0500, Richard Laager wrote:
> Patch every instance of /srv/shiny-server to /var/lib/shiny-server.
> The admin can customize from there.

From FHS §5.8.1,

This hierarchy holds state information pertaining to an application
or the system. State information is data that programs modify while
they run, and that pertains to one specific host. Users must never
need to modify files in /var/lib to configure a package's operation,
and the specific file hierarchy used to store the data must not be
exposed to regular users.

So, I think this suggestion of storing shiny-server (presumably
modifyable) configurations and served data in /var/lib/shiny-server
would violate policy.

-- 
|)|/  Ryan Kavanagh  | 4E46 9519 ED67 7734 268F
|\|\  https://rak.ac | BD95 8F7B F8FC 4A11 C97A


signature.asc
Description: PGP signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Ryan Kavanagh
On Wed, Apr 27, 2022 at 11:27:43PM +0530, Nilesh Patra wrote:
> Essentially if someone has a techincal way/solution to bypass this; or
> if someone on the list has had experience of working on a package that
> had similar reqs as shiny-server, it'd be nice to know what they did
> for their package.

gophernicus had a similar issue. By default, it wanted to serve files
out of /var/gopher, but FHS §5.1 states

Applications must generally not add directories to the top level of
/var. Such directories should only be added if they have some
system-wide implication, and in consultation with the FHS mailing
list.

Instead, gophernicus in Debian serves from /srv/gopher by default to
comply with FHS §3.17.1. The gophernicus package does not create this
directory. Instead, I just documented the issue in README.Debian [0],
and included the default gophermap as an examples file.

If there's a better solution, I'd be happy to hear it.

Best,
Ryan

[0] 
https://salsa.debian.org/debian/gophernicus/-/blob/debian/sid/debian/README.Debian

-- 
|)|/  Ryan Kavanagh  | 4E46 9519 ED67 7734 268F
|\|\  https://rak.ac | BD95 8F7B F8FC 4A11 C97A


signature.asc
Description: PGP signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Russ Allbery
Richard Laager  writes:
> On 4/27/22 12:57, Nilesh Patra wrote:

>> I am looking for more opinions.

> Patch every instance of /srv/shiny-server to /var/lib/shiny-server. The
> admin can customize from there.

A possibly even better option would be for it to take the web root as a
command-line or configuration argument.  It's weird for that sort of
configuration parameter, which administrators are going to want to
customize, to be hard-coded into the package (and for me it raises
questions about its general code quality).

-- 
Russ Allbery (r...@debian.org)  



Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Richard Laager

On 4/27/22 12:57, Nilesh Patra wrote:

I am looking for more opinions.


Patch every instance of /srv/shiny-server to /var/lib/shiny-server. The 
admin can customize from there.


--
Richard


OpenPGP_signature
Description: OpenPGP digital signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Nilesh Patra
On Wed, Apr 27, 2022 at 07:42:29PM +0200, Jonas Smedegaard wrote:
> Following FHS 3.0 is required by Debian Policy, and it says that "no 
> program should rely on a specific subdirectory structure of /srv 
> existing or data necessarily being stored in /srv".
> So if I understand the situation correctly, leaving the package to 
> depend on filesystem path /srv/shiny-server is a violation of Debian 
> Policy and needs to be fixed,

This was the whole point of my email, and it is the reason I started
this email thread in the first place.

I would have gone with installing it in /srv w/o seeking advice if it were
not a violation.

> either by avoiding that code (installing 
> it only as example files) or patching, or convincing upstream to change 
> default path.

Yes, this was discussed in just the previous conversation (w/ me and wookey)
I am looking for more opinions.

Essentially if someone has a techincal way/solution to bypass this; or if 
someone on the list
has had experience of working on a package that had similar reqs as 
shiny-server, it'd be nice to
know what they did for their package.

Best, Nilesh


signature.asc
Description: PGP signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Jonas Smedegaard
Quoting Nilesh Patra (2022-04-27 19:17:21)
> On Wed, Apr 27, 2022 at 06:10:37PM +0100, Wookey wrote:
> > On 2022-04-27 21:40 +0530, Nilesh Patra wrote:
> > > But, the welcome page config 
> > > (https://github.com/rstudio/shiny-server/tree/master/samples) need 
> > > to be stored in /srv/shiny-server for this welcome display to 
> > > happen.
> > > 
> > > (Note that I do not want to patch code to change the default 
> > > behaviour here.)
> > 
> > Why not? This is what distro packages do - make sure things are 
> > installed in sensible places.
> > 
> > And patching a path is nice and simple (although you might also have 
> > to patch some docs to match).
> 
> No, sorry - that'd be a bit too much delta here, meaning shiny-server 
> would be able to serve from two loc (I do not want that) As a 
> distribution I do not want to be doing things completely orthogonal 
> from the way upstream does things.

Following FHS 3.0 is required by Debian Policy, and it says that "no 
program should rely on a specific subdirectory structure of /srv 
existing or data necessarily being stored in /srv".

So if I understand the situation correctly, leaving the package to 
depend on filesystem path /srv/shiny-server is a violation of Debian 
Policy and needs to be fixed, either by avoiding that code (installing 
it only as example files) or patching, or convincing upstream to change 
default path.

 - Jonas

https://www.debian.org/doc/packaging-manuals/fhs/fhs-3.0.html#srvDataForServicesProvidedBySystem

https://www.debian.org/doc/debian-policy/ch-opersys.html#file-system-structure

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc
Description: signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Nilesh Patra
On Wed, Apr 27, 2022 at 06:10:37PM +0100, Wookey wrote:
> On 2022-04-27 21:40 +0530, Nilesh Patra wrote:
> > Hi All,
> > 
> > But, the welcome page config 
> > (https://github.com/rstudio/shiny-server/tree/master/samples)
> > need to be stored in /srv/shiny-server for this welcome display to happen.
> > 
> > (Note that I do not want to patch code to change the default behaviour 
> > here.)
> 
> Why not? This is what distro packages do - make sure things are installed in 
> sensible places.
> 
> And patching a path is nice and simple (although you might also have to patch 
> some docs to match).

No, sorry - that'd be a bit too much delta here, meaning shiny-server would be
able to serve from two loc (I do not want that)
As a distribution I do not want to be doing
things completely orthogonal from the way upstream does things.
Not to mention that derivatives would inherit directly.

Atleast this level of effort does not seem justified for just a welcome page.

> I'm not sure what the right path is. The default webserver path in debian
> has been /var/www/html/ for decades so I'd use that, but you might
> have reasons to make it /var/www/shiny-server instead if you want
> shiny-server to be co-installable with other web-servers, and serve different 
> stuff?

Yeah that makes sense but again, same reason as I gave above. Maybe we (me and 
people in CC)
could ask upstream if they are willing to support something like this at their 
end as well.

Regards,
Nilesh


signature.asc
Description: PGP signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Wookey
On 2022-04-27 21:40 +0530, Nilesh Patra wrote:
> Hi All,
> 
> But, the welcome page config 
> (https://github.com/rstudio/shiny-server/tree/master/samples)
> need to be stored in /srv/shiny-server for this welcome display to happen.
> 
> (Note that I do not want to patch code to change the default behaviour here.)

Why not? This is what distro packages do - make sure things are installed in 
sensible places.

And patching a path is nice and simple (although you might also have to patch 
some docs to match).

I'm not sure what the right path is. The default webserver path in debian
has been /var/www/html/ for decades so I'd use that, but you might
have reasons to make it /var/www/shiny-server instead if you want
shiny-server to be co-installable with other web-servers, and serve different 
stuff?

Wookey
-- 
Principal hats:  Debian, Wookware, ARM
http://wookware.org/


signature.asc
Description: PGP signature


Re: Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Jonas Smedegaard
Quoting Nilesh Patra (2022-04-27 18:10:29)
> But, the welcome page config 
> (https://github.com/rstudio/shiny-server/tree/master/samples) need to 
> be stored in /srv/shiny-server for this welcome display to happen.

The path indicates that it is sample code - so I would suggest to simply 
install it as such.


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

signature.asc
Description: signature


Advice for package needing stuff installed in /srv (node-shiny-server)

2022-04-27 Thread Nilesh Patra
Hi All,

I recently completed the packaging of node-shiny-server, uploaded to NEW and
it is there in the archive now (exp suite)

The default/expected behaviour just after package install is that as soon
as the user starts it and visits (talking about local setup here) 
localhost: they should be
seeing a welcome page.

But, the welcome page config 
(https://github.com/rstudio/shiny-server/tree/master/samples)
need to be stored in /srv/shiny-server for this welcome display to happen.
Now, I think we as a distribution are not supposed to install anything to /srv 
as they are reserved
explicitly for sys admins. I get a big fat lintian error if I even attempt to 
do that.

Without installing the welcome template to /srv/shiny-server, the user would 
get a kind
of warning message when they visit localhost and that might scare them away.
And hence, I need help/opinions to decide what should be done here.

(Note that I do not want to patch code to change the default behaviour here.)

Any ideas?

Regards,
Nilesh


signature.asc
Description: PGP signature