diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-sectool.spec | 204 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 206 insertions, 0 deletions
@@ -0,0 +1 @@ +/sectool-0.0.17.tar.gz diff --git a/python-sectool.spec b/python-sectool.spec new file mode 100644 index 0000000..650065a --- /dev/null +++ b/python-sectool.spec @@ -0,0 +1,204 @@ +%global _empty_manifest_terminate_build 0 +Name: python-sectool +Version: 0.0.17 +Release: 1 +Summary: A tool for keeping secrets during software builds and deployments +License: MIT License +URL: https://github.com/ivaganov/sectool.git +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/62/c6/a2cbaea1f93c42fe1ecfc966fa130f3e4a9d65a8d1ef3dae9790c1055a45/sectool-0.0.17.tar.gz +BuildArch: noarch + + +%description +SEC_FILE="$1" PASS="$2" TMPL_FILE="$3" python3 -c "$script" +} +``` +Inject to ``Dockerfile`` and build a Docker image: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "Dockerfile" | docker build -t tulip -f - . +``` +Inject to ``docker-compose.yml`` and build all images mentioned there: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "docker-compose.yml" | docker-compose -f - build +``` +Inject to AWS Task Definition: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "my-aws-task-def.json" | xargs -0 aws ecs register-task-definition --region eu-west-1 --cli-input-json +``` +### How do I encrypt .ini file? +Easy. You need ``openssl``, the software is very popular and included in almost popular Linux/Unix distributions. +How do I encrypt file? +```shell +openssl enc -aes128 -pbkdf2 -in secrets.ini -out secrets.dat +``` +Don't forget password that the tool will ask! If you forget it, you won't be able to get access to your secrets. +How do I decrypt to check if everything okay? +```shell +openssl enc -aes128 -pbkdf2 -d -in secrets.dat -pass pass:<password> +``` +### How do I mention secret variables in my, for instance, Dockerfile? +Just use a name of the variable in double curly brackets ``{{api_key}}`` +Example of .ini file: +```ini +[secrets] +api_key = AGTDBLWLB5BGG7NNVHV +``` +Example of Dockerfile: +```dockerfile +FROM ubuntu:20.04 +USER wheel +ENV API_KEY={{api_key}} +``` + +%package -n python3-sectool +Summary: A tool for keeping secrets during software builds and deployments +Provides: python-sectool +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-sectool +SEC_FILE="$1" PASS="$2" TMPL_FILE="$3" python3 -c "$script" +} +``` +Inject to ``Dockerfile`` and build a Docker image: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "Dockerfile" | docker build -t tulip -f - . +``` +Inject to ``docker-compose.yml`` and build all images mentioned there: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "docker-compose.yml" | docker-compose -f - build +``` +Inject to AWS Task Definition: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "my-aws-task-def.json" | xargs -0 aws ecs register-task-definition --region eu-west-1 --cli-input-json +``` +### How do I encrypt .ini file? +Easy. You need ``openssl``, the software is very popular and included in almost popular Linux/Unix distributions. +How do I encrypt file? +```shell +openssl enc -aes128 -pbkdf2 -in secrets.ini -out secrets.dat +``` +Don't forget password that the tool will ask! If you forget it, you won't be able to get access to your secrets. +How do I decrypt to check if everything okay? +```shell +openssl enc -aes128 -pbkdf2 -d -in secrets.dat -pass pass:<password> +``` +### How do I mention secret variables in my, for instance, Dockerfile? +Just use a name of the variable in double curly brackets ``{{api_key}}`` +Example of .ini file: +```ini +[secrets] +api_key = AGTDBLWLB5BGG7NNVHV +``` +Example of Dockerfile: +```dockerfile +FROM ubuntu:20.04 +USER wheel +ENV API_KEY={{api_key}} +``` + +%package help +Summary: Development documents and examples for sectool +Provides: python3-sectool-doc +%description help +SEC_FILE="$1" PASS="$2" TMPL_FILE="$3" python3 -c "$script" +} +``` +Inject to ``Dockerfile`` and build a Docker image: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "Dockerfile" | docker build -t tulip -f - . +``` +Inject to ``docker-compose.yml`` and build all images mentioned there: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "docker-compose.yml" | docker-compose -f - build +``` +Inject to AWS Task Definition: +```shell +echo -n "Enter your password: " +read PASSWORD +merge "secrets.dat" $PASSWORD "my-aws-task-def.json" | xargs -0 aws ecs register-task-definition --region eu-west-1 --cli-input-json +``` +### How do I encrypt .ini file? +Easy. You need ``openssl``, the software is very popular and included in almost popular Linux/Unix distributions. +How do I encrypt file? +```shell +openssl enc -aes128 -pbkdf2 -in secrets.ini -out secrets.dat +``` +Don't forget password that the tool will ask! If you forget it, you won't be able to get access to your secrets. +How do I decrypt to check if everything okay? +```shell +openssl enc -aes128 -pbkdf2 -d -in secrets.dat -pass pass:<password> +``` +### How do I mention secret variables in my, for instance, Dockerfile? +Just use a name of the variable in double curly brackets ``{{api_key}}`` +Example of .ini file: +```ini +[secrets] +api_key = AGTDBLWLB5BGG7NNVHV +``` +Example of Dockerfile: +```dockerfile +FROM ubuntu:20.04 +USER wheel +ENV API_KEY={{api_key}} +``` + +%prep +%autosetup -n sectool-0.0.17 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-sectool -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.17-1 +- Package Spec generated @@ -0,0 +1 @@ +7c4908d05b4ac4bb575b70d81abc8641 sectool-0.0.17.tar.gz |
