Ad Schellevis
d656cbf7db
(mvc, constraints) rename message to ValidationMessage
2016-08-15 17:48:05 +02:00
Ad Schellevis
5361a64bd1
(mvc, add constraint pattern) for https://github.com/opnsense/core/issues/272
...
Constraints hook into the default validations, new constraints should derive from BaseConstraint.
This commit contains the code needed to add constraints to our model and a unittest for the UniqueConstraint option.
Add the following to a model field, to force uniqueness for a combination of keys:
<Constraints>
<check001> <!--validation name, unique within this field-->
<message>number should be unique</message> <!--the message to output on validation failure -->
<type>OPNsense\Base\Constraints\UniqueConstraint</type> <!--the class to construct, derived from OPNsense\Base\Constraints\BaseConstraint -->
<addFields> <!--optional additional fields for the equation, defined in UniqueConstraint -->
<field1>optfield</field1>
</addFields>
</check001>
</Constraints>
2016-08-15 17:37:50 +02:00
Franco Fichtner
b3f3a68b0d
dashboard: colour changed, but text did not
2016-08-15 10:42:26 +02:00
Franco Fichtner
123ed735fc
interfaces: no reason to store packet capture on root partition
...
If there is not enough space in /tmp, it's really nothing we
can do about here. This is not an essential file.
2016-08-15 10:26:47 +02:00
Ad Schellevis
608ed9c67f
fix previous
2016-08-15 09:08:18 +02:00
Ad Schellevis
22701ee038
(mvc) propagate ajax errors
2016-08-15 09:02:21 +02:00
Franco Fichtner
d988799a81
src: translations tweaks
...
Taking the liberty to use this as an opportunity to kill the
usage of "e-mail".
Suggested by: @Antonio-Prado
2016-08-15 07:31:18 +02:00
Ad Schellevis
c5e87ca1da
(mvc, api) error handling, set http status code
2016-08-14 20:14:29 +02:00
Ad Schellevis
65471b33de
Merge pull request #1140 from pv2b/improve-api-exception-messages
...
Improve error messages for API calls
2016-08-14 17:27:49 +02:00
Per von Zweigbergk
6839fe81ac
(mvc, api) Removed useless escaping
2016-08-14 13:31:37 +00:00
Per von Zweigbergk
7863c124c0
(mvc, api) improve error handling for api calls
...
Example before: {"errorMessage":"Undefined offset: 0 [8]"}
Example after: {"errorMessage":"Error at \/usr\/local\/etc\/inc\/util.inc:952 - Undefined offset: 0 (errno=8)"}
2016-08-14 13:08:51 +00:00
Ad Schellevis
9ed6406bdc
(mvc, api) add error handling for api calls, https://github.com/opnsense/core/issues/1136
2016-08-14 14:23:43 +02:00
Franco Fichtner
720acc9e1d
util: make dmesg probing optional #1135
...
While there, turn the probing upside down for general sanity:
o Only pull dmesg output once
o Pattern-match one pattern only
o Anchor the match to the line start
2016-08-13 20:53:36 +02:00
Franco Fichtner
c77dd450ac
Merge pull request #1135 from pv2b/fix-missing-dmesg
...
(get_interface_list) Properly handle an interface not appearing in dmesg
2016-08-13 20:22:10 +02:00
Per von Zweigbergk
c9e04ae0f7
(get_interface_list) Properly handle an interface not appearing in dmesg
2016-08-13 16:49:31 +00:00
Franco Fichtner
4870ff1061
ssh: deprecate DSA keys as per OpenSSH recommendation
...
Also see: http://www.openssh.com/txt/release-7.0
2016-08-13 15:39:12 +02:00
Franco Fichtner
081415d4fa
rc: remove IP checks for PPTP and L2TP servers
...
The console would refuse to assign an IP that was used by the
PPTP or L2TP server (surprisingly not PPPoE). This rule changed
during the MPD4 -> MDP5 migration, so remove that code. Also,
the subnet check was never executed, good time to remove it as
well.
2016-08-13 15:18:06 +02:00
Franco Fichtner
7985db12e0
README: bring it up to speed, discourage mount/umount usage
2016-08-13 14:02:37 +02:00
Franco Fichtner
1b21ad916c
www: fix previous
...
Spotted by: @fabianfrz
2016-08-13 13:35:25 +02:00
Franco Fichtner
c1141f4dd6
www: fix two translation issues
...
Reported by: @Antonio-Prado
2016-08-13 12:57:09 +02:00
Franco Fichtner
4425c28ea0
src: extend whitespace sweep to root dir files
2016-08-13 12:50:58 +02:00
Ad Schellevis
d137b214ad
output style for unversioned upgrade in run_migrations.php
2016-08-12 19:08:45 +02:00
Ad Schellevis
f3aed56978
execute run_migrations.php after pkg install
2016-08-12 15:36:24 +02:00
Ad Schellevis
e527d539f6
(model, migrations) extend output
2016-08-12 15:35:53 +02:00
Ad Schellevis
e05b89b44c
osx doesn't mind case.... typo
2016-08-12 15:28:21 +02:00
Ad Schellevis
a015dd4a7d
change mode for run_migrations.php
2016-08-12 15:23:22 +02:00
Ad Schellevis
c16fac21c9
(proxy) set version
2016-08-12 15:22:05 +02:00
Ad Schellevis
73af4392f5
add run_migrations.php
2016-08-12 15:20:41 +02:00
Ad Schellevis
137cac91d5
(model, migrations) add default migration strategy
2016-08-12 15:17:29 +02:00
Ad Schellevis
6a7262c509
style fix
2016-08-12 15:16:34 +02:00
Ad Schellevis
1492ddfd39
(mvc) more work on migrations, fix autoloader, serialize to config when all steps for this model are finished
2016-08-12 14:35:17 +02:00
Franco Fichtner
f55a12b466
vpn: correct capitalisation for Common Name
2016-08-12 14:01:35 +02:00
Ad Schellevis
a38eb7aa90
(mvc) change case for Migrations directory
2016-08-12 12:02:14 +02:00
Ad Schellevis
89fa64dbcb
(mvc) BaseModel add getVersion() to retrieve the running config version, commit changes to in memory config after every migration step.
...
Errors will be send to syslog, current policy is to always upgrade and ignore migration errors.
(there's not really a way back, other then undo pkg install and revert the full config)
2016-08-12 11:27:49 +02:00
Ad Schellevis
aaa0ddafe1
(ids) style fix
2016-08-12 09:33:37 +02:00
Ad Schellevis
2a9b312b2e
Merge pull request #1127 from pv2b/uimodelgrid-itemsperpage-default
...
(Base) Default to inf rows not 9999
2016-08-12 09:22:25 +02:00
Franco Fichtner
74a8a4f0a7
mvc: style sweep
2016-08-12 05:34:50 +02:00
Franco Fichtner
2e31042e43
rc: transition code for new-style extensions ordering
2016-08-12 07:51:16 +02:00
Franco Fichtner
bd182fd5ef
crash reports: don't have to hide this, will be fixed in 16.7.2
2016-08-12 07:45:27 +02:00
Franco Fichtner
b236262878
interfaces: annotate dhcp modes; closes #1052
2016-08-12 07:44:07 +02:00
Franco Fichtner
57bb583c1d
interfaces: add missing validation for previous #1052
2016-08-12 07:25:47 +02:00
Franco Fichtner
e86885cb04
interfaces: fix clearing the dhcp config file when override file is gone #1052
2016-08-12 06:44:17 +02:00
Ad Schellevis
3e0be39524
Merge pull request #1133 from pv2b/patch-1
...
(base) Do not encourage overriding getModel()
2016-08-11 21:43:48 +02:00
pv2b
bf79d5a625
(base) Do not encourage overriding getModel()
...
Overriding getModel() is not to be done lightly. The code relies on the same object being there through multiple calls to getModel(). Any overriding methods should preserve this same behavior. For this reason, we should not encourage tinkering with this in a comment, better be silent on the matter.
2016-08-11 21:41:28 +02:00
Ad Schellevis
a90e2ddc31
(mvc) missed a spot
2016-08-11 21:20:39 +02:00
Ad Schellevis
618036bc55
(mvc) refactor ApiMutableModelControllerBase for https://github.com/opnsense/core/pull/1126
2016-08-11 21:02:11 +02:00
Ad Schellevis
5c68c8f264
Merge pull request #1126 from pv2b/ApiMutableTableModelControllerBase
...
ApiMutableTableModelControllerBase
2016-08-11 20:00:05 +02:00
Ad Schellevis
6a5948df31
(unittests) add versioning and migrations to unittests
2016-08-11 18:48:16 +02:00
Ad Schellevis
653968818f
(mvc) add version to model spec and add initial migration support
2016-08-11 18:46:44 +02:00
Ad Schellevis
d46f43b083
(model) fix typo
2016-08-11 16:45:06 +02:00