Skip to content

Commit 95a7856

Browse files
authored
Merge pull request #1 from trishnaguha/latest
AsciiBinder setup for Atomic host Doc
2 parents 6fb6d4c + c406119 commit 95a7856

15 files changed

+1109
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_preview

_distro_map.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
atomic_host_docs:
3+
name: Atomic Host
4+
author: Project Atomic Documentation Project <[email protected]>
5+
site: main
6+
site_name: Atomic Host Documentation
7+
site_url: http://docs.projectatomic.io/
8+
branches:
9+
master:
10+
name: Latest
11+
dir: latest
29.5 KB
Loading

_javascripts/.gitkeep

Whitespace-only changes.

_javascripts/bootstrap-offcanvas.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$(document).ready(function () {
2+
$('[data-toggle="offcanvas"]').click(function () {
3+
$('.sidebar').show();
4+
$('.row-offcanvas').toggleClass('active');
5+
});
6+
});

_stylesheets/asciibinder.css

+568
Large diffs are not rendered by default.

_templates/_css.html.erb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<%- Dir.glob("_stylesheets/*").sort.each do |sheet| -%>
2+
<link href="<%= File.join(css_path, File.basename(sheet)) %>" rel="stylesheet" />
3+
<%- end -%>

_templates/_nav.html.erb

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<ul class="nav nav-sidebar">
2+
<%- navigation.each.with_index do |topic_group, groupidx| -%>
3+
<%- current_group = topic_group[:id] == group_id -%>
4+
<li class="nav-header">
5+
<a class="" href="#" data-toggle="collapse" data-target="#topicGroup<%= groupidx %>">
6+
<span id="tgSpan<%= groupidx %>" class="fa <%= current_group ? 'fa-angle-down' : 'fa-angle-right' %>"></span><%= topic_group[:name] %>
7+
</a>
8+
<ul id="topicGroup<%= groupidx %>" class="collapse <%= current_group ? 'in' : '' %> list-unstyled">
9+
<%- topic_group[:topics].each.with_index do |topic, topicidx| -%>
10+
<%- if not topic.has_key?(:topics) -%>
11+
<%- current_topic = current_group && (topic[:id] == topic_id) -%>
12+
<li><a class="<%= current_topic ? ' active' : '' %>" href="<%= subtopic_shim %><%= topic[:path] %>"><%= topic[:name] %></a></li>
13+
<%- else -%>
14+
<%- current_subgroup = topic[:id] == subgroup_id -%>
15+
<li class="nav-header">
16+
<a class="" href="#" data-toggle="collapse" data-target="#topicSubGroup-<%= groupidx %>-<%= topicidx %>">
17+
<span id="sgSpan-<%= groupidx %>-<%= topicidx %>" class="fa <%= current_subgroup ? 'fa-caret-down' : 'fa-caret-right' %>"></span>&nbsp;<%= topic[:name] %>
18+
</a>
19+
<ul id="topicSubGroup-<%= groupidx %>-<%= topicidx %>" class="nav-tertiary list-unstyled collapse<%= current_subgroup ? ' in' : '' %>">
20+
<%- topic[:topics].each do |subtopic| -%>
21+
<%- current_subtopic = current_group && current_subgroup && (subtopic[:id] == topic_id) %>
22+
<li><a class="<%= current_subtopic ? ' active' : '' %>" href="<%= subtopic_shim %><%= subtopic[:path] %>"><%= subtopic[:name] %></a></li>
23+
<%- end -%>
24+
</ul>
25+
</li>
26+
<%- end -%>
27+
<%- end -%>
28+
</ul>
29+
</li>
30+
<%- end -%>
31+
</ul>

_templates/page.html.erb

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta content="IE=edge" http-equiv="X-UA-Compatible">
6+
<meta content="width=device-width, initial-scale=1.0" name="viewport">
7+
<title><%= distro %> <%= version %> | <%= [group_title, subgroup_title, topic_title].compact.join(' | ') %></title>
8+
9+
<!-- Bootstrap -->
10+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
11+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
12+
13+
<%= render("_templates/_css.html.erb", :css_path => css_path) %>
14+
<script src="<%= File.join(javascripts_path, "bootstrap-offcanvas.js") %>" type="text/javascript"></script>
15+
16+
<meta content="AsciiBinder" name="application-name">
17+
</head>
18+
<body>
19+
<div class="navbar navbar-default" role="navigation">
20+
<div class="container-fluid">
21+
<div class="navbar-header">
22+
<a class="navbar-brand" href="http://www.projectatomic.io/"><img alt="ProjectAtomic" src="<%= File.join(images_path, "project_atomic_horizontal_logo.png") %>" height="100"></a>
23+
</div>
24+
</div>
25+
</div>
26+
<div class="container">
27+
<p class="toggle-nav visible-xs pull-left">
28+
<button class="btn btn-default btn-sm" type="button" data-toggle="offcanvas">Toggle nav</button>
29+
</p>
30+
<ol class="breadcrumb">
31+
<li class="sitename">
32+
<a href="<%= site_home_path %>"><%= site_name %></a>
33+
</li>
34+
<li class="hidden-xs active">
35+
<%= breadcrumb_root %>
36+
</li>
37+
<li class="hidden-xs active">
38+
<%= breadcrumb_group %>
39+
</li>
40+
<%= breadcrumb_subgroup_block %>
41+
<li class="hidden-xs active">
42+
<%= breadcrumb_topic %>
43+
</li>
44+
</ol>
45+
<div class="row row-offcanvas row-offcanvas-left">
46+
<div class="col-xs-8 col-sm-3 col-md-3 sidebar sidebar-offcanvas">
47+
<%= render("_templates/_nav.html.erb", :navigation => navigation, :group_id => group_id, :topic_id => topic_id, :subgroup_id => subgroup_id, :subtopic_shim => subtopic_shim) %>
48+
</div>
49+
<div class="col-xs-12 col-sm-9 col-md-9 main">
50+
<div class="page-header">
51+
<h2><%= article_title %></h2>
52+
</div>
53+
<%= content %>
54+
</div>
55+
</div>
56+
</div>
57+
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
58+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
59+
<!-- Latest compiled and minified JavaScript -->
60+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
61+
<script type="text/javascript">
62+
/*<![CDATA[*/
63+
$(document).ready(function() {
64+
$("[id^='topicGroup']").on('show.bs.collapse', function (event) {
65+
if (!($(event.target).attr('id').match(/^topicSubGroup/))) {
66+
$(this).parent().find("[id^='tgSpan']").toggleClass("fa-angle-right fa-angle-down");
67+
}
68+
});
69+
$("[id^='topicGroup']").on('hide.bs.collapse', function (event) {
70+
if (!($(event.target).attr('id').match(/^topicSubGroup/))) {
71+
$(this).parent().find("[id^='tgSpan']").toggleClass("fa-angle-right fa-angle-down");
72+
}
73+
});
74+
$("[id^='topicSubGroup']").on('show.bs.collapse', function () {
75+
$(this).parent().find("[id^='sgSpan']").toggleClass("fa-caret-right fa-caret-down");
76+
});
77+
$("[id^='topicSubGroup']").on('hide.bs.collapse', function () {
78+
$(this).parent().find("[id^='sgSpan']").toggleClass("fa-caret-right fa-caret-down");
79+
});
80+
});
81+
/*]]>*/
82+
</script>
83+
</body>
84+
</html>

_topic_map.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This configuration file dictates the organization of the topic groups and
2+
# topics on the main page of the doc site for this branch. Each record
3+
# consists of the following:
4+
#
5+
# --- <= Record delimiter
6+
# Name: Origin of the Species <= Display name of topic group
7+
# Dir: origin_of_the_species <= Directory name of topic group
8+
# Topics:
9+
# - Name: The Majestic Marmoset <= Topic name
10+
# File: the_majestic_marmoset <= Topic file under group dir +/- .adoc
11+
# - Name: The Curious Crocodile <= Topic 2 name
12+
# File: the_curious_crocodile <= Topic 2 file
13+
# - Name: The Numerous Nematodes <= Sub-topic group name
14+
# Dir: the_numerous_nematodes <= Sub-topic group dir
15+
# Topics:
16+
# - Name: The Wily Worm <= Sub-topic name
17+
# File: the_wily_worm <= Sub-topic file under <group dir>/<subtopic dir>
18+
# - Name: The Acrobatic Ascarid <= Sub-topic 2 name
19+
# File: the_acrobatic_ascarid <= Sub-topic 2 file under <group dir>/<subtopic dir>
20+
#
21+
# The ordering of the records in this document determines the ordering of the
22+
# topic groups and topics on the main page.
23+
---
24+
Name: About
25+
Dir: welcome
26+
Topics:
27+
- Name: Welcome
28+
File: index
29+
30+
---
31+
Name: Tools
32+
Dir: atomic-host-guide
33+
Topics:
34+
- Name: Cockpit
35+
Dir: cockpit
36+
Topics:
37+
- Name: Overview
38+
File: overview
39+
- Name: Installation
40+
File: installing_cockpit
41+
- Name: How to Use
42+
File: using_cockpit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
=== Setting up a Cockpit server
2+
3+
A Cockpit server is the machine that is running the cockpit service and exposes the user interface. Depending on the operating system, you need to install the _cockpit_ packages or the _cockpit-ws_ container. You can then open the interface in a browser by typing _localhost:9090_, or use any other machine and type in the IP address of the Cockpit server. Through Cockpit, you can also add more secondary hosts to this primary server. They need to have the cockpit packages installed on them. This document refers to the Cockpit server as the primary server and the added hosts as secondary.
4+
5+
==== Installing Cockpit
6+
7+
*A.* On Red Hat Enterprise Linux Atomic Host
8+
9+
1. Run the *cockpit-ws* image. Use this command:
10+
+
11+
....
12+
-bash-4.2# atomic run rhel7/cockpit-ws
13+
....
14+
15+
Afterwards, you can log into Cockpit. Go to xref:opening_the_interface[Opening The Interface]
16+
17+
*B.* On Red Hat Enterprise Linux
18+
19+
1. Once you have Red Hat Enterprise Linux installed and with enabled networking, you need to register the system and enable the Extras and Optional repositories:
20+
+
21+
....
22+
# subscription-manager register --auto-attach --username=<rhnuser> --password=<rhnpasswd>
23+
# subscription-manager repos --enable=rhel-7-server-extras-rpms
24+
# subscription-manager repos --enable=rhel-7-server-optional-rpms
25+
....
26+
27+
1. Allow external connections to port 9090 through the firewall:
28+
+
29+
....
30+
# firewall-cmd --add-port=9090/tcp
31+
# firewall-cmd --permanent --add-port=9090/tcp
32+
....
33+
34+
1. Install the _cockpit_ packages:
35+
+
36+
....
37+
$ sudo yum install cockpit
38+
....
39+
40+
1. Enable and start the cockpit.socket service:
41+
+
42+
....
43+
$ sudo systemctl enable cockpit.socket
44+
$ sudo systemctl start cockpit.socket
45+
....
46+
47+
==== Opening The Interface
48+
49+
[[opening_the_interface]]
50+
51+
1. Open a web browser and enter the server's IP address with port 9090 in the address bar. If the web browser is on the Cockpit server, open _localhost:9090_ or _hostname:9090_. If you get a security warning by the browser, you will need to add this connection to the security exceptions. Click *Advanced* -> *Add Exception* -> *Confirm Security Exception*. After that, you will see the login screen:
52+
+
53+
image:cockpit_login_rhel.png[caption="Cockpit login screen", title="Cockpit Login Screen", alt="Sunset"]
54+
55+
1. Log into the Cockpit interface with the same user name and password that you would use to log into the Atomic system.
56+
57+
==== Changing Expired Passwords
58+
59+
If there is an account on your Atomic system that has an expired password, you can change it from Cockpit. For example, if you have provisioned your system using *cloud-init* to set up an expired password, you will be prompted to change it the first time you log into the system. It can also be used by system administrators who want to make sure the user changes his password on the first login.
60+
61+
// image:password_login.png[caption="Cockpit Login", title="Cockpit Login", alt="Sunset"]
62+
63+
When you try to log in with the usual password and that password has expired, Cockpit will prompt you to enter the current password again. Enter your current password and click *Login*.
64+
65+
image:password_current.png[caption="Current Password", title="Current Password", alt="Sunset"]
66+
67+
Choose a new password and click *Login*.
68+
69+
image:password_new.png[caption="New Password", title="New Password", alt="Sunset"]
70+
71+
72+
[NOTE]
73+
If you can't log into Cockpit and you are not redirected to the changing password screen, check the `/etc/ssh/sshd_config` file on the Cockpit Server and make sure the `ChallengeResponseAuthentication` line is set to `yes`. After that, restart `sshd` with the `systemctl restart sshd` command.
74+
75+
==== SSH two-factor authentication with Cockpit
76+
77+
Cockpit now supports two-factor authentication so if you have protected your SSH server with such configuration, the Cockpit login screen will prompt you to enter your password and PIN pair. To set up SSH for two-factor authentication you need two components:
78+
79+
* Your company's authenticator application that provides one-time passwords or PIN numbers. An example application is the `Google Authenticator`, which also has its own PAM (Pluggable Authentication Module).
80+
* A server that validates the PINs from your dongle.
81+
82+
These two components can be built in many different ways depending on the infrastructure of your particular company. When you have these two set up, you will need to do the following things:
83+
84+
1. Enter the following line in the `/etc/pam.d/sshd` file as the last `auth` line:
85+
+
86+
....
87+
auth required <your_PAM_module>
88+
....
89+
90+
2. Edit the `/etc/ssh/sshd_config` file so that the `ChallengeResponseAuthentication` line is set to `yes`.
91+
92+
3. Restart the `sshd` service with the `systemctl restart shhd` command.
93+
94+
When you open Cockpit's interface, and enter your password, you will then be prompted to enter your Verification code:
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Cockpit is a system administration tool that provides a user interface for monitoring and administering servers through a web browser. It allows you to monitor current values and adjust limits on system resources, control life cycle on container instances, and manipulate container images. Here are a few important facts about Cockpit:
2+
3+
* Cockpit does not add a layer of other functionalities that are not present on your systems. It exposes user interface elements that enable you to interact with the system.
4+
5+
* Cockpit does not take control over your servers, in a way that when you configure something from Cockpit, you can only manage it from there. You can effectively move away from Cockpit to the command-line and come back to it at any point.
6+
7+
* Cockpit does not require configuration or infrastructure, and once you install it, it is ready for use. You could, however, configure it to make use of the authentication infrastructure that is available to you, for example a single sign-on system like Kerberos.
8+
9+
* Cockpit has zero memory and process footprint on the server when not in use.
10+
11+
* Cockpit does not store data or policy. This also means it does not have its own users. The users from the systems can authenticate in Cockpit using their system credentials and they keep the same permissions.
12+
13+
* Cockpit dynamically updates itself to reflect the current state of the server, within a time frame of a few seconds.
14+
15+
* Cockpit is not intended for configuration management. This means that Cockpit itself does not have a predefined template or state for the server that it then imposes on the server. Cockpit can interact with other configuration management systems or custom tools that are manipulating server configuration.
16+
17+
This document provides instructions on how to install and enable Cockpit so you can monitor your servers, describes basic configuration, and walks you through the interface.
18+
19+
Both Red Hat Enterprise Linux and Red Hat Enterprise Linux Atomic Host can be used for the role of a Cockpit server and that of a secondary server. In this document, all monitored systems are Atomic, but the instructions also cover how to set up Red Hat Enterprise Linux as a primary server.
20+
21+
[NOTE]
22+
Cockpit does not yet have support for Kubernetes on Red Hat Enterprise Linux or Red Hat Enterprise Linux Atomic Host servers.

0 commit comments

Comments
 (0)