Skip to content

Commit

Permalink
Release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Addvilz committed Mar 11, 2020
1 parent f74ada9 commit 807d811
Show file tree
Hide file tree
Showing 30 changed files with 771 additions and 189 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
* Wed Mar 11 2020 Matiss Treinis <mrtreinis@gmail.com> - 1.1.0
- Logging timer no longer reports nonsense values (#1).
- Environment name is now available from within scripts (#2).
- Archives created using the API now have proper timestamps and metadata (#3).
- Empty error messages are no longer possible in libkafe to avoid ambiguous errors (#4).
- Extra arguments to "do" command are now forwarded to task function (#5).
- SSH key passphrase and user password can now be defined in executing environment (#6).

* Wed Mar 4 2020 Matiss Treinis <mrtreinis@gmail.com> - 1.0.0
- Initial public release
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.11.4)

# IMPORTANT: updating version might require update in package dependencies at the end of this file.
set(KAFE_VERSION "1.0.0")
set(KAFE_VERSION "1.1.0")
set(KAFE_VERSION_INT 10)
set(KAFE_VERSION_DEP_NEXT_MAJOR "2.0.0")

Expand Down
84 changes: 84 additions & 0 deletions DOWNLOAD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
### Latest stable release downloads
#### Latest stable build is v1.1.0

Here you can find links to latest binary packages for all supported operating systems.

- [CentOS and RHEL 7](#centos-and-rhel-7)
- [CentOS and RHEL 8](#centos-and-rhel-8)
- [Debian 9](#debian-9)
- [Debian 10](#debian-10)
- [Debian 11](#debian-11)
- [Fedora 31](#fedora-31)
- [Fedora 32](#fedora-32)
- [Fedora 33](#fedora-33)
- [Ubuntu 18.04](#ubuntu-1804)
- [Ubuntu 19.10](#ubuntu-1910)
- [Ubuntu 20.04](#ubuntu-2004)

*NOTE:* macOS is supported, but there are no binary builds available. See [README](./README.md#building-on-macos)
on how to build macOS binaries from source.

*NOTE:* You should be able to use these binary packages for any derivative distributions too. For example,
Elementary OS 5.1 users can use Ubuntu 18.04 packages, since Elementary OS 5.1 is based on Ubuntu 18.04.

See [releases](https://github.com/libkafe/kafe/releases) for all available downloads and historic versions,
including development headers.

#### CentOS and RHEL 7

- [kafe-cli-1.1.0-1.x86_64.el7.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli-1.1.0-1.x86_64.el7.rpm)
- [libkafe-1.1.0-1.x86_64.el7.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe-1.1.0-1.x86_64.el7.rpm)

**IMPORTANT:** Kafe requires Lua version 5.3, a dependency not available in EL7 by default. You can either
build the package yourself or use [Cheese](http://www.nosuchhost.net/~cheese/fedora/packages/epel-7/x86_64/cheese-release.html)
repository to obtain compatible Lua package.

#### CentOS and RHEL 8

- [kafe-cli-1.1.0-1.x86_64.el8.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli-1.1.0-1.x86_64.el8.rpm)
- [libkafe-1.1.0-1.x86_64.el8.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe-1.1.0-1.x86_64.el8.rpm)

#### Debian 9

- [kafe-cli_1.1.0_amd64.deb9.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli_1.1.0_amd64.deb9.deb)
- [libkafe_1.1.0_amd64.deb9.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe_1.1.0_amd64.deb9.deb)

#### Debian 10

- [kafe-cli_1.1.0_amd64.deb10.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli_1.1.0_amd64.deb10.deb)
- [libkafe_1.1.0_amd64.deb10.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe_1.1.0_amd64.deb10.deb)

#### Debian 11

- [kafe-cli_1.1.0_amd64.deb11.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli_1.1.0_amd64.deb11.deb)
- [libkafe_1.1.0_amd64.deb11.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe_1.1.0_amd64.deb11.deb)

#### Fedora 31

- [kafe-cli-1.1.0-1.x86_64.f31.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli-1.1.0-1.x86_64.f31.rpm)
- [libkafe-1.1.0-1.x86_64.f31.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe-1.1.0-1.x86_64.f31.rpm)

#### Fedora 32

- [kafe-cli-1.1.0-1.x86_64.f32.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli-1.1.0-1.x86_64.f32.rpm)
- [libkafe-1.1.0-1.x86_64.f32.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe-1.1.0-1.x86_64.f32.rpm)

#### Fedora 33

- [kafe-cli-1.1.0-1.x86_64.f33.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli-1.1.0-1.x86_64.f33.rpm)
- [libkafe-1.1.0-1.x86_64.f33.rpm](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe-1.1.0-1.x86_64.f33.rpm)

#### Ubuntu 18.04

- [kafe-cli_1.1.0_amd64.ubu1804.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli_1.1.0_amd64.ubu1804.deb)
- [libkafe_1.1.0_amd64.ubu1804.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe_1.1.0_amd64.ubu1804.deb)

#### Ubuntu 19.10

- [kafe-cli_1.1.0_amd64.ubu1910.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli_1.1.0_amd64.ubu1910.deb)
- [libkafe_1.1.0_amd64.ubu1910.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe_1.1.0_amd64.ubu1910.deb)

#### Ubuntu 20.04

- [kafe-cli_1.1.0_amd64.ubu2004.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/kafe-cli_1.1.0_amd64.ubu2004.deb)
- [libkafe_1.1.0_amd64.ubu2004.deb](https://github.com/libkafe/kafe/releases/download/v1.1.0/libkafe_1.1.0_amd64.ubu2004.deb)
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ remote systems administration tasks.

## Downloads

See [releases](https://github.com/libkafe/kafe/releases).
See [available binary packages](DOWNLOAD.md) for current stable release or [releases](https://github.com/libkafe/kafe/releases) for
all available downloads and historic versions.

Binary builds are available for:

- **CentOS** and **RHEL** versions 7<sup>1</sup>, 8
- **Fedora** versions 31, 32, 33
- **Ubuntu** versions 18.04, 19.10, 20.04
- **Debian** versions 9, 10, 11
- **CentOS** and **RHEL** versions [7<sup>1</sup>](./DOWNLOAD.md#centos-and-rhel-7), [8](./DOWNLOAD.md#centos-and-rhel-8)
- **Fedora** versions [31](./DOWNLOAD.md#fedora-31), [32](./DOWNLOAD.md#fedora-32), [33](./DOWNLOAD.md#fedora-33)
- **Ubuntu** versions [18.04](./DOWNLOAD.md#ubuntu-1804), [19.10](./DOWNLOAD.md#ubuntu-1910), [20.04](./DOWNLOAD.md#ubuntu-2004)
- **Debian** versions [9](./DOWNLOAD.md#debian-9), [10](./DOWNLOAD.md#debian-10), [11](./DOWNLOAD.md#debian-11)

You should be able to use these binary packages for any derivative distributions.
For example, Elementary OS 5.1 users can use Ubuntu 18.04 packages, since Elementary OS is based on Ubuntu 18.04.
Expand Down Expand Up @@ -93,6 +94,19 @@ execute following Kafe CLI command:
When executed, Kafe CLI will look for a file named `kafe.lua` in the current working direcory. This
file will be interpreted and requested tasks from it will be executed against all relevant remote servers.

#### SSH and SSH authentication

Kafe is using SSH for remote command execution and file uploads. It will attempt to use SSH agent, any known local
SSH keys, as well as GSSAPI-WITH-MIC and password based authentication to authenticate to remote hosts.

If no SSH agent is present, you can set the passphrase to be used to decrypt any encrypted private keys using
environment variable `KAFE_SSH_PKEY_PASS`. You can set password to be used for password based authentication using
environment variable named `KAFE_SSH_USER_PASS`.

**IMPORTANT:** Kafe will not automatically add remote keys to known hosts nor will it provide a way to do so interactively.
It is your responsibility to ensure remote host keys are added to known hosts before attempting to connect to remote hosts
using Kafe. Any attempts to connect to remote hosts with unknown or changed host keys will fail.

### Debugging

You can change the logging level of the CLI tool by setting `KAFE_LOG_LEVEL` environment variable. For example:
Expand Down
8 changes: 4 additions & 4 deletions cli/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ namespace kafe {

static string context_to_s(const vector<string> &context) {
if (context.empty()) {
return "";
return {};
}

ostringstream ss;

ss << IO_TTY_ANSI_COLOR_MAGENTA;

for (auto &ctx : context) {
for (const auto &ctx : context) {
ss << '[' << ctx << "] ";
}

Expand All @@ -108,7 +108,7 @@ namespace kafe {
case ALL:
case TRACE:
case DEBUG:
color = "";
color = {};
break;
case INFO:
color = IO_TTY_ANSI_COLOR_BLUE;
Expand Down Expand Up @@ -188,7 +188,7 @@ namespace kafe {
line.c_str()
);

if (len > 1 && line[len - 1] != '\n') {
if (len > 0 && line[len - 1] != '\n') {
fputs("\n", stdout);
}

Expand Down
19 changes: 12 additions & 7 deletions cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ int main(int argc, char *argv[]) {
}

if (0 == strcmp("do", argv[1])) {
if (4 != argc) {
cerr << "Command expects exactly two arguments - environment name an"
" comma separated task list.\n"
"Example: kafe do staging task1,task2,task3";
if (4 > argc) {
cerr << "Command expects exactly at least two arguments - environment name and "
"a comma separated task list with any number of arbitrary arguments "
"to forward to the tasks being invoked.\n"
"Example: kafe do staging task1,task2,task3 <arg, arg, arg>";
print_usage();
return 1;
}
Expand All @@ -136,19 +137,23 @@ int main(int argc, char *argv[]) {
envvals.insert(p);
}


string environment = argv[2];
string task_list_s = argv[3];
vector<string> task_list_v = split_csv_arguments(task_list_s, ',');

vector<string> extra_args;
for (int ii = 4; ii < argc; ++ii) {
extra_args.emplace_back(argv[ii]);
}

try {
auto project = Project("kafe.lua");
auto logger = Logger();
auto context = Context(envvals, environment, task_list_v, &logger);
auto inventory = Inventory();
project.execute(context, inventory);
project.execute(context, inventory, extra_args);
} catch (RuntimeException &e) {
cerr << e.what();
cerr << e.what() << endl;
return 1;
}
return 0;
Expand Down
Loading

0 comments on commit 807d811

Please sign in to comment.