1
1
Fork 0
mirror of https://github.com/kytta/share2fedi.git synced 2026-03-15 08:45:35 +00:00
Cross-instance share page for the Fediverse https://s2f.kytta.dev/
  • TypeScript 45.6%
  • Astro 31.6%
  • CSS 8.6%
  • JavaScript 7.3%
  • Dockerfile 3.5%
  • Other 3.4%
Find a file
2026-03-15 00:32:47 +01:00
.github/workflows Add pubishing to Quay.io 2026-03-14 19:41:51 +01:00
.husky Replace lint-staged with nano-staged (#94) 2025-03-11 18:50:03 +01:00
assets Add copyright notices 2023-09-02 21:56:45 +02:00
contrib Add deployment guide 2026-03-06 10:21:43 +01:00
LICENSES Remove unused ISC licence 2025-01-25 10:11:57 +01:00
public Regenerate icons 2026-03-05 09:37:51 +01:00
script Update build-icons script 2026-03-05 09:37:51 +01:00
src Remove links to Vercel's PP 2026-03-06 10:39:10 +01:00
.dockerignore Add .dockerignore 2026-03-10 17:53:09 +01:00
.editorconfig Add .yaml to EditorConfig 2025-01-25 10:20:49 +01:00
.gitignore Clean up other files 2026-03-06 10:21:43 +01:00
.node-version Allow Node.js v22 2025-01-25 17:45:50 +01:00
.prettierignore Clean up other files 2026-03-06 10:21:43 +01:00
astro.config.ts Remove site from Astro config 2026-03-15 00:30:51 +01:00
CHANGELOG.md Update CHANGELOG 2026-03-14 19:41:51 +01:00
Containerfile Pin Node.js image (#178) 2026-03-11 06:02:40 +01:00
CONTRIBUTING.md Update documentation 2026-03-06 10:39:10 +01:00
eslint.config.js Clean up other files 2026-03-06 10:21:43 +01:00
LICENSE Migrate license from MIT to AGPL-3.0 2021-01-30 00:48:40 +01:00
package.json 4.0.0-alpha.3 2026-03-15 00:32:47 +01:00
package.json.license Update licence to AGPL-3.0-only 2023-09-02 21:57:00 +02:00
pnpm-lock.yaml Update astro to v5.18 (#186) 2026-03-14 19:31:44 +01:00
pnpm-workspace.yaml Allow esbuild and workerd postinstall scripts 2025-08-31 19:55:47 +02:00
README.md Update README with the list of container registries 2026-03-14 19:41:51 +01:00
renovate.json5 Rename some dependency groups 2026-03-14 16:31:12 +01:00
REUSE.toml Use JSON5 format 2026-03-10 23:39:58 +01:00
stylelint.config.js Rewrite styles in pure CSS 2025-09-10 13:44:18 +02:00
tsconfig.json Move detection logic to Astro actions 2025-01-25 14:22:12 +01:00

Share2Fedi

Instance-agnostic share page for the Fediverse.

Share₂Fedi (pronounced share-to-fedi) allows you to share stuff on Mastodon, Misskey, Friendica, and other federated social networks, instance-agnostic. Just type in the post text and the instance URL, and click Post!

Or, open this page with the prefilled text URL parameter—it will be automatically inserted into the text field. The same goes for the instance and lang URL parameters. This can be used to build custom share buttons for the federated social networks:

<a href="https://s2f.kytta.dev/?text=Hello%20world!&instance=mastodon.xyz">
  Share on mastodon.xyz
</a>

The instance URL can be saved in your localStorage to be automatically appended if used later—handy!

Important

I know I provide a Share₂Fedi instance for others to use, but if you want to use Share₂Fedi for your share buttons, please consider self-hosting it. Although it's free now, running my instance may become too expensive for me in the future.

Self-hosting

Note

Share₂Fedi is currently undergoing some transitions in regards to deployment. The steps below are not yet stable. This will be fixed in v4.

Docker

Share₂Fedi has an official container image that you can use with any OCI runner. For example, using Podman:

podman run --detach --publish 127.0.0.1:9999:3000/tcp ghcr.io/kytta/share2fedi:4.0.0-alpha.0

You can pull the image from:

  • Docker Hub: kytta/share2fedi
  • GHCR: ghcr.io/kytta/share2fedi
  • Quay: quay.io/kytta/share2fedi

The app runs on port 3000, and the container exposes it. The example above publishes it as port 9999. Same configuration as a Compose file:

services:
  share2fedi:
    image: ghcr.io/kytta/share2fedi:4.0.0-alpha.0
    ports:
      - "127.0.0.1:9999:3000/tcp"

It is recommended to run the app behind a reverse proxy. We won't go into detail here; you probably know what you're doing.

Apart from versioned tags, there is also the edge tag, which is built from the latest commit on the main branch. It is not recommended to use it, as it might contain bugs.

Bare metal

You can host Share₂Fedi without Docker, but this requires some extra setup.

Prerequisites: Node.js v22, pnpm.

  1. Clone the repository on the target machine, or download it as a tarball.

  2. Install dependencies.

    pnpm install
    
  3. Build.

    pnpm build
    
  4. Run server.

    By default, this will only listen on localhost:3000. To enable listening on a certain host and/or port, set the HOST and PORT environment variables, respectively.

    node dist/server/entry.mjs
    

    In production, you might want to use a process manager, like PM2:

    # Start the app, restart on file changes (except node_modules)
    pm2 start dist/server/entry.mjs --name "Share2Fedi" --watch --ignore-watch="node_modules"
    

    More information about self-hosting an Astro website with Node: https://docs.astro.build/en/guides/integrations-guide/node/#standalone

  5. Set up a reverse proxy.

    Basically, you need to run a reverse proxy that would redirect all incoming requests to localhost:3000. Here's how to achieve this in various HTTP servers:

    1. Apache
    ProxyPass "/" "http://localhost:3000/"
    
    1. Nginx
    location / {
        proxy_pass http://localhost:3000/;
    }
    
    1. Caddy
    reverse_proxy :3000
    

Contribute

Source code

TL;DR: pnpm install && pnpm dev

See contributing guide for instructions on how to contribute source code to the project, including adding new Fediverse projects.

Translations

Share₂Fedi uses Hosted Weblate for translations. You can edit translations using it's practical interface.. You also could do it manually by editing files in src/i18n/translations, but this is NOT recommended.

Translation status

Note

New languages do not become automatically available. For this, a separate change to our ad-hoc i18n engine has to be made. See contributing guide for instructions

We thank Weblate for providing Libre hosting!

See also

📯 Shareon (lightweight, stylish, and ethical share buttons) uses Share₂Fedi under the hood!

Licence

© 2020 Nikita Karamov
Licensed under the GNU Affero General Public License v3.0 only.


This project is hosted on GitHub: https://github.com/kytta/share2fedi.git