Unable to set Base URL using deluge-web

Specific support for Deluge on Microsoft Windows OS
Post Reply
instantdreams
New User
New User
Posts: 7
Joined: Fri Sep 10, 2021 5:11 pm

Unable to set Base URL using deluge-web

Post by instantdreams »

I have tried to create an account on the official bug page but the verification email was not sent. I will post my findings here.

I have been running deluged and deluge-web successfully using NSSM for a number of years. I am running on Windows Serve 2016.

I am attempting to run the deluge-web service with a base URL. The switch "--base=[path]" or "-b [path]" are not recognised or actioned by the deluge-web-debug program. Here are my tests and results.

Baseline
Confirm option exists
Output

Code: Select all

C:\Windows\system32>"C:\Program Files (x86)\Deluge\deluge-web-debug.exe" -h
Usage: deluge-web-debug [options] [actions]

Options:
  -h, --help            show this help message and exit
  -v, --version         Show program's version number and exit

  Common Options:
    -c CONFIG, --config=CONFIG
                        Set the config folder location
    -l LOGFILE, --logfile=LOGFILE
                        Output to designated logfile instead of stdout
    -L LOGLEVEL, --loglevel=LOGLEVEL
                        Set the log level: none, info, warning, error,
                        critical, debug
    -q, --quiet         Sets the log level to 'none', this is the same as `-L
                        none`

  Web Options:
    [b]-b BASE, --base=BASE
                        Set the base path that the ui is running on (proxying)[/b]
    -f, --fork          Fork the web interface process into the background
    -i INTERFACE, --interface=INTERFACE
                        Binds the webserver to a specific IP address
    -p PORT, --port=PORT
                        Sets the port to be used for the webserver
    --profile           Profile the web server code
    --no-ssl            Forces the webserver to disable ssl
    --ssl               Forces the webserver to use ssl
Results
Executable deluge-web-debug.exe supports the --base or -b options.

Test 1
Use "--base" and no leading or trailing forward slashes
Output

Code: Select all

C:\Windows\system32>"C:\Program Files (x86)\Deluge\deluge-web-debug.exe" --loglevel="info" --base="deluge"
[INFO    ] 10:50:37 ui:124 Deluge ui 1.3.15
[INFO    ] 10:50:37 ui:127 Starting web ui..
[INFO    ] 10:50:38 server:666 Starting server in PID 9236.
[INFO    ] 10:50:39 server:679 Serving on 0.0.0.0:8112 view at http://0.0.0.0:8112
[INFO    ] 10:50:48 server:696 Shutting down webserver
Results
Accessing http://localhost:8112/ returned a blank page with html headers
Accessing http://localhost:8112/deluge displayed "No Such Resource | No such child resource."

Test 2
Use "--base" and a leading forward slash but no trailing forward slash
Output

Code: Select all

C:\Windows\system32>"C:\Program Files (x86)\Deluge\deluge-web-debug.exe" --loglevel="info" --base="/deluge"
[INFO    ] 10:50:55 ui:124 Deluge ui 1.3.15
[INFO    ] 10:50:55 ui:127 Starting web ui..
[INFO    ] 10:50:57 server:666 Starting server in PID 12032.
[INFO    ] 10:50:57 server:679 Serving on 0.0.0.0:8112 view at http://0.0.0.0:8112
[INFO    ] 10:51:06 server:696 Shutting down webserver
Results
Accessing http://localhost:8112/ returned a blank page with html headers
Accessing http://localhost:8112/deluge displayed "No Such Resource | No such child resource."

Test 3
Use "--base" and both a leading forward slash and a trailing forward slash
Output

Code: Select all

C:\Windows\system32>"C:\Program Files (x86)\Deluge\deluge-web-debug.exe" --loglevel="info" --base="/deluge/"
[INFO    ] 10:51:18 ui:124 Deluge ui 1.3.15
[INFO    ] 10:51:18 ui:127 Starting web ui..
[INFO    ] 10:51:20 server:666 Starting server in PID 11532.
[INFO    ] 10:51:20 server:679 Serving on 0.0.0.0:8112 view at http://0.0.0.0:8112
[INFO    ] 10:51:50 server:696 Shutting down webserver
Results
Accessing http://localhost:8112/ returned a blank page with html headers
Accessing http://localhost:8112/deluge displayed "No Such Resource | No such child resource."

Note that the above tests were done with both --base="[base path]" and --base=[base path] with the same results. The use of double quotes or no quotes produced the same results.

Test 4
Use "-b" and no leading or trailing forward slashes
Output

Code: Select all

C:\Windows\system32>"C:\Program Files (x86)\Deluge\deluge-web-debug.exe" --loglevel="info" -b deluge
[INFO    ] 10:51:59 ui:124 Deluge ui 1.3.15
[INFO    ] 10:51:59 ui:127 Starting web ui..
[INFO    ] 10:52:01 server:666 Starting server in PID 11168.
[INFO    ] 10:52:01 server:679 Serving on 0.0.0.0:8112 view at http://0.0.0.0:8112
[INFO    ] 10:52:08 server:696 Shutting down webserver
Results
Accessing http://localhost:8112/ returned a blank page with html headers
Accessing http://localhost:8112/deluge displayed "No Such Resource | No such child resource."

Test 5
Use "-b" and a leading forward slash but no trailing forward slash
Output

Code: Select all

C:\Windows\system32>"C:\Program Files (x86)\Deluge\deluge-web-debug.exe" --loglevel="info" -b /deluge
[INFO    ] 10:52:16 ui:124 Deluge ui 1.3.15
[INFO    ] 10:52:16 ui:127 Starting web ui..
[INFO    ] 10:52:18 server:666 Starting server in PID 11304.
[INFO    ] 10:52:18 server:679 Serving on 0.0.0.0:8112 view at http://0.0.0.0:8112
[INFO    ] 10:52:22 server:696 Shutting down webserver
Results
Accessing http://localhost:8112/ returned a blank page with html headers
Accessing http://localhost:8112/deluge displayed "No Such Resource | No such child resource."

Test 6
Use "-b" and both a leading forward slash and a trailing forward slash
Output

Code: Select all

C:\Windows\system32>"C:\Program Files (x86)\Deluge\deluge-web-debug.exe" --loglevel="info" -b /deluge/
[INFO    ] 10:52:29 ui:124 Deluge ui 1.3.15
[INFO    ] 10:52:29 ui:127 Starting web ui..
[INFO    ] 10:52:31 server:666 Starting server in PID 4176.
[INFO    ] 10:52:32 server:679 Serving on 0.0.0.0:8112 view at http://0.0.0.0:8112
[INFO    ] 10:52:39 server:696 Shutting down webserver
Results
Accessing http://localhost:8112/ returned a blank page with html headers
Accessing http://localhost:8112/deluge displayed "No Such Resource | No such child resource."


Further test results to follow.
instantdreams
New User
New User
Posts: 7
Joined: Fri Sep 10, 2021 5:11 pm

Re: Unable to set Base URL using deluge-web

Post by instantdreams »

Here is the source for the webpage that is displayed when the base url is set:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>Deluge: Web UI 1.3.15</title>
		
		<link rel="shortcut icon" href="/deluge/icons/deluge.png" type="image/png" />
		<link rel="icon" href="/deluge/icons/deluge.png" type="image/png" />
		<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 163dpi)" href="/deluge/icons/apple-pre-57.png" />
		<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 132dpi)" href="/deluge/icons/apple-pre-72.png" />
		<link rel="apple-touch-icon-precomposed" media="screen and (resolution: 326dpi)" href="/deluge/icons/apple-pre-114.png" />
		
		<!-- Stylesheets -->
		<link rel="stylesheet" type="text/css" href="/deluge/css/ext-all-notheme.css" />
		<link rel="stylesheet" type="text/css" href="/deluge/themes/css/xtheme-gray.css" />
		<link rel="stylesheet" type="text/css" href="/deluge/css/ext-extensions.css" />
		<link rel="stylesheet" type="text/css" href="/deluge/css/deluge.css" />

		<script type="text/javascript">
		deluge = {
			author: 'Damien Churchill <damoxc@gmail.com>',
			version: '1.3.15',
			config: {"sidebar_show_zero": false, "show_session_speed": false, "first_login": false, "theme": "gray", "base": "/deluge/", "sidebar_multiple_filters": true}
		}
		</script>

		<!-- Javascript -->
		<script type="text/javascript" src="/deluge/gettext.js"></script>
		<script type="text/javascript" src="/deluge/js/ext-base.js"></script>
		<script type="text/javascript" src="/deluge/js/ext-all.js"></script>
		<script type="text/javascript" src="/deluge/js/ext-extensions.js"></script>
		<script type="text/javascript" src="/deluge/js/deluge-all.js"></script>
		<script type="text/javascript">
			Deluge.debug = false;
		</script>
	</head>
	<body>
		<div style="background-image: url('/deluge/themes/images/default/tree/loading.gif');"></div>

		<!-- Preload icon classes -->
		<div class="ext-mb-error"></div>
		<div class="icon-ok"></div>
	</body>
</html>
Nothing is displayed or called by the page, which displays blank with the titlebar as "Deluge: Web UI 1.3.15".
instantdreams
New User
New User
Posts: 7
Joined: Fri Sep 10, 2021 5:11 pm

Re: Unable to set Base URL using deluge-web

Post by instantdreams »

I run deluged and deluge-web as a service using nssm. This has worked for a number of years with no issues. As part of the nssm configuration, I use the following arguments: --config="C:\Users\[user]\AppData\Roaming\deluge"

I performed the following steps:
1. nssm stop deluge-web
2. notepad++ C:\Users\[user]\AppData\Roaming\deluge\web.conf
3. Replace

Code: Select all

  "base": "/", 
with

Code: Select all

  "base": "/deluge", 
4. Save web.conf
5. nssm start deluge-web

After doing so, I had the following results:
* Accessing http://localhost:8112/ returned a blank page with html headers
* Accessing http://localhost:8112/deluge displayed "No Such Resource | No such child resource."

So at this point I can only conclude that either deluge-web doesn't process the base argument correctly or I'm fundamentally doing it wrong.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Unable to set Base URL using deluge-web

Post by mhertz »

A quick search reveals a bug fix applied to develop branch and mentioned not will be added to 1.3.x, so maybe can manually backport.

https://dev.deluge-torrent.org/ticket/2677

Also some more info here, e.g option only works for reverse-proxies etc: viewtopic.php?f=12&t=54520

Wiki page, with IIS server instructions etc: https://dev.deluge-torrent.org/wiki/Use ... verseProxy
instantdreams
New User
New User
Posts: 7
Joined: Fri Sep 10, 2021 5:11 pm

Re: Unable to set Base URL using deluge-web

Post by instantdreams »

mhertz wrote: Fri Sep 10, 2021 6:39 pmAlso some more info here, e.g option only works for reverse-proxies etc
I want to address this right now - this isn't correct.

My instance of Tautilli is hosted on [ip address]:8181. When I change the settings to use a base url of "tautulli" I can access it from any of these methods:
1. [localhost:8181]/tautulli - on the box hosting it
2. [ipaddress:8181/tautulli - anywhere on my network
3. [server.local:8181/tautulli - anywhere on my network
4. [domain]/tautulli - through my reverse proxy, using appropriate configuration

Therefore the proper implementation of a base url should not affect the local serving of web pages. I hear this is the same for Ombi, Lidarr, Radarr, Sonarr, Calibre, Grafana, and a whole host of other applications.

Edited to add : The reason why this doesn't and shouldn't matter is that I'm not using IIS for my reverse proxy. I'm using a separate server on my network running another application. The application should be able to server with a base url or not, especially if it says the base url option is a supported argument.
mhertz
Moderator
Moderator
Posts: 2182
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Unable to set Base URL using deluge-web

Post by mhertz »

Sorry for posting incorrect info then, and thanks for correction :) Honestly don't know anything about this, and just quoted Cas's previous statement as such.

If not getting anything out of the links, then hopefully others, better in the know, can help you out.

Good luck.
Post Reply