Setting the baseURI parameter in config.js to anything else then "/" flood won't load to the login screen. The web interface says it succeeded in
Authentication Status
Flood Settings
but then it keeps waiting for something.
During the website loading the URL rewrites back from http://
Here is what NodeJS shows:
$ npm start
[email protected] start /opt/flood
node server/bin/www
GET /flood 200 327.112 ms - 667
GET /style.css 304 2.660 ms - -
GET /app.js 304 3.136 ms - -
GET /flood/auth/verify?1502563159849 200 59.415 ms - 667
GET /fonts/Roboto-regular/Roboto-regular.woff2 304 1.097 ms - -
GET /fonts/Roboto-500/Roboto-500.woff2 304 0.969 ms - -
GET /flood/api/activity-stream?historySnapshot=fiveMin 200 56.154 ms - 667
GET /fonts/Roboto-italic/Roboto-italic.woff2 304 1.075 ms - -
GET /fonts/Roboto-700/Roboto-700.woff2 304 0.750 ms - -
GET /flood/api/client/settings 200 34.012 ms - 667
GET /flood/api/settings 200 23.943 ms - 667
And my config file
$ cat config.js
const CONFIG = {
baseURI: '/flood',
dbCleanInterval: 1000 * 60 * 60,
dbPath: './server/db/',
floodServerHost: '192.168.0.25',
floodServerPort: 3000,
maxHistoryStates: 30,
pollInterval: 1000 * 5,
secret: 'flood',
scgi: {
socket: true,
socketPath: '/home/marcel/rpc.socket',
},
ssl: false,
sslKey: '/absolute/path/to/key/',
sslCert: '/absolute/path/to/certificate/',
torrentClientPollInterval: 1000 * 2
};
Hi @jfurrow
That's my problem too ...
GET /api/client/settings 500 13.364 ms - 85
(500 it is red)
you can see:
www.i.imgur.com/dTU8UPC.png
hi @marcel-st
Was this problem solved for you?
@BenYamin313 If 'Flood Settings' doesn't load, it often means that Flood couldn't connect to rtorrent. Are you sure that isn't the problem?
@SanPilot ,Yes right there
Look
/home/User/.rtorrent.rc
const CONFIG = {
baseURI: '/',
dbCleanInterval: 1000 * 60 * 60,
dbPath: './server/db/',
floodServerHost: '176.31.2.168',
floodServerPort: 3000,
maxHistoryStates: 30,
pollInterval: 1000 * 5,
secret: 'flood',
scgi: {
host: '127.0.0.1',
port: 5000,
socket: false,
socketPath: '/tmp/rtorrent.sock'
},
ssl: false,
sslKey: '/absolute/path/to/key/',
sslCert: '/absolute/path/to/certificate/',
torrentClientPollInterval: 1000 * 2
};
module.exports = CONFIG;
/home/flood/flood/config.js
directory = ~/Downloads
session = /home/User/.rtorrent-session
schedule = low_diskspace,5,60,close_low_diskspace=100M
port_range = 6790-6999
encryption = allow_incoming,enable_retry,try_outgoing
scgi_port = 127.0.0.1:5000
I get this too. Setting baseURI to anything else than '/' breaks flood. Only '/' works for me.
First time setting it up for me, I changed the baseURI to /flood. Am getting this error
Refused to execute script from '...8443/app.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
I'm just getting a plain white screen, not sure if related to this issue or not
EDIT:
Took away the baseURI and it allowed me to open the app
The baseURI has a problem
Both code have Error
baseURI: '/',
baseURI: '/flood',
webserver = apache
How did you guys set up the proxy in apache?
I have this in my vhost.include:
ProxyPass /flood http://localhost:3030
ProxyPassReverse /flood http://localhost:3030
I'm using nginx
nginx.conf:
location /flood {
include proxy_params;
proxy_pass http://127.0.0.1:3000;
}
proxy_params.conf:
````
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Ssl on;
````
(Some of those params are for other apps)
When using the baseURI option, Flood will prefix all client requests with that value. You need something (like nginx or Apache or whatever else) to forward _all_ requests from this prefixed value to the root of the Flood server.
Here's a very simple nginx config example, assuming that baseURI is set to /flood/ and the Flood server is running at localhost:3000:
location /flood {
rewrite ^/flood/(.*) /$1 break;
proxy_pass http://localhost:3000;
}
This question comes up somewhat frequently, so this definitely should be documented more clearly.
I still can't get it to work properly.
This is part of the html is being sent to my browser
<link rel="stylesheet" href="./style.css"><script>window.floodConfig = {baseURI: '/flood/', maxHistoryStates: 30, pollInterval: 5000};</script></head><body><div class="container" id="app"></div><script src="./app.js"></script>
Notice that baseURI is set to /flood/, which is what is in my config.js, but the stylesheet and script source are not pulling that info in.
I was able to get it working, but I had to modify https://github.com/jfurrow/flood/blob/master/server/views/layout.pug
Instead of "./file", I had to change them all to baseURI+"/file" (For all the file's on that page, stylesheet, app.js, etc...). However, this only seems to partially fix the issue. The app works fine, but the URL in my browser window does not show the baseURI.
@Sparticuz did you modify your nginx config to forward all requests to the Flood server? Specifically this line:
rewrite ^/flood/(.*) /$1 break;
I assure you there is no need to modify the layout file to get this working.
nginx:
location /flood {
rewrite ^/flood/(.*) /$1 break;
proxy_pass http://127.0.0.1:3000;
}
config.js:
const CONFIG = {
baseURI: '/flood/',
It is definitely not loading the correct things. Here is the HTML that my browser receives when using the above settings: (example.com/flood) (confirmed after restarting both flood and nginx)
<!DOCTYPE html><html><head><title>Flood</title><link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png"><link rel="manifest" href="./manifest.json"><link rel="mask-icon" href="./safari-pinned-tab.svg" color="#0e2337"><meta name="theme-color" content="#ffffff"><link rel="stylesheet" href="./style.css"><script>window.floodConfig = {baseURI: '/flood/', maxHistoryStates: 30, pollInterval: 5000};</script></head><body><div class="container" id="app"></div><script src="./app.js"></script></body></html>
Obviously, ./app.js won't exist there, it should be pulling in /flood/app.js. I was able to fix it by modifying the layout.pug file to pull in the baseURI into each asset it tried to load. I don't know react at all, so I don't know if some other component rewrites the url after the fact.
OK, I just went to example.com/flood/ and it worked. (Extra / at the end of the url)