From b034e11989cb40c90406fa3768652a5950d4dfe4 Mon Sep 17 00:00:00 2001 From: Pegasis Date: Fri, 31 Jul 2020 00:22:47 -0400 Subject: [PATCH 1/2] Add installation instructions for CentOS 8 (#320) * Add installation instructions for CentOS 8 * Update on CentOS 8 installation instruction When installing et, libsodium will be automaticly installed. * Update Centos 8 installation instructions * Add docker image and builder docker image to readme && format * capitalize docker * Clone git by https * update readme Building using Docker supported OSes --- README.md | 80 ++++++++++++++++++++++++---------- deployment/centos.Dockerfile | 15 +++---- deployment/opensuse.Dockerfile | 6 +-- deployment/ubuntu.Dockerfile | 6 +-- 4 files changed, 63 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index c49257be8..2e58168e2 100644 --- a/README.md +++ b/README.md @@ -16,21 +16,28 @@ Linux: ![Linux CI](https://github.com/MisterTea/EternalTerminal/workflows/Linux% The easiest way to install is using Homebrew: - brew install MisterTea/et/et +``` +brew install MisterTea/et/et +``` Alternatively, a package is available in MacPorts: - sudo port install et +``` +sudo port install et +``` ### Ubuntu For Ubuntu, use our PPA: - sudo add-apt-repository ppa:jgmath2000/et - sudo apt-get update - sudo apt-get install et +``` +sudo add-apt-repository ppa:jgmath2000/et +sudo apt-get update +sudo apt-get install et +``` Install and build from source: + ``` sudo apt install build-essential libgflags-dev libprotobuf-dev protobuf-compiler libsodium-dev cmake git git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git @@ -41,29 +48,40 @@ cmake ../ make && sudo make install sudo cp ../etc/et.cfg /etc/ ``` + Once built, the binary only requires `libgflags-dev` and `libprotobuf-dev`. ### Debian For debian, use our deb repo. For buster: - echo "deb https://github.com/MisterTea/debian-et/raw/master/debian-source/ buster main" | sudo tee -a /etc/apt/sources.list - curl -sSL https://github.com/MisterTea/debian-et/raw/master/et.gpg | sudo apt-key add - - sudo apt update - sudo apt install et - +``` +echo "deb https://github.com/MisterTea/debian-et/raw/master/debian-source/ buster main" | sudo tee -a /etc/apt/sources.list +curl -sSL https://github.com/MisterTea/debian-et/raw/master/et.gpg | sudo apt-key add - +sudo apt update +sudo apt install et +``` ### CentOS 7 -Up to the present day the only way to install is to [build from source](#centos-7). +Up to the present day the only way to install is to [build from source](#centos-7-1). + +### CentOS 8 +``` +sudo dnf install epel-release +sudo dnf install et +``` ### FreeBSD On FreeBSD, use: - pkg install eternalterminal +``` +pkg install eternalterminal +``` ### Fedora (version 29 and later): + ``` sudo dnf install et ``` @@ -82,28 +100,38 @@ Install dependencies: * Fedora (tested on 25): - sudo dnf install boost-devel libsodium-devel ncurses-devel protobuf-devel \ - protobuf-compiler cmake gflags-devel + ``` + sudo dnf install boost-devel libsodium-devel ncurses-devel protobuf-devel \ + protobuf-compiler cmake gflags-devel + ``` * Gentoo: - sudo emerge dev-libs/boost dev-libs/libsodium sys-libs/ncurses \ - dev-libs/protobuf dev-util/cmake dev-cpp/gflags + ``` + sudo emerge dev-libs/boost dev-libs/libsodium sys-libs/ncurses \ + dev-libs/protobuf dev-util/cmake dev-cpp/gflag + ``` Download and install from source: - git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git - cd EternalTerminal - mkdir build - cd build - cmake ../ - make - sudo make install +``` +git clone --recurse-submodules https://github.com/MisterTea/EternalTerminal.git +cd EternalTerminal +mkdir build +cd build +cmake ../ +make +sudo make install +``` ### Windows Eternal Terminal works under WSL (Windows Subsystem for Linux). Follow the ubuntu instructions. +### Docker Image + +See [docker/README.md](docker/) + ## Verifying Verify that the client is installed correctly by looking for the `et` executable: `which et`. @@ -179,7 +207,7 @@ Grab the deps and then follow this process: Debian/Ubuntu Dependencies: ``` sudo apt install libboost-dev libsodium-dev libncurses5-dev \ - libprotobuf-dev protobuf-compiler cmake libgflags-dev libutempter-dev cmake git + libprotobuf-dev protobuf-compiler cmake libgflags-dev libutempter-dev cmake git ``` Source and setup: @@ -247,6 +275,10 @@ Start the et service: sudo systemctl enable --now et.service ``` +## Building using Docker + +Builder Dockerfiles are located at [deployment/](deployment/). Supported OSes: CentOS 8, openSUSE and Ubuntu. + ## Reporting issues If you have any problems with installation or usage, please [file an issue on github](https://github.com/MisterTea/EternalTerminal/issues). diff --git a/deployment/centos.Dockerfile b/deployment/centos.Dockerfile index 82caad4b6..02e99d146 100644 --- a/deployment/centos.Dockerfile +++ b/deployment/centos.Dockerfile @@ -8,23 +8,18 @@ COPY id_rsa.pub .ssh/ RUN chmod 0400 .ssh/id_rsa RUN dnf -y install dnf-plugins-core -RUN yum update -y -RUN yum groupinstall -y "Development Tools" -RUN yum install -y epel-release +RUN dnf update -y +RUN dnf groupinstall -y "Development Tools" +RUN dnf install -y epel-release RUN dnf config-manager --set-enabled PowerTools -RUN yum install --nogpgcheck -y openssh-server cmake3 gcc-c++ protobuf-devel libsodium-devel +RUN dnf install --nogpgcheck -y openssh-server cmake3 gcc-c++ protobuf-devel libsodium-devel RUN alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \ --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \ --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \ --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ --family cmake -RUN git config --global user.email "jgmath2000@gmail.com" -RUN git config --global user.name "Jason Gauci" - -RUN echo -e "StrictHostKeyChecking no\n" >> ~/.ssh/config - -RUN git clone --branch release git@github.com:MisterTea/EternalTerminal.git +RUN git clone --branch release https://github.com/MisterTea/EternalTerminal.git RUN mkdir -p EternalTerminal/build WORKDIR /root/EternalTerminal/build RUN cmake -DFULL_PROTOBUF=ON .. diff --git a/deployment/opensuse.Dockerfile b/deployment/opensuse.Dockerfile index e2dc75bb2..a332a5837 100644 --- a/deployment/opensuse.Dockerfile +++ b/deployment/opensuse.Dockerfile @@ -10,8 +10,4 @@ COPY .gnupg .gnupg RUN zypper --non-interactive install -t pattern devel_C_C++ RUN zypper --non-interactive install git openssh cmake gcc-c++ protobuf-devel libsodium-devel -RUN git config --global user.email "jgmath2000@gmail.com" -RUN git config --global user.name "Jason Gauci" - -RUN ssh-keyscan github.com >> ~/.ssh/known_hosts -RUN git clone --branch release git@github.com:MisterTea/EternalTerminal.git +RUN git clone --branch release https://github.com/MisterTea/EternalTerminal.git diff --git a/deployment/ubuntu.Dockerfile b/deployment/ubuntu.Dockerfile index be57083cb..5a269c9dd 100644 --- a/deployment/ubuntu.Dockerfile +++ b/deployment/ubuntu.Dockerfile @@ -12,10 +12,6 @@ ARG DEBIAN_FRONTEND=noninteractive RUN apt update && apt upgrade -y && apt install -y distro-info build-essential git devscripts ubuntu-dev-tools aptly dput jq libsodium-dev libprotobuf-dev protobuf-compiler cmake libutempter-dev debhelper dh-systemd -RUN git config --global user.email "jgmath2000@gmail.com" -RUN git config --global user.name "Jason Gauci" - -RUN ssh-keyscan github.com >> ~/.ssh/known_hosts -RUN git clone --branch release git@github.com:MisterTea/EternalTerminal.git +RUN git clone --branch release https://github.com/MisterTea/EternalTerminal.git COPY ubuntu/deploy_ubuntu_ppa.sh . From e81db4eb74da8b12c3cc936fe55b5ceb2330cfa3 Mon Sep 17 00:00:00 2001 From: Jason Gauci Date: Fri, 31 Jul 2020 13:54:53 -0700 Subject: [PATCH 2/2] fix stdout logging (#339) --- src/terminal/TerminalClientMain.cpp | 3 +-- src/terminal/TerminalMain.cpp | 5 +---- src/terminal/TerminalServerMain.cpp | 3 +-- test/Main.cpp | 3 +-- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/terminal/TerminalClientMain.cpp b/src/terminal/TerminalClientMain.cpp index 5eadcce53..c3343e6cd 100644 --- a/src/terminal/TerminalClientMain.cpp +++ b/src/terminal/TerminalClientMain.cpp @@ -24,6 +24,7 @@ int main(int argc, char** argv) { // Setup easylogging configurations el::Configurations defaultConf = LogHandler::setupLogHandler(&argc, &argv); + LogHandler::setupStdoutLogger(); // Parse command line arguments cxxopts::Options options("et", "Remote shell for the busy and impatient"); @@ -103,8 +104,6 @@ int main(int argc, char** argv) { // set thread name el::Helpers::setThreadName("client-main"); - LogHandler::setupStdoutLogger(); - // Install log rotation callback el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler); diff --git a/src/terminal/TerminalMain.cpp b/src/terminal/TerminalMain.cpp index bace9c339..e61f72c35 100644 --- a/src/terminal/TerminalMain.cpp +++ b/src/terminal/TerminalMain.cpp @@ -20,6 +20,7 @@ void setDaemonLogFile(string idpasskey, string daemonType) { int main(int argc, char** argv) { // Setup easylogging configurations el::Configurations defaultConf = LogHandler::setupLogHandler(&argc, &argv); + LogHandler::setupStdoutLogger(); // Parse command line arguments cxxopts::Options options("et", "Remote shell for the busy and impatient"); @@ -148,8 +149,6 @@ int main(int argc, char** argv) { // Install log rotation callback el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler); - LogHandler::setupStdoutLogger(); - CLOG(INFO, "stdout") << "IDPASSKEY:" << idpasskey << endl; if (DaemonCreator::createSessionLeader() == -1) { STFATAL << "Error creating daemon: " << strerror(errno); @@ -183,8 +182,6 @@ int main(int argc, char** argv) { // Install log rotation callback el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler); - LogHandler::setupStdoutLogger(); - SocketEndpoint routerEndpoint; routerEndpoint.set_name(result["serverfifo"].as()); UserTerminalHandler uth(ipcSocketHandler, term, true, routerEndpoint, diff --git a/src/terminal/TerminalServerMain.cpp b/src/terminal/TerminalServerMain.cpp index ba97f49b4..a8d59c66c 100644 --- a/src/terminal/TerminalServerMain.cpp +++ b/src/terminal/TerminalServerMain.cpp @@ -9,6 +9,7 @@ using namespace gflags; int main(int argc, char **argv) { // Setup easylogging configurations el::Configurations defaultConf = LogHandler::setupLogHandler(&argc, &argv); + LogHandler::setupStdoutLogger(); cxxopts::Options options("etserver", "Remote shell for the busy and impatient"); @@ -137,8 +138,6 @@ int main(int argc, char **argv) { // Install log rotation callback el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler); - LogHandler::setupStdoutLogger(); - std::shared_ptr tcpSocketHandler(new TcpSocketHandler()); std::shared_ptr pipeSocketHandler( new PipeSocketHandler()); diff --git a/test/Main.cpp b/test/Main.cpp index 255029007..f32dea7cc 100644 --- a/test/Main.cpp +++ b/test/Main.cpp @@ -9,6 +9,7 @@ int main(int argc, char **argv) { // Setup easylogging configurations el::Configurations defaultConf = et::LogHandler::setupLogHandler(&argc, &argv); + et::LogHandler::setupStdoutLogger(); defaultConf.setGlobally(el::ConfigurationType::ToStandardOutput, "true"); defaultConf.setGlobally(el::ConfigurationType::ToFile, "true"); // el::Loggers::setVerboseLevel(9); @@ -22,8 +23,6 @@ int main(int argc, char **argv) { // Reconfigure default logger to apply settings above el::Loggers::reconfigureLogger("default", defaultConf); - et::LogHandler::setupStdoutLogger(); - int result = Catch::Session().run(argc, argv); FATAL_FAIL(::remove(logPath.c_str()));