Commit Graph

111 Commits

Author SHA1 Message Date
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 988d35a736 manually edit package-lock
the purpose is to only add the two new dependencies this PR introduces, piexifjs
and file-types (and their transitive dependencies, ofc), without affecting any
other dependencies, as compared to oasis's current master branch
2020-10-21 13:58:15 +02:00
Henry 67241ce286 pin deps 2020-10-19 10:38:21 +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
dependabot[bot] f8e7f25d6c
Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-19 05:08:58 +00:00
Jacob Karlsson c205826b48 Merge branch 'master' of github.com:fraction/oasis into image-search 2020-05-06 20:05:37 +02:00
Christian Bundy f86b73b40e Upgrade Flotilla and SSB-CONN, remove auto-stage
Problem: The auto-stage code was a horrible hack that may be causeing an
OOM bug if too many peers are staged too quickly.

Solution: Since SSB-CONN now supports a variable number of connection
hops, we can remove the auto-stage hack and use the default scheduler
instead of trying to staple on our own hacky scheduler fix.
2020-05-04 13:27:06 -07:00
Jacob Karlsson e456c1d9c5 Add image search 2020-05-03 22:16:44 +02:00
Christian Bundy 09ff4cad21 2.16.0 2020-04-13 14:32:21 -07:00
Christian Bundy 8e4a1c8e53 2.15.0 2020-04-10 12:51:36 -07:00
Christian Bundy 2968f7d80a Merge https://github.com/fraction/oasis into advisory-fix-1 2020-04-10 10:51:29 -07:00
Christian Bundy ecdd78c42e Merge branch 'master' of github.com:fraction/oasis into update-deps 2020-04-08 14:52:06 -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 182d6d68bc Update npm dependencies
Problem: Our dependencies are getting ahead of us!

Solution: Catch up with `npm update`. I think Markdown-It was the only
breaking change, and it didn't affect us.
2020-04-03 07:11:11 -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 defb57321e Merge branch 'master' of github.com:fraction/oasis into type-defs 2020-03-27 08:02:44 -07:00
Christian Bundy c4aaf47a06 Fix Markdown link bug
Problem: Some sigil links were broken because of a bug in SSB-Markdown
that was recently resolved.

Solution: Upgrade SSB-Markdown.

Fixes: https://github.com/fraction/oasis/issues/242
2020-03-25 10:15:26 -07:00
Christian Bundy c9fffe2b9c Add TypeScript definitions for better guardrails
Problem: We have TypeScript enabled on the project but have been missing
lots of definition files, so there are like 500 errors when you enable
`--noImplicitAny`.

Solution: Add definitions and fix the bugs that they point out. This
reduces the number of errors with `--noImplicitAny` to 285.
2020-03-24 09:23:52 -07:00
Christian Bundy dd388feefe Revert @fraction/flotilla change 2020-03-24 08:15:05 -07:00
Christian Bundy 488852f205 Resolve Travis CI + Windows EOL bug
Problem: Travis CI is converting our EOL characters and it's causing
problems when we're parsing with Prettier.

Solution: Disable auto-conversion.
2020-03-23 19:20:38 -07:00
Christian Bundy 32465e5983 Update npm dependencies
Problem: Our dependencies are falling behind and it'd be nice to have
them up-to-date. The only big update it that Common-Good upgraded to the
latest version of Prettier.

Solution: Update them!
2020-03-23 18:59:53 -07:00
Cinnamon 3e74a5cd2e
Merge pull request #298 from christianbundy/2019-03-npm-update
Upgrade npm dependencies
2020-03-11 16:02:09 -07:00
Christian Bundy c575aebb03 2.14.0 2020-03-10 16:57:46 -07:00
Christian Bundy 9b193cda14 Upgrade npm dependencies
Problem: Patchwork is soon going to release with a new SSB-Backlinks,
and since we share a database with Patchwork we should make sure we're
on the same version. If we're on different versions, we'll be constantly
regenerating indexes and that isn't fun for anyone.

Solution: Upgrade npm dependencies.
2020-03-09 14:34:18 -07:00
Daan Wynen 35c42f6b95 Read settings from ~/.config/oasis/config.json
This should give pretty much expected behaviour. Each config value
can be set by three sources:

1. By command-line argument. If it is not given, then
2. By config file. Or, lastly
3. By default value in the source code.

I can't test that the config file is searched and read from the right
place on windows or macOS, but on linux it works.
2020-02-22 10:32:50 +01:00
Christian Bundy 293dcabe68 Update SSB-Mentions and remove workaround
Problem: We've been using a workaround to filter the results of
SSB-Mentions, but that's just been fixed upstream and so we don't need
the workaround anymore.

Solution: Update the SSB-Mentions package and remove the workaround.
2020-02-19 14:38:10 -08:00
Christian Bundy 8088a9aa8b Add Oasis version to settings
Problem: It was impossible to tell which version of Oasis you're
running, which makes it hard to know when you need to update.

Solution: Put the version in the settings so it's easy to reference.
2020-02-18 10:44:36 -08:00
Christian Bundy 1e28b29758 Replace cooler methods with SSB-Client promises
Problem: We started using `cooler.get()` and `cooler.read()` because it
was impossible to use promises with SSB-Client.

Solution: I made some downstream pull requests into the MuxRPC module
and the SSB-Client module, which means that both of them now natively
support promises. This commit removes the weird convenience methods and
replaces them with the native promise support, which should hopefully
make the code easier to read and write.
2020-02-11 13:20:50 -08:00
Christian Bundy 6031b11470 2.13.1 2020-02-09 16:05:36 -08:00
Christian Bundy dfb498181b 2.13.0 2020-02-09 08:11:32 -08:00
Christian Bundy 214ef3335e Add basic scaffolding for internationalization
Problem: It was impossible to do any internationalization because
strings were all embedded throughout Oasis.

Solution: Add an internationalization submodule that provides
language-specific strings for the text elements in views. In future
commits we can add language selection and fallbacks for when the
selected language doesn't support the text we need to have translated.
2020-02-01 13:20:22 -08:00
Cinnamon 22fe9763d7
Merge pull request #125 from christianbundy/no-links2
Update Flotilla to drop SSB-Links2
2020-01-31 15:29:11 -08:00
Christian Bundy 01701d5119 Fix SVG rendering by setting content-type
Problem: Most browsers parse SVG files as XML and refuse to display it
in an `<img>` tag. It's usually unsafe to have browsers try to sniff the
file type themselves, because they can be tricked into running unsafe
code, so we want to set the file type ourselves in the server.

Solution: Use the Is-SVG library for a quick-n-dirty check for whether a
buffer is an SVG. If so, we set the file type accordingly.
2020-01-31 15:04:13 -08:00
Christian Bundy dc23b8bdf2 Update Flotilla to drop SSB-Links2
Problem: We aren't using the index at all so Oasis is just wasting time
and CPU power.

Solution: Upgrade Flotilla and resolve the problem.
2020-01-31 12:59:26 -08:00
Christian Bundy 53c1a1ad94 Hide private messages from author profiles
Problem: Showing private posts on profiles is scary and may give people
the impression that these posts are visible.
https://github.com/fraction/oasis/issues/113

Solution: Hide private messages when rendering public profiles and
change the method name to be very clear that it only returns public
messages.
2020-01-28 17:15:48 -08:00
Christian Bundy 89b68db17e 2.12.0 2020-01-28 12:56:55 -08:00
Christian Bundy ec3e4d489a Merge branch 'master' of github.com:fraction/oasis into conn-buttons 2020-01-28 10:25:42 -08:00
Christian Bundy b56b4bcd74 Update Flotilla to fix conn.stop bug
Problem: Stopping the networking would sometimes allow peers to remain
connected, which was confusing.

Solution: Upgrade to latest SSB-CONN to pull in a bugfix for this
behavior. Huge thanks to @staltz for the quick fix!
2020-01-28 10:22:24 -08:00
Christian Bundy b61d696a53
Merge branch 'master' into fix-tangle 2020-01-27 13:32:58 -08:00
Christian Bundy 681e3c6755 Add buttons to 'meta' page to manage networking
Problem: Sometimes you want to disconnect from the network but you don't
want to have to restart Oasis with the `--offline` flag
(https://github.com/fraction/oasis/issues/89). Sometimes networking gets
stuck and you need to run the equivalent of `ssb gossip reconnect`
(https://github.com/fraction/oasis/issues/63).

Solution: Buttons on the 'meta' page that let you start, stop, or
restart SSB-CONN whenever you want. Note that this commit includes an
update to SSB-CONN, but this version and the previous version both have
a bug where hitting 'stop' twice in a row will throw an error. This
commit implements a workaround for the bug, but it's something we'll
want to remove later once the underlying bug is fixed.
2020-01-26 16:55:48 -08:00
Christian Bundy dec0f42b0f Fix tangle bug when Patchwork is used as a server
Problem: Patchwork is missing a plugin that we need to set the `branch`
property when posting a message. This property is important because it
helps us sort threads, so we're throwing an error when it isn't
available. See: https://github.com/fraction/oasis/issues/21

Solution: HACK THE ~~PLANET~~ API. This commit injects the plugin we
need via Oasis, which is a bit of a duct tape solution but it *is* a
solution.
2020-01-26 12:57:42 -08:00
Christian Bundy b6314309f6 Add some basic type info with JSDoc
Problem: When we don't have any documentation for variable types it's
difficult for both humans and machines to parse our code.

Solution: As discussed in https://github.com/fraction/oasis/issues/78,
adding some JSDoc information on function signatures would be a nice
step in the right direction and could make debugging easier.
2020-01-26 12:42:28 -08:00
Christian Bundy 3c50b94fa1 Update Common-Good to stop using npm alias
Problem: CG's dependency, CSpell, had problems with Windows support, so
I was using a forked module as an alias to circumvent the problem. This
only works on very recent version of npm.

Solution: This morning the CSpell maintainer resolved the problem, so
the latest CG doesn't have to depend on an alias. This commit runs `npm
update` to get the latest version of CG so we don't have this problem.
2020-01-25 16:28:08 -08:00
Christian Bundy 393f7ef087 Update Common-Good to fix Windows problem 2020-01-24 09:28:37 -08:00
Christian Bundy 6d8591b0c8 Upgrade ssb-client and common-good 2020-01-23 18:27:06 -08:00
Christian Bundy abe802910f Update npm dependencies for new common-good
Problem: Common-Good had a bug in the Prettier glob where the recursion
wasn't working correctly. This meant that we weren't actually testing or
fixing some of the deeper files.

Solution: Update CG to the latest version and run `npm run fix` to fix
the linter stuff.
2020-01-23 14:36:25 -08:00
Christian Bundy f0563d3e27 Upgrade common-good 2020-01-21 18:20:06 -08:00
Christian Bundy defe1ecc98 Upgrade to common-good 1.1.1 2020-01-21 17:03:40 -08:00
Christian Bundy b34b04c2c2 Experiment with common-good module 2020-01-21 16:22:19 -08:00
Christian Bundy cb4a6ef971 2.11.0 2020-01-16 11:58:00 -08:00
Christian Bundy 9636d673ad Add latest changes to changelog 2020-01-16 11:57:49 -08:00
Christian Bundy 769a279daa 2.10.0 2020-01-06 18:16:11 -08:00
Christian Bundy f26a148244 Replace yarn.lock with package-lock.json 2020-01-03 15:19:35 -08:00
Christian Bundy b8384eea68
Add links to reply and reply all pages 2019-08-06 19:44:09 -07:00
Christian Bundy a5dbc26d04
1.14.1 2019-08-01 09:11:15 -07:00
Christian Bundy 1651dbb048
1.14.0 2019-07-26 10:09:23 -07:00
Christian Bundy 8776d27df7
Upgrade node module dependencies 2019-07-26 10:09:16 -07:00
Christian Bundy 136df89836
Add support for viewing mentions 2019-07-26 10:06:47 -07:00
Christian Bundy 170431ff3e
Initial commit 2019-06-24 09:51:21 -07:00
Christian Bundy e19790b891
. 2019-06-21 09:18:19 -07:00