Giter Club home page Giter Club logo

lobsters's Introduction

Lobsters Rails Project build status

This is the quite sad source code to the ghost town at https://lobste.rs. It is a Rails codebase and uses a SQL (MariaDB in production) backend for the database.

You are free to use this code to start your own sister site because the code is available under a permissive license (3-clause BSD). We welcome bug reports and code contributions that help use improve lobste.rs. As a volunteer project we're reluctant to take on work that's not useful to our site, so please understand if we don't want to adopt your custom feature.

Contributing bugfixes and new features

We'd love to have your help. Please see the CONTRIBUTING file for details. If you have questions, there is usually someone in our chat room who's familiar with the code.

Development setup

Use the steps below for a local install or lobsters-ansible for our production deployment config. There's an external project docker-lobsters if you want to use Docker.

  • Install the Ruby version specified in .ruby-version

  • Checkout the lobsters git tree from Github

    $ git clone [email protected]:lobsters/lobsters.git
    $ cd lobsters
    lobsters$
  • Install Nodejs, needed (or other execjs) for uglifier

    Fedora: sudo yum install nodejs
    Ubuntu: sudo apt-get install nodejs
    OSX: brew install nodejs
  • Create a MariaDB (other DBs supported by ActiveRecord may work, only MySQL and MariaDB have been tested) database, username, and password and put them in a config/database.yml file. You will also want a separate database for running tests:

    development:
      adapter: mysql2
      encoding: utf8mb4
      reconnect: false
      database: lobsters_dev
      socket: /tmp/mysql.sock
      username: *dev_username*
      password: *dev_password*
      
    test:
      adapter: mysql2
      encoding: utf8mb4
      reconnect: false
      database: lobsters_test
      socket: /tmp/mysql.sock
      username: *test_username*
      password: *test_password*
  • Run bin/setup to install dependencies and set up db

    lobsters$ bin/setup
    • If when installing the mysql2 gem on macOS, you see ld: library not found for -l-lpthread in the output, see this solution for a fix. You might also see ld: library not found for -lssl if you're using macOS 10.4+ and Homebrew openssl, in which case see this solution.
  • On your production server, copy config/initializers/production.rb.sample to config/initalizers/production.rb and customize it with your site's domain and name. (You don't need this on your dev machine).

  • On your personal computer, you probably want to add some sample data.

    lobsters$ rails fake_data
  • Run the Rails server in development mode. You should be able to login to http://localhost:3000 with your new test user:

    lobsters$ rails server
  • Deploying the site in production requires setting up a web server and running the app in production mode. There are more tools and options available than we can describe; find a guide or an expert. The lobsters-ansible repo has our config files to crib from. Some app-specific notes:

  • Set up crontab or another scheduler to run regular jobs:

    */5 * * * *  cd /path/to/lobsters && env RAILS_ENV=production sh -c 'bundle exec ruby script/mail_new_activity; bundle exec ruby script/mastodon_sync.rb; bundle exec ruby script/traffic_range'
    
  • See config/initializers/production.rb.sample for GitHub/Mastodon integration help.

  • You probably want to use git-imerge to pull in changes from Lobsters to your site.

Administration

Basic moderation happens on-site, but most other administrative tasks require use of the rails console in production. Administrators can create and edit tags at /tags.

lobsters's People

Contributors

abdallahalsamman avatar alanpost avatar alternet0 avatar arandomandy avatar avinassh avatar briankung avatar david-wolgemuth avatar dependabot[bot] avatar emdemir avatar favadi avatar gettoset avatar greysteil avatar hmadison avatar jbbarth avatar jcs avatar kconner avatar masongup avatar nyanpasu avatar pushcx avatar rjsamson avatar srgpqt avatar talklittle avatar thomasdziedzic avatar thomasdziedzic-pd avatar threeplanetssoftware avatar ur5us avatar walle avatar xtian avatar yaaase avatar ymeynot45 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  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

lobsters's Issues

.rbenv-version to 1.9.3-p194?

Does anyone care if I bump the ruby version in .rbenv-version from 1.9.3-p0 to 1.9.3-p194?

rvm is telling me:

Xcode 4.3+ users
- please be warned
- only ruby-1.9.3-p125+ is partially supported
- in case of any compilation issues:
 * downgrade to Xcode 4.1
 * uninstall Xcode and install osx-gcc-installer and reinstall your rubies.

On the submit page, disable outline: none on buttons

If I tab from the "Text:" field to the Submit/Preview buttons, it's impossible to see which button is selected, because outline:none is turned on in the CSS. It would be nice to be able to see which field is focused.

You may need to turn on "move keyboard focus between all controls" in Keyboard on Mac (if you have one) to activate this setting.

I can fix this, just going on holiday until Sunday night and won't have time.

Add list of moderators/admins

In line with Issue 2 and the need for transparency, it's be nice to have a list of admins and moderators somewhere. I'm sure it's primarily jcs right now, but that may change in the future.

No content on RSS posts without description

It would be cool if there were fallbacks in place, such as comments on the story. It would also be kinda nice if the RSS feed contained text representations of each article, allowing the RSS feed to actually be a preview of the content, rather than just the links and their titles.

The reply link does nothing on /comments

When I go to /comments aka 'Newest comments', comments have a reply link. When I click on this link, it does nothing. It just stares at me blankly.

Agent: Firefox 16.0.2
OS: Windows

My reasoning: I believe the lack of #comment_form on the comment's index view means that this form cannot be cloned via https://github.com/jcs/lobsters/blob/master/app/assets/javascripts/application.js.erb#L217

I will submit a pull request that removes the link on such pages. Another method to fix it would be to add such a form but make it invisible, but such a form is tied to the story currently, and this is more difficult of a fix.

Fix positioning of after-submit comment previews

When submitting a comment, the version that is posted looks different than when you refresh the page. This is due to the minor change in output where the after-submit preview goes and where it would be normally. This is kind of annoying.

Also, when submitting a reply comment to a particular comment that is highlighted (from the URL), the submitted reply becomes highlighted too.

Unify tag accessibility function

Tag.accessible_to and Tag#valid_for? should not both exist. Use one or the other everywhere to make future changes only have to happen in one place.

change password field names on settings page

On the settings page, Firefox annoyingly autocompletes the "New Password" field with my current password, which then causes submission to fail because the confirm password field is blank. If the form IDs were slightly different, like "newpass" and "newpass2" this wouldn't happen.

On that note, asking to confirm the existing password before saving any settings may also helpful.

"Reply" link on the "Your threads" page does not work

steps to reproduce:

  1. go to the "Your threads" page
  2. click on a "Reply" link

I expect that it would open a "reply" text box, or go to the thread page, instead nothing happens.

Sorry I don't have time to investigate further at the moment

Transparent Moderation

From the About Lobsters post

All moderator actions on this site will be visible to users and the identities of those moderators are made public. While the individual actions of a moderator may cause debate, there should be no question about who the moderator is or whether they have an ulterior motive for their actions.

Is this implemented on the site yet? I can see that certain people are mods, but there doesn't seem to be a public moderation log anywhere.

don't email me my own comments

I post a comment. Two minutes later I get all excited because I have a new email from lobsters. Then I read it to discover it's my own comment and I get all disappointed.

I suppose this is how email lists work, but I still think of the emails more as a notification feature.

[feature] Move meta stories to their own subdomain

Questions about community norms deserve their own space to be discussed, not as part of the main list of topics. This is one thing that I like about stackoverflow, is that meta issues have their own domain, so that casual browsers of the site don't have to wade through meta topics when reading stories.

Code to post initial articles automatically

I've got a bunch of articles I want to submit at random but short intervals, but I do not want to submit them by hand. My goal is to make it look like there are a bunch of different users submitting articles (as Reddit did in their first days) to have some high quality content at the time I launch.

Does anyone have any code that can help me do this?

Some bugs while setting up local environment

I was trying to get set up on a Snow Leopard Mac, and these were some of the issues I ran into - just a heads up.

  • To get rake db:schema:load to run I ran into issues installing Sphinx - apparently you have to compile it separately, but Thinking Sphinx does not work with the latest stable Sphinx version (2.0.5), so you have to dig up 2.0.2 and compile that one instead.
  • Bootstrapping an initial user was annoying - had to find the checks for invitation and comment them out. It may be good to create a user with a known password in the init script.
  • Similarly for tags, may be good to insert at least one tag into the DB at the start so people can submit stories locally.
  • rails server ran by default for me at localhost:3000, but the default configured URL is lobsters.localhost:3000, which resulted in an error after a story submission.

downvoted color is contagious

I replied to a downvoted gray comment, and then my comment showed up as gray too.

It went away after a refresh, but I also upvoted the parent in the mean time, so I'm not sure if gray color is a one time thing or permanent.

Additional sorts

First, I love what you have so far! Sincerely hoping you have a shot at obviating much of HN.

Or at least something more than just "newest" and "top". Perhaps "most comments". Or "top within past day/week/month/year/forever"?

JSON API for third-party apps / Lobsters iPhone App

I'd absolutely love a JSON API so people can build apps on top of Lobste.rs. I've been wanting to build an iPhone client for the site for a while but the lack of an easily accessible API has prevented that so far. I'd be happy to help implement this myself, I've got a bit of Rails experience, but I thought a feature this large warranted a bit of discussion.

To avoid having to deal with authentication at this point it'd probably be best to start it out as a read-only API. The main things I'd want access to as an app developer right now are the top and newest story sections and individual posts.

Have you thought much about the API so far?

Missing database migrations

I've noticed two tables that are missing migrations:

  • keystores
  • users

Not sure what they're supposed to look like...@jcs do you have these original files somewhere?

no email for message

Somebody sent me a message ("about 20 hours ago"). I didn't get an email. According to the settings page, I am set to receive email notifications for private messages.

PostgreSQL + full text search

Hello there!
I'm going to try to use lobsters for my personal needs in the upcomming days (never tried that before) and i have a first thought in my head.

lobsters by default uses mysql + sphinx for searching. What about using i.e. postgresql to reduce involved tools?

PostgreSQL has a nice full text searching feature ( https://github.com/Casecommons/pg_search ) which probably gives us similar features and is also a database of chocice of many leading ruby tools like discourse (they're also using pg + full text search).

Have you any experience using pg with lobsters ? Or any cons? I would love to make a pull request with such thing (cause i have a plan to implement that for my needs) but it would be great to hear anything from you first :)

Mike

Email notifications on a per-thread basis

Lately, Lobsters seems to have grown enough that the torrent of emails on the mailing list has grown too large to handle. I'm starting to filter out responses and only leave top-level submissions in my inbox. But I'd like to get notifications on some specific threads, which is something my filters aren't useful for. Is a facebook-like 'follow' or 'get notifications' link a good idea on each submission? I can work on this if so.

adapting lobsters into existing rails project

Hi guys!

We liked your project, lobsters and we'd like to adapt into existing rails project. But we don't know how we can do it. Which way should we choose in this situation:

- Adapt lobsters into our project
- Adapt our project into lobsters
- Another options

Thanks for now!

Set isPermaLink="false" on guid in RSS feed?

I'm not sure if it's intentional or not, but your RSS feed (at least in Google Reader) links to the lobste.rs url specified as the guid, rather than the story url specified in link.

I would much prefer the story url be the primary link, possibly with a link to the lobste.rs page in the description.

After checking out the RSS specifications:

http://cyber.law.harvard.edu/rss/rss.html#ltguidgtSubelementOfLtitemgt

It looks setting isPermaLink="false" on the guid element would resolve this issue.

Logged out when submitting new story

I was logged in (I think, certainly looked like it). I submitted a new story, but landed at a login page. OK, I figure, my login timed out (does it?) so I login again. But my submission disappeared. Had to submit again, then it worked.

If my session expires, that should be detected when displaying the submit story page, not after.

The appearance of the login screen led me to believe that the submission would work. I can understand it's hard to make that work, but make it look more like an error page ("you're not logged in, go back and try again!") so I don't wonder about the status of the operation.

better search plz

I heard from a friend that there was a cool story posted about an ISP a while ago. When I searched for "isp" however, I was faced with a great many comments about lisp.

(Searching just stories doesn't appear to work at all, btw.)

RSS Readers (Google Reader) give no link back to comments

When browsing HN via Google Reader, I get no description but always a "Comments" link.

This is important, because it makes it easier to comment on a submission. Also, sometimes I would rather read the comments for a submission rather than visiting the actual link. Finally, it should bring more traffic to the comment threads.

Use a Github-style markdown previewer tab

I like Github's write/preview tabs for writing markdown. I'd like to implement something similar for stories, comments, and private messages (which currently has no preview at all) so that previews don't have to load in different areas of the screen.

Allow public sign up

How do I enable the general public to sign up? i would like to turn off the invite only feature.

Feature request: Show a complete list of tags with story count

I propose that the /t and /tags urls show a list of tags like:

http://snag.gy/gl2SR.jpg

  1. All tags would be shown (even if filtered or not logged in).
  2. Sorted alphabetically
  3. Clicking on the yellow tag oval will take you to /t/[tagname] to see stories

Another option would be to sort descending by story count.

I have a branch with this change on a fork, and I can issue a pull request, if you're interested. No schema changes.

plus signs in POST data turning into spaces

https://lobste.rs/s/pyaji4/improving_the_pi_searcher_s_speed_by_moving_from_c_to_go/comments/a3bqsw

According to at least nginx, the POST data is coming through with plus signs as %2B:

 utf8=%E2%9C%93&_method=put&authenticity_token=X%3D&story%5Burl%5D=http%3A%2F%2Fda-data.blogspot.com%2F2013%2F05%2Fimproving-pi-searchers-speed-by-moving.html&story%5Btitle%5D=Improving+the+Pi+Searcher%27s+speed+by+moving+from+C%2B%2B+to+Go&story%5Btags_a%5D%5B%5D=&story%5Btags_a%5D%5B%5D=go&story%5Bdescription%5D=&story%5Bmoderation_reason%5D=&commit=Save

But rails is seeing it as a space by the time Rack (?) logs it:

 Parameters: {"utf8"=>"â", "authenticity_token"=>"tVfcAOZ//X=", "story"=>{"url"=>"http://da-data.blogspot.com/2013/05/improving-pi-searchers-speed-by-moving.html", "title"=>"Improving the Pi Searcher's speed by moving from C   to Go", "tags_a"=>["", "go"], "description"=>"", "moderation_reason"=>""}, "commit"=>"Save", "id"=>"pyaji4"}

with invalid email address for invited user, error is too generic

I tried to invite someone and accidentally entered an invalid email address. The site gave an unhelpful generic error.

Here is what happened. I was logged in to Lobsters as myself, RoryOKane.

logged in as RoryOKane

I loaded https://lobste.rs/settings and then filled in the invitation form with email address “Hates_ [email protected]” and memo “for http://news.ycombinator.com/item?id=4453708”:

filled-out invitation form for a new user

After I clicked Send Invitation, I was redirected to https://lobste.rs/invitations and saw a page containing nothing but this – no Lobsters website chrome:

generic error: something broke. we're on it.

:(

something broke. we're on it.

I had copy-pasted the email address incorrectly from that user’s public profile – it should be “[email protected]”, not “Hates_ [email protected]”.

Rather than showing a full-page generic error, Lobsters should validate the email address and, if there is an error, redirect me to the invitation form and highlight the invalid address. If the email address is syntactically valid but bounces when you try to send it a message, the site should also tell me that.

Comment titles not updated?

It seems that the comment titles, for instance on this post, keep the original story title even after the story title has been changed — which I assume was the case here.

Should the comments even repeat the original story title? Why would there be a comment not related to the title?

Or maybe that's a way to denote what the title was at the time the commenter posted. Might be a subtle way to be transparent. Not sure.

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.