Go to file
Jose M. Guisado d9f8c95618 views: better dhcp conf parsing when importing clients
This new regex allows parsing of:

	- Irrelevant options that the user may paste from its config
	  file, eg. 'option host-name'.
	- Allows linebreaks.

Hosts still require to have 'hardware ethernet' first, and then
'fixed-address'.

For example this regex admits dhcp host declarations such as

	host pir36-22_78 {
	      hardware ethernet d8:5e:d3:25:28:9d;
	      fixed-address 10.1.36.78;
	      option host-name "pc_78";
	}

Summary of the regex:

(?: *host *)			# Match host keyword and spaces
([\w.-]*)     			# Match any word character (alphanum and underscore)
(?:[ \n\r]*{[ \n\r]*)  		# Match any space or newline, then match { and any following space or newline
(?:[ \t]*hardware *ethernet *)  # Match any space or tab character followed by 'hardware ethernet'
((?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2}))  # Match the mac address using ':' or '-' as separator
(?: *;)				# Match any space character before a ';'
(?:[ \t\n\r]*fixed-address *)	# Match any space, tab or newline followed by 'fixed address' and any following space
(\d+\.\d+\.\d+\.\d+)		# Match an ip address (no validity check)
(?: *;)(?:[ \r\n]*[^}]*})	# Match any space followed by ';', then match any character except '}'
2023-06-27 17:06:34 +02:00
ogcp views: better dhcp conf parsing when importing clients 2023-06-27 17:06:34 +02:00
.gitignore Add gitignore 2020-08-28 10:18:43 +02:00
COPYING Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
README.md Add README.md and COPYING files 2021-05-21 11:18:08 +02:00
requirements.txt Add login 2021-03-05 11:47:27 +01:00
run_test.sh Add run_test.sh script 2020-10-27 10:38:56 +01:00

README.md

ogCP

ogCP (OpenGnsys Control Panel) is the new web interface, a modern alternative to the classical administration panel (WebConsole).

Installation

Steps to install ogCP on Ubuntu 18.04 LTS:

  • Clone the repository that is temporarily available at: https://github.com/javsanpar/ogCP
  • Edit ogcp/cfg/ogcp.json and include the API token and the IP address of the ogServer. In addition, we must define the user and the key we want for authentication in ogCP.
  • Create a python virtual environment.
    • Install venv with:
      apt-get install python3-venv
      
    • Create the folder where we will start the virtual environment.
    • Create the virtual environment with:
      python3 -m venv ./previous-folder
      
  • Activate the shell with the virtual environment with:
    source ./previous-folder/bin/activate
    
  • (Optional) If you want to expose ogCP to other machines, you must edit run_test.sh with:
    ...
    flask run --host=0.0.0.0
    
  • With the shell linked to the newly created python environment, navigate to the folder where you cloned ogCP and launch:
    ./run_test.sh
    
    When running run_test.sh for the first time some errors are expected, but they do not affect to the usability of ogCP.

License

ogCP is released under the GNU Affero Public License v3+

Authors

Soleta Networks