A simple Anonynous Forum app using Actix-web, Casbin and Diesel, with JWT support. This example uses Casbin Actix Middleware and Casbin Actix Actor
- Rename
secret.key.sampletosecret.keyor create your own key by runninghead -c16 /dev/urandom > secret.keyin command line and copy to/srcfolder - Create a database in postgres.
- Rename
.env.sampleto.env. - Update
DATABASE_URLwith your custom configuration. - You may modify
APP_HOST,APP_PORT,POOL_SIZEwith your custom configuration. - WARNING: Please do not change
HASH_ROUNDS, if you insist to do so, please modify the root default password with bcrypt encryption manually (/migrations/2020-07-15-061549_add_root_user/up.sql). - Run with release profile:
cargo run --release
- Default root username:
root, root password:casbin - After running the server you may register
adminuser with password, then modify theusertable in database, alter therolecolumn into1. Then you haveadmin permissionwith useradmin. preset.csvcontains the casbin policies which you want add in the begining, you can alter it to meet your needs.casbin.confis the casbin configuration file, you can alter it to meet your needs.- WARNING: If you want to run this example, suggest not modify
preset.csvandcasbin.conf.