Commit Graph

695 Commits

Author SHA1 Message Date
Christian Bundy 9b53ee94dc Replace C launcher with Golang launcher
Problem: I don't know what I'm doing and can't figure out how to
cross-compile this simple C program to macOS and Windows

Solution: @cryptix reminded me that Go makes cross-compiling easy, so I
took a stab at writing my first Go program. It seems to be working on
macOS and Linux, but I haven't tested on Windows.
2020-02-26 18:20:47 -08:00
Christian Bundy 51981ebfdb Fix argument expansion on Windows
Problem: Apparently one of the previous commits switched us to
shell-style argument expansion.

Solution: Use the appropriate solution on Windows, `%*`.
2020-02-26 15:40:13 -08:00
Christian Bundy dd81f0877a Fix typo in batch file path
Problem: We were using `darwin` instead of `win`.

Solution: Replace `darwin` with `win` to ensure that we're using the
correct path in the batch file we produce.
2020-02-26 15:36:19 -08:00
Christian Bundy 8ed77e5a64 Add basedir check for macOS shell script
Problem: When running the Darwin binary from another directory, the
script would look in the user's current working directory for both
`node` and `src`, which is wrong.

Solution: Set `BASEDIR` and use it so that we use the correct paths.
2020-02-26 07:35:01 -08:00
Christian Bundy 6812347b02 Distribute shell/batch scripts on macOS/Window
Problem: I've quickly learned that cross-compiling is a major headache
and that C programming lacks both rainbows and butterflies. It seems
that my executable only works on Linux, but probably not macOS or
Windows.

Solution: Use shell scripts on macOS, which work when you double-click
them, and batch scripts on Windows, which I *think* work when you
double-click them. I haven't tested this on a macOS device yet, but I
tested the previous shell script on macOS and it seemed to work fine.
Unless I've done something silly, this should work on macOS, but the
Windows batch script is just me writing code from memory and probably
doesn't work correcly. I'll probably beg @SoapDog to help me fix it.
2020-02-25 20:41:57 -08:00
Christian Bundy 4fac7a70b4 Move C program to its own file
Problem: Writing C in a heredoc is super janky and I think it's worth
avoiding whenever we can. We've also been getting compiler warnings that
we should probably resolve.

Solution: Move the C to its own file and resolve the compiler warnings.
2020-02-25 17:58:08 -08:00
Christian Bundy 3a486c851f Replace shell script with C program for max compat
Problem: The shell script didn't work on other platforms and the
AppImage hack ended up confusing people who tried to install it with
AppImageLauncher.

Solution: This feels absolutely ridiculous, but I've written the worst C
program in the world which does the equivalent of `exec ./node src "$@"`
and immediately gets out of our way. This ends up being an executable
that both Nautilus and Dolphin (GNOME and KDE file managers) let us
double-click, and should also work on macOS. It might even work on
Windows if we rename it as an `.exe`, but I'm not sure and *definitely*
haven't tested that.
2020-02-25 16:20:33 -08:00
Christian Bundy 8eb9fa12c4 Provide debugging output for failed module require
Problem: We try to `require()` our native modules to ensure that they
work correctly, but when they don't work we need to produce an error
that will help us debug the problem.

Solution: Switch from `node -p` to `node -e` to avoid printing
unnecessary output and don't redirect output for mandatory modules so
that we can debug them.
2020-02-25 12:58:36 -08:00
Christian Bundy f32e93e7a2 Reduce installer size
Problem: The installer contained npm and npx and a bunch of code that we
really don't need unless we're building from source. Since we don't want
our end-users to build anything from source, we can remove these.

Solution: Use shell-check to make some small fixups to the code and
remove everything we're downloading via wget except the `node` binary.
This requires moving the "build from source" fallback, and also includes
the `.appimage` hack when building from Linux to get double-click
opening working.
2020-02-25 07:38:16 -08:00
Christian Bundy f9013255ef Avoid making installer build from source
Problem: The previous approach of having the installer run `npm install`
was hazardous at best and didn't work well offline.

Solution: Package all of the source code with the application and use
the installer to ensure that it works on the target device. The
installer should ensure that we can `require()` the module, and if that
doesn't work then it should choose between two options:

- If the module is optional, `rm -rf` it and don't worry about it.
- If the module is mandatory, try running `npm install` with some flags
  to ensure that we stay offline and print the absolute minimal output.
  This should never happen, because we should never be packaging Oasis
  for architectures and platforms that we don't have prebuilds for, but
  it's a fine fallback behavior for experimental hackery.
2020-02-24 14:45:44 -08:00
Christian Bundy 5d6ef8acbe Pass through build script command-line arguments
Problem: Running `./oasis --version` should output the current version,
it shouldn't just start the server by default.

Solution: Pass through command-line arguments with `$@` so that we
respect what the user is asking us to do.
2020-02-22 08:53:29 -08:00
Christian Bundy 1e79b123aa Add build script that creates zip files
Problem: Most people don't have npm installed and we probably shouldn't
force them to have a full development environment to use Oasis. It would
be nice to have a way to install Oasis without any development tools.

Solution: Add a build script that can create .zip files that work on
Unix systems like macOs and Linux. Users will need to download the zip,
extract it, and double-click the `oasis` script. This script will run
`npm start || npm install && npm start`, which uses binaries that we
ship in the zip file so that they don't need to have `node` or `npm`
installed.
2020-02-21 16:04:53 -08:00
Jonathan Dahan bbbf3f8808
Merge pull request #247 from christianbundy/add-termux-docs
Add Termux install documentation
2020-02-21 11:04:02 -05:00
Christian Bundy 0bbb4d9bba Remove `--no-optional` to install sodium-native
Problem: I thought `--no-optional` would just ignore our top-level
optional dependencies, but it ends up ignoring deep optionl dependencies
like sodium-native. We really want these dependencies if we can build
them.

Solution: Remove the `--no-optional` suggestion and add a note about
what to do if Sharp doesn't install correctly, which is very likely
since Termux doesn't have libvips available.
2020-02-21 07:43:21 -08:00
Christian Bundy f11eff31de
Merge pull request #248 from cinnamon-bun/master
Add docs/translating.md -- instructions for adding new languages
2020-02-20 15:36:25 -08:00
Cinnamon 4fb61a3bf6 Add docs/translating.md -- instructions for adding new languages 2020-02-20 15:15:29 -08:00
Christian Bundy cf1a88e2f7 Add Termux install documentation
Problem: The Termux install is new and exciting and there isn't any
documentation on how to experiment with it.

Solution: Add some documentation like we've done with systemd and
Docker so that we can collaborate and figure it out in the repo!
2020-02-20 15:12:38 -08:00
Cinnamon 0f893b815b
Merge pull request #246 from christianbundy/remove-ssb-mentions-workaround
Update SSB-Mentions and remove workaround
2020-02-20 12:39:52 -08: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
Cinnamon cf05f46dec
Merge pull request #244 from christianbundy/private-latest
Remove private posts from public views
2020-02-19 14:23:04 -08:00
Christian Bundy a775c99421 Remove private posts from public views
Problem: During the SSB-Query refactor I used `{ private: false }` in an
attempt to hide private messages, but apparently this option is only
available via SSB-Backlinks, so it was ignored without any warning (!).
This allowed private messages to be displayed in public views.

Solution: Remove the unused option and add a filter to public views that
ensures that private messages are always hidden.
2020-02-19 10:27:06 -08:00
Cinnamon 6f5de95d01
Merge pull request #230 from christianbundy/no-messages-by-type
Replace messagesByType() with SSB-Query read
2020-02-18 21:24:14 -08:00
Cinnamon 96e60868cd
Merge pull request #234 from christianbundy/no-img-border
Remove image border
2020-02-18 21:20:18 -08:00
Cinnamon cef75354ae
Merge pull request #236 from christianbundy/no-private-mentions-page
Remove private messages from Mentions
2020-02-18 12:31:01 -08:00
Cinnamon 545944a73e
Merge pull request #235 from christianbundy/friendly-EADDRINUSE
Add friendly EADDRINUSE error message
2020-02-18 12:27:36 -08:00
Christian Bundy b22f458da1 Remove private messages from Mentions
Problem: Private messages should only be showing up in the Private page,
not the Mentions page, but right now they're showing up in Mentions.

Solution: Add a check to ensure that Mentions doesn't have any private
messages.
2020-02-18 11:44:40 -08:00
Christian Bundy 00943affea Add friendly EADDRINUSE error message
Problem: When the port was already taken by another process we've been
dumping a big esoteric error message that really isn't helpful for most
people.

Solution: Catch the error and give our users a friendly error message
with a suggestion on how to run Oasis on another port.
2020-02-18 11:34:21 -08:00
Cinnamon 6c6c46e4be
Merge pull request #233 from christianbundy/publish-redirect-latest
Redirect to Latest after publishing new message
2020-02-18 11:19:31 -08:00
Christian Bundy a0449cefe0 Remove image border
Problem: I added an image border to try to make it easier to see the
boundaries of images but it's not really necessary and at least one
person didn't love it, which is grounds for removal.

Solution: Get it out of here! This commit removes the image border and
also removes a random `console.log()` that shouldn't have been left in
`src/index.js`.
2020-02-18 11:15:43 -08:00
Jonathan Dahan 16f19e85fb
Merge pull request #232 from christianbundy/add-version
Add Oasis version to settings
2020-02-18 14:03:41 -05:00
Cinnamon 4a24e7a663
Merge pull request #223 from christianbundy/summaries-page
Create 'Summaries' page for new summary view
2020-02-18 10:56:28 -08:00
Christian Bundy 97c71be4bd Redirect to Latest after publishing new message
Problem: After publishing a message you were redirected to the Popular
view, which wasn't good feedback that your message had been published.

Solution: After publishing a new message, redirect to the Latest view.
2020-02-18 10:52:37 -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
Jonathan Dahan 8237e08d73
Merge pull request #228 from christianbundy/authors
Add AUTHORS and MAINTAINERS files
2020-02-18 11:50:15 -05:00
Jonathan Dahan b25e34bb1c
Merge pull request #229 from christianbundy/no-npm
Remove references to npm registry publish
2020-02-17 20:26:39 -05:00
Christian Bundy aa6f797937 Replace messagesByType() with SSB-Query read
Problem: The `messagesByType()` queries don't let us sort by asserted
time, which means that we can get messages from a long time ago that
just ended up on our computer.

Solution: Use SSB-Query everywhere. The query syntax isn't really my
favorite but it lets us make declarative queries that respect the
asserted timestamp instead of just the received timestamp.
2020-02-17 17:11:18 -08:00
Christian Bundy 51635ce6f6 Remove references to npm registry publish
Problem: The npm registry is great for proprietary modules who need to
ship binaries but not really useful for free and open source software.
It creates a divide between users and our Git repo, and introduces a
for-profit company as an intermediary to distribute Oasis.

Solution: Remove the npm registry as a distribution platform and just
use our Git repository instead. This removes npm registry references
from the readme, instead prioritizing the GitHub repository, and leaves
room for others to mirror the Git repository (for allows us to move to
less-Microsofty Git hosting).
2020-02-17 16:40:53 -08:00
Christian Bundy 9a000800ec Add AUTHORS and MAINTAINERS files
Problem: It's hard to know who has worked on the project and who is
maintaining the project, for security and code of conduct issues.

Solution: Add AUTHORS and MAINTAINERS files to track who has contributed
code and mixed in their copyright (woo!) and keep track of who is
committed to maintaining the project and merging patches.
2020-02-17 16:38:02 -08:00
Jonathan Dahan b1b58d8a64
Merge pull request #225 from christianbundy/search-refs
Redirect search to SSB references
2020-02-17 16:56:10 -05:00
Christian Bundy 99c51b4a12 Redirect search to SSB references
Problem: There wasn't an easy way to copy and paste a message ID, feed
ID, or blob ID and get directed to that page in Oasis.

Solution: When someone pastes one of the above into the search, just
redirect the browser to the correct page rather than searching for that
text.
2020-02-17 12:46:37 -08:00
Christian Bundy 58b4d419f7 Create 'Summaries' page for new summary view
Problem: Until we have a way to change the view of each page, it seems
to me that each of the views that we're experimenting with should be on
their own page rather than modifying the existing pages to add more
functionality. I'm also noticing that I can't process all of the
information that's on the screen when the new horizontal layout is used,
and I think we would benefit from using the previous layout
consistently.

Solution: Move the summary view to its own page so that we can continue
to iterate on it without modifying the popular view, which is already
complex, and revert the style changes to maintain consistency with the
rest of the linear design (threads go downward, indentation denotes
sub-threads, etc).
2020-02-17 12:08:03 -08:00
Jonathan Dahan 5b37240067
Merge pull request #218 from christianbundy/fix-like
Fix likes not working with Patchwork as server
2020-02-17 11:43:48 -05:00
Christian Bundy 97b8d6924c
Merge pull request #219 from ciex/comments-preview
Show a preview of comments in listings
2020-02-17 07:59:36 -08:00
Christian Bundy 161235190d
Merge pull request #190 from fraction/tag-and-publish-on-npm
tag and publish on npm
2020-02-17 07:38:56 -08:00
Vincent Ahrend 4913b3a93a Add VSCode files to gitignore 2020-02-17 12:57:38 +01:00
Vincent Ahrend 2e7bc4739b Add code style fixes 2020-02-17 12:57:01 +01:00
Vincent Ahrend 6977cc3ee3 Show a preview of comments in post listings 2020-02-16 20:14:23 +01:00
Christian Bundy 3abd28ade2 Fix likes not working with Patchwork as server
Problem: Recently we refactored the code so that we calls over MuxRPC
used promises, which was incompatible with the client-side SSB-Tangle
plugin that was expecting a callback. While debugging this error, I also
noticed that our `{ ws: { http: false } }` code wasn't doing anything,
and that our connection error handler was handling all kinds of
unrelated errors that would make debug more difficult.

Solution: Use `util.promisify()` to convert the callback-style function
into a promise-style function, remove the unused SSB-WS code, and reduce
the scope of the error catcher so that it'll continue to output errors
unless they're "cannot connect to sbot".
2020-02-16 10:24:42 -08:00
Cinnamon e9a7cc5fa1
Merge pull request #215 from christianbundy/default-about
No more `null` for unknown names and descriptions
2020-02-14 20:49:02 -08:00
Cinnamon 22b00e6a09
Merge pull request #214 from christianbundy/publish-custom
Hide custom publish behind publish menu
2020-02-14 20:47:54 -08:00