casdoor/README.md
2021-08-14 14:18:08 +08:00

3.6 KiB

Casdoor

Go Report Card license GitHub issues GitHub stars GitHub forks

Casdoor is a UI-first centralized authentication / Single-Sign-On (SSO) platform based on OAuth 2.0 / OIDC.

Online demo

Deployed site: https://door.casbin.com/

Quick Start

Run your own casdoor program in a few minutes😃

Download

There are two methods, get code via go subcommand get:

go get github.com/casbin/casdoor

or git:

git clone https://github.com/casbin/casdoor

Finally, change directory:

cd casdoor/

We provide two start up methods for all kinds of users.

Manual

Simple configuration

Edit conf/app.conf, modify dataSourceName to correct database info, which follows this format:

username:password@tcp(database_ip:database_port)/

Run

Casdoor provides two run modes, the difference is binary size and user prompt.

Dev Mode

Edit conf/app.conf, set runmode=dev. Firstly build front-end files:

cd web/ && npm install && npm run start

Then build back-end binary file, change directory to root(Relative to casdoor):

go run main.go

That's it! Try to visit http://127.0.0.1:7001/. 🛩️

Prod Mode

Edit conf/app.conf, set runmode=prod. Firstly build front-end files:

cd web/ && npm install && npm run build

Then build back-end binary file, change directory to root(Relative to casdoor):

go build main.go && sudo ./main

Notice, you should visit back-end port, default 8000. Now try to visit http://127.0.0.1:8000/

Docker

This method requires docker and docker-compose to be installed first.

Simple configuration

Edit conf/app.conf, modify dataSourceName to the fixed content:

dataSourceName = root:123@tcp(db:3306)/

If you need to modify conf/app.conf, you need to re-run docker-compose up.

Run

Just execute:

docker-compose up

That's

Detailed documentation

We also provide a complete document as a reference.

Other examples

These all use casdoor as a centralized authentication platform.

  • Casnode: Next-generation forum software based on React + Golang.
  • Casbin-OA: A full-featured OA(Office Assistant) system.
  • ......

Contribute

For casdoor, if you have any questions, you can give Issues, and you can also directly Pull Requests(but we recommend give issues first to communicate with the community).

In addition to contributing codes to casdoor, uou can also contribute to the internationalization of casdoor by translating for casdoor in the language you are good at.

Both are welcome! 😙

License

Apache-2.0