diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f2586c14b516d2867422e53ade616ac1ba92ecee..96931202c04f40b30cd573ed1d4d4c2001bd5ea4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,21 +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: v0.1.0 + hooks: + - id: shell-lint + files: ssl-ca - repo: local hooks: - - id: local_test + - id: test name: make test entry: make test language: system - always_run: True - files: Makefile - -- repo: https://www.shore.co.il/git/shell-pre-commit/ - sha: 604fe77b53d3514d5ad0f66764c7783850bb6e98 - hooks: - - id: shell-lint - files: ssl-ca + files: Makefile|ssl-ca diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..e3a68d0d63f88e8c3fae720b253e0d0209d30c08 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +--- +language: python +python: "2.7" +dist: trusty +sudo: false +group: beta +cache: + - pip + - directories: + - $HOME/.pre-commit + +addons: + apt: + packages: + - mawk + - openssl + - curl + - 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 fe7445bcfa7d963c56424009de093f41228d8391..5b7a85b950e3be63d3597973b7861338a34de4d8 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,10 @@ -.PHONY: install clean test lint +.PHONY: install test install: cp ssl-ca /usr/local/bin/ssl-ca chmod 755 /usr/local/bin/ssl-ca -clean: - if [ -f .server.pid ]; then kill "$$(cat .server.pid)"; fi - rm -rf openssl.cnf certs keys CA.key CA.crt CA.p12 CA.srl .server.pid - -lint: - /bin/sh -en ssl-ca - -test: clean lint +test: ./ssl-ca init test "$$(openssl rsa -noout -check -in CA.key)" = "RSA key ok" test "$$(openssl verify -CAfile CA.crt CA.crt)" = "CA.crt: OK" diff --git a/README.rst b/README.rst index 3a8f768e6c80a7bba7f5a10d950df9d81d583b25..9c6490af9fc7a6e54967e4557951c4f52e92faa7 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,9 @@ SSL-CA ###### +.. image:: https://travis-ci.org/adarnimrod/ssl-ca.svg?branch=master + :target: https://travis-ci.org/adarnimrod/ssl-ca + This utility automates generating an SSL certificate authority, keys and signed certificates. The dependencies are: OpenSSL, cURL git and make (for testing and installation, although you can just copy the file). The use case in mind is @@ -68,10 +71,9 @@ other cert on the internet. 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 ------- @@ -86,6 +88,3 @@ Nimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website <https://www.shore.co.il/>`_. Patches are welcome via `git send-email <http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located at: https://www.shore.co.il/cgit/. - -TODO -----