Simple password manager service
- Download the binary file from GitHub Releases.
- Extract the downloaded binary file then make sure it's executable.
tar -xzf pwman_backend....tar.gz chmod u+x pwman_backend
- Create configuration file from the template.
cp app.yml.example app.yml
- Edit the app config file as needed. You can check the template for explanation of each field.
- Generate new secret string for TOTP.
./pwman_backend -gen # will output something like 'Your secret: KBXXXX............'
- Put that secret string to
app.yml
in sectioncred.secret
. - 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. - Verify that the TOTP is valid
If already output VERIFIED then you may continue for next step.
./pwman_backend -verify 123456 # will output 'ERR: INVALID' if the given otp is invalid otherwise should output 'VERIFIED'
- 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`
- Change debug in
app.yml
tofalse
, then run the app../pwman_backend
- 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.
[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
- Save above systemd script in
/etc/systemd/system/
with a filename maybe something likepwman_backend.service
. - Run and enable systemd, so it will run even after reboot.
sudo systemctl enable pwman_backend.service --now
This project is licensed under the MIT License - see the LICENSE file for details.