Coder Social home page Coder Social logo

elektronaut / sugar Goto Github PK

View Code? Open in Web Editor NEW
119.0 16.0 34.0 22.24 MB

Totally sweet Ruby on Rails-based forum software

License: MIT License

Ruby 59.61% JavaScript 3.04% CSS 6.77% HTML 18.30% Shell 0.07% Dockerfile 0.33% TypeScript 11.87%
forum ruby rails

sugar's Introduction

Build

Sugar

Sugar is a modern open-source forum optimized for performance and usability, written in Ruby on Rails.

Dependencies

Installation

If you want to hack on Sugar, the easiest way to get up and running is using Docker Compose:

$ docker-compose run rails bin/setup
$ docker-compose up

Sugar is now running on localhost:3000.

You can run the tests and linters with:

$ docker-compose run rails bin/rspec
$ docker-compose run rails bin/rubocop

Deploying Sugar

Sugar is deployed like a regular Rails app, see the official Rails site. A sample Capistrano recipe is provided config/deploy.rb.dist.

For production use, you'll want a full grown Solr setup. See the Sunspot documentation for guides on how to get up and running.

Heroku is currently not supported.

Configuring Sugar

Most of Sugar is configured with a web interface. However, a few details must be sorted out before the app starts. The defaults should be fine for development, but you need tweak these settings for production use with environment variables.

Environment variable Required Info
SUGAR_SECRET_KEY_BASE Yes Set to a long, random string
SUGAR_SESSION_KEY - Default: _sugar_session
SUGAR_DB_DATABASE - Default: sugar_<%= Rails.env %>
SUGAR_DB_HOST - Default: localhost
SUGAR_DB_USERNAME - Default: rails
SUGAR_DB_PASSWORD - Default: ``
S3_BUCKET - Default: none, set if you want to use S3
S3_KEY_ID - Default: none, set if you want to use S3
S3_SECRET - Default: none, set if you want to use S3
SENTRY_DSN - Default: none, set if you want to use Sentry

Credits

Thanks to the members of the B3S community for feedback, ideas and encouragement, names far too many to be mentioned. Napkin was written by Branden Hall of Automata Studios.

License

Copyright (c) 2008 Inge Jørgensen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

sugar's People

Contributors

brandenhall avatar ccope avatar cdelargy avatar corinedwards avatar dependabot-support avatar dependabot[bot] avatar down10 avatar elektronaut avatar elstob avatar irrg avatar jaydee8 avatar jedrekk avatar mmascorro avatar ozziash avatar tensafefrogs avatar vena avatar wevah avatar yuxisteem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sugar's Issues

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "eco":
  In Gemfile:
    backbone-on-rails was resolved to 1.2.0.0, which depends on
      eco

Could not find gem 'eco', which is required by gem 'backbone-on-rails', in any of the sources.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

You can mention @dependabot in the comments below to contact the Dependabot team.

Postgres fix

Here is another. I could not figure out how to do a pull request for just this commit on develop branch.

wprater@5293849

facebook_uid? problem

this is in development env with postgresql.

i filled all the user information at sign-up page and got this error:

NoMethodError in UsersController#create

undefined method `facebook_uid?' for #User:0x10345a908

Rails.root: /Users/zlu/projects/sugar
Application Trace | Framework Trace | Full Trace

app/models/user.rb:46:in _callback_before_5129' app/controllers/users_controller.rb:181:increate'

Request

Parameters:

{"authenticity_token"=>"P7hcCVbjdPlspxIaMGW0Di4eXjT0YSYu9S0if1YiQpo=",
"utf8"=>"\342\234\223",
"user"=>{"realname"=>"",
"location"=>"",
"confirm_password"=>"[FILTERED]",
"username"=>"zlu",
"password"=>"[FILTERED]",
"email"=>"[email protected]"}}

unable to cancel invite

after sending an invitation successful, click on cancel and get exception #show action not defined.

excessive polling to server

hello, i think the polling to server for various data is a bit too excessive. for example:
when i'm on discussions page, this is be done a few seconds apart:

Started GET "/discussions/3/posts/count.js" for 127.0.0.1 at Wed Feb 02 04:51:21 +0000 2011
Processing by PostsController#count as JS
Parameters: {"discussion_id"=>"3"}
Rendered text template (0.0ms)
Write page /home/zlu/projects/sugar/config/environments/../../public/cache/discussions/3/posts/count.js (0.0ms)
Completed 200 OK in 10ms (Views: 0.0ms | ActiveRecord: 0.0ms)

i suggest we reduce the polling period to a few minutes apart, and after 20 -30 min or so, poll in a much larger duration like 1 hr, or just stop polling.

accept invitation link is wrong

the link in the invitation below is wrong.
it is http://forum/invites
is it configurable somehow? i didn't see it.

zhao lu has invited you to Forum@Myopenvoice!
From:
OpenVoice Forum [email protected]
View Contact
To: [email protected]
Hi,

zhao lu has invited you to Forum@Myopenvoice!

Click this link to register:
http://forum/invites/ec0b2062692eea331ca7d957556b8766b5de3711/accept

Please note:
If the link won't work, please copy the entire URL (on one line)
and paste it into your browser address bar.

This invitation is meant for you personally, and will expire
after 14 days. If you do not wish to join
Forum@Myopenvoice, simply ignore this email.

Suggestion / request: use Dependabot to keep dependencies up-to-date

First of all, thanks for Sugar!

I've got a suggestion / request: would you be up for using Dependabot to automatically create dependency update PRs for this repo? I ran it against my fork and it generated these PRs. I'll port the nokogiri one across to this repo now because it's security related.

I built Dependabot, but I'm honestly only suggesting it because I hope it can save you some time. I'd love any feedback, and obviously having open source repos using Dependabot helps boost its profile, but if it's not helpful to you then it's not really worth anything.

You can install it from here or here if you decide to give it a try. It's been through GitHub's security testing (to be allowed in the GitHub Marketplace) and is used by a few thousand organisations, and the source code is here.

:octocat:

LoadError: cannot load such file -- tasks/emoji.rake

vagrant@sugar-dev-box:/vagrant/sugar$ rake db:create --trace
rake aborted!
LoadError: cannot load such file -- tasks/emoji.rake
/vagrant/sugar/rakefile:5:in `load'
/vagrant/sugar/rakefile:5:in `<top (required)>'
/usr/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load'
/usr/lib/ruby/2.2.0/rake/rake_module.rb:28:in `load_rakefile'
/usr/lib/ruby/2.2.0/rake/application.rb:689:in `raw_load_rakefile'
/usr/lib/ruby/2.2.0/rake/application.rb:94:in `block in load_rakefile'
/usr/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/usr/lib/ruby/2.2.0/rake/application.rb:93:in `load_rakefile'
/usr/lib/ruby/2.2.0/rake/application.rb:77:in `block in run'
/usr/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/usr/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/usr/bin/rake:33:in `<main>'
vagrant@sugar-dev-box:/vagrant/sugar$

How to fix?

User status expansion

Currently, user accounts are visible in one of two states which, as I understand it, is flagged as an attribute:

  • Active
    • User is registered, can login, and has posted with a recent time period.
  • Banned
    • User is registered, cannot login, and has posted but has been deliberately barred from posting/editing.
    • OR This user has registered, has made zero or more posts, and may or may not have been actively barred from posting or editing.

I find this to be a limitation of the software and confusing to forum participants as to the true nature of a banned user, whether they willfully stopped posting on their own or had to be forcefully removed because of bad behavior.

I propose instead that user accounts be instead in one of the following 5 states:

  • Reserved
    • User is unregistered, but the account is set aside for internal use or special cases. These would be accounts set aside as "invites," or for VIPs (Kanye wants an account).
  • Inactive
    • This user is registered, can login, but has made zero posts or has not posted within a specified time period. This will be the default state of all registered users if they do not regularly post and participate on the forum.
  • Active
    • User is registered, can login, and makes posts regularly.
  • Suspended (or Self-Banned)
    • User is registered, cannot login until a specified time period has passed, has made zero or more posts, but has not been banned outright. Active users can file a request to be suspended by a single admin (aka self-ban). Likewise, suspended users can file a request to be active once again.
  • Banned
    • User is registered, cannot login, and cannot file a request to be active again. Bans can be lifted, but only by one or more admins.
  • Deceased
    • User has been confirmed as passed away. Will not be returning, and will not be active again.

This is just one method. I'm sure other methods of designating users exist that are more robust, but I think these features would be a great improvement to the forum.

edit: Added "Deceased" to list. :(

Error when creating a new discussion

Hi there! I'm trying to get up and running with your sugar repo. I have it all set up on a VM, and am able to login on localhost:3000. However, when I go to create a new discussion I am receiving this error:
Connection refused - {:data=>"<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">Discussion 5</field><field name=\"type\">Discussion</field><field name=\"type\">Exchange</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">Discussion</field><field name=\"type_s\">Discussion</field><field name=\"poster_id_i\">1</field><field name=\"last_poster_id_i\">1</field><field name=\"trusted_b\">true</field><field name=\"closed_b\">false</field><field name=\"sticky_b\">false</field><field name=\"created_at_d\">2016-09-12T01:12:17Z</field><field name=\"updated_at_d\">2016-09-12T01:12:17Z</field><field name=\"last_post_at_d\">2016-09-12T01:12:17Z</field><field name=\"title_text\">please work</field></doc></add>", :headers=>{"Content-Type"=>"text/xml"}, :method=>:post, :params=>{:wt=>:ruby}, :query=>"wt=ruby", :path=>"update", :uri=>#<URI::HTTP http://localhost:8982/solr/development/update?wt=ruby>, :open_timeout=>nil, :read_timeout=>nil, :retry_503=>nil, :retry_after_limit=>nil}

So I switched the port to 3000 in the sunspot.yml file because it was at 8981, but then I got this error: Net:::ReadTimeout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.