sman591 / discourse-nntp-bridge Goto Github PK
View Code? Open in Web Editor NEWDiscourse plugin to keep NNTP & Discourse in sync
License: MIT License
Discourse plugin to keep NNTP & Discourse in sync
License: MIT License
When an NNTP post is made in a newsgroup (csh.b) that references a post in (csh.a) the bridge will place the post inline to the thread in csh.a, instead of in a new thread in csh.b (as it is located in NNTP proper).
Currently only small parts have tests written for them. A good base to kick off from would be https://github.com/grantovich/CSH-WebNews/tree/api-v1/spec
Maybe. Use case I can think of is our big move to Discourse, and wanting to make discourse-only pinned post that is only displayed to Discourse users.
This could get messy.
Job exception: PG::UndefinedColumn: ERROR: column users.email does not exist
LINE 1: SELECT "users".* FROM "users" WHERE "users"."email" = '[redacted]'...
^
: SELECT "users".* FROM "users" WHERE "users"."email" = '[redacted]' ORDER BY "users"."id" ASC LIMIT 1
The Discourse schema has changed from storing the email address of the user in the users
table to having a users_emails
table with foreign keys relating email addresses back to the user.
Either via environment variables or a config/nntp.yml file
I am not able to get this plugin to work with Cyrus.
First, I had an issue where the 'rake discourse_nntp_bridge:assign_newsgroups' would not recognize newsgroups (cyrus shared folders). I figured that it's because Cyrus is case sensitive so I had to remove the .downcase off of this line
The next error I get is "Job exception: Bad date/time". I found no discrepancy between the date and time of the Cyrus and Discourse servers.
Here's the full backtrace from Discourses /logs
/var/www/discourse/plugins/discourse-nntp-bridge/gems/2.5.1/gems/thoughtafter-nntp-1.0.0.3/lib/nntp.rb:867:in `check_response'
/var/www/discourse/plugins/discourse-nntp-bridge/gems/2.5.1/gems/thoughtafter-nntp-1.0.0.3/lib/nntp.rb:836:in `shortcmd'
/var/www/discourse/plugins/discourse-nntp-bridge/gems/2.5.1/gems/thoughtafter-nntp-1.0.0.3/lib/nntp.rb:819:in `io_longcmd'
/var/www/discourse/plugins/discourse-nntp-bridge/gems/2.5.1/gems/thoughtafter-nntp-1.0.0.3/lib/nntp.rb:814:in `longcmd'
/var/www/discourse/plugins/discourse-nntp-bridge/gems/2.5.1/gems/thoughtafter-nntp-1.0.0.3/lib/nntp.rb:616:in `newnews'
/var/www/discourse/plugins/discourse-nntp-bridge/lib/discourse_nntp_bridge/server.rb:15:in `message_ids'
/var/www/discourse/plugins/discourse-nntp-bridge/lib/discourse_nntp_bridge/newsgroup_importer.rb:24:in `sync!'
/var/www/discourse/plugins/discourse-nntp-bridge/app/jobs/regular/nntp_bridge_importer.rb:10:in `execute'
/var/www/discourse/app/jobs/base.rb:137:in `block (2 levels) in perform'
/usr/local/lib/ruby/gems/2.5.0/gems/rails_multisite-2.0.4/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/app/jobs/base.rb:127:in `block in perform'
/var/www/discourse/app/jobs/base.rb:123:in `each'
/var/www/discourse/app/jobs/base.rb:123:in `perform'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:187:in `execute_job'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:169:in `block (2 levels) in process'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/middleware/chain.rb:128:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:81:in `call'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/middleware/chain.rb:130:in `block in invoke'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/middleware/chain.rb:133:in `invoke'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:168:in `block in process'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:139:in `block (6 levels) in dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/job_retry.rb:98:in `local'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:138:in `block (5 levels) in dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq.rb:36:in `block in <module:Sidekiq>'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:134:in `block (4 levels) in dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:199:in `stats'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:129:in `block (3 levels) in dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/job_logger.rb:8:in `call'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:128:in `block (2 levels) in dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/job_retry.rb:73:in `global'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:127:in `block in dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/logging.rb:48:in `with_context'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/logging.rb:42:in `with_job_hash_context'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:126:in `dispatch'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:167:in `process'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:85:in `process_one'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/processor.rb:73:in `run'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/util.rb:16:in `watchdog'
/usr/local/lib/ruby/gems/2.5.0/gems/sidekiq-5.1.3/lib/sidekiq/util.rb:25:in `block in safe_thread'
Did anyone get this plugin working with Cyrus?
That's a feature. We should support it.
Discourse uses Sidekiq, so it should be pretty easy to create a custom worker for this.
If the worker fails (for a reason such as NNTP temorarily not connecting), it should retry.
Something such as the below would be interpreted as a single quote:
> Hello world!
Oh, hello there
On import, the topic's bump date isn't updated, which it should.
Possibly. It's an NNTP feature.
I would like to use this plugin on my Discourse site, but it is marked as broken on the Discourse Meta. Any way to use this on any new DIscourse site? This looks like exactly the thing I need.
With the move to a worker in #1, it's possible for the post topic -> NNTP move to get delayed somehow and any reply to jump ahead of it. This would cause dethreading on NNTP's side.
Preliminarily over a rake utility, maybe a web interface later on.
Discourse has a PostCreator
that handles a bunch of extra logic this bridge doesn't consider, and consolidates a lot of logic (such as bumping posts, #20). We should switch to using that instead of doing raw Post.create
calls.
A simple example of use: https://github.com/discourse/try-bot/blob/master/plugin.rb
If a Discourse -> NNTP error arrises, the worker should just retry. However, if this error is due to something other than a temporary NNTP connection issue, we need to investigate and resolve the issue.
[qutoe]
'd text should become quotes with >
May be able to automate this via scheduled workers instead of a cron, too.
Should be
Stuart Olivera wrote:
(extra new line)
> ...
Rare case, but it looks like it the from field is formatted weirdly (like has \'
in the name), it won't match the email address.
Maybe via a refactored setup script
Apologies for the second post. Github is having some issues
https://blog.github.com/2018-10-21-october21-incident-report/
https://status.github.com/messages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.