[FluidNC Issue#1417] Problem: I can not compile the source after enabling Authentication

未分类 bolang 4个月前 (10-14) 34次浏览

Issue #1417 | 状态: 已关闭 | 作者: alidemyr | 创建时间: 2024-12-29


Wiki Search Terms

I searched about how to enable authentication

Controller Board

MKS DLC32

Machine Description

I compile with wifi environment v3..9.3 and earlier past five versions unsuccessfully.

Input Circuits

No response

Configuration file

// Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
// Copyright (c) 2009-2011 Simen Svale Skogsrud
// Copyright (c) 2021 -	Bart Dring
// Use of this source code is governed by a GPLv3 license that can be found in the LICENSE file.

#pragma once

// This file contains compile-time configuration choices.  Most users will not need
// to directly modify these, but they are here for unusual needs, i.e.
// performance tuning or adjusting to non-typical machines.

// IMPORTANT: Any changes here require recompilation.

/*
ESP 32 Notes

Some features should not be changed. See notes below.

*/

// It is no longer necessary to edit this file to choose
// a machine configuration; edit machine.h instead
// machine.h is #included below, after some definitions
// that the machine file might choose to undefine.

const int MAXNAXIS = 6;

const int MAXMESSAGELINE = 256;

// Axis array index values. Must start with 0 and be continuous.
// Note: You set the number of axes used by changing MAXNAXIS.
// Be sure to define pins or servos in the machine definition file.
const int X_AXIS = 0;  // Axis indexing value.
const int Y_AXIS = 1;
const int Z_AXIS = 2;
const int A_AXIS = 3;
const int B_AXIS = 4;
const int C_AXIS = 5;

const int X2AXIS = (XAXIS + MAXNAXIS);
const int Y2AXIS = (YAXIS + MAXNAXIS);
const int Z2AXIS = (ZAXIS + MAXNAXIS);
const int A2AXIS = (AAXIS + MAXNAXIS);
const int B2AXIS = (BAXIS + MAXNAXIS);
const int C2AXIS = (CAXIS + MAXNAXIS);

const int SUPPORTTASKCORE = 0;  // Reference: CONFIGARDUINORUNNING_CORE = 1

// Serial baud rate
// OK to change, but the ESP32 boot text is 115200, so you will not see that is your
// serial monitor, sender, etc uses a different value than 115200
const int BAUD_RATE = 115200;

//Connect to your local AP with these credentials
//#define CONNECTTOSSID  "your SSID"
//#define SSID_PASSWORD  "your SSID password"
//CONFIGUREEYECATCHBEGIN (DO NOT MODIFY THIS LINE)

// Warning! The current authentication implementation is too weak to provide
// security against an attacker, since passwords are stored and transmitted
// "in the clear" over unsecured channels.  It should be treated as a
// "friendly suggestion" to prevent unwitting dangerous actions, rather than
// as effective security against malice.
#define ENABLE_AUTHENTICATION
// CONFIGUREEYECATCHEND (DO NOT MODIFY THIS LINE)

#ifdef ENABLE_AUTHENTICATION
const char* const DEFAULTADMINPWD   = "admin";
const char* const DEFAULTUSERPWD    = "user";
const char* const DEFAULTADMINLOGIN = "admin";
const char* const DEFAULTUSERLOGIN  = "user";
#endif

// Upon a successful probe cycle, this option provides immediately feedback of the probe coordinates
// through an automatically generated message. If disabled, users can still access the last probe
// coordinates through the '$#' print parameters command.
const bool MESSAGEPROBECOORDINATES = true;  // Enabled by default. Comment to disable.

// When the microprocess is power cycled or hard reset with the reset button, the default boot state
// is no ALARM.  This makes it simpler for new users.  When homing is enabled and limit switches are
// present, the initial state on boot is ALARM, indicatint that the position is unknown, so the user
// must home the system before proceeding. The FORCE_INITIALIZATION option overrides the no-ALARM
// behavior, so the system boots into ALARM state regardless of homing presence. This option is
// provided for OEMs and LinuxCNC users that prefer this behavior.
const bool FORCEINITIALIZATIONALARM = false;  // Default disabled. Uncomment to enable.

// ---------------------------------------------------------------------------------------
// ADVANCED CONFIGURATION OPTIONS:

// Configure rapid, feed, and spindle override settings. These values define the max and min
// allowable override values and the coarse and fine increments per command received. Please
// note the allowable values in the descriptions following each define.
namespace FeedOverride {
    const int Default         = 100;  // 100%. Don't change this value.
    const int Max             = 200;  // Percent of programmed feed rate (100-255). Usually 120% or 200%
    const int Min             = 10;   // Percent of programmed feed rate (1-100). Usually 50% or 1%
    const int CoarseIncrement = 10;   // (1-99). Usually 10%.
    const int FineIncrement   = 1;    // (1-99). Usually 1%.
};
namespace RapidOverride {
    const int Default  = 100;  // 100%. Don't change this value.
    const int Medium   = 50;   // Percent of rapid (1-99). Usually 50%.
    const int Low      = 25;   // Percent of rapid (1-99). Usually 25%.
    const int ExtraLow = 5;    // Percent of rapid (1-99). Usually 5%.  Not Supported
};

namespace SpindleSpeedOverride {
    const int Default         = 100;  // 100%. Don't change this value.
    const int Max             = 200;  // Percent of programmed spindle speed (100-255). Usually 200%.
    const int Min             = 10;   // Percent of programmed spindle speed (1-100). Usually 10%.
    const int CoarseIncrement = 10;   // (1-99). Usually 10%.
    const int FineIncrement   = 1;    // (1-99). Usually 1%.
};

// When a M2 or M30 program end command is executed, most GCode states are restored to their defaults.
// This compile-time option includes the restoring of the feed, rapid, and spindle speed override values
// to their default values at program end.
const bool RESTOREOVERRIDESAFTERPROGRAMEND = true;  // Default enabled. Comment to disable.

// Some status report data isn't necessary for realtime, only intermittently, because the values don't
// change often. The following macros configures how many times a status report needs to be called before
// the associated data is refreshed and included in the status report. However, if one of these value
// changes, this data will be included in the next status report, regardless of the current count.
// This reduces the communication overhead of high frequency reporting and agressive streaming.
// The busy and idle refresh counts send refreshes more frequently when not doing anything important.
// With a good GUI, this data doesn't need to be refreshed very often, on the order of a several seconds.
// NOTE: WCO refresh must be 2 or greater. OVR refresh must be 1 or greater.

const int REPORTOVRREFRESHBUSYCOUNT = 20;  // (1-255)
const int REPORTOVRREFRESHIDLECOUNT = 10;  // (1-255) Must be less than or equal to the busy count
const int REPORTWCOREFRESHBUSYCOUNT = 30;  // (2-255)
const int REPORTWCOREFRESHIDLECOUNT = 10;  // (2-255) Must be less than or equal to the busy count

// The temporal resolution of the acceleration management subsystem. A higher number gives smoother
// acceleration, particularly noticeable on machines that run at very high feedrates, but may negatively
// impact performance. The correct value for this parameter is machine dependent, so it's advised to
// set this only as high as needed. Approximate successful values can widely range from 50 to 200 or more.
// NOTE: Changing this value also changes the execution time of a segment in the step segment buffer.
// When increasing this value, this stores less overall time in the segment buffer and vice versa. Make
// certain the step segment buffer is increased/decreased to account for these changes.
const int ACCELERATIONTICKSPER_SECOND = 100;

// Sets which axis the tool length offset is applied. Assumes the spindle is always parallel with
// the selected axis with the tool oriented toward the negative direction. In other words, a positive
// tool length offset value is subtracted from the current location.
const int TOOLLENGTHOFFSETAXIS = ZAXIS;  // Default z-axis. Valid values are XAXIS, YAXIS, or Z_AXIS.

// Minimum planner junction speed. Sets the default minimum junction speed the planner plans to at
// every buffer block junction, except for starting from rest and end of the buffer, which are always
// zero. This value controls how fast the machine moves through junctions with no regard for acceleration
// limits or angle between neighboring block line move directions. This is useful for machines that can't
// tolerate the tool dwelling for a split second, i.e. 3d printers or laser cutters. If used, this value
// should not be much greater than zero or to the minimum value necessary for the machine to work.
const float MINIMUMJUNCTIONSPEED = 0.0f;  // (mm/min)

// Sets the minimum feed rate the planner will allow. Any value below it will be set to this minimum
// value. This also ensures that a planned motion always completes and accounts for any floating-point
// round-off errors. Although not recommended, a lower value than 1.0 mm/min will likely work in smaller
// machines, perhaps to 0.1mm/min, but your success may vary based on multiple factors.
const double MINIMUMFEEDRATE = 1.0;  // (mm/min)

// Number of arc generation iterations by small angle approximation before exact arc trajectory
// correction with expensive sin() and cos() calcualtions. This parameter maybe decreased if there
// are issues with the accuracy of the arc generations, or increased if arc execution is getting
// bogged down by too many trig calculations.
const int NARCCORRECTION = 12;  // Integer (1-255)

// The arc G2/3 GCode standard is problematic by definition. Radius-based arcs have horrible numerical
// errors when arc at semi-circles(pi) or full-circles(2*pi). Offset-based arcs are much more accurate
// but still have a problem when arcs are full-circles (2*pi). This define accounts for the floating
// point issues when offset-based arcs are commanded as full circles, but get interpreted as extremely
// small arcs with around machine epsilon (1.2e-7rad) due to numerical round-off and precision issues.
// This define value sets the machine epsilon cutoff to determine if the arc is a full-circle or not.
// NOTE: Be very careful when adjusting this value. It should always be greater than 1.2e-7 but not too
// much greater than this. The default setting should capture most, if not all, full arc error situations.
const double ARCANGULARTRAVEL_EPSILON = 5E-7;  // Float (radians)

// Serial send and receive buffer size. The receive buffer is often used as another streaming
// buffer to store incoming blocks to be processed when ready. Most streaming
// interfaces will character count and track each block send to each block response. So,
// increase the receive buffer if a deeper receive buffer is needed for streaming and avaiable
// memory allows. The send buffer primarily handles messages. Only increase if large
// messages are sent and the system begins to stall, waiting to send the rest of the message.
// #define RXBUFFERSIZE 128 // (1-254) Uncomment to override defaults in serial.h
// #define TXBUFFERSIZE 100 // (1-254)

// Writing to non-volatile storage (NVS) can take a long time and interfere with timely instruction
// execution, causing problems for the stepper ISRs and serial comm ISRs and subsequent loss of
// stepper position and serial data. This configuration option forces the planner buffer to completely
// empty whenever the NVS is written, to prevent any chance of lost steps.
// It doesn't prevent loss of serial Rx data, especially if a GUI is premptively filling up the
// serial Rx buffer.  GUIs should detect GCodes that write to NVS - notably G10,G28.1,G30.1 -
// and wait for an 'ok' before sending more data.
// NOTE: Most setting changes - $ commands - are blocked when a job is running. Coordinate setting
// GCode commands (G10,G28/30.1) are not blocked, since they are part of an active streaming job.
// This option forces a planner buffer sync only with such GCode commands.
const bool FORCEBUFFERSYNCDURINGNVS_WRITE = true;  // Default enabled. Comment to disable.

// In old versions of Grbl, v0.9 and prior, there is a bug where the WPos: work position reported
// may not correlate to what is executing, because WPos: is based on the GCode parser state, which
// can be several motions behind. This option forces the planner buffer to empty, sync, and stop
// motion whenever there is a command that alters the work coordinate offsets G10,G43.1,G92,G54-59.
// This is the simplest way to ensure WPos: is always correct. Fortunately, it's exceedingly rare
// that any of these commands are used need continuous motions through them.
const bool FORCEBUFFERSYNCDURINGWCO_CHANGE = true;  // Default enabled. Comment to disable.

// By default, feed rate overrides are disabled for all G38.x probe cycle commands. Although this
// may be different than some pro-class machine control, it's arguable that it should be this way.
// Most probe sensors produce different levels of error that is dependent on rate of speed. By
// keeping probing cycles to their programmed feed rates, the probe sensor should be a lot more
// repeatable. If needed, you can disable this behavior by uncommenting the define below.
const bool ALLOWFEEDOVERRIDEDURINGPROBE_CYCLES = false;

const int MAXNI2C = 2;

#include "NutsBolts.h"

Startup Messages

--

User Interface Software

WebUI

What happened?

I tried to compile the source after enabling authentication but could not. Everything is just fine without authentication.

GCode File

No response

Other Information

* Executing task: C:\Users\aliko\.platformio\penv\Scripts\platformio.exe run

Processing wifi (board: esp32dev; platform: https://github.com/platformio/platform-espressif32.git; framework: arduino)
—————————————————————————————————————————————————————————————————————–
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.9.0+sha.492d38b) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
– framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b
– tool-esptoolpy @ 1.40501.0 (4.5.1)
– toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 38 compatible libraries
Scanning dependencies…
Dependency Graph
|– TMCStepper @ 0.7.3
|– ESP8266 and ESP32 OLED driver for SSD1306 displays @ 4.4.1
|– WebSockets @ 2.4.1+sha.5713ffb
|– WiFi @ 2.0.0+sha.47668f6
|– FS @ 2.0.0
|– WiFiClientSecure @ 2.0.0
|– ArduinoOTA @ 2.0.0
|– WebServer @ 2.0.0
|– DNSServer @ 2.0.0
|– Update @ 2.0.0
Building in release mode
Compiling .pio\build\wifi\src\esp32\PwmPin.cpp.o
Compiling .pio\build\wifi\src\esp32\StartupLog.cpp.o
Compiling .pio\build\wifi\src\esp32\StepTimer.cpp.o
Compiling .pio\build\wifi\src\esp32\coredump.c.o
Compiling .pio\build\wifi\src\esp32\delay_usecs.cpp.o
Compiling .pio\build\wifi\src\esp32\esp_error.cpp.o
Compiling .pio\build\wifi\src\esp32\gpio.cpp.o
Compiling .pio\build\wifi\src\esp32\gpio_dump.cpp.o
Compiling .pio\build\wifi\src\esp32\i2c.cpp.o
Compiling .pio\build\wifi\src\esp32\i2s_engine.c.o
Compiling .pio\build\wifi\src\esp32\littlefs.cpp.o
Compiling .pio\build\wifi\src\esp32\localfs.cpp.o
Compiling .pio\build\wifi\src\esp32\restart.cpp.o
Compiling .pio\build\wifi\src\esp32\rmt_engine.c.o
Compiling .pio\build\wifi\src\esp32\sdspi.cpp.o
Compiling .pio\build\wifi\src\esp32\spi.cpp.o
Compiling .pio\build\wifi\src\esp32\spiffs.cpp.o
Compiling .pio\build\wifi\src\esp32\timed_engine.c.o
Compiling .pio\build\wifi\src\esp32\tmc_spi.cpp.o
Compiling .pio\build\wifi\src\esp32\tmcspisupport.c.o
Compiling .pio\build\wifi\src\esp32\wdt.cpp.o
Compiling .pio\build\wifi\src\src\Channel.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\AfterParse.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\Completer.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\GCodeParam.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\Generator.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\JsonGenerator.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\LegacySettingRegistry.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\Parser.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\RuntimeSetting.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\Tokenizer.cpp.o
Compiling .pio\build\wifi\src\src\Configuration\Validator.cpp.o
Compiling .pio\build\wifi\src\src\Control.cpp.o
Compiling .pio\build\wifi\src\src\ControlPin.cpp.o
Compiling .pio\build\wifi\src\src\CoolantControl.cpp.o
Compiling .pio\build\wifi\src\src\CustomCode.cpp.o
Compiling .pio\build\wifi\src\src\Error.cpp.o
Compiling .pio\build\wifi\src\src\Expression.cpp.o
Compiling .pio\build\wifi\src\src\FileCommands.cpp.o
Compiling .pio\build\wifi\src\src\FileStream.cpp.o
Compiling .pio\build\wifi\src\src\Flowcontrol.cpp.o
Compiling .pio\build\wifi\src\src\FluidError.cpp.o
Compiling .pio\build\wifi\src\src\FluidPath.cpp.o
Compiling .pio\build\wifi\src\src\GCode.cpp.o
Compiling .pio\build\wifi\src\src\HashFS.cpp.o
Compiling .pio\build\wifi\src\src\InputFile.cpp.o
In file included from FluidNC/src/SDCard.h:22,
from FluidNC/src/Machine/MachineConfig.h:16,
from FluidNC/src/Channel.cpp:6:
FluidNC/src/WebUI/Authentication.h:16:36: error: invalid use of incomplete type ‘class StringSetting’
class AuthPasswordSetting : public StringSetting {
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:14:7: note: forward declaration of ‘class StringSetting’
class StringSetting;
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h: In constructor ‘AuthPasswordSetting::AuthPasswordSetting(const char, const char, const char*)’:
FluidNC/src/WebUI/Authentication.h:19:9: error: type ‘StringSetting’ is not a direct base of ‘AuthPasswordSetting’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: error: ‘WEBSET’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: note: suggested alternative: ‘FD_SET’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
FD_SET
FluidNC/src/WebUI/Authentication.h:19:44: error: ‘WA’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~
FluidNC/src/WebUI/Authentication.h: In member function ‘Error AuthPasswordSetting::setStringValue(std::string_view)’:
FluidNC/src/WebUI/Authentication.h:29:37: error: incomplete type ‘StringSetting’ used in nested name specifier
return StringSetting::setStringValue(s);
^~~~~~~~~~~~~~
Compiling .pio\build\wifi\src\src\JSONEncoder.cpp.o
Compiling .pio\build\wifi\src\src\Job.cpp.o
In file included from FluidNC/src/SDCard.h:22,
from FluidNC/src/Configuration/../Machine/MachineConfig.h:16,
from FluidNC/src/Configuration/Completer.cpp:5:
FluidNC/src/WebUI/Authentication.h:16:36: error: invalid use of incomplete type ‘class StringSetting’
class AuthPasswordSetting : public StringSetting {
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:14:7: note: forward declaration of ‘class StringSetting’
class StringSetting;
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h: In constructor ‘AuthPasswordSetting::AuthPasswordSetting(const char, const char, const char*)’:
FluidNC/src/WebUI/Authentication.h:19:9: error: type ‘StringSetting’ is not a direct base of ‘AuthPasswordSetting’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: error: ‘WEBSET’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: note: suggested alternative: ‘DSRSET’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
DSRSET
FluidNC/src/WebUI/Authentication.h:19:44: error: ‘WA’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~
FluidNC/src/WebUI/Authentication.h: In member function ‘Error AuthPasswordSetting::setStringValue(std::string_view)’:
FluidNC/src/WebUI/Authentication.h:29:37: error: incomplete type ‘StringSetting’ used in nested name specifier
return StringSetting::setStringValue(s);
^~~~~~~~~~~~~~
* [.pio\build\wifi\src\src\Channel.cpp.o] Error 1
* [.pio\build\wifi\src\src\Configuration\Completer.cpp.o] Error 1
In file included from FluidNC/src/Settings.h:4,
from FluidNC/src/FileCommands.cpp:5:
FluidNC/src/WebUI/Authentication.h:16:36: error: invalid use of incomplete type ‘class StringSetting’
class AuthPasswordSetting : public StringSetting {
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:14:7: note: forward declaration of ‘class StringSetting’
class StringSetting;
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h: In constructor ‘AuthPasswordSetting::AuthPasswordSetting(const char, const char, const char*)’:
FluidNC/src/WebUI/Authentication.h:19:9: error: type ‘StringSetting’ is not a direct base of ‘AuthPasswordSetting’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: error: ‘WEBSET’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: note: suggested alternative: ‘INTSET’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
INTSET
FluidNC/src/WebUI/Authentication.h:19:44: error: ‘WA’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~
FluidNC/src/WebUI/Authentication.h: In member function ‘Error AuthPasswordSetting::setStringValue(std::string_view)’:
FluidNC/src/WebUI/Authentication.h:29:37: error: incomplete type ‘StringSetting’ used in nested name specifier
return StringSetting::setStringValue(s);
^~~~~~~~~~~~~~
In file included from FluidNC/src/Settings.h:4,
from FluidNC/src/GCode.cpp:9:
FluidNC/src/WebUI/Authentication.h:16:36: error: invalid use of incomplete type ‘class StringSetting’
class AuthPasswordSetting : public StringSetting {
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:14:7: note: forward declaration of ‘class StringSetting’
class StringSetting;
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h: In constructor ‘AuthPasswordSetting::AuthPasswordSetting(const char, const char, const char*)’:
FluidNC/src/WebUI/Authentication.h:19:9: error: type ‘StringSetting’ is not a direct base of ‘AuthPasswordSetting’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: error: ‘WEBSET’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: note: suggested alternative: ‘INTSET’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
INTSET
FluidNC/src/WebUI/Authentication.h:19:44: error: ‘WA’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~
FluidNC/src/WebUI/Authentication.h: In member function ‘Error AuthPasswordSetting::setStringValue(std::string_view)’:
FluidNC/src/WebUI/Authentication.h:29:37: error: incomplete type ‘StringSetting’ used in nested name specifier
return StringSetting::setStringValue(s);
^~~~~~~~~~~~~~
In file included from FluidNC/src/SDCard.h:22,
from FluidNC/src/Machine/MachineConfig.h:16,
from FluidNC/src/FileStream.cpp:5:
FluidNC/src/WebUI/Authentication.h:16:36: error: invalid use of incomplete type ‘class StringSetting’
class AuthPasswordSetting : public StringSetting {
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:14:7: note: forward declaration of ‘class StringSetting’
class StringSetting;
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h: In constructor ‘AuthPasswordSetting::AuthPasswordSetting(const char, const char, const char*)’:
FluidNC/src/WebUI/Authentication.h:19:9: error: type ‘StringSetting’ is not a direct base of ‘AuthPasswordSetting’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: error: ‘WEBSET’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: note: suggested alternative: ‘INTSET’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
INTSET
FluidNC/src/WebUI/Authentication.h:19:44: error: ‘WA’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~
FluidNC/src/WebUI/Authentication.h: In member function ‘Error AuthPasswordSetting::setStringValue(std::string_view)’:
FluidNC/src/WebUI/Authentication.h:29:37: error: incomplete type ‘StringSetting’ used in nested name specifier
return StringSetting::setStringValue(s);
^~~~~~~~~~~~~~
* [.pio\build\wifi\src\src\GCode.cpp.o] Error 1
* [.pio\build\wifi\src\src\FileStream.cpp.o] Error 1
* [.pio\build\wifi\src\src\FileCommands.cpp.o] Error 1
In file included from FluidNC/src/SDCard.h:22,
from FluidNC/src/Machine/MachineConfig.h:16,
from FluidNC/src/FluidPath.cpp:8:
FluidNC/src/WebUI/Authentication.h:16:36: error: invalid use of incomplete type ‘class StringSetting’
class AuthPasswordSetting : public StringSetting {
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:14:7: note: forward declaration of ‘class StringSetting’
class StringSetting;
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h: In constructor ‘AuthPasswordSetting::AuthPasswordSetting(const char, const char, const char*)’:
FluidNC/src/WebUI/Authentication.h:19:9: error: type ‘StringSetting’ is not a direct base of ‘AuthPasswordSetting’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~~~~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: error: ‘WEBSET’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
FluidNC/src/WebUI/Authentication.h:19:36: note: suggested alternative: ‘L_SET’
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~~~~~
L_SET
FluidNC/src/WebUI/Authentication.h:19:44: error: ‘WA’ was not declared in this scope
StringSetting(description, WEBSET, WA, NULL, name, defVal, MINLOCALPASSWORDLENGTH, MAXLOCALPASSWORDLENGTH) {}
^~
FluidNC/src/WebUI/Authentication.h: In member function ‘Error AuthPasswordSetting::setStringValue(std::string_view)’:
FluidNC/src/WebUI/Authentication.h:29:37: error: incomplete type ‘StringSetting’ used in nested name specifier
return StringSetting::setStringValue(s);
^~~~~~~~~~~~~~
* [.pio\build\wifi\src\src\FluidPath.cpp.o] Error 1
========================================================================================== [FAILED] Took 8.45 seconds ==========================================================================================

Environment Status Duration
————- ——– ————
wifi FAILED 00:00:08.448
===================================================================================== 1 failed, 0 succeeded in 00:00:08.448 =====================================================================================


评论 (9)

#1 – MitchBradley 于 2024-12-29

The authentication code has not been maintained or tested for several years. We are not supporting it anymore so if you need to use it, it will be up to you to figure out how to fix it.


#2 – alidemyr 于 2024-12-29

> The authentication code has not been maintained or tested for several years. We are not supporting it anymore so if you need to use it, it will be up to you to figure out how to fix it.

Hello!

Thank you for your quick reply. I built a machine at the shared workshop and I don’t want to let unauthorized someone to use the laser cutter because of the safety issues. I reassembled the usb port of the board and I only use the machine with TCP. I set a statical IP and clever students discovered that while I were controlling the machine with LightBurn. I would appreciate it if you could figure it out and share with anyone who needs that layer of security.

Thanks in advance,
Ali.


#3 – MitchBradley 于 2024-12-29

Spend $10 on an old wifi router and give the machine its own network for which only you know the credentials.


#4 – alidemyr 于 2024-12-29

> Spend $10 on an old wifi router and give the machine its own network for which only you know the credentials.

The problem is anyone can connect the machine who knows the device IP. I want to put a password to WebUI to prevent people who connect to the same WiFi. A router could fix it but everyone is using own PC. If there were a stationary PC, I could use an external modem or I could use the machine with AP mode, instead of STA.

I hope I did not misunderstand your solution.

Thank you,
Ali.


#5 – MitchBradley 于 2024-12-29

The dedicated wifi router will have its own ssid and password so random people will not be able to connect to that network. The fluidnc IP will only exist on that network.

For a little extra obscurity, you could make it a hidden SSID.


#6 – MitchBradley 于 2024-12-29

The compiled-in authentication feature would not work with TCP/Lightburn anyway. It only applies to WebUI and does nothing to protect against the TCP streaming channel. Doing security right is very difficult and the old WebUI authentication is not very secure. That is the main reason why we decided to drop it. We don’t have the time or skill to do proper security, so if you need it, it is best to wrap the FluidNC system behind a gateway – i.e. a dedicated router – whose security was implemented by security specialists.


#7 – alidemyr 于 2024-12-29

Thank you for your reply. When I saw authentication future, I jus wondered if I could use it to solve my problem with onboard future without adding extra hardware. I will consider your guess as a solution of my problem. If I could enable authentication, I could have kept using with WebUI. Maybe I can try to find a handshake algorithm during connection.

Thanks in advance,
Ali


#8 – MitchBradley 于 2024-12-29

The extra hardware costs a few dollars at most, and many people have old routers that have been taken out of service, that can be had for nothing. The time I have already spent explaining this is substantially more costly.


#9 – alidemyr 于 2024-12-29

So, I tried to set a password to Bluetooth connection. Esp32 does not support setting a pass key also. I will try to figure out a handshake algorithm. If I succeed in, I would share my work. Thank you for giving your time.


原始Issue: https://github.com/bdring/FluidNC/issues/1417

喜欢 (0)