Commit Graph

817 Commits

Author SHA1 Message Date
Deimos
eee2f2a03c Move <li> tag out of post_action_toggle_button 2020-02-09 16:21:32 -07:00
Deimos
a4b52086bd Add space between logo and "context" on mobile 2020-02-09 15:08:29 -07:00
Bauke
6b3ae4e3c5 Add more places to open user and group links in new tabs 2020-02-09 14:52:43 -07:00
Bauke
f96e9ecc65 Toggle the set default theme button on page load 2020-02-09 14:30:27 -07:00
Deimos
c3c3a073d2 Hide "View Markdown" when user can edit the post
If a user can edit a post, they don't need the ability to view the
markdown separately, so the button doesn't need to be shown in those
cases. I'm not sure if this should be a separate permission defined
inside the ACL or not.
2020-02-09 13:47:02 -07:00
Bauke
0ad36ac143 Add a View Markdown option for topics and comments 2020-02-09 13:45:56 -07:00
Deimos
5b49ef6991 2FA settings: add note about generating new codes 2020-02-09 13:10:43 -07:00
Deimos
06ec67c144 Shorten topic re-visit "grace period" to 30 sec 2020-02-07 11:48:41 -07:00
Deimos
6462991b2e Fix missing "with context" in messages template 2020-02-06 21:34:42 -07:00
Bauke
accb39df8e Add settings to open group and user links in new tab 2020-02-06 18:25:16 -07:00
Bauke
7a4ca23b5a Add the post new topic button to group searches 2020-02-06 15:03:59 -07:00
Alexander Bliskovsky
d75a6fc547 Add detection for IP addresses in the domain parser 2020-02-05 16:23:55 -07:00
Cassidy Dingenskirchen
dccf3df4db Add query parameters for auto-filling PM content 2020-02-05 14:52:10 -07:00
Bauke
589918401a Add a way to view your 2FA backup codes 2020-02-04 15:52:35 -07:00
Deimos
94460790db Update pypi package versions (requirements.txt) 2020-02-03 18:13:08 -07:00
Deimos
e198b51ad0 Replace Roadmap link with Planned Features
The "roadmap" issue boards on GitLab aren't being maintained in any sort
of useful way, and are probably just more confusing to anyone than
helpful. This replaces that link with a "Planned Features" one that goes
to an issue search for ones that have both the "Stage::Accepted" and
"Feature Request" labels, sorted by GitLab's "priority" method which
will put High Priority ones at the top.
2020-01-31 16:08:29 -07:00
Deimos
ef332df319 Fix autoflush issue with repeated comment votes
I removed this no_autoflush block in another recent change, but it was
still necessary due to the calls to _mark_comment_read_from_interaction
not being inside the try: block looking for an IntegrityError. This
could also be done in a different order to avoid the issue without
needing to disable autoflush, but this works fine.
2020-01-31 11:58:29 -07:00
Deimos
bc96dbfd4e Add method to user for verifying email address 2020-01-30 17:38:07 -07:00
Deimos
71bc57d437 Align voting button to top of topics in listings 2020-01-30 16:04:04 -07:00
Deimos
0fe14d3c37 Prevent inserting subsequent topic visits
This should prevent a few strange behaviors related to topic visits,
such as "losing" new comments if you accidentally double-click when
entering a topic's comments.

Currently, the "grace period" is set to 2 minutes, and no new visits
will be stored until the previous visit is at least that old.
2020-01-30 13:14:58 -07:00
Deimos
5495d5b4d2 Store all topic visits, adjust triggers/queries
This changes from storing only a single topic visit per user to just
storing all of them. I don't intend to keep all of these and will
probably find a way to "quantize" repeated visits soon. However, I want
to get an idea of the volume first, and also use this to see how the new
querying methods work in production.

On that note, I'm not sure that the LATERAL outer join is the best
method, but it seems interesting (and was kind of a pain in the ass in
SQLAlchemy), so we'll see how it looks.

As part of this, I also changed the method of adjusting num_comments on
past topic visits to be done entirely in triggers, instead of the
previous approach of doing it in _increment_topic_comments_seen().
However, this really just made me realize how incorrect this idea is and
how many edge cases can come up that will mess up the comment counters
on the visits (e.g. post a comment and then delete it immediately).
Hopefully this can go away in the somewhat near future with some other
changes to notifications.
2020-01-30 13:14:53 -07:00
Bauke
2e5546d999 Change codeblocks to use the primary background color inside quotes. 2020-01-29 14:05:36 +01:00
Deimos
078ca207f9 Apply PGTune recommendations to PostgreSQL in prod
This is just using the recommendations from PGTune for a web application
being hosted on a server with the prod server's specs. I'm sure they're
not the best values, but should be better than the defaults.
2020-01-28 17:13:44 -07:00
Deimos
0cca43fc50 Allow admins to reply to removed comments 2020-01-28 15:07:39 -07:00
Deimos
2484997325 Enable "mark new comments" for all users
Previously, this feature was disabled by default. However, despite being
one of the best features on the site, only about 10% of users ever
enabled it, and even very involved/frequent users often didn't realize
it existed.

My original thought about why it should be opt-in only is that I thought
it had a meaningful privacy impact, but it really doesn't. User visits
to topics are already tracked through server logs and similar data, so
the feature doesn't really make any difference.

This commit enables the feature for everyone, removes the separate
Settings page, and moves the "Collapse old comments" sub-setting onto
the main Settings page.
2020-01-28 14:31:42 -07:00
Deimos
0d589f2493 Add more SiteInfo entries for common sites 2020-01-25 13:27:41 -07:00
Deimos
3e37c1ec7c Add error-handling for event stream consumers
Previously, if an event stream consumer hit an error when processing a
message, it would crash and restart, and the message that caused the
error would be left in "pending" status for that consumer forever while
the consumer continued processing new messages.

This commit adds some more deliberate handling of messages that cause
errors:

* When a consumer starts, it will try to read pending messages first. In
  a case where an error was transient, this should mean that the message
  that previously caused a crash will be processed on retry.
* If a particular message causes the consumer to crash 3 times, it will
  be considered "dead" and moved out of the consumer's pending list into
  one specifically for dead messages. These dead queues can be monitored
  and inspected manually to look into failures, while the consumer can
  still continue processing new messages.
* After clearing or processing all pending messages, consumers go back
  to waiting for and processing new messages.
2020-01-25 12:48:39 -07:00
Deimos
bb1ccfe590 Set a maximum length for Redis event streams
Nothing should get anywhere near this limit for a very long time, but
it's better to have it set up in case anything ever gets out of control.
2020-01-24 07:41:55 -07:00
Deimos
9eec00cc6a Prevent comment notifications from ignored topics
This stops sending comment notifications from both replies and mentions
if the potential notification recipient is ignoring the topic.
2020-01-22 18:56:35 -07:00
Deimos
2434e06e93 Say "Ignore this post" in topic actions menu
This should be a little more clear about what the Ignore function does
(as opposed to thinking that it might ignore the user that posted the
topic, one of the topic's tags, etc.).

Not a huge fan of this implementation, but it seems to work okay.
2020-01-22 18:04:40 -07:00
cfabbro
e7025cd442 Fix filtered tags section for non-home pages 2020-01-21 17:24:08 -07:00
Deimos
3811ec3924 Eliminate RabbitMQ
This removes RabbitMQ as well as everything else attached to it:
Erlang; the Prometheus collector; the pg-amqp-bridge and all PostgreSQL
functions and triggers; and the amqpy Python package and the Tildes code
that used it.

Note that this commit does not actually uninstall or delete any of these
packages or services, so if you have a running instance that you want to
keep (instead of re-provisioning from scratch), you will need to
manually remove them if you want them completely gone.
2020-01-20 17:28:16 -07:00
Deimos
bcb5a3e079 Replace RabbitMQ uses with Redis streams
RabbitMQ was used to support asynchronous/background processing tasks,
such as determining word count for text topics and scraping the
destinations or relevant APIs for link topics. This commit replaces
RabbitMQ's role (as the message broker) with Redis streams.

This included building a new "PostgreSQL to Redis bridge" that takes
over the previous role of pg-amqp-bridge: listening for NOTIFY messages
on a particular PostgreSQL channel and translating them to messages in
appropriate Redis streams.

One particular change of note is that the names of message "sources"
were adjusted a little and standardized. For example, the routing key
for a message caused by a new comment was previously "comment.created",
but is now "comments.insert". Similarly, "comment.edited" became
"comments.update.markdown". The new naming scheme uses the table name,
proper name for the SQL operation, and column name instead of the
previous unpredictable terms.
2020-01-20 13:17:33 -07:00
Deimos
c0caec62c9 Upgrade Redis to 5.0.7 and update redis.conf 2020-01-20 12:55:31 -07:00
Deimos
9fe098cc6c Fix Black exclusion regex to only apply to folders
Noticed that this wasn't working correctly when Black was skipping over
a Python file with "sql" in its name.
2020-01-16 18:48:43 -07:00
Deimos
47657c988e Extend topic indexes for keyset pagination
The "keyset"-style pagination that Tildes uses for topic listings uses
WHERE and ORDER BY clauses that involve multiple columns to keep a
deterministic ordering even when the values in the main sort column are
equal. For example, when sorting by number of votes, you're actually
ordering by num_votes DESC, topic_id DESC. The previous single-column
indexes were a little inefficient for this and couldn't always be used
well.

This commit extends all of the relevant indexes to composite ones that
contain topic_id as well, and drops all of the original ones. This
should be more efficient, and should probably be done to indexes on the
comments table as well.
2020-01-15 14:10:10 -07:00
Deimos
3830f31c0e Improve performance of excluding ignored topics
This generates a significantly better execution plan for the query - I
think using one of the columns from the join condition helps the
query-planner do this properly.
2020-01-14 16:04:41 -07:00
Deimos
6f3e1ebbae Use <input type="search"> in search forms 2020-01-14 13:56:41 -07:00
Deimos
8412e44488 Add more SiteInfo entries for common sites 2020-01-14 11:00:30 -07:00
Deimos
35f3135742 Trim leading/trailing whitespace on topic links 2020-01-14 09:45:49 -07:00
Deimos
8318accb68 Improve alignment of topic actions dropdown
If the footer stretches to two lines (should only happen on mobile and
when there are new comments), this aligns the dropdown button more
towards the bottom of the topic, which looks better.
2020-01-14 09:30:59 -07:00
Deimos
64319eea0f Replace dropdown shadow with outset-style border
Shadows don't really fit with the site's overall style, and looked
especially weird in dark themes.
2020-01-13 19:27:11 -07:00
Deimos
0f020d4a2a Close dropdowns by clicking toggle button again 2020-01-13 18:19:09 -07:00
Deimos
ed2cdd2c4b Remove animation on dropdown
This also removes the attempt to close the dropdown if you the toggle
again while it's already open, since it seems like that isn't working
correctly anyway.
2020-01-13 17:34:01 -07:00
Deimos
c784c4e49d Add JS behavior to dropdowns (and fix OSX/Safari) 2020-01-13 16:44:53 -07:00
Deimos
9dd41562a4 Include ignored topics in Your Bookmarks page
If a user both bookmarks and ignores a topic, we should still show it in
the bookmarks page. They can unbookmark it if they don't want it in
there.
2020-01-13 16:15:14 -07:00
Deimos
983df2027d Add Actions dropdown to topics in listings
Currently, this dropdown contains Bookmark and Ignore.

As part of this, Spectre.css's icons stylesheet is now included, for the
caret icon used on the dropdown button. This is excessive since it's the
only icon being used for now, but the whole thing only adds about 1.3kb
to the gzipped size of tildes.css.
2020-01-13 13:16:04 -07:00
Ivan Fonseca
75c0fa0471 Add simple functionality for ignoring topics
This adds a simple Ignore functionality for topics, with the only effect
being to exclude ignored topics from listing pages.

It also adds a "Your ignored topics" page (linked through the user menu)
that lists all of a user's ignored topics, so that they can access them
if needed (to be able to un-ignore).
2020-01-07 18:00:43 -07:00
Deimos
2a8a1d4ba0 Add more SiteInfo entries for common sites 2020-01-06 14:08:57 -07:00
Deimos
9fceb3dbfc Update pypi package versions (requirements.txt) 2020-01-06 13:55:04 -07:00