FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.12k stars 223 forks source link

PrinterManagement: create printer with FQDN #560

Open osiktech opened 1 year ago

osiktech commented 1 year ago

Hi,

While trying out the printermanagement feature of FOG I noticed that it is not possible to use a FQDN as described here https://docs.fogproject.org/en/latest/management/web/printers (unter TCP/IP printers). This seems to be a database related issue as the length of pIP column is VARCHAR(20). It is also not possible to add a port via web UI as described in the docs:

Printer IP (optional)

This is ip address of an IP based printers only, this can take the
form of 1.2.3.4:9100 or 1.2.4.5 or printer-dns-hostname or
printerName.domain.com. If the port doesn't exist already, it
will create a printer TCP/IP port with the name given in the port
field to point to this address

SQL create table

CREATE TABLE `printers` (
  `pID` int(11) NOT NULL AUTO_INCREMENT,
  `pPort` longtext NOT NULL,
  `pDefFile` longtext NOT NULL,
  `pModel` varchar(250) NOT NULL,
  `pAlias` varchar(250) NOT NULL,
  `pConfig` varchar(10) NOT NULL,
  `pConfigFile` varchar(255) NOT NULL,
  `pIP` varchar(20) NOT NULL,
  `pAnon2` varchar(10) NOT NULL,
  `pAnon3` varchar(10) NOT NULL,
  `pAnon4` varchar(10) NOT NULL,
  `pAnon5` varchar(10) NOT NULL,
  `pDesc` longtext DEFAULT NULL,
  PRIMARY KEY (`pID`),
  UNIQUE KEY `pAlias` (`pAlias`),
  KEY `new_index1` (`pModel`),
  KEY `new_index2` (`pAlias`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci ROW_FORMAT=DYNAMIC;

Also it is not possible add the port of the tcp/ip printer using colon notation (1.2.3.4:9100)

Hope this helps and all the best

Sebastian-Roth commented 1 year ago

@osiktech Thanks for bringing up this issue and sorry for the long delay. Will look into this soon.

Sebastian-Roth commented 1 year ago

@osiktech Forgot to ask, which version of FOG are you using?

osiktech commented 1 year ago

@Sebastian-Roth no worries, and thanks for looking into it.

You're running the latest dev-branch version: 1.5.10.4