Douban Login Plugin / 豆瓣登录插件


(Erick Guan) #1

Douban is a Chinese SNS website allowing registered users to record information and create content related to film, books, music, and recent events and activities in Chinese cities.
Since Douban didn’t provide email, the user have to fill the email address manually.

Authenticate with discourse with Douban.

通过豆瓣登陆 Discourse。

Register Client Key & Secert / 申请豆瓣接入

  1. 登录豆瓣开发者中心,注册填写相关信息。
  2. 点击我的应用,再点击创建新应用
  3. 填写相关信息。网站域名可填写根域名或者具体域名。如图所示。(验证所需要的标签可在 Discourse 设置中插入,验证后即可删除;访问 Discourse 管理面板 - 内容 - 页面顶部)
    回调地址:
  • https 填写:http://meta.discoursecn.org:443/auth/douban/callback
  • http 填写:http://meta.discoursecn.org/auth/douban/callback
  1. 在申请到的后台找到刚申请到的引用,概览中即可以获得keysecret,将其填入Discourse 设置中。

Installation / 安装

Docker 安装

app.yml

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git

最后一行 - git clone https://github.com/discourse/docker_manager.git 后添加:

- git clone https://github.com/fantasticfears/douban-login.git

Manual / 手动安装

Run rake plugin:install repo=https://github.com/fantasticfears/douban-login in your discourse directory

In development mode, run rake assets:clean

In production, recompile your assets: rake assets:precompile

在您 Discourse 目录中运行 rake plugin:install repo=https://github.com/fantasticfears/douban-login

在开发者模式下,运行 rake assets:clean

在生产模式下,重编译 assets rake assets:precompile

Usage / 使用

Go to Site Settings’s login category, fill in the client id and client secret.

进入站点设置的登录分类,填写 client id 和 client serect。

Issue / 问题

Visit topic on Discourse Meta or GitHub Issues.

访问Discourse Meta上的主题GitHub Issues


Login Strategy for Chinese Discourse / Discourse 登录插件列表
(Cobe) #2

做的真棒!

谢谢你的贡献!

正需要呢。
请问楼主 discourse 的代码在ubuntu的位置中是哪儿呢?


(Erick Guan) #3

你应该把那一段加到 containers/app.yml 里面。


(Cobe) #4

好的,谢谢楼主!

Sent from Mailbox


#5
  rm: cannot remove ‘/var/www/discourse/public/plugins/emoji’: Operation not permitted
ln: failed to create symbolic link ‘/var/www/discourse/public/plugins/emoji/public’: File exists
Cloning into '/var/www/discourse/plugins/douban-login'...
remote: Counting objects: 27, done.
remote: Total 27 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (27/27), done.
Checking connectivity... done.
warning: unable to access '/root/.config/git/attributes': Permission denied

try to install, but error shown above.


(bubill) #6

Install Douban Login Plugin Steps:

1. cd /var/discourse
2. ./launcher enter app
3. cd /var/www/discourse
4. rake plugin:install repo=https://github.com/fantasticfears/douban-login
5. rake assets:precompile
6. exit
7. ./launcher restart app

type url in the browser or refresh browser , click login button , you’ll see douban login.


#7

Hi there,

Thank you so much for your reply,

I followed your step, and could not get to it still


(bubill) #8

OK. That is normal install steps.

but for you, got error . so, maybe it should remove douban plugin ( just rm -rf douban plugin folder)

try rebuild app, exit root ,and login root back .

and try Install douban login plugin again.

Also if have error, please supply error message, and describe more infos as much as possible.


#9

I followed, and
shows

douban client id
douban client secret
on admin page,
but on login page, there is nothing

since I am new here, thus, cannot provide screen shot.


(bubill) #10

Yes. That’s correct.
click login button in the homepage , before exit user


#11

I checked

there is nothing douban login button after click sign up


(bubill) #12

Please sceenshot it .OR Ask for @fantasticfears


#13

@fantasticfears
I tried both qq and douban login.


and result:


(bubill) #14

Sorry. I have no idea .
Are you a chinese ?
see http://meta.discoursecn.org

your site url and QQ numbers ?


#15

W: httplife.com
Q: 51751360


(bubill) #16

oh ! sorry I forget something.

when uninstall login plugin, ( rm -rf douban plugin ), and then clean it( rake assets:clean), then,recompile it ( rake assets:precompile) restart app ( ./launcher restart app ). This is complete uninstall login plugin :slight_smile:
Please try uninstall login plugin agian, and install agian. :smile:


#17
root@QiuLinJia:/var/www/discourse# rake assets:clean
rm: cannot remove ‘/var/www/discourse/public/plugins/emoji’: Operation not permitted
ln: failed to create symbolic link ‘/var/www/discourse/public/plugins/emoji/public’: File exists

any idea?


(bubill) #18

Sorry . I have no idea :frowning:
Just try rake assets:precompile after clean it .
Update uninstall complete plugin
when uninstall login plugin, ( rm -rf douban plugin ), and then clean it( rake assets:clean), then,recompile it ( rake assets:precompile) restart app ( ./launcher restart app ).


#19

root@HTTPLIFE:/var/discourse# ./launcher enter app
Downloading nsenter
Pulling repository samsaffron/nsenter
8c777453fc88: Download complete
511136ea3c5a: Download complete
42eed7f1bf2a: Download complete
120e218dd395: Download complete
a9eb17255234: Download complete
sudo: unable to resolve host HTTPLIFE
nsenter: cannot open /proc/5966/ns/pid: No such file or directory


(bubill) #20

Oh my god !

I have never happen this issue.

Sorry .I have no idea .

You host is ? Digital Ocean ? Linode ? others ?