From 8ac53385d080103b075c85a5979e0fbf2649056f Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Thu, 1 Dec 2016 10:07:00 +0200 Subject: [PATCH] - Removed clean target, use git clean instead. - Moved test to pre-commit. - Removed lint target, pre-commit already does that. - Removed useless pre-commit checks. - Added Travis CI. - Filled in fields in license. - Updated README accordingly. --- .pre-commit-config.yaml | 11 ++++++++--- .travis.yml | 26 ++++++++++++++++++++++++++ LICENSE.txt | 4 ++-- Makefile | 11 ++--------- README.rst | 10 ++++++---- 5 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 .travis.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a15931b..82d9ff6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,12 +2,17 @@ sha: 97b88d9610bcc03982ddac33caba98bb2b751f5f hooks: - id: check-added-large-files - - id: check-json - - id: check-xml - id: check-yaml - id: check-merge-conflict - repo: https://www.shore.co.il/git/shell-pre-commit/ - sha: 604fe77b53d3514d5ad0f66764c7783850bb6e98 + sha: v0.1.0 hooks: - id: shell-lint files: ssh-ca +- repo: local + hooks: + - id: test + name: make test + language: system + entry: make test + files: ssh-ca|Makefile diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..833d0ec --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +--- +language: python +python: "2.7" +dist: trusty +sudo: false +group: beta +cache: + - pip + - directories: + - $HOME/.pre-commit + +addons: + apt: + packages: + - openssh-server + - openssh-client + - build-essential + +install: + - pip install pre_commit + +script: + - pre-commit run --all-files + +notifications: + email: false diff --git a/LICENSE.txt b/LICENSE.txt index 38c6bf2..26259f8 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) [year] [fullname] +Copyright (c) 2016 Adar Nimrod Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile index d241c56..f7dc457 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -.PHONY: install clean test lint +.PHONY: install test USERNAME = $$(whoami) -test: lint clean ssh_config sshd_config CA CA.pub users/$(USERNAME) hosts/localhost known_hosts +test: ssh_config sshd_config CA CA.pub users/$(USERNAME) hosts/localhost known_hosts $$(PATH=$$PATH:/usr/local/sbin:/usr/sbin:/sbin which sshd) -f sshd_config test "$$(ssh -F ssh_config test whoami)" = "$$USER" kill $$(cat sshd.pid) @@ -49,10 +49,3 @@ ssh_config: install: cp ssl-ca /usr/local/bin/ssh-ca chmod 755 /usr/local/bin/ssh-ca - -clean: - if [ -f sshd.pid ] && [ -d "/proc/$$(cat sshd.pid)" ]; then kill "$$(cat sshd.pid)"; fi - rm -rf CA CA.pub users hosts known_hosts sshd.pid sshd_config ssh_config - -lint: - /bin/sh -en ssh-ca diff --git a/README.rst b/README.rst index 3b66041..97695df 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,9 @@ SSH-CA ###### +.. image:: https://travis-ci.org/adarnimrod/ssh-ca.svg?branch=master + :target: https://travis-ci.org/adarnimrod/ssh-ca + This utility assists in creating an SSH certificate authority. It aims to be production-ready and a secure solution for managing SSH key-pairs for both users and hosts. @@ -87,10 +90,9 @@ Authenticating users Development ----------- -To ease development :code:`make clean`, :code:`make lint` and :code:`make test` -are available. It's recommended to add :code:`make lint` and :code:`make test` -to to your Git pre-commit and pre-push hooks accordingly. Also, this repo has -`pre-commit <http://pre-commit.com/>`_ configured. +For testing run :code:`make test`. For cleaning temporary files run :code:`git +clean -fdx`. You can use `pre-commit <http://pre-commit.com/>`_ to have the test +(which is quite quick) run on every commit to ensure quality code. License ------- -- GitLab