CLI Application that provides the Freedesktop Secret Service using Pass as its backend!

Related tags

CLI pass-secrets
Overview

pass-secrets

CLI Application that provides the Freedesktop Secret Service using Pass as its backend!

Status

Currently working to store secrets with protonmail-bridge. I have not done tests with other applications; if it doesn't work, please open an issue!

How to build

pass-secrets requires pass and sdbus-c++ to be installed on your machine. Rapidjson and nanoid are included in the repo.

cd pass-secrets
mkdir build
cd build
cmake ..
make

You can then install with sudo make install. This will by default install a systemd user service that can be dbus-activated when enabled.

sudo make install
systemctl --user enable pass-secrets
Issues
  • needing help setting it up

    needing help setting it up

    after enabling/starting the systemd service unit I tried to log in into minecraft, but the unit get stopped because pass couldn't write:

    × pass-secrets.service - Pass SecretService
         Loaded: loaded (/usr/lib/systemd/user/pass-secrets.service; enabled; vendor preset: enabled)
         Active: failed (Result: signal) since Wed 2021-09-29 10:48:43 -03; 432ms ago
        Process: 3564 ExecStart=/usr/bin/pass-secrets (code=killed, signal=ABRT)
       Main PID: 3564 (code=killed, signal=ABRT)
            CPU: 41ms
    
    set 29 10:48:43 shadow systemd[561]: Starting Pass SecretService...
    set 29 10:48:43 shadow systemd[561]: Started Pass SecretService.
    set 29 10:48:43 shadow pass-secrets[3564]: Loaded collection /home/mg_user/.password-store/secretservice/0M58kCNVdu2p9fpY9gHBi
    set 29 10:48:43 shadow pass-secrets[3564]: Found pass at /usr/bin/pass
    set 29 10:48:43 shadow pass-secrets[3564]: terminate called after throwing an instance of 'std::runtime_error'
    set 29 10:48:43 shadow pass-secrets[3564]:   what():  pass returned an error while writing!
    set 29 10:48:43 shadow systemd[561]: pass-secrets.service: Main process exited, code=killed, status=6/ABRT
    set 29 10:48:43 shadow systemd[561]: pass-secrets.service: Failed with result 'signal'.
    

    I probably not setting something right, I followed part of the example from arch wiki and it went all good.

    gpg --gen-key # generated a key, set it up a password and all
    pass init [email protected]
    pass insert archlinux.org/wiki/username # again here all went good, set it up a password too, no errors
    

    what more do I need to do?

    opened by ltsdw 18
  • problem with compiling

    problem with compiling

    Hello @nullobsi Thank you for your work! Can you help me with compilling? Because I have next error:

    [ 83%] Building CXX object CMakeFiles/pass-secrets.dir/impl/CollectionProxy.cpp.o
    In file included from /usr/include/signal.h:328,
                     from /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/vendor/catch2/catch2/catch.h:8007,
                     from /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/tests/unit_tests.cpp:10:
    /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/vendor/catch2/catch2/catch.h:10791:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
    10791 |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
          |                                                          ^~~~~~~~~~~
    In file included from /usr/include/bits/sigstksz.h:24,
                     from /usr/include/signal.h:328,
                     from /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/vendor/catch2/catch2/catch.h:8007,
                     from /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/tests/unit_tests.cpp:10:
    /usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
      640 | extern long int sysconf (int __name) __THROW;
          |                 ^~~~~~~
    In file included from /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/tests/unit_tests.cpp:10:
    /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/vendor/catch2/catch2/catch.h:10850:45: error: size of array ‘altStackMem’ is not an integral constant-expression
    10850 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
          |                                             ^~~~~~~~~~~~
    [ 88%] Building CXX object CMakeFiles/pass-secrets.dir/impl/sessions/Plain.cpp.o
    /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/tests/unit_tests.cpp: In member function ‘predefined_random::result_type predefined_random::operator()()’:
    /home/grisa/.cache/yay/pass-secrets-git/src/pass-secrets/nanoid_cpp/tests/unit_tests.cpp:36:9: warning: no return statement in function returning non-void [-Wreturn-type]
       36 |         }
          |         ^
    make[2]: *** [nanoid_cpp/CMakeFiles/nanoid_tests.dir/build.make:76: nanoid_cpp/CMakeFiles/nanoid_tests.dir/tests/unit_tests.cpp.o] Error 1
    make[1]: *** [CMakeFiles/Makefile2:145: nanoid_cpp/CMakeFiles/nanoid_tests.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    [ 94%] Linking CXX executable pass-secrets
    [ 94%] Built target pass-secrets
    make: *** [Makefile:136: all] Error 2
    
    opened by grigorii-horos 6
  • Unbreak build on FreeBSD

    Unbreak build on FreeBSD

    Packaged

    $ pkg install pass-secrets
    $ pass init <my-key>
    $ daemon -f pass-secrets
    
    $ secret-tool store --label=test foo bar
    
    $ lssecret
    Collection:     Default Keyring
    
    Item:   test
    Key:    foo
    Value:  bar
    
    $ secret-tool search foo bar
    [/org/freedesktop/secrets/collection/ALl1D6BvtyxGuoI6bO2N7/Y8aYEwmavsxeKKfBmiWWb]
    label = test
    secret = abc
    created = 2021-12-21 00:01:04
    modified = 2021-12-21 00:01:04
    attribute.foo = bar
    
    opened by jbeich 1
  • Storing pass secrets in password store and git

    Storing pass secrets in password store and git

    I see that there is some secret information stored as json files. I have several questions:

    1. Should this be stored in the password store directory? Some of the extensions/apps that interface with password store think they are passwords which I think is incorrect. If they aren't passwords then maybe they should be stored elsewhere.
    2. If they should be stored in the password store, should they be tracked in git? Currently I am not tracking them.
    opened by timlag1305 1
  • use lower-level DBus library

    use lower-level DBus library

    sdbus-cpp is great but requires hacks for the proxy objects which increases code complexity

    also, it requires a lot of spreading of the code state. moving to a lower level library would allow some state from dbus (request path)

    opened by nullobsi 0
  • use GPGME

    use GPGME

    Using pass directly as a subprocess feels fragile and prone to error (#2)

    Pros:

    • direct support for encrypting/decrypting
    • error handling
    • less hacky

    Cons:

    • git commit would not be made
    • have to manually support .gpg-id
    opened by nullobsi 0
  • Daemon crashes when the pass store directory doesn't exist

    Daemon crashes when the pass store directory doesn't exist

    I have my pass' store directory set up at ~/.local/share/pass and I set it up through PASSWORD_STORE_DIR environment variable, however the systemd unit didn't have the said variable, so it tried to read from ~/.password-store and the service has died. After adding a systemd unit override to include the environment variable everything started working fine. I suggest that pass' store directory missing could handled gracefully instead of dumping core due to an exception.

    journalctl logs
    Jan 22 21:05:34 uds systemd[936]: Starting Pass SecretService...
    Jan 22 21:05:34 uds systemd[936]: Started Pass SecretService.
    Jan 22 21:05:34 uds pass-secrets[2133]: terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
    Jan 22 21:05:34 uds pass-secrets[2133]:   what():  filesystem error: cannot create directory: No such file or directory [/home/zneix/.password-store/secretservice]
    Jan 22 21:05:34 uds systemd-coredump[2139]: [🡕] Process 2133 (pass-secrets) of user 1000 dumped core.
    
                                                Module linux-vdso.so.1 with build-id f9fada32e91353254b262e357cb155d189cc0523
                                                Module libgpg-error.so.0 with build-id 3801187d42c4955bd93c605451430cdf1b164e63
                                                Module libgcrypt.so.20 with build-id db45f5d5e0f7af1e77324fea1885f974619ad268
                                                Module libcap.so.2 with build-id f56c6cd6ad4d35053340d7ff2f8f954498796739
                                                Module liblz4.so.1 with build-id e63600ab23b2f6997f42fac2fa56e1f02ce159a1
                                                Module libzstd.so.1 with build-id ea8f70c7c6816cee97c9890081a80259ca44d397
                                                Module liblzma.so.5 with build-id 8b615460aa230708c5183f16bede67aa0437d95e
                                                Module librt.so.1 with build-id 75484da2d6f1515189eefa076e0a40328834cd16
                                                Module ld-linux-x86-64.so.2 with build-id 040cc3dd10461562f177df39e3be2f3704258c3c
                                                Module libm.so.6 with build-id 2b8fd1f869ecab4e0b55e92f2f151897f6818acf
                                                Module libsystemd.so.0 with build-id 6a2a26aa5fff87c1eb61137339bc55a53956c9ac
                                                Module libc.so.6 with build-id 4b406737057708c0e4c642345a703c47a61c73dc
                                                Module libpthread.so.0 with build-id 07c8f95b4f3251d08550217ad8a1f31066229996
                                                Module libgcc_s.so.1 with build-id 7f8508bb914546ada778809b64b99d234337d835
                                                Module libstdc++.so.6 with build-id 9b5eeeb149bf3c4efe787fb398b44f00507aec87
                                                Module libsdbus-c++.so.1 with build-id 3b1e7345adc1d1bf90efd0a7789e2259b81b6e2a
                                                Module pass-secrets with build-id 7a3e759d73d8fbe5524afd43868c332ebbc8ba68
                                                Stack trace of thread 2133:
                                                #0  0x00007f8d52e1fd22 raise (libc.so.6 + 0x3cd22)
                                                #1  0x00007f8d52e09862 abort (libc.so.6 + 0x26862)
                                                #2  0x00007f8d53084802 _ZN9__gnu_cxx27__verbose_terminate_handlerEv (libstdc++.so.6 + 0x99802)
                                                #3  0x00007f8d53090c8a _ZN10__cxxabiv111__terminateEPFvvE (libstdc++.so.6 + 0xa5c8a)
                                                #4  0x00007f8d53090cf7 _ZSt9terminatev (libstdc++.so.6 + 0xa5cf7)
                                                #5  0x00007f8d53090f8e __cxa_throw (libstdc++.so.6 + 0xa5f8e)
                                                #6  0x00007f8d530890a1 _ZNSt10filesystem16create_directoryERKNS_7__cxx114pathE (libstdc++.so.6 + 0x9e0a1)
                                                #7  0x000055cfb625e998 n/a (pass-secrets + 0x22998)
                                                #8  0x000055cfb624cf18 n/a (pass-secrets + 0x10f18)
                                                #9  0x000055cfb624acff n/a (pass-secrets + 0xecff)
                                                #10 0x00007f8d52e0ab25 __libc_start_main (libc.so.6 + 0x27b25)
                                                #11 0x000055cfb624b25e n/a (pass-secrets + 0xf25e)
                                                ELF object binary architecture: AMD x86-64
    Jan 22 21:05:34 uds systemd[936]: pass-secrets.service: Main process exited, code=dumped, status=6/ABRT
    Jan 22 21:05:34 uds systemd[936]: pass-secrets.service: Failed with result 'core-dump'.
    Jan 22 21:15:00 uds systemd[936]: Starting Pass SecretService...
    Jan 22 21:15:00 uds systemd[936]: Started Pass SecretService.
    
    opened by zneix 1
The KISS file manager: CLI-based, ultra-lightweight, lightning fast, and written in C

CliFM is a CLI-based, shell-like (non-curses) and KISS terminal file manager written in C: simple, fast, and lightweight as hell

leo-arch 511 Jun 24, 2022
Creating CLI's just got a whole lot better

Staq Creating CLI's just got a whole lot better. Don't worry about CLI colouring, networking, Size of Executables, Speed ever again Have any doubts? R

null 9 Jun 1, 2021
Fegeya Freud, CLI FPaper renderer, based on Totem (`less`-like tool without `--help`)

Fegeya Freud, CLI FPaper renderer, based on Totem (`less`-like tool without `--help`)

Ferhat Geçdoğan 3 Jun 11, 2021
Um CLI para encontrar os seus alias

Manager-Alias Que tal gerenciar todos os seus alias de um único local? Pesquisar e encontrar o que você precisa sem ter que ficar lendo diversos arqui

Wiris Rafael Januario Wernek 3 Oct 26, 2021
Port of ani-cli with more features 😉

Port of ani-cli with more features ??

Dinkan 14 Jun 25, 2022
A CLI for extracting libraries from Apple's dyld shared cache file

dyld-shared-cache-extractor As of macOS Big Sur, instead of shipping the system libraries with macOS, Apple ships a generated cache of all built in dy

Keith Smiley 171 Jun 23, 2022
The Efficient Study Planner (ESP) is a CLI app that gives an optimized plan to study for an upcoming exam.

Welcome to Efficient Study Planner ?? Optimize your study plan with ESP! Table of Contents About The Project Tech Stack Prerequisites How To Use? Lice

Md Ausaf Rashid 3 Dec 30, 2021
Windows Package Manager CLI (aka winget)

Welcome to the Windows Package Manager Client (aka winget.exe) repository This repository contains the source code for the Windows Package Manager Cli

Microsoft 17.3k Jun 28, 2022
CLI to play a word-guessing game like Wordle

Lexeme What is this? Python program to play a word-guessing game like Wordle, but… More addictive because you can play it over and over and over, not

Dan Lenski 6 Feb 7, 2022
This is a simple CLI interface helper library for C.

LIBCCLI This is a very simple shell like interface for CLI activities. More will be added to this, but for now, this is the basic idea:

Steven Rostedt 39 Jun 16, 2022
A CLI program that helps you find classes and plan pre-requisites. Written in C++ and Python.

CourseHelper A CLI program created to help you prepare for course registration. Note: At the moment, this project is built specifically for other UCLA

Kyle Chui 1 Jan 25, 2022
File's sizes as a markdown table (CLI)

File's sizes as a markdown table (CLI)

Reaper 5 Feb 6, 2022
A CLI based solver for the popular word guessing game WORDLE

Project WAR WAR stands for Wordle Answer and Resolver About Wordle is a web-based word game developed by Welsh-born software engineer Josh Wardle, for

Yeluri Ketan 2 Feb 19, 2022
CLI for single-cell analyses

CLI for single-cell analyses This repository provides a no-frills command-line interface for single-cell RNA-seq data analysis from a Matrix Market fi

Aaron Lun 2 Jan 28, 2022
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Cacahuète Sans Sel 18 Apr 27, 2022
CLI11 is a command line parser for C++11 and beyond that provides a rich feature set with a simple and intuitive interface.

CLI11: Command line parser for C++11 What's new • Documentation • API Reference CLI11 is a command line parser for C++11 and beyond that provides a ri

null 2.1k Jun 24, 2022
EAMain provides a multi-platform entry point used for platforms that don't support console output, return codes and command-line arguments.

EAMain provides a multi-platform entry point used for platforms that don't support console output, return codes and command-line arguments.

Electronic Arts 30 May 17, 2022
A basic to-do list application for the command line.

A basic command-line todo list, allowing you to keep track of tasks right in the terminal

Scott Hutchins 1 Oct 22, 2021
A simple command line application in order to create new Code workspaces.

mkcws Summary A simple command line application in order to create new Code workspaces. License This project's license is GPL 2. The whole license tex

Kevin Matthes 0 Apr 1, 2022