Casbin-forum is the official forum for Casbin developers and users.

Overview

Casbin-forum

Casbin-forum is the official forum for Casbin developers and users.

Link

https://forum.casbin.com/

Architecture

Casbin-forum contains 2 parts:

Name Description Language Source code
Frontend Web frontend UI for Casbin-forum Javascript + React https://github.com/casbin/casbin-forum/tree/master/web
Backend RESTful API backend for Casbin-forum Golang + Beego + MySQL https://github.com/casbin/casbin-forum

Installation

  • Get the code:

    go get github.com/casbin/casbin-forum

    or

    git clone https://github.com/casbin/casbin-forum
  • Custom settings: Casbin-forum currently allows some user-defined items, and the customized files are located in web/src/main/custom/.

    Customizable option:

    • Logo, include forum Logo and organization Logo which organization by web/src/main/custom/logo.css
  • Setup database:

    Casbin-forum will store its users, nodes and topics informations in a MySQL database named: casbin_forum, will create it if not existed. The DB connection string can be specified at: https://github.com/casbin/casbin-forum/blob/master/conf/app.conf

    dataSourceName = root:[email protected](localhost:3306)/

    Casbin-forum uses XORM to connect to DB, so all DBs supported by XORM can also be used.

  • Setup your forum to enable some third-party login platform:

    Casbin-forum provide a way to sign up using Google account, Github account, WeChat account and so on, so you may have to get your own ClientID and ClientSecret first.

    1. Google

      You could get them by clicking on this url: https://console.developers.google.com/apis You should set Authorized JavaScript origins to fit your own domain address, for local testing, sethttp://localhost:3000. And set the Authorized redirect URIs, the same domain address as before, add /callback/google/signup and /callback/google/link after that, for local testing, sethttp://localhost:3000/callback/google/signup + http://localhost:3000/callback/google/link.

    2. Github

      You could get them by clicking on this url: https://github.com/settings/developers You should set Homepage URL to fit your own domain address, for local testing, sethttp://localhost:3000. And set the Authorization callback URL, the same domain address as before, add /callback/github after that, for local testing, sethttp://localhost:3000/callback/github.

    And to improve security, you could set a state value determined by yourself to make sure the request is requesting by yourself, such as "random". Those information strings can be specified at: https://github.com/casbin/casbin-forum/blob/master/conf/app.conf

    GoogleAuthClientID = "xxx" //your own client id
    GoogleAuthClientSecret = "xxx" //your own client secret
    GoogleAuthState = "xxx" //set by yourself
    GithubAuthClientID = "xxx" //your own client id
    GithubAuthClientSecret = "xxx" //your own client secret
    GithubAuthState = "xx" //set by yourself, we may change this to a random word in the future

    You may also have to fill in the same information at: https://github.com/casbin/casbin-forum/blob/master/web/src/Conf.js. By the way, you could change the value of scope to get different user information form them if you need, we just take profile and email.

    export const GoogleClientId  = "xxx"
    
    export const GoogleAuthState  = "xxx"
    
    export const GoogleAuthScope  = "profile+email"
    
    export const GithubClientId  = "xxx"
    
    export const GithubAuthState  = "xxx"
    
    export const GithubAuthScope  = "user:email+read:user"
    1. QQ

      Before you begin to use QQ login services, you should make sure that you have applied the application at QQ-connect

    Configuration:

    export const QQClientId  = ""
    
    export const QQAuthState  = ""
    
    export const QQAuthScope  = "get_user_info"
    
    export const QQOauthUri = "https://graph.qq.com/oauth2.0/authorize"
    QQAPPID = ""
    QQAPPKey = ""
    QQAuthState = ""
    1. WeChat

      Similar to QQ login service, before using WeChat to log in, you need to apply for OAuth2.0 service fee on the WeChat open platform open weixin. After completing the configuration, you can log in via WeChat QR code.

    Configuration:

    export const WechatClientId  = ""
    
    export const WeChatAuthState = ""
    
    export const WeChatAuthScope = "snsapi_login"
    
    export const WeChatOauthUri = "https://open.weixin.qq.com/connect/qrconnect"
    WeChatAPPID = ""
    WeChatKey = ""
    WeChatAuthState = ""

    We would show different login/signup methods depending on your configuration.

  • OSS, Mail, and SMS services.

    We use Ali OSS, Ali Mail, and Ali SMS to save the user's pictures, send emails to users and send short messages to users.

    You could use another OSS, Mail, and SMS services, we separate those functions from main code, you could found those functions at https://github.com/casbin/casbin-forum/tree/master/service

    We would mainly use Ali services for example in the next.

    Information in Conf.js

    export const OSSRegion = "" //your oss region
    
    //The endpoint of your oss region, find it on https://help.aliyun.com/document_detail/31837.html
    export const OSSEndPoint = "" //your oss end point
    
    export const OSSBucket = "" //your oss bucket
    
    //The path stored in your oss
    //eg: `casbin-forum` or `casbin/forum/xxx/xxx`
    export const OSSBasicPath = "" //prefix for saved pictures 
    
    //If you set a custom domain name in ali-oss bucket, please fill in.
    export const OSSCustomDomain = ""

    Information in app.conf. You could get your roleArn in https://ram.console.aliyun.com/roles. Before that, you should have an independent account for this application, and add corresponding permissions. Such as:

    {
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "oss:PutObject",
                    "oss:GetObject",
                    "oss:AbortMultipartUpload",
                    "oss:DeleteObject"
                ],
                "Resource": [
                    "acs:oss:*:*:yourbucket",
                    "acs:oss:*:*:yourbucket/*"
                ]
            }
        ],
        "Version": "1"
    }
    

    By the way, you should set your bucket permissions to public read.

    accessKeyID     = ""
    accessKeySecret = ""
    roleArn         = ""
    OSSCustomDomain = ""
    OSSBasicPath = ""
    OSSRegion = ""
    OSSEndPoint = ""
    OSSBucket = ""
    SMSSignName = ""
    SMSTemplateCode = ""
    mailUser = ""
    mailPass = ""
    mailHost = ""
    mailPort = ""
  • Github corner

    We added a Github icon in the upper right corner, linking to your Github repository address. You could set ShowGithubCorner to hidden it.

    Configuration:

    export const ShowGithubCorner = true
    
    export const GithubRepo = "https://github.com/casbin/casbin-forum" //your github repository
  • Run backend (in port 7000):

    go run main.go
  • Run frontend (in the same machine's port 3000):

    cd web
    ## npm
    npm install
    npm run start
    ## yarn
    yarn install
    yarn run start
  • Open browser:

    http://localhost:3000/

Comments
  • There seems to be a bug when creating a new topic.

    There seems to be a bug when creating a new topic.

    There seems to be a bug. When creating a new topic, clicking multiple times will create multiple identical topics. Normally, only one should be created.

    image

    bug released 
    opened by erdengk 16
  • Added Casdoor JS SDK

    Added Casdoor JS SDK

    Part of: https://github.com/casbin/casnode/issues/256

    This is a initial version of Casdoor JS SDK. It only supports password login. In next PRs, I will implement these functions:

    • OAuth login
    • Forget password
    • 2FA

    Deployed at: https://forum.chromium.link Username: Kininaru Password: 123

    opened by kininaru 10
  • fix: made casnode adapt the layout according to the page size

    fix: made casnode adapt the layout according to the page size

    fix: https://github.com/casbin/casnode/issues/191

    Now, when you drag the browser window to 4:3, it automatically displays the phone's layout, no matter what device you are using.

    And now there is a minimum width limit.

    Deployed at: https://forum-hk.chromium.link/

    released 
    opened by kininaru 10
  • fix: zoom image broken

    fix: zoom image broken

    fix: #436 CPT2203060120-500x563 The package Zmage seemed to be broken, replaced the places which require zoom images with package https://www.npmjs.com/package/react-image-zooom

    opened by MayankMittal1 9
  • chore: optimize images

    chore: optimize images

    *Total -- 43.74kb -> 27.72kb (36.63%)

    /web/src/logo.png -- 33.46kb -> 18.87kb (43.62%) /web/public/favicon.png -- 10.28kb -> 8.85kb (13.88%)

    Signed-off-by: ImgBotApp [email protected]

    opened by Rajpratik71 9
  • Implement post content translation via API like Google Translate API

    Implement post content translation via API like Google Translate API

    Currently this website does not support language translation. Because of that it tough for other user who are not familiar with chinese language to understand the content.

    I like to work on this by add google translation api.

    Update:

    See Twitter: https://twitter.com/bts_bighit/status/1403641483832422405

    image

    image

    We may provide a translate button for each post, we will also provide a global switch to translate all contents shown.

    enhancement 
    opened by kunalprakash1309 9
  • Make it SEO friendly via SSR

    Make it SEO friendly via SSR

    Refer to: https://forum.casbin.com/t/75

    As we know, SPA is not friendly for SEO like Googlebot. We need to add SSR (Server-Side Rendering) to this React app, like using Next.js: https://nextjs.org/

    enhancement 
    opened by hsluoyz 9
  • fix: [Web] fixed hidding of SignIn behind github -with signoff

    fix: [Web] fixed hidding of SignIn behind github -with signoff

    This PR fixes #306 Signed-off-by: Nikhil [email protected]

    ** Description ** There was an issue with the navbar links as on the smaller devices the "SignIn" link gets hide behind the GitHub logo.

    Before Changes

    Screenshot from 2021-06-22 17-40-06

    Screenshot from 2021-06-22 17-40-01

    After Changes

    Screenshot from 2021-06-22 17-39-43

    Screenshot from 2021-06-22 17-39-50

    opened by NikhilSharma03 8
  • fix: Perfect the function of add node

    fix: Perfect the function of add node

    Signed-off-by: MRGUOKING [email protected]

    You can add a node on a page, and the node ID will be automatically generated according to the node name and parent node

    Signed-off-by: MRGUOKING [email protected]

    opened by MRGUOKING 8
  • It is recommended to put all configuration (including front-end configuration) on the back end

    It is recommended to put all configuration (including front-end configuration) on the back end

    建议将所有配置(包括前端配置)放到后端,后端提供一个公开接口来向前端提供配置,而前端总是只与一个后端API交互,而所有配置统一由后端管理,主要是casdoor的配置

    It is recommended to put all configuration (including front-end configuration) on the back end, which provides a public interface to provide configuration to the front end, which always only interacts with a back-end API, and all configuration is managed by the back end,mainly casdoor configuration

    question 
    opened by lchjczw 7
  • Try to use docker to simplify the deployment process of casbin-forum

    Try to use docker to simplify the deployment process of casbin-forum

    I want to try to use docker to simplify the deployment process of casbin-forum , This will make it easier for more users and developers to try the forum

    enhancement 
    opened by ChelesteWang 7
  • The casdoor page is blank

    The casdoor page is blank

    [[email protected] web]# serve -s build -l 8000 ERROR: Cannot copy server address to clipboard: Couldn't find the xsel binary and fallback didn't work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel.

    ┌──────────────────────────────────────────────────┐ │ │ │ Serving! │ │ │ │ - Local: http://localhost:8000 │ │ - On Your Network: http://165.22.14.90:8000 │ │ │ └──────────────────────────────────────────────────┘

    image

    question 
    opened by truman1998 1
  • Failed to access http://your-ip:8000

    Failed to access http://your-ip:8000

    `[[email protected] web]# npm run build

    [email protected] build craco build

    Creating an optimized production build... Compiled successfully.

    File sizes after gzip:

    783.97 kB build/static/js/main.2df5edba.js 73.89 kB build/static/css/main.f8e90a0a.css

    The bundle size is significantly larger than recommended. Consider reducing it with code splitting: https://goo.gl/9VhYWB You can also analyze the project dependencies: https://goo.gl/LeUzfb

    The project was built assuming it is hosted at /. You can control this with the homepage field in your package.json.

    The build folder is ready to be deployed. You may serve it with a static server:

    yarn global add serve serve -s build

    Find out more about deployment here:

    https://cra.link/deployment`

    [[email protected] web]# cd .. [[email protected] casdoor]# sudo nohup ./main & [1] 27548 [[email protected] casdoor]# nohup: ignore input and append output to "nohup.out"

    Unable to access http://your-ip:8000 to configure Casnode

    [[email protected] web]# netstat -tln Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp6 0 0 ::1:25 :::* LISTEN tcp6 0 0 :::111 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 :::8888 :::* LISTEN

    to open ports 7001 and 8000, but it does not show occupied

    The database password has been changed to 123 driverName = mysql dataSourceName = root:[email protected](localhost:3306)/

    bug 
    opened by truman1998 1
  • Support discuz x3.4 Theme

    Support discuz x3.4 Theme

    Hi mainainer,

    We are trying to use casnode instead of Discuz X. Our volunteer perfer to use the currently Discuz X theme. The website is https://bbs.baobeihuijia.com/

    image image

    enhancement 
    opened by deancn 2
  • Fix broken links in member profile page

    Fix broken links in member profile page

    Like: https://forum.casbin.com/member/MayankMittal1

    We need to fix these broken links:

    image

    We should fix it to have the same behavior as: https://v2ex.com/member/redbeanice . See how it works.

    image

    bug 
    opened by hsluoyz 1
Releases(v1.8.0)
Owner
Casbin
Casbin authorization library and the official middlewares
Casbin
Purpose: dump slack messages, users and files using browser token and cookie.

Slack Dumper Purpose: dump slack messages, users and files using browser token and cookie. Typical usecase scenarios: You want to archive your private

Rustam 253 Nov 27, 2022
Quickly clone an entire org/users repositories into one directory - Supports GitHub, GitLab, Bitbucket, and more

ghorg ghorg allows you to quickly clone all of an orgs, or users repos into a single directory. This can be useful in many situations including Search

Jay Gabriels 1.1k Nov 30, 2022
Official vilmos visual language interpreter!

vilmos interpreter - let's put software in museums ?? Uninstall all your IDE's, close the terminal, install your favourite drawing software and start

null 29 May 23, 2022
The official golang implementation for Project Anatha.

Project Anatha The official golang implementation for Project Anatha. For instructions on setting up a validator on the Anatha network, view the guide

潘毅 0 Nov 25, 2021
The official Go implementation for interacting with the TonicPow API

The official Go implementation for interacting with the TonicPow API Table of Contents Installation Documentation Examples & Tests Benchmarks Code Sta

TonicPow 8 Jan 17, 2022
klaytnBreak - Official golang implementation of the Klaytn protocol

Klaytn Official golang implementation of the Klaytn protocol. Please visit KlaytnDocs for more details on Klaytn design, node operation guides and app

Zer0Luck 0 Jan 13, 2022
Go-generic-unboxing - A quick ready to ship demo for go generic using the official example

Go generic This repo contain basic demo for installing and running go1.18beta1 v

Shenouda Fawzy 1 Feb 1, 2022
TLDR Page Creator is a program designed to help users make TLDR pages

TLDR Page Creator is a program designed to help users make TLDR pages, while avoiding syntax errors from TLDR-style markdown.

null 10 Dec 3, 2022
Read RFID card data so Protospace directors can assign them to users!

RFID Reader Dependencies This application was developed with: go1.17.5 linux/amd64 xclip version 0.13 (if you're on Linux) Find go for your OS and arc

Protospace - Calgary's Makerspace 1 Dec 15, 2021
Using JWT to authenticate the users of an web-application

Checkpoint Using JWT to authenticate the users of a web-application. Routes /api

AmirH.Najafizadeh 5 Oct 2, 2022
[TOOL, CLI] - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships. Export structural types as TypeScript value object or bare type representations.

typex Examine Go types and their transitive dependencies. Export results as TypeScript value objects (or types) declaration. Installation go get -u gi

Daniel T. Gorski 154 Nov 2, 2022
:chart_with_upwards_trend: Monitors Go MemStats + System stats such as Memory, Swap and CPU and sends via UDP anywhere you want for logging etc...

Package stats Package stats allows for gathering of statistics regarding your Go application and system it is running on and sent them via UDP to a se

Go Playgound 163 Nov 10, 2022
James is your butler and helps you to create, build, debug, test and run your Go projects

go-james James is your butler and helps you to create, build, debug, test and run your Go projects. When you often create new apps using Go, it quickl

Pieter Claerhout 56 Oct 8, 2022
A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

Cron.go This is a simple library to handle scheduled tasks. Tasks can be run in a minimum delay of once a second--for which Cron isn't actually design

Robert K 215 Nov 19, 2022
Library to work with MimeHeaders and another mime types. Library support wildcards and parameters.

Mime header Motivation This library created to help people to parse media type data, like headers, and store and match it. The main features of the li

Anton Ohorodnyk 25 Nov 9, 2022
The new home of the CUE language! Validate and define text-based and dynamic configuration

The CUE Data Constraint Language Configure, Unify, Execute CUE is an open source data constraint language which aims to simplify tasks involving defin

null 3.2k Nov 28, 2022
Hack this repo and add your name to the list above. Creativity and style encouraged in both endeavors.

Hack this repo and add your name to the list above. Creativity and style encouraged in both endeavors.

Danger 2 Oct 1, 2021
A comprehensive training, nutrition, and social platform for martial artists and combat sport athletes

COMHRAC Comhrac (Gaelic for "Combat") is a comprehensive training, nutrition, and social platform for martial artists and combat sport athletes. Devel

Jack Hegarty 0 Oct 17, 2021
Package buildinfo provides basic building blocks and instructions to easily add build and release information to your app.

Package buildinfo provides basic building blocks and instructions to easily add build and release information to your app. This is done by replacing variables in main during build with ldflags.

null 1 Nov 14, 2021