Code Monkey home page Code Monkey logo

twitarr's Introduction

twitarr

Twit-arr is a micro-blogging site that is set up for JoCo Cruise. Originally developed by walkeriniraq. This version is no longer in active development, but is being kept around as a fallback. Development on the new version is currently taking place here: https://github.com/jocosocial/swiftarr/

Description

Twit-arr was the name for the Status.net instance brought onto the cruise ship for JCCC2 and JCCC3. Status.net being less than optimal for this environment, I took it upon myself to build a new version, completely customized for the cruise.

Docker setup

If you're not running on linux, or just want an isolated environment, you can run twitarr in docker.

Prereqs

You'll need the Docker toolbox. I (Joey) used version 1.16.1. The default install on a Mac is Just Fine; not sure about other platforms.

Configuration

  • Create a default_users.yml file based on the default_users.yml.example file. Set the reg codes to alphanumeric strings (all uppercase). Pick strong passwords of your choice.
  • Create a master.key file adjacent to secrets.yml (in the /config directory) containing a sufficiently long random hex string. Consider using rails secret to generate.
  • If you want to run with local changes (so that you can change the Ruby code and not have to rebuild the world each time), modify docker-compose accordingly:
  volumes:   # Remove this for production use
   - ./:/srv/app

Building the docker images

Run:

   $ docker-compose build [--no-cache]
   $ docker-compose up
   # When you're done
   $ docker-compose down [-v]

This will create a docker image based on ruby, as well as download a postgres image.

This can take a while to set up, as it generates the database and seed data in postgres. Once it completes you should be able to reach twitarr via http://localhost:3000.

Non-Docker Setup

  1. Install pre-reqs

    Debian 11:

    sudo apt-get install git gnupg2 curl imagemagick libmagickwand-dev libidn11-dev libpq-dev postgresql postgresql-contrib nodejs redis
    

    Fedora 34:

    sudo dnf install git gnupg2 curl imagemagick ImageMagick-devel libidn-devel libpq-devel postgresql postgresql-contrib nodejs redis
    
  2. Set your postgres password

    Debian 11:

    sudo -u postgres psql
    \password
    Set the password to whatever you want. Simplest is `password`
    \q
    
  3. Install RVM. Follow the instructions at https://rvm.io/. Reload your terminal environment after installing.

  4. Clone the repository, cd into it

  5. If pompted by RVM, install the required version of ruby, then leave and re-enter the directory to create the gemset

    rvm install ruby-3.1.0
    
  6. Install gems

    bundle install
    
  7. Copy the dev environment file. If you used a different postgres password, or need ot change the postgres connection info, edit the .env file after copying it:

    cp .env-example .env
    

    Also copy the default users file, and edit it. Set the reg codes to alphanumeric strings (all uppercase). Pick strong passwords of your choice:

    cp config/default_users.yml.example config/default_users.yml
    
  8. Populate the database

    rails db:setup
    
  9. Run the dev server

    rails server
    

The database population will create 20 reusable registration codes, which can be used for creating new users. The created codes are numbered, code1 through code20. Note that codes 1 through 4 will already be used by the default users.

For these default users, the user's password is the same as the username.

  1. kvort (code1, an admin user)
  2. james (code2, a non-admin user)
  3. steve (code3, a non-admin user)
  4. admin (code4, another admin user)

By default, the dev server can be hit from http://localhost:3000

twitarr's People

Contributors

hendricksond avatar walkeriniraq avatar wingar avatar grundoon avatar dependabot[bot] avatar rangerrick avatar cohoe avatar jettjones avatar jmarianer avatar martinbogo avatar spacewhippet avatar rlkammerer avatar

Stargazers

Jason Tratta avatar  avatar Chris John avatar  avatar Kevin McGinn avatar Nathan Files avatar Mandie Kramer avatar  avatar Edward Childress avatar  avatar Steve Ognibene avatar Meghan Callahan avatar Chris Ross avatar Matt Rognstad avatar Jason Marshall Thomas avatar Terra Field avatar

Watchers

Brad Huber avatar  avatar Dustin Knie avatar James Cloos avatar  avatar Chris Ross avatar Vern Hart avatar Sean Berry avatar Brian Young avatar  avatar

twitarr's Issues

Tweet Stream Threading

From the 2018 feedback thread:

Threading seems to break after a thread has had several replies.

The original author admittedly said it doesn’t work very well, and it’s definitely on the re-think list. A deleted twarrt aywhere up or down chain will thoroughly mess those up, for one thing.

Send pictures via seamail

Feature request from 2018 feedback thread:

Being able to send pictures through seamail would be nice.

Search user by Real Name

Feature request from 2018 feedback thread:

It’s kind of impossible to find people on here unless you know their specific username. Would it be possible to be able to search the “real name” field?

Dismiss Announcement

Feature request from 2018 feedback thread:

I wish there was a way to dismiss an announcement from my alerts page.

Posting Guidelines/reminders

Feature request from 2018 feedback thread:

Maybe some kind of guidelines people had to read (sorry) about how Twit-arr has no feed management tools so people should be mindful of what they're posting to everybody and to maybe keep certain types of content (like games, etc) in the forums.

I also wouldn’t mind the occasional reminder twart of said guidelines (maybe automated in some way?) just to help maintain a higher signal-to-noise ratio.

“Close photo” X icon invisible if photo is dark or does not cover top corner

Web interface. The X icon is transparent, which works if the photo is light coloured and extends to the edge of the photo frame, but since the frane size appears static, if the photo is in a different aspect ratio or happens to be dark in that corner, the black circle around the X blends into the black background and it is impossible to see how to close a photo.

Feed re-design recomendations

For a number of reason the design of the main tweet feed should be revisited:

  • Overall usage keeps increasing, there's too much content for the current format
  • This year it got really noisy with so many pokemon sightings.
  • There were issues with sea mail so individuals were communicating with their parties via the main feed
  • There were multiple conversations with content that many people didn't want to watch.

Proposals:

  • Discontinue the universal feed, i.e. Users don't follow all other users by default.
  • Prefer forums for topical discussions.
    • Forum threads are easier to scroll past if you're not interested in the topic (Pokemon, librarians, kink), and less likely to inflame if users must click-through / subscribe to see the content (?).
    • Allow a user to hide/ignore a forum thread for piece of mind and to improve discovery other threads (active threads are always on top right now).
    • Pre-seed popular topics. E.g. Pokemon, food recommendations, main events (created automatically prior to the event), etc..
  • Allow building a personal feed (like the real Twitter)
    • Follow an individual's public tweets
    • Refer users with empty feeds to the forums.
    • Follow forum threads
    • Follow hashtags
    • Follow sea-mail conversations
  • Show a user's tweets (but not forum posts) on their profile so you can decided if you want to follow them

Overall, having an opt-in content model should help reduce the noise and may also help reduce the reliance on moderation features (e.g. bocking, reporting).

View all posts from user

Feature request from 2018 feedback thread:

Wish I could click on a user and see all their posts, so I could more easily follow conversations threads.

shiptimezoneoffset API endpoint

To be able to reliably show the calendar with the correct times regardless of the accuracy of the device clock or device time zone, it would be nice to have an explicit API end point that specifies the offset from UTC of the ship's local time. Then, calendar events could just be displayed in that time zone.

Ability to ban a user

Create a user interface and backend support for banning/unbanning users.

Banned users should be prevented from logging in. If already logged in, they should be prevented from making any write operations, and if possible, forced to log out.

Additionally, any account that uses the same registration_code as the banned user should also be banned. The registration_code should no longer be usable for creating any new accounts.

Initiate a seamail from user profile page

Feature request from 2018 feedback thread:

To be able to send seamail from a profile page, unless that has been a problem in the past of people being annoying too easily.

Make e-mail address non-required, remove from registration

It has been suggested that e-mail address become non-required. If this change is made, the following will need to happen:

  • Make e-mail non-required in the database/user model
  • Remove e-mail address from the registration screen
  • Remove e-mail address from the forgot password process
  • Remove the 'public email' checkbox from the profile screen - if email is present, it will be public

Forum Navigation Improvements

Feature request from 2018 feedback thread:

Navigation buttons at the top and bottom of forum posts would be lovely.

Web page for IR blasters, or allow .wav files in forum posts

On the last cruise, a number of people were trying to connect consoles and laptops to their room TV HDMI ports. Changing inputs required having a concierge bring a remote to a room, and the TV would reset the input when turned off & back on. I'll be making and distributing DIY headphone jack IR blasters to give to people on the ship wanting to use the HDMI inputs on their room TVs. The range is short, only a few feet, but they'll work well for this purpose.

To prevent having to download & configure an app, I'd like to be able to make a page available on Twit-arr for users. The page would consist of text, and buttons/links to play tiny .wav files. If THO provides a list of TV models on the ship, I can provide this in advance, otherwise I'd need to provide this on board.

Alternatively, if tiny .wav files are permitted in forum posts, I could post the .wav files in a forum post once on board.

bogus display name error when username is too long

Try to create a user with username "oehuiheouoetionyihyhnioueithoehuiheouoetionyihyhnioueithoehuiheouoetionyihyhnioueithoehuiheouoetionyihyhnioueithoehuiheouoetionyihyhnioueith" and password "oooooo", no display name.

You get an error with the display name:
If display name is entered, it must be three or more characters and cannot include any of ~!@#$%^*()+=<>{}[]\|;:/?

Change all timestamp sorts to sort by ID instead

Tweet stream queries currently use timestamps for sorting. Change them to use ID instead. This will guarantee that if there is a timestamp collision, the posts will be returned in a consistent order.

Dark Mode

Feature request from 2018 feedback thread:

Dark mode would be great but IDK how easy it’d be to implement.

The e-mail address validator is wrong

We use this to validate e-mail addresses:

  validates :email, format: { with: /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i, message: 'address is not valid.' }

This is wrong. It considers e-mail addresses such as [email protected] to be invalid, but that's a valid e-mail address. It also considers [email protected] to be invalid, but that's a valid e-mail address.

Also, it allows data before and after the e-mail address, for example it considers The value <[email protected]> is not my e-mail address to be a valid e-mail address.

The following is the regular expression that the HTML spec recommends to validate e-mail addresses:

/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/

Front-end for reactions to stream and forum posts

Stream and forum posts can have reactions added/removed - see app/models/concerns/postable.rb add_reaction and remove_reaction

  • Add user interface controls for adding/removing reactions.
  • Add summary of reactions to a post (number of likes/thoughtfuls/whatever) - this is currently returned in the json of each post
  • Add a way to see the details of all reactions to a post - lists of users who have given each reaction type (potentially also for likes on posts that say "x seamonkeys like this post"). This is available by hitting the show_likes / show_reacts endpoints of a stream or forum post.

Set focus when tweeting or forum-ing or searching

This is merely a nice to have feature only if you have time and/or are willing.

Whenever possible, can you set the focus on the textbox when performing an action that then requires the user to type? This would save a click and streamline the use of the site.

That would be setting the focus on:

  • The textarea for new Tweets or Replies to tweets
  • The "Subject" text box when creating a new forum topic
  • The "Start typing a name" for new Seamail
  • The textarea for replying to seamail
  • The "Search" text box when searching
  • NOT the "Post a message" textarea for replying to a forum topic (that would make it scroll down, I think)
  • NOT the "personal comment" field when looking at a user's profile.
  • NOT the search box on every page. :)
  • NONE of the fields when looking at your own profile.

Maybe others, but these will help a lot.

Forum Thread Categories

Feature request from 2018 feedback thread:

There are so many forum threads, it would be nice if they could be arranged (at creation?) into categories (e.g., meet-ups, gaming, puzzles, etc.)!

Delete/Edit Forum Posts

Feature request from 2018 feedback thread:

It would be fabulous if you could delete (or even edit) forum posts.

New Landing Page

Create a new landing/main page, to guide users towards schedules, forums, seamails, and a de-emphasized tweet stream. Do not immediately land on the tweet stream when loading twitarr.

Perhaps include a dashboard of trending/highly liked/highly reacted posts.

[Task] Poll the user base

I'd be useful to get feedback from the wider user base about what worked well for them, what didn't, and suggested improvements.

Curated Feed of Followed Users - make it more usable

This currently exists, but is burred behind a few clicks:

  1. Open left menu, click "My Starred Users"
  2. Click "View filtered feed of tweets made only by starred users"

Make this easier to access. Also add some help text explaining how to follow people and view this feed.

Perhaps add a way to follow/star users directly from the stream without having to go to their profile page first. Maybe change the Star button to a follow/unfollow button, too.

Ability to link to events in forums/stream posts

Feature request from the 2018 feedback thread:

I just posted a URL to a schedule event in a forum thread, and it did not get turned into an href. It's not the biggest of deals, but it bothers me way more than it should :P

Moderation Features

Implement a "3 strikes you're out" system for moderation. Give users the ability to report posts that violate code of conduct. Users/posts who receive 3 reports will be restricted in some way (user inactivated? post hidden?) until a moderator reviews and either approves, warns, or issues a permanent ban.

This system still needs a bit of discussion, and final approval from THO, around how it should function before implementation.

Subscribe to Forum Thread

Feature request from 2018 feedback thread:

Would be nice to be able to subscribe to forum threads too and get twitarr notifications for new posts in a thread. There are so many threads it can be hard to keep up

Search box in initial server interface is non-functional

While the search box in the upper right corner of the web interface appears functional, if you select "Search" from the hamburger menu, then the search box on that page is non-responsive. It doesn't seem to initiate a search if I hit return or click on the "Go" button.

Ability to block/mute accounts

Feature request from the 2018 feedback thread:

I want the ability to block/mute accounts. I appreciate that a lot of Seamonkey comedy nerds want to use Twit-Arr to workshop their craft through memes, but that also adds so much noise to the signal. It's probably far too much to ask the joke writers to move to the forums, but a way to at least mute some of the meme accounts that don't interest me would be nice.

Forum Entry Navigation

Feature request from 2018 feedback thread:

It would be great if we had already read a forum, that it would take us to the last page or better, unread posts.

Right now, when I first open a thread it takes me to the end (and I have to click back to see the beginning) and when I come back later, I have to click through to the end. Minor, but annoying :D

Pin Form Thread

Feature request from 2018 feedback thread:

Being able to pin or favorite forums so that they stay at the top of the list

API endpoint to specify update intervals

If we end up not going with the websocket update channel, I think we should have the server specify the update intervals for things like the calendar, twitarr, forums, and seamail, so that if the client becomes too popular, we can dial back the numbers.

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.