Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display the stephdl repo inside the cockpit server-manager #1

Merged
merged 3 commits into from Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 35 additions & 0 deletions api/read
@@ -0,0 +1,35 @@
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
use NethServer::ApiTools;
use LWP::Simple qw (head);

my $input = NethServer::ApiTools::readInput();
my $cmd = $input->{'action'};
my $ret = {};
my $url = 'http://mirror.de-labrusse.fr';


if ( $cmd eq "app-info") {
if (head($url)) {
$ret = {
'name' => "Stephdl online",
'url' => "https://mirror.de-labrusse.fr",
'description' => "Provide the stephane de Labrusse (stephdl) repository",
'summary' => "Provide the stephane de Labrusse (stephdl) repository"
};
}
else {
$ret = {
'name' => "Stephdl offline",
'url' => "https://mirror.de-labrusse.fr",
'description' => "The stephane de Labrusse (stephdl) repository seems to be offline",
'summary' => "The stephane de Labrusse (stephdl) repository seems to be offline"
};
}
} else {
NethServer::ApiTools::error();
}

print encode_json($ret);
Binary file added logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions manifest.json
@@ -0,0 +1,4 @@
{
"version": 0,
"content-security-policy": "style-src 'self' 'unsafe-inline'"
}
21 changes: 21 additions & 0 deletions nethserver-stephdl.json
@@ -0,0 +1,21 @@
{
"id": "nethserver-stephdl",
"name": "stephdl",
"summary": "Provide the repository of stephane de Labrusse",
"description": "Provide the repository of stephane de Labrusse",
"url": "",
"provides": ["nethserver-stephdl"],
"release": {
"version": "_RELEASE_"
},
"author": {
"name": "Stephane de Labrusse",
"url": "https://github.com/stephdl/nethserver-stephdl",
"email": "stephdl@de-labrusse.fr"
},
"infoapi": {
"path": "nethserver-stephdl/read"
},
"icon": "logo.png",
"external": true
}
15 changes: 14 additions & 1 deletion nethserver-stephdl.spec
@@ -1,6 +1,6 @@
Summary: NethServer configuration for stephdl repository
Name: nethserver-stephdl
Version: 1.1.2
Version: 1.1.3
Release: 1%{?dist}
License: GPL
Source: %{name}-%{version}.tar.gz
Expand All @@ -25,11 +25,21 @@ NethServer configuration for stephdl repository
%build
%{makedocs}
perl createlinks
sed -i 's/_RELEASE_/%{version}/' %{name}.json

%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)

mkdir -p %{buildroot}/usr/share/cockpit/%{name}/
mkdir -p %{buildroot}/usr/share/cockpit/nethserver/applications/
mkdir -p %{buildroot}/usr/libexec/nethserver/api/%{name}/
cp -a manifest.json %{buildroot}/usr/share/cockpit/%{name}/
cp -a logo.png %{buildroot}/usr/share/cockpit/%{name}/
cp -a %{name}.json %{buildroot}/usr/share/cockpit/nethserver/applications/
cp -a api/* %{buildroot}/usr/libexec/nethserver/api/%{name}/
chmod +x %{buildroot}/usr/libexec/nethserver/api/%{name}/*

%{genfilelist} $RPM_BUILD_ROOT > e-smith-%{version}-filelist

%clean
Expand All @@ -45,6 +55,9 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) /etc/yum.repos.d/stephdl.repo

%changelog
* Fri Nov 06 2020 stephane de labrusse <stephdl@de-labrusse.fr> - 1.1.3-1
- Display stephdl repo inside the the cockpit application list

* Mon Sep 28 2020 stephane de labrusse <stephdl@de-labrusse.fr> - 1.1.2-1
- Include eorepo inside configuration backup

Expand Down
7 changes: 7 additions & 0 deletions root/etc/sudoers.d/50_nsapi_nethserver_stephdl
@@ -0,0 +1,7 @@
#
# nsapi_nethserver_stephdl
#
Cmnd_Alias NSAPI_NETHSERVER_STEPHDL = \
/usr/libexec/nethserver/api/nethserver-stephdl/read

Defaults!NSAPI_NETHSERVER_STEPHDL !requiretty