Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
a2323c04
Commit
a2323c04
authored
Jul 25, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Jul 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(firmware) add subscription option for private repositories
(cherry picked from commit
e061374a
)
parent
9112ec28
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
4 deletions
+47
-4
opnsense-update.deciso.com.20160725
...ints/OPNsense/trusted/opnsense-update.deciso.com.20160725
+2
-0
FirmwareController.php
.../app/controllers/OPNsense/Core/Api/FirmwareController.php
+13
-2
firmware.volt
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
+32
-2
No files found.
src/etc/pkg/fingerprints/OPNsense/trusted/opnsense-update.deciso.com.20160725
0 → 100644
View file @
a2323c04
function: "sha256"
fingerprint: "c3cf42fa6dd81c9be7decd2c76d1ee834b903b2f0188c90fa773b60673dd47ae"
src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php
View file @
a2323c04
...
...
@@ -396,6 +396,7 @@ class FirmwareController extends ApiControllerBase
$mirrors
=
array
();
$mirrors
[
''
]
=
'(default)'
;
$mirrors
[
'https://opnsense.aivian.org'
]
=
'Aivian (Shaoxing, CN)'
;
$mirrors
[
'https://opnsense-update.deciso.com'
]
=
'Deciso (NL, Commercial)'
;
$mirrors
[
'https://mirror.auf-feindgebiet.de/opnsense'
]
=
'auf-feindgebiet.de (Karlsruhe, DE)'
;
$mirrors
[
'https://opnsense.c0urier.net'
]
=
'c0urier.net (Lund, SE)'
;
//$mirrors['https://fleximus.org/mirror/opnsense'] = 'Fleximus (Roubaix, FR)';
...
...
@@ -408,12 +409,15 @@ class FirmwareController extends ApiControllerBase
$mirrors
[
'http://mirror.ragenetwork.de/opnsense'
]
=
'RageNetwork (Munich, DE)'
;
$mirrors
[
'http://mirror.wjcomms.co.uk/opnsense'
]
=
'WJComms (London, GB)'
;
$has_subscription
=
array
();
$has_subscription
[]
=
'https://opnsense-update.deciso.com'
;
$flavours
=
array
();
$flavours
[
''
]
=
'(default)'
;
$flavours
[
'libressl'
]
=
'LibreSSL'
;
$flavours
[
'latest'
]
=
'OpenSSL'
;
return
array
(
"mirrors"
=>
$mirrors
,
"flavours"
=>
$flavours
);
return
array
(
"mirrors"
=>
$mirrors
,
"flavours"
=>
$flavours
,
'has_subscription'
=>
$has_subscription
);
}
/**
...
...
@@ -448,6 +452,7 @@ class FirmwareController extends ApiControllerBase
$response
[
'status'
]
=
'ok'
;
$selectedMirror
=
filter_var
(
$this
->
request
->
getPost
(
"mirror"
,
null
,
""
),
FILTER_SANITIZE_URL
);
$selectedFlavour
=
filter_var
(
$this
->
request
->
getPost
(
"flavour"
,
null
,
""
),
FILTER_SANITIZE_URL
);
$selSubscription
=
filter_var
(
$this
->
request
->
getPost
(
"subscription"
,
null
,
""
),
FILTER_SANITIZE_URL
);
// config data without model, prepare xml structure and write data
if
(
!
isset
(
Config
::
getInstance
()
->
object
()
->
system
->
firmware
))
{
...
...
@@ -457,7 +462,13 @@ class FirmwareController extends ApiControllerBase
if
(
!
isset
(
Config
::
getInstance
()
->
object
()
->
system
->
firmware
->
mirror
))
{
Config
::
getInstance
()
->
object
()
->
system
->
firmware
->
addChild
(
'mirror'
);
}
Config
::
getInstance
()
->
object
()
->
system
->
firmware
->
mirror
=
$selectedMirror
;
if
(
empty
(
$selSubscription
))
{
Config
::
getInstance
()
->
object
()
->
system
->
firmware
->
mirror
=
$selectedMirror
;
}
else
{
// prepend subscription
Config
::
getInstance
()
->
object
()
->
system
->
firmware
->
mirror
=
$selectedMirror
.
'/'
.
$selSubscription
;
}
if
(
!
isset
(
Config
::
getInstance
()
->
object
()
->
system
->
firmware
->
flavour
))
{
Config
::
getInstance
()
->
object
()
->
system
->
firmware
->
addChild
(
'flavour'
);
...
...
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
View file @
a2323c04
...
...
@@ -318,6 +318,7 @@ POSSIBILITY OF SUCH DAMAGE.
$("#firmware_mirror").append($("<option/>")
.attr("value",key)
.text(value)
.data("has_subscription", firmwareoptions['has_subscription'].indexOf(key) == 0)
.prop('selected', selected)
);
});
...
...
@@ -325,8 +326,15 @@ POSSIBILITY OF SUCH DAMAGE.
.attr("value", firmwareconfig['mirror'])
.text("(other)")
.data("other", 1)
.data("has_subscription", false)
.prop('selected', other_selected)
);
if ($("#firmware_mirror option:selected").data("has_subscription") == true) {
$("#firmware_mirror_subscription").val(firmwareconfig['mirror'].substr($("#firmware_mirror").val().length+1));
} else {
$("#firmware_mirror_subscription").val("");
}
$("#firmware_mirror").selectpicker('refresh');
$("#firmware_mirror").change();
...
...
@@ -361,6 +369,11 @@ POSSIBILITY OF SUCH DAMAGE.
} else {
$("#firmware_mirror_other").hide();
}
if ($("#firmware_mirror option:selected").data("has_subscription") == true) {
$("#firmware_mirror_subscription").parent().parent().show();
} else {
$("#firmware_mirror_subscription").parent().parent().hide();
}
});
$("#firmware_flavour").change(function() {
$("#firmware_flavour_value").val($(this).val());
...
...
@@ -374,8 +387,13 @@ POSSIBILITY OF SUCH DAMAGE.
$("#change_mirror").click(function(){
$("#change_mirror_progress").addClass("fa fa-spinner fa-pulse");
var confopt = {};
confopt.mirror = $("#firmware_mirror_value").val()
confopt.flavour = $("#firmware_flavour_value").val()
confopt.mirror = $("#firmware_mirror_value").val();
confopt.flavour = $("#firmware_flavour_value").val();
if ($("#firmware_mirror option:selected").data("has_subscription") == true) {
confopt.subscription = $("#firmware_mirror_subscription").val();
} else {
confopt.subscription = null;
}
ajaxCall(url='/api/core/firmware/setFirmwareConfig',sendData=confopt, callback=function(data,status) {
$("#change_mirror_progress").removeClass("fa fa-spinner fa-pulse");
});
...
...
@@ -439,6 +457,18 @@ POSSIBILITY OF SUCH DAMAGE.
</td>
<td></td>
</tr>
<tr>
<td style="width: 150px;"><a id="help_for_mirror_subscription" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> {{ lang._('Subscription') }}</td>
<td>
<input type="text" id="firmware_mirror_subscription">
<div class="hidden" for="help_for_mirror_subscription">
<strong>
{{ lang._("Provide subscription key.") }}
</strong>
</div>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment