diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a15931bc5c2c9884dc6fbeaeca708c633c466206..82d9ff6a75044595e0e28e17960035087f30a59c 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 0000000000000000000000000000000000000000..833d0ec24697eb5a580487c87a0ad229213834fa --- /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 38c6bf23b1163a62b464155a95401d90348e3ff3..26259f8ede5ead7e28994616f416fbe2e1f193e5 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 d241c56af22c6713a826b123e638dd724dfcc1d7..f7dc457bf7226fa9aa64e1cc582dd6511a141b0f 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 3b660418f3901381910a2e24eaec4b9d4cbc249b..97695df6fbc26f91d52ced196475fec8d64a6895 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 -------