Giter Club home page Giter Club logo

postmarks's Introduction

Postmarks

About this project

Postmarks is a bookmarking site that you own yourself and can connect the Fediverse, interacting with other Postmarks sites as well as Mastodon/FireFish/any text-based ActivityPub platform. You can read more about it here:

The site allows the owner to add, edit and delete bookmarks, but only if a valid login is provided. Check the setup below to understand how to do that!

Setting up your site

To set your app up:

  • If you're using Glitch:
    • Rename your project immediately in the project settings, if you intend to be called something else. This determines the domain that your site lives at, which also determines the second half of your @[email protected] identity on the fediverse. NOTE: If you change this later, you will break the connection any existing followers have to your site, they'll have to re-follow the account on its new domain (and depending on the software they're following from, may even prevent them from unfollowing the old URL 😱)
    • In your .env editor, create a key ADMIN_KEY and give it a text string as a value. This is your "password" when your browser prompts you, so make it as secure as you need to protect your data.
    • Add another key to your .env called SESSION_SECRET and generate a random string for its value. This is your session secret, used to generate the hashed version of your session that gets encoded with the cookies used to store your login. If you make this string too easily guessable, you make it easier for someone to hijack your session and gain unauthorized login. Also, if you ever change this string, it will invalidate all existing cookies.
    • If you've got a custom domain in front of your Glitch project, add a key to your .env called PUBLIC_BASE_URL with the value set to the hostname (the part after the https://) at which you want the project to be accessible.
    • Edit the contents of account.json.example to set your @username, display name, bio, and avatar. (If you don't set a username, your default actor name will be 'bookmarks', so people will find you on the fediverse @[email protected].)
    • THEN: either rename account.json.example to account.json, or copy the contents into a new file called account.json. Whatever username you have in this file when the project first starts you'll need to retain or else you'll break your followers' connection to this account.
  • Otherwise:
    • Create a .env file in the root of the project.
    • Add the line PUBLIC_BASE_URL=<hostname> to your .env where <hostname> is the hostname of your instance.
    • Add the line ADMIN_KEY=<key> to your .env where <key> is the password you'll enter when the browser prompts you, and another line for SESSION_SECRET=<secret> where <secret> is a random string used when hashing your session for use in a secure cookie.
    • Make a file called account.json in the project root. Copy the contents of account.json.example into it and edit the values to set your @username, display name, bio, and avatar. (If you don't set a username, your default actor name will be 'bookmarks', so people will find you on the fediverse @[email protected].)
  • If you're using Glitch, you should be done! If you're running this yourself, run npm run start via whatever mechanism you choose to use to host this website.
  • Click on the Admin link in the footer, and enter the password (whatever you set ADMIN_KEY to in the .env).
  • You should be logged in, at which point you can configure various settings, import bookmarks, and use the "Add" links in the header and footer (as well as the bookmarklet, available in the Admin section) to save new bookmarks.

Mastodon Verification

Setting MASTODON_ACCOUNT in the .env file will cause a link to be added to the Postmarks home page that can be used for verification with your Mastodon account. See the Mastodon documentation for more details.

Development & Contributions

See CONTRIBUTING.md for more information on how to work with Postmarks' development environment as well as how to submit your changes for review.

Acknowledgments

  • The "Postmarks" name is compliments of Casey C (no relation to Casey K), who brainstormed dozens of ideas for the name when Casey was first trying to rename the project. Thank you!
  • Postmarks (in its default configuration) uses an edited version of Eynav Raphael's "Postmark Stamp" icon from The Noun Project.
  • It also makes use of free fonts including Averia Sans and Public Sans.
  • Much of the original form of the site's frontend is lifted from the starter projects available on Glitch. Thank you to all the people who have contributed to those projects over the years!
  • Much of the original backend of the site is based off of Darius Kazemi's express-activitypub repo. I made a point not to just clone his repo from the start, but then ended up retyping most of it as I learned how things work. While some pieces have been upgraded, much of Darius' work creates the foundation for Postmarks' ActivityPub functionality.

We built this with Glitch!

Glitch is a friendly community where millions of people come together to build web apps and websites.

postmarks's People

Contributors

andypiper avatar benbrown avatar boogah avatar ckolderup avatar dependabot[bot] avatar iambijayd avatar jeffsikes avatar johnholdun avatar manavb2214 avatar patoconnor43 avatar pburke avatar steve-bate avatar tomcasavant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

postmarks's Issues

handle ActivityPub support for more follow/unfollow interactions

The most egregious one here is that we don't actually do anything when you send an Unfollow message, so we keep broadcasting to everyone who has ever been a follower. In general Mastodon seems smart enough to compare the incoming message to your actual local following list and just discard the message, but to be a good citizen we should stop doing that.

Also, it'd be great to allow people to set up their Fedimarks instance as a "request to follow" situation similar to what Mastodon supports. That'll involve handling those AP messages and also building an interface for it in the admin section of the site, though, so that's a bit more of a heavy lift.

CSV import

We have the rudimentary import feature in the admin page but we should support an import that maintains custom metadata (title, description, tags) and possibly even datetime?

UPDATE: To be specific and make this ticket cleanly scoped, we should support the CSV export format from #118. Additional import formats from other tools should be filed as separate tickets so they can be prioritized based on demand.

getInboxFromActorProfile fails when remote instance requires HTTP signature on GET

I tried following my postmarks user from my account @[email protected] and got this error in the log on glitch:

Image

The likely culprit is that hackers.town has AUTHORIZED_FETCH enabled as a Mastodon setting.

This means that fetching my actor data without HTTP signature headers in the GET request will result in a 401 Unauthorized status.

https://hackers.town/users/lmorchard.json

FWIW, it worked fine from my @[email protected] account, where AUTHORIZED_FETCH is not enabled.

Fix layout on mobile

It's not great right now, especially on my iPhone mini! We probably need to make the two-column design work more responsively, maybe putting the tags list behind a hamburger menu?

No authorization required to retrieve actor collections

Some people may not want their following (and followers?) collections to be public. At a minimum, there should be a warning about that information being exposed to the public at the place where following addresses are added.

show pending status on all follows

the workflow we use for following accounts relies on sending the Follow message and then waiting for the Accept response before we actually record it in the activitypub.db file. We should record somewhere that we SENT a message so that we can reflect in the UI that you successfully sent a request, and then upgrade that when it's complete. This will also help us implement the "request to follow" flow properly on locked Mastodon accounts.

Spec out how fedimarks talks to other fedimarks instances

This is the big movement to make Fedimarks into its own thing on the Fediverse instead of a Mastodon sidecar app. We probably need to fully flesh out our ActivityPub support and also look at any pitfalls that Bookwyrm or other apps might have experienced in doing this while also cross-posting to Mastodon.

Add admin page for managing followers

You should be able to block followers if you don't want them. Full domain-block might be necessary, but at the very least a per-user blocklist, both blocking people from your list of followers as well as pre-emptively listing usernames you want to block, would be a start.

revisit outbox generation

I think I'm not fully following the spec-- I should be using the notes from the ActivityPub DB, not the bookmark objects. If I swap that over, will that mean that the timeline on Mastodon of a newly-fetched Postmarks instance will be back-populated?

Media attachments on comments?

If someone attaches an image or other multimedia to a reply they send on Mastodon, or even just includes a URL in their post, should we render that? And how would we support caching the media locally? Do we need to include some kind of S3 bucket (or compatible service) support?

UI: autosuggest tags during bookmark creation/edit

Both by looking at what tags are already in the fedimarks instance and then also looking at any structured data we can find on the page? Opengraph tags exist, but not sure how common/useful they are? are there any other standard ways to encode suggested tags in the page that we should be scanning for?

logo

I made a very bad logo so that I would be motivated to fix it before too long. Help. The only time I've made a good logo in my life it was by accident and for a joke project among friends.

Duplicate detection?

Do we want to allow multiple copies of the same URL to be bookmarked? Should we allow it but display some kind of warning/message in the UI?

follow chains of replies

as of Feb 2023 if someone replies to a Fedimarks post on Mastodon it gets queued as a comment in Fedimarks, but if someone replies to that Mastodon reply, it doesn't.

To fix this, we'll need to index all existing replies and look those up as reply-to ids to check when determining what bookmark to file a comment under. We could retain this specific reply-to information and build threaded comments on the fedimarks side, or experiment with flattening it all, but we should at least keep enough information to try some things out on the frontend.

Tag names need validation

Postmarks happily allowed me to type a tag name of "developer relations" with a space, showed #developer relations in the UI, but then reported an error about the format of the tag when I hit save. It would be better to validate and/or force the entry of compliant tag names.

write first version of contributor guidelines

  • recommended tooling for linting etc
  • suggestions re: how to vet approach before doing the work
  • recommendations for debugging cross-instance or vs mastodon interop
  • documentation requirements?
  • credit (opt-out?)

handle more ActivityPub message types for bookmark and comment CRUD

Right now we don't broadcast deletes if you delete a bookmark and we don't accept deletes or edits if someone tries to manage a comment they made. All the ActivityPub support is hand-rolled, perhaps we should move to a separate library to handle the breadth of ActivityPub messages and then implement our functionality on top of that?

Admin page: set up basic profile

You should be able to have the user look like something-- both an avatar and a customizable display name, and probably a bio? -- on Mastodon

figure out release strategy

  • related to #37, since if we're going to present organized releases we also need it to be expected that an upgrade path is possible
  • semver, presumably.
  • changelog format? github actions or similar integration with PR process?

auto-link bare URLs in bookmark description

we will have more bare URLs in bookmark descriptions since they're part of the Quickadd template from the Network page. We should find those URLs and wrap them in <a> tags that href to that URL-- linkifyjs should be able to do this.

simple search

just a basic substring search of URL/title/description/tags. we can consider doing something fancier but I don’t want to make this impossible to deploy atomically on something like Glitch

make error messages appear on the page

right now when things go wrong we just kinda spit out plain text/html with an error. It should instead redirect back to whatever you were doing and flash a message. Like a website.

Feature request: API for adding / deleting / editing postmark entries

I'd love to be able to programmatically add new entries from third party / external code.

For instance, I have a concept for an app that goes like this:

  • I can bookmark a post on Mastodon
  • app reads my bookmarks via the Mastodon API, checks for and extracts any links from those posts, and adds those link to my postmarks.
    • note that I'm not looking to directly replicate the Mastodon bookmarks experience so I don't want to bookmark the Mastodon post(s), I want to bookmark things that the post might contain
    • optionally, add any hashtags from the bookmarked toot, as tags on the postmark entry
    • optionally, mark the postmark with a #readlater tag

It may also be interesting to do the same thing with any posts that get liked on Mastodon, or (for example) posts I've saved on Lemmy, etc.

figure out how to accommodate sqlite db changes

Since it's been just me using this software up until now, it's not a huge deal if I break things when I pull down new code-- I can figure out what happened and change the sqlite schema to match whatever changed in the DB setup code. But with other people installing the app and theoretically wanting to pull in new changes, I'm going to need to restructure the way that DB stuff is initialized so that it can figure out if anything's out of sync and update appropriately.

iOS Shortcut?

The bookmarklet technically works on iOS Safari but the ergonomics of setting it up are still annoying and it'd also be cool to be able to submit URLs from inside other apps, which a Shortcut would provide.

Delegate your identity to your Mastodon user?

It'd be nice if instead of having to set up a whole profile, you could put your mastodon URL into the admin page and it would automatically pull your avatar/info and set your bio to something that explains what Fedimarks is but also points back to your Mastodon profile. And then it should also set up your mastodon URL as a <link rel="me"> in the site <head> so that your Fedimarks instances get the green check when you put them in your Mastodon bio!

Enhancement: PWA / mobile web app UI

This would be a great site to make installable as a PWA for phones etc. Probably related to any other UI work that might be planned. Interested to help around these areas if I can, this is as much a note-to-self to look into as anything else.

Optional embeds for commonly embeddable content

Some people might enjoy it if bookmarks for things like Youtube videos, tweets, Mastodon posts, Bandcamp albums, etc would auto-include an embed for that along with the description. Maybe this is toggleable at the instance level?

autosuggest known usernames when managing allowlist/denylists

In both the site-wide and per-bookmark settings, we should replace the generic text field with a user entry field that autocompletes using known usernames-- we have a list of everyone who follows and can generate one of everyone who has ever commented, regardless of their following status.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.