User can use this boolean field to specify if an backup copy needs to be
created before updating an image.
This only applies when sending a request to a client (ogClient)
supporting this parameter.
Some programs substitute regular space characters (\u0020) by en spaces
(\u2002) when displaying monospace text. Others replace it by
non-breaking spaces.
Using a character set such as [ \t\n] to match any possible "space
related" character. Use \s to match any kind of whitespace related
character in the regex.
Pasted from python's documentation:
\s
For Unicode (str) patterns:
Matches Unicode whitespace characters (which includes
[ \t\n\r\f\v], and also many other characters, for example the
non-breaking spaces mandated by typography rules in many languages). If
the ASCII flag is used, only [ \t\n\r\f\v] is matched.
[...]
Fixes: 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 '}'
Help user by hinting the current expected format via a placeholder in
the textarea box.
Current regex has its limitations when parsing dhcpd host declarations.
It does not support multi line host declarations or different options
outside "hardware ethernet ..." and "fixed-address ...".
If an administrator selects a client without disks and goes to
"Partition & Format", ogCP redirects it again to "Commands" and shows a
floating message indicating that the client has no disks.
Since ogCP multi ogServer support, g.server is not used anymore. The
list of available servers is stored in the global variable "servers" at
og_server.py
Clients pills show MACs regardless of the ogServer they belong to. Flask
GET /client/mac API uses "get_server_from_clients()" function to send
the command to the correct ogServer.
When users select an image, its ogServer is sent too. Then, the back-end
(flask) processes the form to obtain this ogServer and send it the
pertinent requests.
It also makes "Image details" view use this new parameter, and adds
javascript code to ensure that users can only work with several images
at the same time if they belong to the same ogServer.
Images view fetch images from all ogServers configured and show them in
the left tree as a nested list. ogServers are represented as the parents
of their images.
This commit adds a new select input with all available ogServers to "Add
center" view. The ogCP creates the center in the ogServer selected by
the user.
With this commit when users select a scope, the ogServer to
which it belongs is also sent. Then when processing the form we obtain
this ogServer and we can send it the pertinent requests.
This commit also makes action "Add client" to use the ogServer sent in
the form.
This commit adapt how "get_scopes()" accesses the name of the ogServer
because commit eae64dd changes how "multi_request()" returns it.
Fixes: eae64dd ("Initial support of ogServer requests routing")
This commit adds a helper function ("get_server_from_clients()") to get
the adequate ogServer according to the targeted clients.
It also makes "Client details" command use this function.
'multi_request()' function make requests to ogServers defined in the
configuration and aggregates it responses.
This commit also makes 'get_scopes()' use it.
Update the configuration file format to support several ogServers and
retrieve scopes from those ogServers.
The old config file format is still supported.
On image creation use the id to identify repositories instead of the IP.
ogServer related commit:
* 52a38d3 ("#915 Use the repository id on image creation")
This patch moves login password hashing from the frontend/javascript to
the backend/flask.
This patch moves password hashing of login and user management forms.
Related commits:
* c7b0024 ("Add password hashing")
* 661254b ("Add 'Add user' to Users section")
Creates "Edit user" form with the following inputs: password, password
confirmation, role (administrator or regular), allowed scopes. It does
no allow to change/edit the username.
The front-end now hashes passwords before sending them to the back-end.
It uses SHA-512.
This commit adds a hidden input which sends the password hash to not
interfere with browsers' save password functionality.
Also change passwords of the template configuration file for their
hashed/digested versions.
Add import clients form with required inputs: room and dhcpd.conf.
This permits users to rapidly add large amounts of clients to a room
using dhcpd.conf's syntax. Users can copy full dhcpd.conf files to the
text area and the parser only matches lines with the following format as
clients:
host dummy {hardware ethernet 12:34:56:78:90:ab; fixed-address 192.168.1.55; }
Allows updating the image file for an existing image.
This action is related to /image/create in ogServer API. If ogServer
receives an POST /image/create without the parameter "description", it
does not create a new image and only updates.
Disk selection uses "scopesForm" to submit the change, but setup/show
view receives new parameters not provided by this form.
Commit 17757baa4727 adds those parameters.
This commit gives disk selection its own form with all the required
parameters.
get_client_setup() takes an IP address that identify the client,
instead of passing an iterator with one single IP address, pass
directly such IP address.
Both "Add client" and "Client details" views use client_details.html
template. With this commit, "Add client" extends scopes.html and "Client
details" extend commands.hmlt.
Extend commands.html template to keep scope tree, and action buttons
state.
When in the software inventory view, there exists two options: 'update'
or 'view'. Do not print raw json response from ogserver about the software
inventory/profile.
When vieweing the software list, print a html table using the new
template: software_list.html.
Do not print blank pages with plain text html error codes when something
goes wrong. Instead, print an error message after redirecting to the
commands view.
If something goes wrong, the application shows an error message after
redirecting to the commands view.
Do not show blank pages with plain text error codes.
Extending from command.html is required for action views to mantain
the scope context on the left side column.
Enables setting dropdown button and action button as active when loading
the hardware inventory view.
User can confirm when deleting an image by double checking the
information displayed on this page.
Adds a new optional field in GenericForm: 'ids'. Used when dealing with
ids instead of ips.
This commit adds an extra view to ensure users do not reboot clients
accidentally.
ogcp GET /reboot returns the confirmation page and POST /reboot
builds and sends the request to ogServer.
It also includes Spanish translation of the new strings.
This commit adds an extra view to ensure users do not power off clients
accidentally.
ogcp GET /poweroff returns the confirmation page and POST /poweroff
builds and sends the request to ogServer.
It also includes Spanish translation of the new strings.
This commit rename partition table type MSDOS to MBR in the front-end.
At the back-end ogCP still uses MSDOS string because ogClient scripts
(aka cloning engine) expects it.
This commit converts disk and partition size from kibibytes to mebibytes
to improve usability. Disk and partition size are used in "Client
details" and "Partition & format" forms.
It also returns size to kibibytes when creating /setup API
payload as required by ogServer.
ogCP limits which scopes can use each user.
Configuration file stores allowed scopes by their names. Leave scope
list empty to give a user permissions on all scopes.
Clients in ogLive offer a web page with lighttpd that shows a real-time
log. This commit links this log in ogcp.
Future patches will deprecate this log functionality in favour of more
robust solutions.
Add a new select input and button to choose which disk you want to
partition.
TODO: Current argument parsing function returns a list with all the
arguments, except csrf_token. Future patches should add granular parsing
of different types of arguments.
Adds a new button in the images view.
This action handles image deletion, one at a time for security. Users
must select an image using the images tree.