You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
hanpeng a111fd672c
fix: Add the configuration of whether to print SQL. The default value is false (#429)
21 hours ago
.github Fix Crowdin sync. 3 weeks ago
authz fix: refresh_token endpoint does not work (#410) 3 weeks ago
conf fix: Add the configuration of whether to print SQL. The default value is false (#429) 21 hours ago
controllers Fix bug in IsGlobalAdmin(). 5 days ago
cred feat: Add bcrypt encrypted password type (#386) 4 weeks ago
i18n Fix translation. 1 month ago
idp fix: idp using goth shows wrong display name (#398) 3 weeks ago
object fix: Add the configuration of whether to print SQL. The default value is false (#429) 21 hours ago
proxy Don't crash when proxy is unavailable. 4 months ago
routers Add permission page. 3 weeks ago
storage Add tencent_cloud_cos.go 2 months ago
swagger feat: update swagger api json with tags (#347) 2 months ago
util Support user uploading via xlsx. 3 weeks ago
web Add ErrorText to syncer. 3 days ago
xlsx Support user uploading via xlsx. 3 weeks ago
.dockerignore feat: support semantic release (#244) 5 months ago
.gitattributes Detect as Go. 2 months ago
.gitignore feat: support checking password through ldap server (#354) 1 month ago
.releaserc.json fix: support master branch trigger (#247) 5 months ago
Dockerfile feat: support create database via cmd line (#417) 1 week ago
LICENSE Initial commit 1 year ago
README.md Add Gitter badge. 3 weeks ago
docker-compose.yml fix: wrong sub return and docker-compose boolean value error. (#375) 1 month ago
go.mod Change syncer.SyncInterval to second-level. 3 days ago
go.sum Change syncer.SyncInterval to second-level. 3 days ago
main.go feat: support create database via cmd line (#417) 1 week ago

README.md

📦️ Casdoor

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

semantic-release docker pull casbin/casdoor GitHub Workflow Status (branch) GitHub Release Docker Image Version (latest semver)

Go Report Card license GitHub issues GitHub stars GitHub forks Crowdin Gitter

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

Casdoor requires a running Relational database to be operational.Thus you need to modify configuration to point out the location of database.

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/ && yarn && yarn run start

A word of caution : Casdoor's front-end is built using yarn. You should use yarn instead of npm. It has a potential failure during building the files if you use npm.

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/. 🛩️
But make sure you always request the backend port 8000 when you are using SDKs.

Production Mode

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

cd web/ && yarn && yarn 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://SERVER_IP:8000/

Docker

Casdoor provide 2 kinds of image:

  • casbin/casdoor-all-in-one, in which casdoor binary, a mysql database and all necessary configurations are packed up. This image is for new user to have a trial on casdoor quickly. With this image you can start a casdoor immediately with one single command (or two) without any complex configuration. Note: we DO NOT recommend you to use this image in productive environment

  • casbin/casdoor: normal & graceful casdoor image with only casdoor and environment installed.

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

Start casdoor with casbin/casdoor-all-in-one

if the image is not pulled, pull it from dockerhub

docker pull casbin/casdoor-all-in-one

Start it with

docker run -p 8000:8000 casbin/casdoor-all-in-one

Now you can visit http://localhost:8000 and have a try. Default account and password is 'admin' and '123'. Go for it!

Start casdoor with casbin/casdoor

modify the configurations

For the convenience of your first attempt, docker-compose.yml contains commands to start a database via docker.

Thus edit conf/app.conf to point out the location of database(db:3306), modify dataSourceName to the fixed content:

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

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

Run

docker-compose up

That's it! Try to visit http://localhost:8000/. 🛩️

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, or you can also directly start Pull Requests(but we recommend giving issues first to communicate with the community).

I18n notice

If you are contributing to casdoor, please note that we use Crowdin as translating platform and i18next as translating tool. When you add some words using i18next in the web/ directory, please remember to add what you have added to the web/src/locales/en/data.json file.

License

Apache-2.0