pwman_backend

command module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 9 Imported by: 0

README

Password Manager API

Simple password manager service

How to Use

  1. Download the binary file from GitHub Releases.
  2. Extract the downloaded binary file then make sure it's executable.
    tar -xzf pwman_backend....tar.gz
    chmod u+x pwman_backend
    
  3. Create configuration file from the template.
    cp app.yml.example app.yml
    
  4. Edit the app config file as needed. You can check the template for explanation of each field.
  5. Generate new secret string for TOTP.
    ./pwman_backend -gen
    # will output something like 'Your secret: KBXXXX............'
    
  6. Put that secret string to app.yml in section cred.secret.
  7. Use 2FA apps such as Microsoft Authenticator or Authy or similar, add new account and manually copy secret string above, or you can generate the QR code file using ./pwman_backend -qr "/my/path/" and finally just scan that QR image.
  8. Verify that the TOTP is valid
    ./pwman_backend -verify 123456
    # will output 'ERR: INVALID' if the given otp is invalid otherwise should output 'VERIFIED'
    
    If already output VERIFIED then you may continue for next step.
  9. Run migration and seeder (optional). migration alone should be sufficient since that will create the tables.
    ./pwman_backend -migrate -seed
    # if only need migration then just use `-migrate`
    
  10. Change debug in app.yml to false, then run the app.
    ./pwman_backend
    
  11. Check the log file that should be resided in directory that you put in config. There are should be 3 logs file:
  • fiber-app-log is for fiber log access log, contain all endpoints that has been hit by client.
  • log is for internal log, for example if failed to query from repository layer, this app's host and port, etc.
  • gorm-log just as the name suggest, GORM-related log file.
Optional (Integrate with systemd)
[Unit]
Description=instance to serve pwman api service
After=network.target

[Service]
User=root
Group=your-username
ExecStart=/bin/sh -c "cd /path/to/binary/file && ./pwman_backend"

[Install]
WantedBy=multi-user.target
  1. Save above systemd script in /etc/systemd/system/ with a filename maybe something like pwman_backend.service.
  2. Run and enable systemd, so it will run even after reboot.
sudo systemctl enable pwman_backend.service --now

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL