mirror of
https://github.com/zoriya/flood.git
synced 2025-12-06 07:16:18 +00:00
config: move floodServerProxy to client DevServer script
This commit is contained in:
@@ -20,7 +20,10 @@ const paths = require('../../shared/config/paths');
|
|||||||
const config = require('../config/webpack.config.dev');
|
const config = require('../config/webpack.config.dev');
|
||||||
const createDevServerConfig = require('../config/webpackDevServer.config');
|
const createDevServerConfig = require('../config/webpackDevServer.config');
|
||||||
|
|
||||||
const userConfig = require('../../config');
|
const {proxy: floodServerProxy} = require('yargs').env('FLOOD_OPTION_').option('proxy', {
|
||||||
|
default: 'http://127.0.0.1:3000',
|
||||||
|
type: 'string',
|
||||||
|
}).argv;
|
||||||
|
|
||||||
const isInteractive = process.stdout.isTTY;
|
const isInteractive = process.stdout.isTTY;
|
||||||
|
|
||||||
@@ -46,7 +49,7 @@ choosePort(HOST, DEFAULT_PORT)
|
|||||||
// Create a webpack compiler that is configured with custom messages.
|
// Create a webpack compiler that is configured with custom messages.
|
||||||
const compiler = webpack(config);
|
const compiler = webpack(config);
|
||||||
// Serve webpack assets generated by the compiler over a web sever.
|
// Serve webpack assets generated by the compiler over a web sever.
|
||||||
const serverConfig = createDevServerConfig(userConfig.floodServerProxy, urls.lanUrlForConfig);
|
const serverConfig = createDevServerConfig(floodServerProxy, urls.lanUrlForConfig);
|
||||||
const devServer = new WebpackDevServer(compiler, serverConfig);
|
const devServer = new WebpackDevServer(compiler, serverConfig);
|
||||||
// Launch WebpackDevServer.
|
// Launch WebpackDevServer.
|
||||||
devServer.listen(port, HOST, (err) => {
|
devServer.listen(port, HOST, (err) => {
|
||||||
|
|||||||
@@ -155,12 +155,6 @@ const {argv} = yargs
|
|||||||
hidden: true,
|
hidden: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
})
|
})
|
||||||
.option('proxy', {
|
|
||||||
default: 'http://127.0.0.1:3000',
|
|
||||||
describe: 'DEV ONLY: See the "Local Development" section of README.md',
|
|
||||||
hidden: true,
|
|
||||||
type: 'string',
|
|
||||||
})
|
|
||||||
.option('test', {
|
.option('test', {
|
||||||
default: false,
|
default: false,
|
||||||
describe: 'DEV ONLY: Test setup',
|
describe: 'DEV ONLY: Test setup',
|
||||||
@@ -291,7 +285,6 @@ const result = configSchema.safeParse({
|
|||||||
configUser: connectionSettings,
|
configUser: connectionSettings,
|
||||||
floodServerHost: argv.host,
|
floodServerHost: argv.host,
|
||||||
floodServerPort: argv.port,
|
floodServerPort: argv.port,
|
||||||
floodServerProxy: argv.proxy,
|
|
||||||
maxHistoryStates: argv.maxhistorystates,
|
maxHistoryStates: argv.maxhistorystates,
|
||||||
torrentClientPollInterval: argv.clientpoll,
|
torrentClientPollInterval: argv.clientpoll,
|
||||||
torrentClientPollIntervalIdle: argv.clientpollidle,
|
torrentClientPollIntervalIdle: argv.clientpollidle,
|
||||||
|
|||||||
@@ -73,11 +73,6 @@ export const configSchema = object({
|
|||||||
// The port that Flood should listen for web connections on. [default: 3000]
|
// The port that Flood should listen for web connections on. [default: 3000]
|
||||||
floodServerPort: number().int().positive(),
|
floodServerPort: number().int().positive(),
|
||||||
|
|
||||||
// CLI argument: --proxy
|
|
||||||
// Used for development only. Not used in production.
|
|
||||||
// See the "Local Development" section of README.md for detail.
|
|
||||||
floodServerProxy: string().url().optional(),
|
|
||||||
|
|
||||||
// CLI argument: --maxhistorystates
|
// CLI argument: --maxhistorystates
|
||||||
// Flood keeps a history of torrent download and upload speeds.
|
// Flood keeps a history of torrent download and upload speeds.
|
||||||
// This value dictates the number of individual records per period to keep.
|
// This value dictates the number of individual records per period to keep.
|
||||||
|
|||||||
Reference in New Issue
Block a user