- TypeScript 45.6%
- Astro 31.6%
- CSS 8.6%
- JavaScript 7.3%
- Dockerfile 3.5%
- Other 3.4%
| .github/workflows | ||
| .husky | ||
| assets | ||
| contrib | ||
| LICENSES | ||
| public | ||
| script | ||
| src | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| .node-version | ||
| .prettierignore | ||
| astro.config.ts | ||
| CHANGELOG.md | ||
| Containerfile | ||
| CONTRIBUTING.md | ||
| eslint.config.js | ||
| LICENSE | ||
| package.json | ||
| package.json.license | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| renovate.json5 | ||
| REUSE.toml | ||
| stylelint.config.js | ||
| tsconfig.json | ||
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.
-
Clone the repository on the target machine, or download it as a tarball.
-
Install dependencies.
pnpm install -
Build.
pnpm build -
Run server.
By default, this will only listen on
localhost:3000. To enable listening on a certain host and/or port, set theHOSTandPORTenvironment variables, respectively.node dist/server/entry.mjsIn 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
-
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:- Apache
ProxyPass "/" "http://localhost:3000/"- Nginx
location / { proxy_pass http://localhost:3000/; }- 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.
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