Commit Graph

125 Commits

Author SHA1 Message Date
Nick Wynja 398ebe9271 Adds subscribed channels to Topics
Any subscribed channels now appear at the top of Topics. This gives you
easy access to view subscribed channels using the existing hashtags
view.
2021-03-03 13:36:23 -05:00
Supernova 1b47d439ec Add support for linking an optional custom-style.css file from the user's oasis configuration folder. 2020-12-08 12:37:26 -05:00
Christian Bundy a02744d0eb Add rebuild button to settings
Problem: The latest release seems to have some index problems, which is
frustrating, but might be able to be circumvented with a database
rebuild. The rebuild was something that Ahau funded and I'm excited to
be able to finally expose this to users without asking them to `rm -rf`
random files in their `~/.ssb` directory.

Solution: Replaced unused 'progress' bars (always at 100%) with rebuild
button.
2020-11-29 10:55:00 -08:00
Christian Bundy 925e4bc78b Merge branch 'master' of github.com:fraction/oasis into upgrade-koa-router 2020-11-24 20:46:51 -08:00
Christian Bundy 65b7df9ea9 Remove comments to disable linters
Problem: Our tests seem to have been disabled in various places, which
means that type errors, typos, and other small problems were introduced.

Solution: Remove the comments and fix the underlying problems without
disabling the linters.
2020-11-22 16:52:12 -08:00
Christian Bundy 781e647fce Upgrade @koa/router
This also fixes our routes so that we're listening on `/foo` instead of
`/foo/` with an accidental trailing slash.
2020-11-21 20:15:03 -08:00
Daan Wynen 9e57b011f7
Merge pull request #469 from christianbundy/stricter-regex
Use stricter regex for @mention match
2020-11-22 00:29:10 +01:00
Christian Bundy dde991a680 Use stricter regex for @mention match
Problem: You can't publish email addresses or user@host combos or
anything like that because the regex is super liberal in what it
matches.

Solution: Ensure that the first word in a message is a mention *or*
ensure that there's whitespace before a mention. This also adds a
regex101 link (in lieu of proper testing, for now) which makes this
easier to test and track over time.

See-also: https://github.com/fraction/oasis/issues/466
2020-11-20 17:09:55 -08:00
Christian Bundy 0aacf3bbc3 Fix tests and remove workaround
Problem: Recently there was a PR [0] merged with a quickfix to avoid
some test failures, which is something I've been trying to avoid. While
`process.exit()` works fine, I'm worried that it means we don't
understand what's happening under the hood, *plus* I have the [maybe
unjustified?] worry that it might kill the process during a database
write or something dangerous. It looks like this particular test hang
was caused by both a stream and some number of intervals that were left
open.

Solution: Provide a way to close the stream and intervals in `index.js`
and ensure that we do that before closing the server.

[0]: https://github.com/fraction/oasis/pull/462
2020-11-11 08:25:38 -08:00
Alexander Cobleigh 2fc33f450d document quick fix for making the server definitively exit 2020-11-11 16:57:28 +01:00
Alexander Cobleigh e567443925 try workaround 2020-11-11 15:19:05 +01:00
Henry e7ea4dbb37 make code flow more shallow 2020-11-01 14:45:14 +01:00
Henry e3906e2230 fix race on blobs variable
fixes TypeError: Cannot read property 'startsWith' of undefined
2020-11-01 14:40:43 +01:00
Alexander Cobleigh 4d5c571df3 restore common-good check & fix its errors
after having restored the package-lock.json to that of the master branch, this
PR now uses common-good@2.0.3, which has common-good check as a command.

i ran it manually as $(npm bin)/common-good check, and fixed whatever
it complained about.
2020-10-21 15:33:01 +02:00
Alexander Cobleigh 756fd180e4 fix eslint errors 2020-10-20 13:55:52 +02:00
Alexander Cobleigh e08901d88c replace warning with comment 2020-10-20 13:28:52 +02:00
Henry e7dd215f4d fix common-good setup
somehow it's cli arguments changed
2020-10-19 10:06:34 +02:00
Alexander Cobleigh 2f746d99e1 remove bracket from regex 2020-10-19 10:06:07 +02:00
Alexander Cobleigh ffb207ce57 add more delims, fix double nicknames 2020-10-19 10:06:07 +02:00
Henry 8f9ef5e3c7 change name->feed lookup structure
we had duplicates and _old_ names in the first attempt,
with this new strucutre only one name per feed is kept (the most recent)

also: tweak regexp some more

should not correctly match end of string and NOT match inside md link
https://regex101.com/r/Uu6iTj/3/
2020-10-19 10:06:07 +02:00
Alexander Cobleigh 28f1821fd5 improve mentions regex edge cases 2020-10-19 10:06:06 +02:00
Henry 6ea47ebac6 some more comments 2020-10-19 10:06:06 +02:00
Alexander Cobleigh a2817cf5fb implement relationship-based name matching 2020-10-19 10:06:06 +02:00
Henry 9004280d0b some @mentions in preview
replaces immediatly if there is one match,
but just spews multiple ones.

* add silly in-memory about:name cache

rational is also commented the code. the tl:dr; is oasis already doesnt
use ssb-about or other indexing plugins.

butt for @mentions we need a quick way to lookup names to feeds,
otherwise we block the preview flow with long query times.
2020-10-19 10:06:06 +02:00
Alexander Cobleigh 6d50e53604 remove exif data from uploaded jpegs 2020-10-19 10:06:06 +02:00
Alexander Cobleigh 680a894efd add blob upload to comment, subtopics 2020-10-19 10:06:06 +02:00
Alexander Cobleigh 119c1f8584 implement content warnings for comments, subtopics
also make sure to only display content warning in summary for subtopics
2020-10-19 10:06:06 +02:00
Alexander Cobleigh 2d5781f0fe add subtopic previewing 2020-10-19 10:06:06 +02:00
Henry 5cb4c8aff1 use file-type for mime and enhanced preview
and cleanup blob addition to text
2020-10-19 10:06:02 +02:00
Alexander Cobleigh e64b595b54 implement comment previewing 2020-10-19 10:04:39 +02:00
Henry 423c0c11f4 begin working on preview with blobs 2020-10-19 10:04:39 +02:00
Daan Wynen 9519050eb2 Add rendering of blog messages.
Patchwork does that. So if we're aiming for feature parity...
Also, blogs are neat. :)
2020-05-25 03:46:29 +02:00
Daan Wynen a40b2eefc1 make the linters happy.
this time they had a *lot* of opinions. :P
2020-05-23 21:14:49 +02:00
Daan Wynen e8c8aa49a7 Add simple pagination to user feeds.
This is simply based on sequence numbers and the `gt`/`lt` arguments of
`createUserStream`.
2020-05-23 06:13:11 +02:00
Jacob Karlsson 3b753f16ac Apply style fixes 2020-05-03 23:14:19 +02:00
Jacob Karlsson 51ae2966f1 Add sidebar entry 2020-05-03 22:38:34 +02:00
Jacob Karlsson e456c1d9c5 Add image search 2020-05-03 22:16:44 +02:00
Christian Bundy 8e2eb404e0 Rename "reply" to "subtopic"
Problem: The words "comment" and "reply" are super ambiguous, but
renaming them is hard.

Solution: I think "subtopic" captures the sentiment well, and makes it
clear that you're leaving the current topic to start a new topic (rather
than just replying to an individual message).
2020-04-16 08:31:35 -07:00
Nick Wynja a896f637e5 Progress checking and connected peers
Rework how I'm doing progress checking and be very verbose about it
until I understand how this all works. Also refactors connected peer
function into shared model for use on settings page.
2020-04-13 17:27:03 -04:00
Nick Wynja fd1d63ffba Introduces sync endpoint
Starts, waits until connected to peers, waits for progress, disconnects
2020-04-13 11:28:36 -04:00
Christian Bundy ebf6e17389 Add --allow-host CLI flag for for proxy use-case
Problem: When proxying Oasis, the CSRF + DNS rebind security precautions
will respond with HTTP 400 if you use a hostname that Oasis doesn't
know about. For example, if Oasis is listening on `localhost` and you
use Caddy/Nginx/etc to proxy that to `oasis.example.com`, then Oasis
will see GET requests as DNS rebind attacks and POST requests as CSRF
attacks.

Solution: Add `--allow-host` command-line flag so that you can
`--allow-host oasis.example.com` and ensure that the host is allowed by
the security measures.
2020-04-11 08:36:29 -07:00
Christian Bundy 3886b1fc53 Increase test timeout and remove log statements
Problem: The Windows tests seem to be failing, it looks like a timeout
problem? Also there are a handful of debug statements around the code
that can be safely removed.

Solution: Double the timeout length and remove debug statements.
2020-04-06 13:22:07 -07:00
Christian Bundy cb1be6bc8b Fix open sockets that weren't closing during tests
Problem: The test suite isn't closing the database because `app.close()`
only affects the HTTP server. This means that tests don't exit cleanly
and sockets remain open and all sorts of really fun stuff that we don't
want while writing tests.

Solution: Refactor `src/ssb.js` so that we can exit cleanly and have
less rope to hang ourselves with. Add a small lifecycle test that can
help us ensure that the bare minimum lifecycle events are working
correctly, plus now the previous tests are passing on my machine too.
2020-04-06 12:14:58 -07:00
Christian Bundy 3c9ec37d2f Add very basic test suite
Problem: ESLint and TypeScript help catch some types of regressions, but
they don't protect us against obvious stuff like "the server won't
start". This means that humans need to test a bunch of stuff manually,
and that can be really tedious and exhausting.

Solution: Yesterday someone invented this cool concept called "testing"
where you write automated tests for your software to ensure it actually
works the way you expect. It might have beeen invented before yesterday,
I don't know. Anyway, this solution adds a bunch of tests that send HTTP
GET requests to a bunch of endpoints to make sure the server is at least
returning HTTP 200 responses. It also fixes a race condition where HTTP
server was available before the readme / version strings were loaded.
2020-04-03 09:17:13 -07:00
Christian Bundy 7e22829578 Fix own profile error
Problem: A `null` relationship represents when it's your profile, which
isn't very intuitive. It causes an error when we try to check for the
`blocking` and `following` properties, which don't exist on `null`.

Solution: Instead of `null`, set a `me` property to tell whether this
relationship is our own profile.
2020-03-28 13:32:02 -07:00
Christian Bundy e7bd3ed305 Add block and unblock to author profile
Problem: We have a way to follow and unfollow, but there's no way to
block or unblock. Also if you go to the profile of a blocked peer, their
posts still show up.

Solution: Add block and unblock and hide messages from blocked peers on
their profile page.

Fixes: https://github.com/fraction/oasis/issues/370
2020-03-28 10:03:31 -07:00
Christian Bundy 555249277f Remove @ts-ignore workaround
Problem: The workaround is no longer necessary now that the new version
of @types/koa has been published. Thanks to @peterblazejewicz,
@harryparkdotio, and @orta for the quick upstream fix.

Solution: Run `npm update` and remove the `@ts-ignore` comment.
2020-03-27 09:13:31 -07:00
Christian Bundy fb23d25217 Add more type definitions to reduce implicit any
Problem: We still have heaps of implicit 'any' types that our linters
can't make sense of.

Solution: Keep on adding type documentation! Slowly but surely I'm
hoping we can reduce the amount of untyped JavaScript in the repo.
2020-03-27 08:21:40 -07:00
Christian Bundy defb57321e Merge branch 'master' of github.com:fraction/oasis into type-defs 2020-03-27 08:02:44 -07:00
Nick Wynja 95e7a31dcd lint fix 2020-03-25 09:05:53 -04:00