incomplete URL for session email link

3 views
Skip to first unread message

Hoover, David (NIH/CIT) [E]

unread,
Jun 20, 2024, 3:48:06 PMJun 20
to genome...@soe.ucsc.edu
We are hosting the genome browser as a mirror using a Docker container using a reverse proxied VM. When a user clicks on the 'Email' link in the hgSession page, it should generate an email with the following content:

> Here is a UCSC browser session I'd like to share with you: https://hpcnihapps.cit.nih.gov/genome/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah blah blah]...

However, the initial part of the URL is missing, and we get:

> Here is a UCSC browser session I'd like to share with you: hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah blah blah]...

Is there a configuration parameter in hg.conf that will set the correct host URL information?

David
--
David Hoover, Ph.D.
Computational Biologist
High Performance Computing Services,
Center for Information Technology,
National Institutes of Health
12 South Dr., Rm 2N207
Bethesda, MD 20892, USA
TEL: (+1) 301-435-2986
Email: hoov...@hpc.nih.gov

Galt Barber

unread,
Jun 21, 2024, 3:24:00 PMJun 21
to Hoover, David (NIH/CIT) [E], genome...@soe.ucsc.edu


Hi, David!

Please check if you have the relative link setting turned on,

which may well be the case for reverse proxy. 

Clearly an e-mail cannot contain a relative link,

it must be converted to absolute or just skip the feature.


hdb.c

char *hLocalHostCgiBinUrl()
/* Return the current full absolute URL of the cgi-bin directory of the local
 * server in the format http(s)://<host>/<cgiBinDir>, e.g.
 * https://genome.ucsc.edu/cgi-bin/.
 * The <host> is coming from the SERVER_NAME variable, which is
 * the ServerName setting in the Apache config file.
 * The cgi-bin directory is coming from the SCRIPT_NAME variable, the relative
 * location of the cgi program relative to Apache's DOCUMENT_ROOT.
 * Https is used if the variable HTTPS is set by Apache.
 *
 * If login.relativeLink=on is set, return only the empty string.
 * (This is used on the CIRM server, as it has no way of knowing what its
 * actual server name or protocol is, it is behind a reverse proxy)
 * Result has to be free'd. */
{ boolean relativeLink = cfgOptionBooleanDefault(CFG_LOGIN_RELATIVE, FALSE); if (relativeLink) return cloneString(""); char *cgiDir = cgiScriptDirUrl(); char buf[2048]; char *hgLoginHost = cgiServerNamePort(); safef(buf, sizeof(buf), "http%s://%s%s", cgiAppendSForHttps(), hgLoginHost, cgiDir); return cloneString(buf); }
Galt Barber
Senior Software Engineer
UCSC Genome Browser


Let us know if you have any more questions.

Ar Déar 20 Meith 2024 ag 12:48, scríobh 'Hoover, David (NIH/CIT) [E]' via UCSC Genome Browser Mirror-Specific Support <genome...@soe.ucsc.edu>:
--

---
You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu.
To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/bd5ade9f-8edb-4752-82e0-5f9d88b66b30%40hpc.nih.gov.

Hoover, David (NIH/CIT) [E]

unread,
Jun 21, 2024, 8:09:13 PMJun 21
to Galt Barber, genome...@soe.ucsc.edu
Gotcha, so I changed login.relative to 'off', but now it is displaying the wrong server name. The docker container is running as a reverse proxy.

Is there no way of using hg.conf to "force" hgSession to use a given hostname? Must it take it from Apache?

David

On 6/21/2024 3:23 PM, Galt Barber wrote:
>
> Hi, David!
>
> Please check if you have the relative link setting turned on,
>
> which may well be the case for reverse proxy.
>
> Clearly an e-mail cannot contain a relative link,
>
> it must be converted to absolute or just skip the feature.
>
>
> hdb.c
>
> char *hLocalHostCgiBinUrl()
> /* Return the current full absolute URL of the cgi-bin directory of the local
> * server in the format http(s)://<host>/<cgiBinDir>, e.g.
> *https://genome.ucsc.edu/cgi-bin/ <https://genome.ucsc.edu/cgi-bin/>.
> * The <host> is coming from the SERVER_NAME variable, which is
> * the ServerName setting in the Apache config file.
> * The cgi-bin directory is coming from the SCRIPT_NAME variable, the relative
> * location of the cgi program relative to Apache's DOCUMENT_ROOT.
> * Https is used if the variable HTTPS is set by Apache.
> *
> * If login.relativeLink=on is set, return only the empty string.
> * (This is used on the CIRM server, as it has no way of knowing what its
> * actual server name or protocol is, it is behind a reverse proxy)
> * Result has to be free'd. */
>
> {
> boolean relativeLink = cfgOptionBooleanDefault(CFG_LOGIN_RELATIVE, FALSE);
> if (relativeLink)
> return cloneString("");
>
> char *cgiDir = cgiScriptDirUrl();
> char buf[2048];
> char *hgLoginHost = cgiServerNamePort();
> safef(buf, sizeof(buf), "http%s://%s%s", cgiAppendSForHttps(), hgLoginHost, cgiDir);
>
> return cloneString(buf);
> }
>
> Galt Barber
> Senior Software Engineer
> UCSC Genome Browser
>
>
> Let us know if you have any more questions.
>
>
> Ar Déar 20 Meith 2024 ag 12:48, scríobh 'Hoover, David (NIH/CIT) [E]' via UCSC Genome Browser Mirror-Specific Support <genome...@soe.ucsc.edu <mailto:genome...@soe.ucsc.edu>>:
>
> We are hosting the genome browser as a mirror using a Docker container using a reverse proxied VM.  When a user clicks on the 'Email' link in the hgSession page, it should generate an email with the following content:
>
> > Here is a UCSC browser session I'd like to share with you: https://hpcnihapps.cit.nih.gov/genome/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah <https://hpcnihapps.cit.nih.gov/genome/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah> blah blah]...
>
> However, the initial part of the URL is missing, and we get:
>
> > Here is a UCSC browser session I'd like to share with you: hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah blah blah]...
>
> Is there a configuration parameter in hg.conf that will set the correct host URL information?
>
> David
> --
> David Hoover, Ph.D.
> Computational Biologist
> High Performance Computing Services,
> Center for Information Technology,
> National Institutes of Health
> 12 South Dr., Rm 2N207
> Bethesda, MD 20892, USA
> TEL: (+1) 301-435-2986
> Email: hoov...@hpc.nih.gov <mailto:hoov...@hpc.nih.gov>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu <mailto:genome-mirror%2Bunsu...@soe.ucsc.edu>.
> To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/bd5ade9f-8edb-4752-82e0-5f9d88b66b30%40hpc.nih.gov <https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/bd5ade9f-8edb-4752-82e0-5f9d88b66b30%40hpc.nih.gov>.

Hoover, David (NIH/CIT) [E]

unread,
Jun 21, 2024, 8:09:16 PMJun 21
to Galt Barber, genome...@soe.ucsc.edu
Also, setting login.relative=off breaks the session login; it needs to be login.relative=on in order for login to work, which then truncates the host in the email link.

This seems like a bad design. How do other users deal with docker-based reverse proxies?

David

Maximilian Haeussler

unread,
Jun 25, 2024, 1:12:33 PMJun 25
to Hoover, David (NIH/CIT) [E], Galt Barber, genome...@soe.ucsc.edu
Hi David,

I don't think we have heard from other users yet who run it behind a reverse proxy.

I just looked at ex.hg.conf, it looks like we have this option for this case:

wiki.host=HTTPHOST

It's documented as follows and is the default value, so I'm confused why this is not working on your mirror:

#              The special value HTTPHOST for wiki.host will use the
#              server hostname as supplied by the http request. This allows
#              login to work if a server is reached under different names.
#              The default value HTTPHOST should work in all contexts.

It seems that using the server name as supplied by the HTTP request should work?



To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu.
To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/84561f13-da87-4560-b1b1-63cd924428b2%40hpc.nih.gov.

Hoover, David (NIH/CIT) [E]

unread,
Jun 25, 2024, 1:23:05 PMJun 25
to genome...@soe.ucsc.edu
Nope. Currently I have

wiki.host=hpcwebdev.cit.nih.gov/genometest

When I set it to

wiki.host=HTTPHOST,

I can't authenticate for sessions via hgLogin:

This site can’t be reached
10.1.201.101 took too long to respond.

It attempts to use the IP address of the VM running docker.

David
> >>   *https://genome.ucsc.edu/cgi-bin/ <https://genome.ucsc.edu/cgi-bin/>  <https://genome.ucsc.edu/cgi-bin/ <https://genome.ucsc.edu/cgi-bin/>>.
> >>   * The <host> is coming from the SERVER_NAME variable, which is
> >>   * the ServerName setting in the Apache config file.
> >>   * The cgi-bin directory is coming from the SCRIPT_NAME variable, the relative
> >>   * location of the cgi program relative to Apache's DOCUMENT_ROOT.
> >>   * Https is used if the variable HTTPS is set by Apache.
> >>   *
> >>   * If login.relativeLink=on is set, return only the empty string.
> >>   * (This is used on the CIRM server, as it has no way of knowing what its
> >>   * actual server name or protocol is, it is behind a reverse proxy)
> >>   * Result has to be free'd. */
> >>
> >> {
> >> boolean relativeLink = cfgOptionBooleanDefault(CFG_LOGIN_RELATIVE, FALSE);
> >> if (relativeLink)
> >>      return cloneString("");
> >>
> >> char *cgiDir = cgiScriptDirUrl();
> >> char buf[2048];
> >> char *hgLoginHost = cgiServerNamePort();
> >> safef(buf, sizeof(buf), "http%s://%s%s", cgiAppendSForHttps(), hgLoginHost, cgiDir);
> >>
> >> return cloneString(buf);
> >> }
> >>
> >> Galt Barber
> >> Senior Software Engineer
> >> UCSC Genome Browser
> >>
> >>
> >> Let us know if you have any more questions.
> >>
> >>
> >> Ar Déar 20 Meith 2024 ag 12:48, scríobh 'Hoover, David (NIH/CIT) [E]' via UCSC Genome Browser Mirror-Specific Support <genome...@soe.ucsc.edu <mailto:genome...@soe.ucsc.edu> <mailto:genome...@soe.ucsc.edu <mailto:genome...@soe.ucsc.edu>>>:
> >>
> >>     We are hosting the genome browser as a mirror using a Docker container using a reverse proxied VM.  When a user clicks on the 'Email' link in the hgSession page, it should generate an email with the following content:
> >>
> >>      > Here is a UCSC browser session I'd like to share with you: https://hpcnihapps.cit.nih.gov/genome/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah <https://hpcnihapps.cit.nih.gov/genome/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah> <https://hpcnihapps.cit.nih.gov/genome/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah <https://hpcnihapps.cit.nih.gov/genome/cgi-bin/hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah>> blah blah]...
> >>
> >>     However, the initial part of the URL is missing, and we get:
> >>
> >>      > Here is a UCSC browser session I'd like to share with you: hgTracks?hgS_doOtherUser=submit&hgS_otherUserName=...[blah blah blah]...
> >>
> >>     Is there a configuration parameter in hg.conf that will set the correct host URL information?
> >>
> >>     David
> >>     --     David Hoover, Ph.D.
> >>     Computational Biologist
> >>     High Performance Computing Services,
> >>     Center for Information Technology,
> >>     National Institutes of Health
> >>     12 South Dr., Rm 2N207
> >>     Bethesda, MD 20892, USA
> >>     TEL: (+1) 301-435-2986
> >>     Email: hoov...@hpc.nih.gov <mailto:hoov...@hpc.nih.gov> <mailto:hoov...@hpc.nih.gov <mailto:hoov...@hpc.nih.gov>>
> >>
> >>     --
> >>     ---
> >>     You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
> >>     To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu <mailto:genome-mirror%2Bunsu...@soe.ucsc.edu> <mailto:genome-mirror%2Bunsu...@soe.ucsc.edu <mailto:genome-mirror%252Buns...@soe.ucsc.edu>>.
> >>     To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/bd5ade9f-8edb-4752-82e0-5f9d88b66b30%40hpc.nih.gov <https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/bd5ade9f-8edb-4752-82e0-5f9d88b66b30%40hpc.nih.gov> <https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/bd5ade9f-8edb-4752-82e0-5f9d88b66b30%40hpc.nih.gov <https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/bd5ade9f-8edb-4752-82e0-5f9d88b66b30%40hpc.nih.gov>>.
> >>
> >
>
> --
> David Hoover, Ph.D.
> Computational Biologist
> High Performance Computing Services,
> Center for Information Technology,
> National Institutes of Health
> 12 South Dr., Rm 2N207
> Bethesda, MD 20892, USA
> TEL: (+1) 301-435-2986
> Email: hoov...@hpc.nih.gov <mailto:hoov...@hpc.nih.gov>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu <mailto:genome-mirror%2Bunsu...@soe.ucsc.edu>.
> To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/84561f13-da87-4560-b1b1-63cd924428b2%40hpc.nih.gov <https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/84561f13-da87-4560-b1b1-63cd924428b2%40hpc.nih.gov>.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "UCSC Genome Browser Mirror-Specific Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to genome-mirro...@soe.ucsc.edu <mailto:genome-mirro...@soe.ucsc.edu>.
> To view this discussion on the web visit https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/CAHm%3D4fx2V7WAKbzJxBcXD0uhLpiE6dKm3C5NppY-R-YbpHsq5g%40mail.gmail.com <https://groups.google.com/a/soe.ucsc.edu/d/msgid/genome-mirror/CAHm%3D4fx2V7WAKbzJxBcXD0uhLpiE6dKm3C5NppY-R-YbpHsq5g%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages