Commit Graph

885 Commits

Author SHA1 Message Date
Andrew Shu
bac168bb08 Clear previous error message on markdown preview 2020-07-14 16:03:06 -07:00
Deimos
a9d312d152 Remove welcome message sent on registration
This message is getting pretty outdated now, and should probably be done
in a different way regardless so that it doesn't need to be in the code,
especially since forks won't want the same message (or any message).

A better approach would probably be a consumer or cronjob watching for
new registrations in the event stream.
2020-07-14 15:09:51 -06:00
Andrew Shu
cf3e777fd8 Add bottom padding to topic full text
Prevents scrollbar from showing up when there is a
subscript on the last line of text.

Another option would have been overflow-y: hidden,
but that clips the text in the (pathological?) case
of deeply nested subscripts.
2020-07-12 15:59:51 -06:00
Andrew Shu
ac8e43876d Show (OP) in Topic Log changes 2020-07-12 15:53:49 -06:00
Deimos
e85dfa2492 Salt: ensure that the site-icons.css file exists
The generate_site_icons_css cronjob will create this file, but the site
won't work before it exists, so there's a (less than 5 min) gap where
the site is broken when first set up. This probably won't be noticeable
in dev/prod setups, but breaks things like CI setups where everything is
getting created freshly each time.

This makes sure that the file always exists on initial setup and
whenever the Salt states are re-run.
2020-07-12 14:33:15 -06:00
Andrew Shu
c330811fc9 Vagrantfile: relax Salt pinned version to 2019.2
Fixes provisioning of a new VM.

Old versions like 2019.2.3 may be moved to an archive
and get an HTTP 404 error.
Relaxing the pinned version allows setup to find
newer patches, such as 2019.2.5.

More info:
752768b1ff/accepted/0022-old-releases.md
2020-07-09 23:43:33 -07:00
Ry Jones
f8aa1f0a03 Fix link to boards view
Signed-off-by: Ry Jones <ry@linux.com>
2020-07-08 18:17:00 -07:00
Deimos
5b1addab9f Hide old-scheduled-topic message if not logged in 2020-07-06 17:03:34 -06:00
Deimos
080aadb131 Add backfill for topic_schedule.latest_topic_id
I doubt the absence of this would have ever been noticed or that adding
this will ever matter for anyone, but I might as well do it properly!
2020-07-06 15:51:29 -06:00
Deimos
c4af5c7d57 Prevent top-level comments in old scheduled topics
By default, new top-level comments will only be allowed in the latest
topic from a particular set of scheduled topics. Replies to existing
comments in old topics will still be allowed - this is just intended to
prevent the cases where an old scheduled topic gets bumped back up due
to a reply and people inadvertently start adding new top-level comments
to it instead of the latest one.

This should be the correct behavior for most scheduled topics, but it
can be disabled for a particular schedule if needed.
2020-07-06 13:52:32 -06:00
Deimos
a451b7fb03 Track latest topic for each schedule
This adds a new latest_topic_id column to topic_schedule and uses
triggers on the topics table to keep it correct.

This isn't really ideal, but it will simplify a few things related to
scheduled topics by quite a bit. For example, this commit also uses that
new data to much more easily populate the list of scheduled topics in a
group's sidebar, which previously required a subquery and windowing.
2020-07-05 13:26:26 -06:00
Deimos
96aaf50b04 Remove comment back-and-forth delay
I think overall this is triggering more than I want, and getting in the
way of perfectly reasonable conversations. I like the idea still, but
needs adjusting.
2020-06-19 13:26:56 -06:00
Deimos
a66e16d6c7 Remove specialized coronavirus views
Coronavirus topics have slowed down greatly now, with generally only
about 3 per day, and are almost all restricted to ~health.coronavirus,
so users can easily find (or avoid) them by just using that group.
2020-06-17 18:37:24 -06:00
Deimos
59b0f24e7b Add metric for back-and-forth warnings 2020-06-16 15:04:30 -06:00
Deimos
60f47cc3f2 Replace "whitelist" terminology 2020-06-16 14:42:18 -06:00
Deimos
15ced1a750 Add a delay to comment back-and-forths 2020-06-16 14:04:48 -06:00
Deimos
6227f747c1 Use intercooler for comment reply form
Previously, the comment reply form was being created entirely
client-side by cloning and modifying a <template>. This was nice because
it meant that a network request wasn't necessary to display the form,
but it also had downsides.

For example, if a topic was locked after a user had already loaded the
page (or their notifications page with a comment from that topic), they
would still be able to click Reply and type in a comment, and wouldn't
know that replying wasn't possible until they actually tried to submit
the comment.

By switching to using intercooler for this form, we can do server-side
validation to check permissions before showing the form, and it also
simplifies some other aspects, such as the warning about replying to an
old comment, which previously needed a data-js-old-warning-age attribute
in the HTML, but is now just part of generating the reply form template
server-side.
2020-06-15 19:10:09 -06:00
Deimos
e15359919d Prioritize showing comment removal over deletion
If a comment is removed and then deleted by its author, we should
continue showing it as removed, since that's the more significant action
(and the deletion is usually *because* of the removal).
2020-06-02 12:50:40 -06:00
Deimos
e8f8885f22 Don't post full "backlog" of scheduled topics
This will probably only ever be relevant in development environments,
but we don't want the topic scheduler to always post a full backlog of
scheduled topics when it hasn't run for a while. For example, if a dev
environment has a daily scheduled topic set up, but the VM is not
launched for a week, the next time the "post scheduled topics" cronjob
runs, it will post all 7 of the backlogged topics.

This commit changes the script so that it advances the schedule to the
next *future* occurrence, instead of continuing the backlog.
2020-05-26 18:48:40 -06:00
Deimos
740f71d339 TopicQuery: include ignored topics by default
Previously, TopicQuery was excluding ignored topics by default. However,
this caused some unexpected issues, such as a crash when someone tried
to vote on a topic after ignoring it. I think it's more intuitive to
reverse the logic like this: include the ignored topics by default, and
only specifically exclude them in the cases where that's necessary.
2020-05-25 19:54:27 -06:00
Deimos
ce9ae214d8 Adjust posting rate-limits 2020-05-21 19:24:55 -06:00
Deimos
384c5c985f Salt: move postgresql-redis bridge to own state 2020-05-15 16:45:46 -06:00
Deimos
78002847ba Fix environment check in Prometheus config
Checking for prod isn't correct - we want the monitoring server to have
these entries so that it can scrape them from prod.
2020-05-15 16:08:39 -06:00
Deimos
d5453cf286 Exclude forums.terraria.org from url transforms
This forum uses the same invalid url scheme as the Paradox forums, so
needs to be excluded as well.
2020-05-15 15:24:44 -06:00
Deimos
b011be34ef Add simple metrics to event stream consumer jobs
This adds some very simple metrics to all of the background jobs that
consume the event streams. Currently, the only "real" metric is a
counter tracking how many messages have been processed by that consumer,
but a lot of the value will come from being able to utilize the
automatic "up" metric provided by Prometheus to monitor and make sure
that all of the jobs are running.

I decided to use ports starting from 25010 for these jobs - this is
completely arbitrary, it's just a fairly large range of unassigned
ports, so shouldn't conflict with anything.

I'm not a fan of how much hard-coding is involved here for the different
ports and jobs in the Prometheus config, but it's also not a big deal.
2020-05-14 18:19:26 -06:00
Deimos
42f99a82ba Add temporary bans (manual)
This enables me to set a ban expiry time for a user (manually, in the
database). By doing so:

* The user's page will say that they're temporarily banned, and show the
  date their ban will be lifted.
* If the user tries to log in, it will say they're temporarily banned,
  and give a specific datetime that the ban will be lifted by.
* An hourly cronjob will lift any bans that have expired.
2020-05-09 14:25:20 -06:00
Deimos
7e96fb00b7 Update error message for breached passwords
This isn't always in the sidebar, so the previous message could be
confusing.
2020-05-09 12:22:56 -06:00
Deimos
25e4207563 Login: show whether username or password was wrong
I get a fair number of "forgot password" emails where the person is
actually trying to log in with the wrong username. Normally, a login
system shouldn't display whether the username or password was the
incorrect part, but since it's already public information which
usernames exist on Tildes (simply by visiting /user/<username>), this
really isn't meaningfully hiding anything. It would only have any effect
on the most absolutely naive attackers. I think it's an acceptable
trade-off to help out people that are inadvertently trying to log in
with the wrong username instead.
2020-05-08 18:22:17 -06:00
Shahzaib Sahibzada
d901abfb84 Fix tag autocompletion when space between tags
Previously, typing a space at the start of a tag would prevent the
autocomplete options from appearing.
2020-05-04 19:56:44 -06:00
Deimos
c85eec1c84 Fix tag/unfiltered info not showing on home page
Adding the info about the coronavirus views overrode this block, so we
can just show either (or both, which probably shouldn't happen, but
could) by doing this.
2020-04-29 18:18:35 -06:00
Deimos
56f709bda2 Add a current_theme request method 2020-04-14 19:39:20 -06:00
dougmellon
2e8623c22f Show theme switcher in footer for logged-in users 2020-04-14 18:39:12 -06:00
Deimos
9cd86ad33d Salt pillar: update Prometheus IP to IPv6
I've switched the Prometheus server to communicate over IPv6 now, so
this needs to be updated to make the nginx configuration correct.
2020-04-14 18:39:12 -06:00
dougmellon
b707e2b9bb Remove aria-label from divs
This is a recommendation from the W3C validator: "Don't use aria-label
or aria-labelledby on a span or div unless its given a role."
2020-04-07 15:06:27 -06:00
Deimos
f2c0b68f78 Monitoring server: add blackbox exporter
This is a prometheus exporter that allows checking IPv4 and IPv6
responses, among other things. This sets it up to make sure that the
site is responding over both IPv4 and IPv6, so that I can monitor and
set up an alert if either stops working.
2020-04-03 17:49:20 -06:00
Deimos
284c3cfd8d Treat scheduled-topic title/markdown as Jinja
This probably isn't particularly safe, but it's fine since I'm the only
one that can create or edit scheduled topics for now. The only available
variable so far is current_time_utc.
2020-03-25 16:32:01 -06:00
Timo
f0305bc0cd Show donation meter on financials page 2020-03-23 17:35:17 -06:00
Deimos
a0d62be6cb Fix more minor styling issues with header views 2020-03-21 11:04:17 -06:00
Deimos
2c6967b3da Fix alignment of "segmented" subgroup header links 2020-03-20 18:16:39 -06:00
Deimos
4dedcf1716 Add more space between groups on the group listing 2020-03-19 17:42:28 -06:00
Deimos
3903c6f6de Refactor site header HTML/CSS away from flexbox
I don't like this as much, but it works better to be able to wrap the
coronavirus views bar underneath the logo on small screens.
2020-03-19 16:55:25 -06:00
Deimos
dbaf4c61e2 Stop specialized views breaking on thin screens
This isn't great, but at least it won't be as broken as it was before.
I'll try to follow this up with a better improvement soon.
2020-03-19 11:59:56 -06:00
Deimos
fea2884343 Move coronavirus views into header
This is a little awkward on mobile, but it doesn't take up any more
vertical space than the previous version did, and is much better on
desktop.
2020-03-18 19:43:07 -06:00
Deimos
0ea9d81a6b Add id to bar with coronavirus views
To make it easier for people to hide using local CSS, uBlock element
filtering, etc.
2020-03-18 15:42:29 -06:00
Deimos
3f1decb243 Add global autocomplete tags
This is kind of hacky again (and shouldn't contain the coronavirus tag
over the long term), but makes sure that the "spoiler", "nsfw", and
"coronaviruses.covid19" tags are always offered as autocomplete options,
no matter how common they are in the topic's group.
2020-03-17 17:05:42 -06:00
Deimos
355dd9d334 TEMP: Add some hacky coronavirus "views"
This adds two links at the top of the home page that go to different
"views" - one includes only topics related to the coronavirus, while the
other filters out all coronavirus topics.

For the purposes of these views, a "coronavirus topic" is one that is
either in the ~health.coronavirus group, or has coronaviruses.covid19
tag.

This is very hacky and will only work on the main tildes.net site due to
hardcoded group name and tag. I'm okay with that.
2020-03-17 16:28:59 -06:00
Deimos
1c739d9736 Update groups page layout + show activity stats
This replaces the groups page with a new list style that doesn't include
the ability to subscribe/unsubscribe directly on the page, and also
shows approximate activity statistics (daily topics/comments) for each
group.
2020-03-12 18:25:31 -06:00
Deimos
7d1c3297fb Add group_stats table, track daily topics/comments
This adds a group_stats table and cronjob that will insert the previous
day's stats into it each day just after 00:00 UTC.
2020-03-09 17:57:43 -06:00
Deimos
01752141fc Salt: set overall server timezone to UTC 2020-03-05 20:55:12 -07:00
Deimos
c8f8697767 Fix autocomplete chip X "ends with" conflicts
Let's try this again without the regex.

Clicking the X button in an autocomplete chip could inadvertently remove
the wrong tag (and cause a weird "merging" behavior) if another tag
ended with the same text as the one being removed. For example, if a
post had both "one.two" and "two" tags and you clicked the X button on
the "two".
2020-03-05 14:13:11 -07:00