我正在尝试使用这些说明设置Discourse开发环境.但是,当我运行Vagrant时,我得到错误:
NFS报告您的导出文件无效.在对文件进行任何更改之前,Vagrant会进行此检查.请更正以下问题并执行"vagrant reload":
无法打开/ etc/exports
我查了一下,而且我没有etc/exports文件夹,所以我创建了一个并运行了vagrant reload.这让我:
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/hosts/bsd/host.rb:146:in
read': Is a directory - /etc/exports (Errno::EISDIR) from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/hosts/bsd/host.rb:146:innfs_prune'来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/ plugins/synced_folders/nfs/synced_folder.rb:68:incleanup' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:24:inblock in call'from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:22:ineach_key' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/synced_folder_cleanup.rb:22:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:12:incall' .1/lib/vagrant/action/warden.rb:34:call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:118:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in来电'来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/env_set.rb:19:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4. 1/lib/vagrant/action/warden.rb:34:call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/builtin/provision.rb:52:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:13:incall'来自/ Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/set_name.rb:19:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34 :call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in来自/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:34:incall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/providers/virtualbox/action/check_accessible.rb:18:in来自/ Applications/Vagrant/embedded/gems/gems/vagrant -1.4.1/lib/vagrant/action/warden.rb:34:inizeize_actioncall' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/lib/vagrant/action/warden.rb:95:in' …
我在我的主域example.com上设置了一个项目,然后将其移动到子域sub.example.com
现在,当我尝试在OpenId上使用相同的(默认的ASP.NET MVC或我的Discourse论坛)项目并点击Google按钮使用我的Google帐户登录时,会抛出以下错误 -
那是一个错误.
OpenID auth request contains an unregistered domain: http://sub.example.com
我曾尝试使用谷歌搜索该消息,但显然我是前四个人之一.这里有什么想法?
我正在寻找为我正在开发的网站集成留言板.新的话语板看起来很有趣http://www.discourse.org/但是没有太多关于通过oauth2或sso或者使用rails引擎类型系统集成到另一个站点的信息.有没有人用这样的应用程序成功设置了这个?
谢谢
编辑
是否存在未来如何进行此整合的路线图?它的一部分看起来非常有趣,但想要了解如何处理这个用例的更多信息.
编辑2
由于这个问题正在得到一个公平的流量,我想添加这篇文章http://meta.discourse.org/t/integrating-discourse-with-current-user-database/6669,它超越了SSO的尝试目前正在进行话语.我也与thougtbot的人们就他们的实施进行了接触.
我有一个现有的rails应用程序,它使用设计作为用户身份验证.我添加了一个话语论坛,一切顺利,它位于一个子域.我已经在https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045上阅读了这篇文章,但是一旦用户登录,我仍然不知道如何处理设计方面的问题在现有的铁路网站上.目前这是我理解的过程:
第1步:用户点击子域名上的话语论坛.用户需要登录才能点击登录按钮.
步骤2:将用户发送到现有rails站点的登录页面.
步骤3:用户登录rails站点.
步骤4:用户应重定向到登录的话语论坛子域.
我的问题是 - 我需要做些什么才能使用户登录第3步时将其重定向回子域?有没有人成功实现过这个?我在该演练页面上看到了这段代码:
class DiscourseSsoController < ApplicationController
def sso
secret = "MY_SECRET_STRING"
sso = SingleSignOn.parse(request.query_string, secret)
sso.email = "user@email.com"
sso.name = "Bill Hicks"
sso.username = "bill@hicks.com"
sso.external_id = "123" # unique to your application
sso.sso_secret = secret
redirect_to sso.to_url("http://l.discourse/session/sso_login")
end
end
Run Code Online (Sandbox Code Playgroud)
这是我需要在现有的rails应用程序中添加的内容吗?我猜测解析检查该信息是否在URL中,如果是,它一旦完成设计登录过程就重定向,如果不是,它就像往常一样.我会将此代码放在设计文件中的某个位置吗?
我已经设置了一个新的数据库,用于在PostgreSQL中安装Discourse.当我运行rake db:migrate时,它会创建大多数表,但它会失败:
-- execute("INSERT INTO archetypes (name_key, created_at, updated_at) VALUES ('poll', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)")
-> 0.0009s
-- add_column(:forum_threads, :archetype_id, :integer, {:default=>1, :null=>false})
-> 0.0209s
== CreateArchetypes: migrated (0.0424s) ======================================
== AddMetaDataToForumThreads: migrating ======================================
-- execute("CREATE EXTENSION IF NOT EXISTS hstore")
rake aborted!
An error has occurred, this and all later migrations canceled:
PG::Error: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS hstore
/usr/local/rvm/gems/ruby-1.9.3-p385/bundler/gems/MiniProfiler-d149f34fcdb6/Ruby/lib/patches/sql_patches.rb:155:in `exec'
/usr/local/rvm/gems/ruby-1.9.3-p385/bundler/gems/MiniProfiler-d149f34fcdb6/Ruby/lib/patches/sql_patches.rb:155:in `async_exec'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.12/lib/active_record/connection_adapters/postgresql_adapter.rb:652:in `block in execute' …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用此存储库构建我的第一个 iOS 应用程序:\n https://github.com/pmusaraj/discourse-mobile-single-site-app
\n\n构建时,我收到错误并且无法继续。我是一个绝对的菜鸟,会花很长时间在这上面,但不知道我\xe2\x80\x99是否已经达到了代码中的故障点,我可以通过一些简单的调整来超越,或者我是否必须等待我的代码由开发人员解决的问题(在存储库上打开)。我认为开发人员正忙于其他项目,可能没有时间提供帮助。
\n\n也许我的软件对此来说太新了?我应该尝试将版本控制回react-native 和XCode 吗?我可以降级到 XCode 9.2(2017 年 12 月至 2018 年 3 月版本)并将 React-native 降级到 0.53.0(2018 年 1 月版本)。
\n我的机器:
\nMac OSX:10.14.6
\nreact-native-cli:2.0.1
\nreact-native:0.58.6
\nXCode:10.3(内部版本 10G8)
问题:info.plist 文件无法与构建器很好地配合。在 /ios/DiscoSingle/Info.plist 中,我看到 CFBundleIdentifier 正确定义为:
\n\n<key>CFBundleIdentifier</key>\n<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>\nRun Code Online (Sandbox Code Playgroud)\n\n这对我来说看起来是正确的。
\n\n这里\xe2\x80\x99s运行时出现错误react-native ios-build:
The following build commands failed:\n Ld /Users/user919021/Desktop/discourse/ios/build/Build/Products/Debug-iphonesimulator/DiscoSingle.app/DiscoSingle normal x86_64\n(1 failure)\n\nInstalling build/Build/Products/Debug-iphonesimulator/DiscoSingle.app\nAn error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):\nFailed to install the requested application\nThe bundle identifier of the application could …Run Code Online (Sandbox Code Playgroud) 我正在使用使用omniauth进行身份验证的话语.我需要这个与我当前的用户群(当前通过电子邮件或Facebook进行身份验证)集成.一种可能性是创建一个自定义的omniauth策略(如https://github.com/intridea/omniauth-oauth2).我会对话语代码进行一些调整,但是我需要将我当前的应用程序实现为Oauth2提供程序吗?或者有一个更简单的解决方案吗?
我知道这有点开放; 我想我正在寻找最简单的方法来为这个应用程序添加话语,并且现在还有其他一百万个事情正在进行中,所以非常专注于最快似乎是一个相当简单的用例.
谢谢
我在话语中查看了一些代码并偶然发现了这一点,并想知道为什么klass = self.据我所知,他们比我更好的红宝石开发者,必须有充分的理由.
为什么他们不会调用self.remove_from_cache!(message ["key"],false)?块是否创建了一个新的范围,其中self指的是MessageBus的类?是否有其他示例需要在Ruby中创建这种类型的构造,或者这是主要的?如果MessageBus.subscribe是MessageBus的一个实例(比如说m_bus.subscribe),那么自己会在块中引用m_bus吗?Ensure_class_listener是类方法的事实是否与此有关?对不起,所有的问题,但只是想确定.
谢谢
https://github.com/discourse/discourse/blob/master/app/models/site_customization.rb#L118
def self.ensure_cache_listener
unless @subscribed
klass = self
MessageBus.subscribe("/site_customization") do |msg|
message = msg.data
# what would self her refer to
# what would self her refer to
# would self.remove_from_cache!(message["key"], false)
klass.remove_from_cache!(message["key"], false)
end
@subscribed = true
end
end
Run Code Online (Sandbox Code Playgroud)
MessageBus.subscribe的实现似乎在这里:https: //github.com/SamSaffron/message_bus/blob/master/lib/message_bus.rb#L217
我已经设置了第一个 Discourse 实例,在 ASP.NET 5 Web 应用程序上编写了自定义端点,并启用了 DiscourseConnect。
一切正常 - 当用户单击Log In按钮时,他会登录(如果他登录到我的网站)
该论坛将仅对我的网站用户开放,因此我想在他们访问论坛时自动登录他们(他们通过 DiscourseConnect 重定向到我的登录/注册表单)
这是网站结构:
我在 Discourse Meta 上找不到任何内容,所以我问她:
当用户访问 forum.example.com 时如何进行自动登录。
我知道我可以在我的网站上创建一个重定向到 sso ( https://example.com/session/sso) 的链接,但如果用户从我的网站启动(通过单击菜单中的链接),这将起作用。如果他为论坛添加书签并通过该书签(或直接输入地址)打开它,则不会发生自动登录。
我正在按照标准指南在我的本地mac上安装话语.启动安装工具后,./discourse-setup我收到错误消息:
cd /pups && git pull && /pups/bin/pups --stdin
/usr/local/bin/docker: Error response from daemon: Mounts denied: er.com/docker-for-mac/osxfs/#namespaces for more info.
.
r/discourse/shared/standalone/log/var-log
are not shared from OS X and are not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
Run Code Online (Sandbox Code Playgroud)
最初我尝试安装到/ Users中的工作目录.此文件夹位于"文件共享"中.
然后我安装到/ var/discourse文件夹,同样的错误.我假设该var文件夹不在Docker文件共享中,所以我尝试将/var文件夹添加到Docker的共享文件并获得消息
The path /var is reserved by Docker
Run Code Online (Sandbox Code Playgroud)
这可能是个问题?
discourse ×10
asp.net-mvc ×1
block ×1
devise ×1
docker ×1
doorkeeper ×1
export ×1
hstore ×1
info.plist ×1
ios ×1
macos ×1
nfs ×1
oauth-2.0 ×1
omniauth ×1
openid ×1
react-native ×1
ruby ×1
ubuntu ×1
vagrant ×1