diff --git a/.gitignore b/.gitignore index 1e1b9608..79249b1b 100644 --- a/.gitignore +++ b/.gitignore @@ -32,16 +32,11 @@ public/.well-known public/avatars public/sitemap* -# templates to be created per-site -app/views/about/404.* -app/views/about/about.* -app/views/about/chat.* -app/views/about/privacy.* -public/apple-touch-icon* -public/favicon.ico - # prod config config/credentials.yml.enc + +# files added in production +lib/tasks/deploy.rake config/database.yml config/initializers/development.rb config/initializers/production.rb @@ -49,4 +44,5 @@ config/master.key config/scout_apm.yml config/*.sphinx.conf config/unicorn.conf.rb -lib/tasks/deploy.rake +config/scout_apm.yml +.env diff --git a/app/assets/stylesheets/application.css.erb b/app/assets/stylesheets/application.css.erb index fdbcb205..20e25c16 100644 --- a/app/assets/stylesheets/application.css.erb +++ b/app/assets/stylesheets/application.css.erb @@ -233,10 +233,10 @@ html { } body, textarea, input, button { - font-family: "helvetica neue", arial, sans-serif; - font-size: 10pt; + font-family: "IBM Plex Mono", "JetBrains Mono", Consolas, "Courier New", Courier, monospace; + font-size: 11pt; color: var(--color-fg); - line-height: 1.45em; + line-height: 1.35em; } body { diff --git a/app/assets/stylesheets/local/lobsters.css b/app/assets/stylesheets/local/lobsters.css new file mode 100644 index 00000000..2736adb3 --- /dev/null +++ b/app/assets/stylesheets/local/lobsters.css @@ -0,0 +1,69 @@ +/* light mode */ +:root { + --color-lobsters-fg-has-suggestions: #bd6060; + + --color-lobsters-tag-special-bg: #f9ddde; + --color-lobsters-tag-special-border: #f0b2b8; + + --color-lobsters-hat-sysop-crown-fill: #ddc7c7; + --color-lobsters-hat-sysop-brim-stroke: #bbb2b2; +} + +/* dark mode */ +@media (prefers-color-scheme: dark) { + :root { + --color-lobsters-fg-has-suggestions: #df7171; + + --color-lobsters-tag-special-bg: #3b1719; + --color-lobsters-tag-special-border: #611a21; + + --color-lobsters-hat-sysop-crown-fill: #3e2f2f; + --color-lobsters-hat-sysop-brim-stroke: #2c2222; + } +} + +li .byline a.story_has_suggestions { + color: var(--color-lobsters-fg-has-suggestions); +} + +a.tag_announce, a.tag_ask, a.tag_show, a.tag_interview { + background-color: var(--color-lobsters-tag-special-bg); + border-color: var(--color-lobsters-tag-special-border); + color: var(--color-fg-67); +} + +span.hat_openbsd_developer span.crown { + font-family: comic sans ms, comic sans, comic neue, sans-serif; + font-size: 7pt; +} + +span.hat_sysop { + border-color: var(--color-lobsters-hat-sysop-brim-stroke); + color: var(--color-fg-67); +} +span.hat_sysop span.crown { + background-color: var(--color-lobsters-hat-sysop-crown-fill); +} + +#l_holder { + position: relative; +} +#l_holder:after { + content: ''; + background: transparent url("/favicon-16x16.png") no-repeat center; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; +} + +@media +only screen and (min-resolution: 2dppx), +only screen and (-webkit-min-device-pixel-ratio: 2) { + #l_holder { + background: transparent url("/favicon-16x16.png") no-repeat; + background-size: 16px; + background-position: 1px 1px; + } +} diff --git a/app/models/user.rb b/app/models/user.rb index 0d68d209..e61f2bdc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -143,7 +143,7 @@ class User < ApplicationRecord "sysop", "webmaster", "enable", "new", "signup"].freeze # days old accounts are considered new for - NEW_USER_DAYS = 70 + NEW_USER_DAYS = 7 # minimum karma required to be able to offer title/tag suggestions MIN_KARMA_TO_SUGGEST = 10 diff --git a/app/views/about/about.html.erb b/app/views/about/about.html.erb index 7551fb51..82af547b 100644 --- a/app/views/about/about.html.erb +++ b/app/views/about/about.html.erb @@ -1,369 +1,14 @@ -<% render partial: 'about/subnav' %> -
- <%- raise "Site owner: You need to delete app/views/home/about.html.erb and write your own about page" if Rails.env.production? and Rails.application.name != 'Lobsters' -%> - -
-

- Lobsters is a computing-focused community centered around link aggregation - and discussion, launched on July 3rd, 2012. - The administrator is Peter Bhat Harkins ("pushcx"), contact him with any support issues. - Lobsters was created by joshua stein - with careful design touches to encourage a healthy community: -

- - - -

Tags and Topicality

-

- When links or stories are submitted, they must be tagged by the submitter from a list of predefined tags. - Users can choose to filter out or - subscribe to all submissions with particular tags (example: programming.rss) - or combinations of tags (example: programming,audio.rss). - All users see all stories by default. - The tagging system works this way for three reasons: -

- - - -

- Creating new tags and retiring old tags is done by the community by submitting, discussing, and voting on meta-tagged requests about them, - and these events are logged (since 2018-04). - To propose a tag, post a meta thread with the name and description. - Explain the scope, list existing stories that should have been tagged, make a case for why people would want to specifically filter it out, and justify the increased complexity for submitters and mods. -

- -
-

- Lobsters is focused pretty narrowly on computing; tags like art don't imply every piece of art is on-topic. - Some rules of thumb for great stories to submit: Will this improve the reader's next program? Will it deepen their understanding of their last program? Will it be more interesting in five or ten years? -

- -

- Some things that are off-topic here but popular on larger, similar sites: - entrepreneurship, management, news about companies that employ a lot of programmers, - investing, world events, anthropology, self-help, personal productivity systems, - last-resort customer service requests via public shaming, - "I wanted to see what this site's amazing users think about this off-topic thing", - and - defining the single morally correct economic and political system for the entire world when we can't even settle tabs vs. spaces. -

-
- -

Invitation Tree

-

- The full <%= link_to 'user tree', users_tree_path %> is public and each user's profile - shows who invited them. This provides some degree of accountability and - helps identify voting rings. -

- -

- Invitations are used as a mechanism for spam-control, - to slow registrations to a pace we can acculturate (more below) - and to encourage users to be nice, not to make the Lobsters userbase an elite club. - Users are considered "new" for their first <%= User::NEW_USER_DAYS %> days, - and their usernames appear in green. - New users can't - send invites, - submit links to domains we haven't seen submitted before, - flag stories and comments, - suggest edits to story titles and tags, - resubmit links that have been seen before, - or - use tags for meta discussions or that are prone to off-topic stories - (<% Tag.not_permitted_for_new_users.pluck(:tag).map { |t| %><%= link_to t, tag_path(t) %> <%- } %>). - -

- -

- The quickest way to receive an invitation is to talk to someone you <%= link_to 'recognize from the site', users_tree_path %>. - If you wrote a link that was posted, please reach out in chat, we'd love to have you join the discussion. - Finally, if you can't find anyone you know in the invitation tree and didn't author something posted to the site, - <% if Rails.application.allow_invitation_requests? %> - you can request an invite. - <% else %> - consider getting to know the community in the chat room. - <% end %> -

- -

- There's no limit on how many invitations a user can send (though we might at some point, to manage growth). - There's also no official vetting process for new users, each user is responsible for inviting people they believe will contribute positively to Lobsters. - When accounts are banned for spam, sockpuppeting, or other abuse, - moderators will consider disabling their inviter's ability to send invitations or, rarely, also ban them. -

- -

Ranking

-

- All story and comment ranking on this site comes from user activity. - All users have equal votes, with no special priorities or penalties for specific users or domains. - Moderators have no ability to raise or lower the rankings of stories or comments (besides voting like any user). - Per-tag hotness modifiers affect all stories with - those tags, but these modifiers (and changes to them) are public. - Domains used for marketing analytics are banned and tracking parameters are removed from links - (look for TRACKING_DOMAINS and utm_ in story.rb). -

- -
-

- Users can flag stories and comments when there's a serious problem that needs moderator attention; two flags are needed to add the story or comment to the moderation queue. - Users must reach <%= User::MIN_KARMA_TO_FLAG %> karma to flag. - To guide usage and head off distracting meta conversations ("Why was this flagged!?", etc), flagging requires selecting from a preset list of reasons. -

- -

- For stories, these are: - "Off-topic" for stories that are not about computing; - "Already Posted" for duplicate submissions and links that elaborate on or responses to a thread that's less than a week old (see merging); and - "Broken Link" for links that 404, 500, or present a paywall; - "Spam" for links that promote a commercial service. -

- -

- For comments, these are: - "Off-topic" for drifting into meta or topics that aren't related to the story; - "Me-too" when a comment doesn't add new information, typically a single sentence of appreciation, agreement, or humor; - "Troll" for derailing conversations into classic arguments, well-intentioned or not; - "Unkind" when uncharitable, insulting, or dismissive; - and - "Spam" for promoting commercial services. -

-
- -

- Less than 1% of stories or comments get flagged, and users are not automatically punished by flags. - Users whose stories or comments are getting flagged significantly more often are strongly encouraged to talk to mods about what's not working. - (Please don't use flagging to try to push down topics or people you don't like; click "hide" on the story and move on rather than clutter up the mod dashboard with false alarms.) -

- -

Transparency Policy

-

- All moderator actions on this site are visible to - everyone and the identities of those moderators are <%= link_to 'public', moderators_path %>. - While the individual actions of a moderator may cause debate, there should be no question about if an action happened or who is responsible. -

- -

- If users are disruptive enough to warrant banning, they will be banned - absolutely, given notice of their banning, and their disabled user profile - will indicate which moderator banned them and why. - There will be no shadow banning or other secret moderation actions. -

- -

- The source code to this site and - its provisioning and deployment are - made available under a 3-clause BSD license for viewing, auditing, forking, or contributing to. - The codebase is used to run a dozen or so sister sites (that we know of) and we keep a list; - please get in touch if you've launched one. -

- -

- The Lobsters community is in a sweet spot that it's large enough to be worth asking questions about and small enough the answers make sense. - We have some basic stats available, - and Peter is happy to run queries against the database and Rails/MySQL/nginx logs (but not write them for you), - as long as they don't reveal personal info like IPs, browsing, and voting or create “worst-of” leaderboards celebrating most-flagged users/comments/stories. -

- -

- If you dislike the content or moderation policies here, you may prefer - Y Combinator News, - r/programming, - Slashdot, - Tilde News, or - comp.*. - Or you could use our codebase to start your own site. -

- -

Other Technical Features

- - - -

Trivia

- - -
+
about
+

this is a link aggregator for the tildeverse.

+
+

Rules

+
    +
  1. Political links are not allowed, unless directly related technology or tilde issues,ie
  2. +
      +
    • Net Neutrality
    • +
    • Privacy
    • +
    +
  3. Please limit content to PG-13, mild R rated
  4. +
diff --git a/app/views/about/chat.html.erb b/app/views/about/chat.html.erb index 19316730..a0077003 100644 --- a/app/views/about/chat.html.erb +++ b/app/views/about/chat.html.erb @@ -1,68 +1,8 @@ -<% render partial: 'about/subnav' %> -
-
-

- An official real-time discussion channel is available to members and guests - of the site, hosted on the - Libera.Chat IRC network - in #lobsters. - This channel was originally - created by - @kristof on freenode, and - stayed with the network on 2021-05-19 after that domain was lost. - @pushcx, - @355e3b (c355e3b on IRC), and - @aleph (Church on IRC) are channel operators. -

+
chat
+ tildeverse irc network here
+ webchat here -

- To participate in the discussion, join the - #lobsters channel on - irc.libera.chat with an IRC client. -

- -

- The policies and ideals of the discussion channel are the same as the website; quality content and conversing, respect for other users, and no spamming. - Slightly off-topic discussion is generally acceptable, but we're still not open to discussion of electoral politics and policies. - The channel isn't busy enough that there's always someone talking, so don't be surprised if you try to start a conversation and no one responds. - Leave it open and you'll see activity, though we're most active during US work hours. -

- -

- If you want an invite to the site, it's best to hang out and chat until people get to know you. - They'll likely ask you for a link to your homepage or a public profile to feel confident that you're not a spammer. - If you ask for an invite immediately on joining, expect people will be a lot more skeptical. -

- -

- If you are the author of or otherwise involved with a story that was submitted to the site, ask and someone can send you an invite. - We've unfortunately had problems with impersonation, so it helps a lot if you point out how your email address is linked to the story. -

- -

- The channel has a bot named - mockturtle. - It announces new stories submitted to the site and provides other useful features like showing the page title of URLs mentioned in the channel. -

- -

- If you'd like a cloak to note that you've contributed to - Lobsters development - or just for privacy as a regular user, contact a channel operator for a - lobsters/developer/username or lobsters/user/username - cloak. -

- -

- For a feed of stories without discussion, mockturtle also posts new stories in #lobsters-feed. -

- -

- Lobsters used to have a channel called #lobsters-boil for off-topic conversations (especially American politics) that "boiled over" from the main channel. - It was useful in the wake of some big events, but the mods didn't want to run it indefinitely. - Community members independently run ##crustaceans subject to their own policies, if you're looking for more off-topic discussion. -

- -
+

new posts are mirrored to tilde.chat in #meta and #tildeverse

+

comments are mirrored to #tildeverse

diff --git a/config/initializers/production.rb b/config/initializers/production.rb new file mode 100644 index 00000000..9437f575 --- /dev/null +++ b/config/initializers/production.rb @@ -0,0 +1,11 @@ +class << Rails.application + def domain + "tilde.news" + end + + def name + "tilde news" + end +end + +Rails.application.routes.default_url_options[:host] = Rails.application.domain diff --git a/config/puma.rb b/config/puma.rb index 476d5df7..dd4a5f14 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -55,7 +55,7 @@ on_worker_boot { |index| sleep sleep_for_index(index, worker_boot_duration) } # before forking the application. This takes advantage of Copy On Write # process behavior so workers use less memory. if ENV.fetch("RAILS_ENV") == "production" - bind "unix:///srv/lobste.rs/run/puma.sock" + bind "unix:///srv/lobsters/lobsters/run/puma.sock" # phased restarts # https://github.com/puma/puma/blob/master/docs/restart.md diff --git a/db/migrate/20200809023435_create_categories.rb b/db/migrate/20200809023435_create_categories.rb index 54563b86..3fda2faf 100644 --- a/db/migrate/20200809023435_create_categories.rb +++ b/db/migrate/20200809023435_create_categories.rb @@ -8,7 +8,7 @@ class CreateCategories < ActiveRecord::Migration[5.2] end def change - raise "You need to edit this migration to define categories matching your site" unless Rails.application.name == "Lobsters" + #raise "You need to edit this migration to define categories matching your site" unless Rails.application.name == 'Lobsters' create_table :categories do |t| t.string :category @@ -20,18 +20,22 @@ class CreateCategories < ActiveRecord::Migration[5.2] # list your tags in console with: Tag.all.pluck(:tag).join(' ') { - compsci: %w[ai compsci distributed formalmethods graphics osdev plt programming networking], - culture: %w[culture person philosophy law], - field: %w[cogsci crypto education finance hardware math science], - format: %w[ask audio pdf show slides transcript video], - genre: %w[art book event historical job news rant release satire], - interaction: %w[a11y design visualization], - languages: %w[apl assembly c c++ clojure css d dotnet elixir elm erlang fortran go haskell java javascript lisp lua ml nodejs objectivec perl php python ruby rust scala swift], - lobsters: %w[announce interview meta], - os: %w[android dragonflybsd freebsd illumos ios linux mac netbsd openbsd unix windows], - platforms: %w[browsers cryptocurrencies email games ipv6 mobile wasm web], - practices: %w[api debugging devops performance practices privacy reversing scaling security testing virtualization], - tools: %w[compilers databases emacs systemd vcs vim] + misc: ["test"], + capitalism: ["business", "capitalism", "censorship", "cloud-computing", "blockchain", "cryptocurrency", "5G", "adblock", "artificial-intelligence", "data-analysis", "data-brokers", "data-exploration", "data-science", "data-visualization", "extreme-capitalism", "finding-cures", "government", "health-insurance", "information-abundance", "intelligent-cloud", "intelligent-edge", "IoT", "machine-learning", "microsoft", "oracle", "propaganda", "SaaS", "social-data", "social-media", "surveillance", "surveillance-capitalism", "twitch", "U.S.A", "USA", "youtube"], + social: ["IRC", "matrix", "fediverse", "email"], + software: ["projects", "command line", "algorithms", "automation", "FOSS", "GNU", "gnu+linux", "agile", "programming", "open-source", "UNIX", "theory", "design", "kernel", "init", "software-development"], + hardware: ["Hardware", "desktop-computing", "Raspberry-Pi"], + os: ["BSD", "Linux", "macos", "windows", "distros"], + languages: ["bash", "css", "javascript", "lisp", "rust", "python"], + learn: ["ecology", "education", "EFF", "guide", "History", "Hackers", "hackerspace", "learning", "makerspace", "projects", "physics", "science", "space", "leadership"], + tools: ["emacs", "git", "shell", "systemd", "terminal", "ssh", "vim", "dns", "scripting"], + privacy: ["anonymity", "Privacy"], + security: ["cryptography", "cybersecurity", "security"], + tildes: ["yourtilde", "~team", "~town", "envs", "tildes", "tildeverse", "thunix", "system administration"], + culture: ["coffee", "content_warning", "current-events", "Art", "astronomy", "broadcasting", "equality", "fun", "gaming", "general", "health", "meme", "repair", "tips-n-tricks", "today-i-learned", "trivia", "yikes", "random", "MUSH", "satire", "sports"], + people: ["dennis-ritchie", "ken-thompson", "Luke Smith", "paul-ford", "richard-stallman"], + smallinternet: ["decentralized-internet", "gopher", "gemini", "internet-freedom", "lowtech", "self-hosting", "slow", "small internet", "SpartanWeb", "non-commerical-internet", "protocols", "text", "KISS", "design"], + web: ["digitalization", "internet", "modern-web", "mozilla", "Podcasts", "radio", "media", "multiplayer", "Reddit", "search engines", "Video", "web", "web-browsers", "web-development"], }.each do |category, tags| c = Category.create! category: category Tag.where(tag: tags).update_all(category_id: c.id) diff --git a/public/apple-touch-icon-144.png b/public/apple-touch-icon-144.png index 8223fa3f..e615c07d 100644 Binary files a/public/apple-touch-icon-144.png and b/public/apple-touch-icon-144.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index b4be1a69..3d59ae8e 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 00000000..7eb9580d Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon.ico b/public/favicon.ico index 25147def..029ec3fb 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ