Compare commits

..

19 Commits

Author SHA1 Message Date
Nikita Karamov 442cb0d33d
v3.0.0-rc.2 2022-11-14 18:37:41 +01:00
Nikita Karamov 9c7ddce8fe
Replace colours with a experimental new palette 2022-11-14 18:35:36 +01:00
Nikita Karamov 683cc18f6d
Remove Mastodon branding and wording 2022-11-14 18:17:43 +01:00
Nikita Karamov 043cfbb88b
Update project name across the site 2022-11-14 18:15:34 +01:00
Nikita Karamov 44127fac7f
Use newer Mastodon logo 2022-11-14 18:13:14 +01:00
Nikita Karamov 3f73ef7744
Replace title logo 2022-11-14 18:10:05 +01:00
Nikita Karamov df460b568a
Update caniuse database 2022-11-14 17:56:06 +01:00
Nikita Karamov 888a323d5c
v3.0.0-rc.1 2022-11-14 17:40:17 +01:00
Nikita Karamov 47d82c2d4b
Clean .gitignore 2022-11-14 17:39:18 +01:00
Nikita Karamov 3bba48014c
Update code formatting 2022-11-14 17:38:45 +01:00
Nikita Karamov fa337fbdc7
Replace Gulp with Parcel
Gulp hasn't been supported for a while now, and Parcel seems like an
alternatice that is way faster, more optimised, and more fun to work
with.

This commit also bumps the Node.js version to 16.
2022-11-14 17:35:47 +01:00
Nikita Karamov 09d19d46fa
Move Browserslist to package.json 2022-11-14 17:24:02 +01:00
Nikita Karamov fd8edcab72
Update CHANGELOG 2022-11-14 14:10:28 +01:00
Nikita Karamov 1443619c6d
Update licence in package.json 2022-11-14 14:08:28 +01:00
Nikita Karamov d9a549debb
Update copyright headers in files 2022-11-14 14:08:27 +01:00
Nikita Karamov f2193207eb
Relicense project to ISC
I have decided to relicense this project using a simpler licence. Since
this is a pretty small piece of software, I find it unnecessary to use
such a restrictive licence on it.

I have reached out to both other contributors privately, and they have
given me their permission to relicense the code they've contributed.

Acked-by: Tealk <tealk@anzah.email>
Acked-by: Andy Balaam <andybalaam@artificialworlds.net>
2022-11-14 14:08:26 +01:00
Nikita Karamov 4c858654e6
Update README 2022-11-14 14:08:25 +01:00
Nikita Karamov cdbd98a1e0
Use the new logo in the README 2022-11-14 14:08:24 +01:00
Nikita Karamov 487fa710e7
Add new logos
See: #1
2022-11-14 14:08:23 +01:00
85 changed files with 1837 additions and 9734 deletions

View File

@ -1,27 +1,16 @@
# This EditorConfig is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = tab
tab_width = 2
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true
[src/i18n/translations/*.json]
max_line_length = off
indent_style = space
indent_size = 4
[*.md]
indent_style = space
max_line_length = off
trim_trailing_whitespace = false
[*.yml]

View File

@ -1,10 +0,0 @@
# This ESLint ignore file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
.vercel/
/dist/
node_modules/
script/

View File

@ -1,30 +0,0 @@
// This ESLint config is part of ShareFedi
// https://github.com/kytta/share2fedi
//
// SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
// SPDX-License-Identifier: CC0-1.0
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:unicorn/recommended",
"plugin:astro/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"env": {
"browser": true
},
"overrides": [
{
"files": ["*.astro"],
"parser": "astro-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser",
"extraFileExtensions": [".astro"]
}
}
]
}

5
.github/FUNDING.yml vendored
View File

@ -1,8 +1,3 @@
# This file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
github: kytta
liberapay: kytta
custom: paypal.me/NickKaramoff

View File

@ -1,32 +0,0 @@
# This file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: AGPL-3.0-only
name: Check and build
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: "^18.17.0"
cache: "pnpm"
- run: pnpm install
- run: pnpm check
- run: pnpm build

View File

@ -1,36 +0,0 @@
name: Deploy to Deno
on:
push:
branches:
- "main"
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: "^18.17.0"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm run build --s2f-use-deno
- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: share2fedi
entrypoint: server/entry.mjs
root: dist

23
.gitignore vendored
View File

@ -1,19 +1,8 @@
# This Git ignore file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
# Outputs
/.idea/
/.parcel-cache/
/.vercel/
/.vscode/
/dist/
/node_modules/
# Cache/state
node_modules/
# Editors/IDEs
.idea/
.vscode/
# Backend
.vercel/
.netlify
*.min.svg

View File

@ -1,7 +0,0 @@
# This file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
npx lint-staged

View File

@ -1 +1 @@
18
16

View File

@ -1,13 +1,6 @@
# This Prettier ignore file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
.vercel/
/.idea/
/.parcel-cache/
/.vercel/
/.vscode/
/dist/
node_modules/
script/
pnpm-lock.yaml
src/i18n/translations/*.json
/pnpm-lock.yaml

View File

@ -1,21 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Share₂Fedi
Upstream-Contact: Nikita Karamov <me@kytta.dev>
Source: https://github.com/kytta/share2fedi
Files: public/site.webmanifest
Copyright: 2023 Nikita Karamov <me@kytta.dev>
License: AGPL-3.0-only
Files: src/i18n/translations/*.json
Copyright: 2023 Nikita Karamov <me@kytta.dev>
License: AGPL-3.0-only
Files:
assets/*.png
assets/*.svg
public/*.ico
public/*.png
public/*.svg
Copyright: 2023 Nikita Karamov <me@kytta.dev>
License: CC-BY-4.0

View File

@ -1,8 +1 @@
# This Vercel ignore file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: CC0-1.0
/assets/
/script/

View File

@ -1,141 +1,18 @@
<!--
This change log is part of Share₂Fedi
https://github.com/kytta/share2fedi
SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: CC0-1.0
-->
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.1.0] - 2024-02-12
## Added
- new translation languages
- Nederlands/Dutch (thx [Heimen](https://github.com/Vistaus)!)
- Español/Spanish (thx gallegonovato!)
- <span dir="rtl">العربية</span>/Arabic (thx ButterflyOfFire](https://mstdn.fr/@butterflyoffire)!)
### Fixed
- locale switcher would not work if an unknown locale is in the local storage
## [v3 (unreleased)][unreleased]
### Changed
- i18n engine improved
- added support for RTL languages
- enumerations (of project variations) are now done with Intl.ListFormat and
thus adhere to the language rules
- disabled search indexing
- hopefully this will prevent Google shamelessly indexing other's peoples'
content in Chrome
- moved translations to [Hosted Weblate](https://hosted.weblate.org/engage/share2fedi/)
- updated dependencies
## [v3][3.0.0]
This version is a huge reinvention of toot. The name was changed to Share₂Fedi,
as to indicate that sharing to other federated networks is now possible.
### ⚠️ BREAKING CHANGES
Share₂Fedi is now an [Astro](https://astro.build/) site. The migration allowed
us to have a performant service that is easily hostable on both serverless
platforms, like Vercel or Netlify, as well as locally. Setting the project up
now takes seconds! This comes with changes, though:
- **static files aren't built any more**, but generated server-side
- **new output directory**: ~~`public/`~~`dist/`
- this also means that `public/` **is not ignored any more**
Some changes came with the name change:
- **changed API endpoint path**: ~~`/api/toot`~~`/`
- just send a POST request instead of a GET request with the same body
### Added
- **new federated social networks**
- Friendica
- GNU Social
- Hubzilla
- Misskey (+ flavours)
- **new ways to host**
- Netlify
- Cloudflare Pages
- **multilingual share page**
- Share₂Fedi can be used in English, German, and Russian.
[Help us with other languages!](./src/i18n/translations.ts)
- remembering of multiple Fediverse instances
- new API endpoints
- `/api/instances` will return the list of popular instances
- `/api/detect/[host]` will detect the Fediverse project used by a host
- a privacy policy describing what data is being processed and stored
- a link to the status page
### Changed
- **new project name**: Share₂Fedi (see
[GH#24](https://github.com/kytta/share2fedi/issues/24))
- **new project name**: Share₂Fedi (see #1)
- new default instance URL: <https://s2f.kytta.dev>
- new logo
- new design
- repository moved back to GitHub
- licence of the project is now AGPL v3 **only**
- for now, this has no effect. If AGPL v4 ever comes out, Share₂Fedi v2 will
not be available under it
- s2f is now being built with Astro
- Share₂Fedi is now 100% server-side rendered. You don't have to host any
static files, all you need is to run the Node server.
- when developing, the API endpoint can now be tested locally
### Removed
- GoatCounter analytics. I will no longer track the visitors of s2f.kytta.dev
## [2.4.5] - 2023-06-17
### Fixed
- blocked crawling of all pages other than index (#33)
## [2.4.4] - 2023-03-01
### Fixed
- fixed not working instance prefilling (#15)
## [2.4.3] - 2022-12-23
### Changed
- analytics script replaced with own implementation
- now uses `navigator.sendBeacon()` for a more lightweight solution
- now doesn't send anything other than path and screen size
- updated CanIUse databases, which may cause some browsers become unsupported
## [2.4.2] - 2022-12-21
### Changed
- analytics should send query parameters anymore
### Removed
- tracking pixel for JS-less analytics
## [2.4.1] - 2022-11-20
### Fixed
- "remember instance on this device" didn't work (#12, #13)
- new website style
- the licence changed (again) from AGPL-3.0 to ISC
## [2.4.0] - 2022-11-14
@ -218,8 +95,7 @@ Some changes came with the name change:
### Changed
- design of the page so that it looks more like a Mastodon website (without
impersonating anyone)
- design of the page so that it looks more like a Mastodon website (without impersonating anyone)
### Fixed
@ -233,8 +109,7 @@ Some changes came with the name change:
### Security
- migrated from `gulp-sass` to `@mr-hope/gulp-sass` to avoid loading and
building `node-sass` and other old deps
- migrated from `gulp-sass` to `@mr-hope/gulp-sass` to avoid loading and building `node-sass` and other old deps
## [1.1.1] - 2021-03-03
@ -283,26 +158,19 @@ Initial release of the site
- Add main code for the site
[Unreleased]: https://github.com/kytta/share2fedi/compare/v3.1.0...HEAD
[3.1.0]: https://github.com/kytta/share2fedi/compare/v3.0.0...v3.1.0
[3.0.0]: https://github.com/kytta/share2fedi/compare/v2.4.5...v3.0.0
[2.4.5]: https://github.com/kytta/share2fedi/compare/v2.4.4...v2.4.5
[2.4.4]: https://github.com/kytta/share2fedi/compare/v2.4.3...v2.4.4
[2.4.3]: https://github.com/kytta/share2fedi/compare/v2.4.2...v2.4.3
[2.4.2]: https://github.com/kytta/share2fedi/compare/v2.4.1...v2.4.2
[2.4.1]: https://github.com/kytta/share2fedi/compare/v2.4.0...v2.4.1
[2.4.0]: https://github.com/kytta/share2fedi/compare/v2.3.1...v2.4.0
[2.3.1]: https://github.com/kytta/share2fedi/compare/v2.3.0...v2.3.1
[2.3.0]: https://github.com/kytta/share2fedi/compare/v2.2.2...v2.3.0
[2.2.2]: https://github.com/kytta/share2fedi/compare/v2.2.1...v2.2.2
[2.2.1]: https://github.com/kytta/share2fedi/compare/v2.2.0...v2.2.1
[2.2.0]: https://github.com/kytta/share2fedi/compare/v2.1.0...v2.2.0
[2.1.0]: https://github.com/kytta/share2fedi/compare/v2.0.0...v2.1.0
[2.0.0]: https://github.com/kytta/share2fedi/compare/v1.2.2...v2.0.0
[1.2.2]: https://github.com/kytta/share2fedi/compare/v1.2.1...v1.2.2
[1.2.1]: https://github.com/kytta/share2fedi/compare/v1.2.0...v1.2.1
[1.2.0]: https://github.com/kytta/share2fedi/compare/v1.1.2...v1.2.0
[1.1.2]: https://github.com/kytta/share2fedi/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/kytta/share2fedi/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/kytta/share2fedi/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/kytta/share2fedi/compare/e85aa15400bcdbcccf655d331f72df8304744b85...v1.0.0
[unreleased]: https://codeberg.org/kytta/toot/compare/v2.4.0...HEAD
[2.4.0]: https://codeberg.org/kytta/toot/compare/v2.3.1...v2.4.0
[2.3.1]: https://codeberg.org/kytta/toot/compare/v2.3.0...v2.3.1
[2.3.0]: https://codeberg.org/kytta/toot/compare/v2.2.2...v2.3.0
[2.2.2]: https://codeberg.org/kytta/toot/compare/v2.2.1...v2.2.2
[2.2.1]: https://codeberg.org/kytta/toot/compare/v2.2.0...v2.2.1
[2.2.0]: https://codeberg.org/kytta/toot/compare/v2.1.0...v2.2.0
[2.1.0]: https://codeberg.org/kytta/toot/compare/v2.0.0...v2.1.0
[2.0.0]: https://codeberg.org/kytta/toot/compare/v1.2.2...v2.0.0
[1.2.2]: https://codeberg.org/kytta/toot/compare/v1.2.1...v1.2.2
[1.2.1]: https://codeberg.org/kytta/toot/compare/v1.2.0...v1.2.1
[1.2.0]: https://codeberg.org/kytta/toot/compare/v1.1.2...v1.2.0
[1.1.2]: https://codeberg.org/kytta/toot/compare/v1.1.1...v1.1.2
[1.1.1]: https://codeberg.org/kytta/toot/compare/v1.1.0...v1.1.1
[1.1.0]: https://codeberg.org/kytta/toot/compare/v1.0.0...v1.1.0
[1.0.0]: https://codeberg.org/kytta/toot/compare/e85aa15400bcdbcccf655d331f72df8304744b85...v1.0.0

View File

@ -1,139 +0,0 @@
<!--
This file is part of Share₂Fedi
https://github.com/kytta/share2fedi
SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: CC0-1.0
-->
# Contributing guide
First off, thank you for considering contributing to Share₂Fedi! There are many
ways you can improve on the project:
- [write new and improve on the old code](#improving-code)
- [write documentation](#writing-documentation)
- [translate UI strings](#translating)
- [report bugs](#reporting-bugs)
Please, follow this guide if you want to contribute. We promise, it's not too
many rules! Following this helps us merge changes quicker!
Unsure where to begin contributing? You can start by looking through
[the help-wanted issues](https://github.com/kytta/share2fedi/labels/help%20wanted)!
## Improving code
Before you start, make sure you've got a fresh Node.js version (v18 should work)
installed. You'll also need to [install pnpm](https://pnpm.io/installation), as
this is our package manager of choice.
1. Fork the repository and clone it
2. Install dependencies:
```sh
pnpm install
```
3. To start a dev server, run:
```sh
pnpm dev
```
This server will auto-update on changes to the file
4. After implementing a feature, create a new Git branch and commit your changes
on it
5. Push the branch and open a PR.
### Adding support for other Fediverse projects
In order for a Fediverse project to be supported, it has to have a "Share" page
located at a fixed address. That means, that the address is the same for all
users and all frontends. For example, Mastodon's "Share" page is always at
`/share`. The share page should also accept the text of the post via URL
parameters. For example, Mastodon allows pre-filling the text of a post using
`?text=`. Lastly, it should be listed on
[fediverse.observer](https://fediverse.observer/).
If the Fediverse project satisfies these requirements, you can add it to
Share2Fedi. For this:
1. Add an entry to `supportedProjects` inside `src/lib/project.ts`.
- keep the list in alphabetical order
- the key should match the software name from NodeInfo/fediverse.observer
- the value should be an object of type `ProjectPublishConfig`. The endpoint
is the path to the "Share" page (leading slash optional).
- if the service you're adding is a flavour of an already supported service,
use the variable to reduce code duplication. See `mastodonConfig` for an
example
2. Pick an instance of the project you've added and visit
`/api/detect/<INSTANCE-DOMAIN>`. Make sure the detection is correct
3. Go to the `/` and try to share something to the instance. Make sure the
"Share" page opens with correct parameters.
## Writing documentation
Share₂Fedi's documentation is pretty complete at the moment, but you are free to
fix errors and to add clarifications. The only documentation we have is the
`README.md` and `CONTRIBUTING.md` that you're reading right now.
## Translating
Starting with v3, Share₂Fedi has a very primitive translation framework built
in. Despite it being simple, you can edit translations and add new languages in
form of JSON-based dictionaries.
There are two ways you can add/edit translations:
1. [Weblate](https://hosted.weblate.org/engage/share2fedi/), a web-based tool
that simplifies this process.
- we use Hosted Weblate. You can login using any account. Make sure to set
the correct email so that the changes can be attributed to you!
- Weblate handles PRs automatically. You do not need to do anything other
than use it to edit translations
2. The JSON files under `src/i18n/translations` represent dictionaried for
different languages. The two-letter codes correspond to the ISO 639-1
language codes.
- to edit translations, just edit the files. Refer to
[the coding guide](#improving-code) for more information on how to do this.
### Adding new languages
You may notice that adding a new language in Weblate or in the code does not add
it to the language dropdown. This is due to the i18n needing to define the
languages for the dropdown.
To add a new language, edit the `src/i18n/translations.ts` file. Import the JSON
file with the translations and add a new entry to the `languages` mapping.
> [!IMPORTANT]
> For the language name, use a **capitalized autonym**. An autonym
> is the name of the language in the language itself. You can consult CLDR or
> Wikipedia for this. It should be capitalized, if it makes sense in the
> language. It should NOT include the word "language" unless it's common to use
> it ("Bahasa Indonesia", but "Русский", not "русский язык")
>
> A good rule of thumb is to take the value that Wikipedia uses in their
> [language list](https://www.wikipedia.org/#js-lang-lists).
## Reporting bugs
> [!IMPORTANT]
> If you find a security vulnerability, do NOT open an issue. Email
> [Nikita Karamov](mailto:me@kytta.dev) instead.
If you find a bug you can't (or don't want to) fix yourself, don't hesitate
filing an issue. We do not have a preset issue template, but try to answer these
questions in the issue body:
1. What version of Share₂Fedi are you using?
2. How do you deploy it (Node/Vercel/Netlify/Cloudflare/Deno)?
3. What did you do?
4. What did you expect to see?
5. What did you see instead?
---
We are looking forward to your contributions!

670
LICENSE
View File

@ -1,661 +1,15 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
ISC License
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Copyright (c) 2020-2022 Nikita Karamov <me@kytta.dev>
Preamble
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

View File

@ -1,235 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.

View File

@ -1,156 +0,0 @@
Creative Commons Attribution 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensors permission is not necessary for any reasonfor example, because of any applicable exception or limitation to copyrightthen that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part; and
B. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. Downstream recipients.
A. Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@ -1,121 +0,0 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.

View File

@ -1,8 +0,0 @@
ISC License:
Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
Copyright (c) 1995-2003 by Internet Software Consortium
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

173
README.md
View File

@ -1,185 +1,108 @@
<!--
This README is part of Share₂Fedi
https://github.com/kytta/share2fedi
SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: CC0-1.0
-->
<h1 align="center"><img src="assets/share2fedi.svg" width="520" height="160" alt="Share2Fedi"></h1>
> 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!
**[Share₂Fedi]** allows you to share stuff on Mastodon, GoToSocial, Pleroma, 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:
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` URL parameter. This can be used to build custom share buttons for the federated social networks:
```html
<a href="https://s2f.kytta.dev/?text=Hello%20world!&instance=mastodon.xyz">
<a
href="https://s2f.kytta.dev/?text=Hello%20world!&instance=https%3A%2F%2Fmastodon.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](https://s2f.kytta.dev) 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.
The instance URL can be saved in your `localStorage` to be automatically appended if used later—handy!
## Hosting
### Vercel, Netlify, Cloudflare Pages
### One-click Vercel deploy
Share₂Fedi was designed to run on [Vercel](https://vercel.com/), but you can
also run it on [Netlify](https://www.netlify.com/) or
[Cloudflare Pages](https://pages.cloudflare.com/). To deploy it yourself (it's
free!), you can use the following buttons:
For now, **Share₂Fedi** is vendor-locked to run on [Vercel](https://vercel.com/). To deploy it yourself, you can use the following button:
[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fkytta%2Fshare2fedi)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/kytta/share2fedi)
To deploy to Cloudflare Pages, fork the repository and
[follow the instructions](https://docs.astro.build/en/guides/deploy/cloudflare/#how-to-deploy-a-site-with-git).
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fkytta%2Ftoot)
<!-- TODO: update the selfhosting instructions -->
<!--
### Host it yourself
Self-hosting Share₂Fedi outside of SSR providers requires some extra setup:
Self-hosting **Share₂Fedi** outside of Vercel requires some extra setup:
**Prerequisites:** modern Node.js (v18 is recommended), `pnpm`. You can host
with Deno, but Node.js is still required to build Share₂Fedi.
1. Make sure you have got Node.js v12 or later as well as pnpm installed
1. Install dependencies.
2. Build the static part of toot:
```sh
pnpm install
pnpm install # to install dependencies
pnpm run build # to build the website
```
2. Build.
3. Run the backend server for the form:
```sh
pnpm build
node api/toot.js
```
If you want to use Deno, add the `--s2f-use-deno` flag:
or if you want to run the process in the background:
```sh
pnpm build --s2f-use-deno
pm2 start api/toot.js --watch --ignore-watch="node_modules"
```
3. Run server.
> You can find a summary for pm2 at: https://pm2.keymetrics.io/docs/usage/quick-start/
> By default, this will only listen on localhost port 3000. To enable
> listening on a certain host and/or port, set the `HOST` and `PORT`
> environment variables, respectively.
```sh
node dist/server/entry.mjs
```
In production, you might want to use a process manager, like
[PM2](https://pm2.keymetrics.io/docs/usage/quick-start/):
```sh
# 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
If you've built Share₂Fedi for Deno:
```sh
deno run --allow-net --allow-read --allow-env ./dist/server/entry.mjs
```
> More information about self-hosting an Astro website with Deno:
> https://docs.astro.build/en/guides/integrations-guide/deno/#usage
4. 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:
4. Set up webserver
1. Apache
```apacheconf
ProxyPass "/" "http://localhost:3000/"
DocumentRoot "path_to_toot/public"
ProxyPass "/api/toot" "http://localhost:8000/"
```
2. Nginx
```nginxconf
location / {
proxy_pass http://localhost:3000/;
root path_to_toot/public;
index.html;
location /api/toot {
proxy_pass http://localhost:8000/;
}
```
3. Caddy
```caddy
reverse_proxy :3000
root * path_to_toot/public;
try_files index.html
handle_path /api/toot {
reverse_proxy localhost:8000
}
```
### Docker
If you _really_ have to use Docker, there is
[a good guide on building Astro apps with Docker](https://docs.astro.build/en/recipes/docker/).
**I will not** provide support for Docker-based deployments in the observable
future.
## Contribute
### Source code
TL;DR: `pnpm install && pnpm dev`
See [contributing guide](CONTRIBUTING.md#improving-code) 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.](https://hosted.weblate.org/engage/share2fedi/).
You also could do it manually by editing files in `src/i18n/translations`, but
this is NOT recommended.
<a href="https://hosted.weblate.org/engage/share2fedi/">
<img src="https://hosted.weblate.org/widget/share2fedi/site/multi-auto.svg" alt="Translation status" />
</a>
> [!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](CONTRIBUTING.md#translating) for instructions
_We thank Weblate for providing Libre hosting!_
-->
## See also
**[📯 Shareon](https://shareon.js.org)** (lightweight, stylish, and ethical
share buttons) uses **Share₂Fedi** under the hood!
**[📯 Shareon](https://shareon.js.org)**
(lightweight, stylish, and ethical share buttons) uses **Share₂Fedi** under the hood!
## Licence
© 20202023 [Nikita Karamov]\
Licensed under the [GNU Affero General Public License v3.0 only][AGPL-3.0-only].
© 20202022 [Nikita Karamov]\
Licensed under the [ISC License][isc].
The repo banner includes Mastodons Full logo, licensed under [AGPL-3.0].
---
This project is hosted on GitHub: <https://github.com/kytta/share2fedi.git>
This project is hosted on Codeberg: <https://codeberg.org/kytta/toot.git>
[AGPL-3.0-only]: https://spdx.org/licenses/AGPL-3.0-only.html
[Nikita Karamov]: https://www.kytta.dev
[Share₂Fedi]: https://s2f.kytta.dev/
[agpl-3.0]: https://spdx.org/licenses/AGPL-3.0-only.html
[isc]: https://spdx.org/licenses/ISC.html
[nikita karamov]: https://www.kytta.dev
[share₂fedi]: https://s2f.kytta.dev/

20
api/toot.js Normal file
View File

@ -0,0 +1,20 @@
const http = require("http");
http
.createServer(async (req, res) => {
const buffers = [];
for await (const chunk of req) {
buffers.push(chunk);
}
const data = Buffer.concat(buffers).toString();
const params = new URLSearchParams(data);
const text = params.get("text") || "";
const instanceURL = params.get("instance") || "https://mastodon.social/";
const finalURL = new URL("share", instanceURL);
finalURL.search = new URLSearchParams({ text }).toString();
res.writeHead(303, { Location: finalURL.toString() }).end();
})
.listen(8000);

View File

@ -1,4 +1,3 @@
<!-- © 2022 Nikita Karamov. Licensed under CC-BY 4.0 -->
<svg viewBox="0 0 64 64" width="512" height="512" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<defs>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,4 +1,3 @@
<!-- © 2022 Nikita Karamov. Licensed under CC-BY 4.0 -->
<svg viewBox="0 0 64 64" width="512" height="512" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<defs>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,4 +1,3 @@
<!-- © 2022 Nikita Karamov. Licensed under CC-BY 4.0 -->
<svg viewBox="0 0 260 80" width="520" height="160" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<defs>

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -1,85 +0,0 @@
/* eslint-env node */
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { defineConfig } from "astro/config";
import cloudflare from "@astrojs/cloudflare";
import deno from "@astrojs/deno";
import netlify from "@astrojs/netlify";
import node from "@astrojs/node";
import vercel from "@astrojs/vercel/serverless";
import browserslist from "browserslist";
import { browserslistToTargets, transform } from "lightningcss";
let adapterConfig = {};
if (process.env.VERCEL) {
console.info("Using Vercel (serverless) adapter...");
adapterConfig = {
adapter: vercel({
functionPerRoute: true,
}),
};
} else if (process.env.CF_PAGES) {
console.info("Using Cloudflare (Pages) adapter...");
adapterConfig = {
adapter: cloudflare(),
};
} else if (process.env.NETLIFY) {
console.info("Using Netlify (Functions) adapter...");
adapterConfig = {
adapter: netlify(),
};
} else if (process.argv.includes("--s2f-use-deno")) {
console.info("Using Deno adapter...");
adapterConfig = {
adapter: deno(),
};
} else {
console.info("Using Node.js adapter...");
console.info("Run with '--s2f-use-deno' flag to use Deno");
adapterConfig = {
adapter: node({
mode: "standalone",
}),
};
}
const lightningCssPlugin = () => {
const targets = browserslistToTargets(browserslist());
return {
name: "vite-plugin-lightningcss",
transform(source: string, id: string) {
if (!id.endsWith(".css")) return;
const { code, map } = transform({
filename: id,
code: Buffer.from(source),
minify: true,
sourceMap: true,
targets,
});
return {
code: code.toString(),
// eslint-disable-next-line unicorn/no-null
map: map ? map.toString() : null,
};
},
};
};
export default defineConfig({
site: "https://s2f.kytta.dev",
output: "server",
...adapterConfig,
vite: {
plugins: [lightningCssPlugin()],
},
});

View File

@ -1,6 +0,0 @@
[build]
command = "pnpm run build"
publish = "dist"
[dev]
command = "pnpm dev"
targetPort = 4321

View File

@ -1,81 +1,32 @@
{
"name": "share2fedi",
"version": "3.1.0",
"description": "Instance-agnostic share page for the Fediverse.",
"license": "AGPL-3.0-only",
"name": "toot",
"version": "3.0.0-rc.2",
"description": "Cross-instance share page for Mastodon",
"license": "ISC",
"author": "Nikita Karamov <me@kytta.dev>",
"homepage": "https://s2f.kytta.dev/",
"homepage": "https://toot.kytta.dev/",
"repository": {
"type": "git",
"url": "https://github.com/kytta/share2fedi.git"
"url": "https://codeberg.org/kytta/toot.git"
},
"private": true,
"type": "module",
"source": "src/index.html",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"build:icons": "bash ./script/build-icons",
"preview": "astro preview",
"check": "pnpm run /^check:/",
"check:astro": "astro check",
"check:eslint": "eslint .",
"check:prettier": "prettier --check --plugin=prettier-plugin-astro .",
"check:stylelint": "stylelint **/*.scss",
"check:typescript": "tsc --noEmit",
"fix": "pnpm fix:prettier . && pnpm fix:eslint .",
"fix:eslint": "eslint --fix",
"fix:prettier": "prettier --write --ignore-unknown --plugin=prettier-plugin-astro",
"fix:stylelint": "stylelint --fix",
"test": "pnpm run check",
"prepare": "husky"
},
"browserslist": "cover 95%, last 2 versions, Firefox ESR, not dead",
"dependencies": {
"@astrojs/cloudflare": "^9.2.1",
"@astrojs/deno": "^5.0.1",
"@astrojs/netlify": "^5.2.0",
"@astrojs/node": "^8.2.5",
"@astrojs/vercel": "^7.5.2",
"@nanostores/persistent": "^0.9.1",
"astro": "^4.5.16",
"nanostores": "^0.9.5"
"build": "pnpm run copy-static && parcel build",
"build-icons": "svgo --multipass assets/pentagon.svg assets/s2f.svg assets/share2fedi.svg -o assets/pentagon.min.svg assets/s2f.min.svg src/images/share2fedi.svg",
"copy-static": "mkdir -p dist/ && cp src/icons/favicon.ico src/robots.txt dist/",
"fmt": "prettier --write .",
"serve": "parcel serve",
"watch": "parcel watch"
},
"browserslist": "> 0.3%, last 2 versions, Firefox ESR, not dead",
"devDependencies": {
"@astrojs/check": "^0.5.10",
"@types/node": "^18.19.29",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"browserslist": "^4.23.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-astro": "^0.31.4",
"eslint-plugin-unicorn": "^51.0.1",
"husky": "^9.0.11",
"lightningcss": "^1.24.1",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"sass": "^1.74.1",
"sharp": "^0.33.3",
"stylelint": "^16.3.1",
"stylelint-config-standard-scss": "^13.1.0",
"svgo": "^3.2.0",
"typescript": "^5.4.3"
},
"lint-staged": {
"*": "pnpm run fix:prettier",
"*.{astro,js,ts}": "pnpm run fix:eslint",
"*.scss": "pnpm run fix:stylelint",
"assets/*.{png,svg}": "pnpm run build:icons"
},
"prettier": {
"singleAttributePerLine": true
},
"stylelint": {
"extends": "stylelint-config-standard-scss"
},
"engines": {
"node": "^18.17.0 || >= 20.3.0"
"@parcel/core": "^2.8.0",
"@parcel/packager-raw-url": "^2.8.0",
"@parcel/transformer-sass": "^2.8.0",
"@parcel/transformer-webmanifest": "^2.8.0",
"parcel": "^2.8.0",
"prettier": "2.5.1",
"svgo": "^3.0.1"
}
}

View File

@ -1,5 +0,0 @@
This file is part of Share₂Fedi
https://github.com/kytta/share2fedi
SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: CC0-1.0

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
This (auto-generated) file is part of Share₂Fedi
https://github.com/kytta/share2fedi
SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: CC0-1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 64 64"><defs><clipPath id="a"><path d="m38.802 1.632 23.656 29.212-20.473 31.524-36.307-9.729L3.71 15.102z"/></clipPath><filter id="b"><feGaussianBlur stdDeviation="15"/></filter></defs><g clip-path="url(#a)" filter="url(#b)"><circle cy="10" r="39" fill="#F44336"/><circle cx="45" cy="-5" r="39" fill="#FFEB3B"/><circle cx="70" cy="25" r="39" fill="#4CAF50"/><circle cx="50" cy="65" r="39" fill="#03A9F4"/><circle cx="5" cy="70" r="39" fill="#673AB7"/><circle cx="50" cy="31.5" r="12" fill="#4CAF50"/><circle cx="37.5" cy="50.5" r="12" fill="#03A9F4"/><circle cx="15.5" cy="44.5" r="12" fill="#673AB7"/><circle cx="14" cy="22" r="12" fill="#F44336"/><circle cx="36" cy="14" r="12" fill="#FFEB3B"/></g></svg>

Before

Width:  |  Height:  |  Size: 785 B

View File

@ -1,23 +0,0 @@
#!/bin/bash
# This file is part of Share₂Fedi
# https://github.com/kytta/share2fedi
#
# SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
# SPDX-License-Identifier: AGPL-3.0-only
# This script converts raw SVG icons to favicons according to the article:
# https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs
set -euo pipefail
if ! type "magick"; then
echo "ImageMagick ('magick') not found; exiting"
exit 1
fi
node script/icons.js
magick convert public/favicon-32.png public/favicon-16.png public/favicon.ico
rm public/favicon-32.png public/favicon-16.png
echo "Done."

View File

@ -1,47 +0,0 @@
/*!
* This file is part of Share₂Fedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import sharp from "sharp";
import { optimize } from "svgo";
const pentagon = join(".", "assets", "pentagon.svg");
const smallLogo = join(".", "assets", "s2f.svg");
const outputDirectory = join(".", "public");
try {
await Promise.all([
sharp(pentagon).resize(32).toFile(join(outputDirectory, "favicon-32.png")),
sharp(pentagon).resize(16).toFile(join(outputDirectory, "favicon-16.png")),
sharp(smallLogo)
.resize(140)
.extend({
top: 20,
bottom: 20,
left: 20,
right: 20,
background: "#000",
})
.flatten({ background: "#000" })
.toFile(join(outputDirectory, "apple-touch-icon.png")),
sharp(smallLogo).resize(192).toFile(join(outputDirectory, "icon-192.png")),
sharp(smallLogo).resize(512).toFile(join(outputDirectory, "icon-512.png")),
]);
} catch (error) {
console.error(error);
}
writeFileSync(
join(outputDirectory, "icon.svg"),
optimize(readFileSync(pentagon), {
path: pentagon,
multipass: true,
}).data,
);

View File

@ -1,169 +0,0 @@
---
/*!
* This file is part of Share₂Fedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
const { instance, errors } = Astro.props;
---
<datalist id="popular-instances"></datalist>
<label class="mt1r">
<span data-translate="instance">Fediverse instance</span>
<div
class="instance-input"
dir="ltr"
>
<span id="https-label">https://</span>
<input
type="text"
name="instance"
id="instance"
list="popular-instances"
required
aria-invalid={Boolean(errors)}
aria-errormessage={errors ? "instance-error" : undefined}
aria-describedby="https-label"
value={instance}
/>
</div>
{
errors && (
<p
class="error"
id="instance-error"
aria-live="assertive"
>
{errors}
</p>
)
}
</label>
<div
id="saved-instances"
class="mt1r"
>
<span data-translate="previouslyUsed">Previously used:</span>&#x0020;
<span class="list"></span>
</div>
<label
class="mt1r"
for="remember"
>
<input
type="checkbox"
id="remember"
name="remember"
/>&#x0020;
<span data-translate="rememberInstance">Remember instance on this device</span
><noscript>.</noscript>
<noscript style="color:darkred;font-size:smaller">
This will not work when JavaScript is disabled.</noscript
>
</label>
<style lang="scss">
.instance-input {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: stretch;
width: 100%;
span {
display: flex;
align-items: center;
padding: 0.5rem;
font-size: 1rem;
}
input[type="text"] {
position: relative;
flex: 1 1 auto;
width: 1%;
}
}
#saved-instances {
margin-block-end: 1rem;
> div {
display: inline-block;
}
:global(span.link) {
color: var(--s2f-accent-color-contrast);
cursor: pointer;
text-decoration: 1px solid underline currentColor;
}
}
</style>
<script>
import { getUrlDomain, normalizeURL } from "@lib/url";
import { $popularInstances } from "@stores/popular-instances";
import { $savedInstances, save } from "@stores/saved-instances";
const instanceElement = document.querySelector(
"#instance",
) as HTMLInputElement;
const savedInstancesElement = document.querySelector(
"#saved-instances",
) as HTMLDivElement;
$savedInstances.subscribe((instances) => {
if (instances.size === 0) {
savedInstancesElement.style.display = "none";
return;
}
const savedInstances = [...instances];
if (!instanceElement.value) {
instanceElement.value = getUrlDomain(savedInstances[0] as string);
}
savedInstancesElement.style.display = "block";
document.querySelector("#saved-instances>.list")!.replaceChildren(
...savedInstances
.flatMap((instance: string) => {
if (!instance) {
return [];
}
const host = getUrlDomain(instance);
const element = document.createElement("span");
element.classList.add("link");
element.textContent = host;
element.dir = "ltr";
element.addEventListener("click", () => {
instanceElement.value = host;
});
return [element, ", "];
})
.slice(0, -1),
);
});
document.querySelector("#form")!.addEventListener("submit", (event) => {
const formData = new FormData(event.target as HTMLFormElement);
if (formData.get("remember")) {
save(normalizeURL(formData.get("instance") as string));
}
return true;
});
$popularInstances.subscribe((instances) => {
document.querySelector("#popular-instances")!.replaceChildren(
...instances.map((domain) => {
const option = document.createElement("option");
option.value = domain;
return option;
}),
);
});
</script>

View File

@ -1,58 +0,0 @@
---
/*!
* This file is part of Share₂Fedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { languages } from "@i18n/translations";
const initialLanguage = "en";
---
<label>
🌍 <span data-translate="language">Language:</span>&#x0020;
<select
name="language"
id="language"
>
{
Object.entries(languages).map(([k, v]) => {
return (
<option
selected={k === initialLanguage}
value={k}
>
{v.autonym}
</option>
);
})
}
</select>
</label>
<script>
import { findBestLanguage } from "@i18n/engine";
import { applyTranslations } from "@i18n/engine";
import { $locale } from "@stores/i18n";
const select: HTMLSelectElement = document.querySelector("#language")!;
document.addEventListener("DOMContentLoaded", () => {
$locale.subscribe((newLocale) => {
if (newLocale === undefined) {
newLocale = findBestLanguage();
}
applyTranslations(newLocale);
if (select.value !== newLocale) {
select.value = newLocale;
}
});
select.addEventListener("change", (event) => {
$locale.set((event.target as typeof select).value);
});
});
</script>

View File

@ -1,29 +0,0 @@
<!--
This file is part of Share₂Fedi
https://github.com/kytta/share2fedi
SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: CC0-1.0
-->
<details>
<summary data-translate="licence">Licence</summary>
<p
data-translate="licence1"
dir="auto"
>
Share₂Fedi is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License, version 3, as published
by the Free Software Foundation.
</p>
<p
data-translate="licence2"
dir="auto"
>
Share₂Fedi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
for more details.
</p>
</details>

View File

@ -1,34 +0,0 @@
<!--
This file is part of Share₂Fedi
https://github.com/kytta/share2fedi
SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: CC0-1.0
-->
<details>
<summary data-translate="privacyNotice">Privacy Notice</summary>
<p
data-translate="privacy1"
dir="auto"
>
s2f.kytta.dev is hosted on Vercel. Vercel processes IP addresses, system
configuration information, and other information about traffic to and from
s2f.kytta.dev. Vercel does not store this information nor does it get shared
with third parties. See
<a
href="https://vercel.com/legal/privacy-policy#customers"
data-translate="vercelPP"
>Vercels privacy policy</a
>
for more information.
</p>
<p
data-translate="privacy2"
dir="auto"
>
When you click the Publish button, youll get redirected to a Fediverse
instance youve specified. It may process and/or store your data. Please
refer to the privacy policy of the respective instance.
</p>
</details>

9
src/env.d.ts vendored
View File

@ -1,9 +0,0 @@
/* eslint-disable unicorn/prevent-abbreviations */
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: CC0-1.0
*/
/// <reference types="astro/client" />

BIN
src/fonts/Roboto-400.woff Normal file

Binary file not shown.

BIN
src/fonts/Roboto-400.woff2 Normal file

Binary file not shown.

BIN
src/fonts/Roboto-500.woff Normal file

Binary file not shown.

BIN
src/fonts/Roboto-500.woff2 Normal file

Binary file not shown.

View File

@ -1,90 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { strings, defaultLanguage, languages } from "./translations";
export function useTranslations(language: string) {
return function t(
key: keyof (typeof strings)[typeof defaultLanguage],
): string {
return (
strings[language as keyof typeof strings][key] ||
strings[defaultLanguage][key] ||
""
);
};
}
export function findBestLanguage(): string {
const urlLanguage = new URLSearchParams(window.location.search).get("lang");
if (urlLanguage && urlLanguage in languages) {
return urlLanguage;
}
let browserLanguages = navigator.languages;
if (!navigator.languages) browserLanguages = [navigator.language];
for (const language of browserLanguages) {
const locale = new Intl.Locale(language);
const minimized = locale.minimize();
for (const candidate of [locale.baseName, minimized.baseName]) {
if (candidate in languages) {
return candidate;
}
}
}
return defaultLanguage;
}
export function applyTranslations(language: string) {
if (!(language in strings)) {
language = defaultLanguage;
}
const t = useTranslations(language);
for (const node of document.querySelectorAll("[data-translate]")) {
const dataset = (node as HTMLElement).dataset;
if (dataset.translateAttribute) {
node.setAttribute(dataset.translateAttribute, t(dataset.translate!));
continue;
}
let splitTranslated = t(dataset.translate!).split("{}");
if (splitTranslated.length === 1) {
node.innerHTML = t(dataset.translate!);
continue;
}
// XXX: this is needed for the strings where the placholder sits at the very
// beginning, which introduces phantom empty strings.
splitTranslated = splitTranslated.filter((string) => string !== "");
for (const child of node.childNodes) {
if (child.nodeType === Node.TEXT_NODE) {
child.textContent = splitTranslated.shift() || "";
}
}
}
if (Intl.ListFormat) {
const formatter = new Intl.ListFormat(language, {
style: "short",
type: "conjunction",
});
for (const node of document.querySelectorAll("[data-enumerate]")) {
const dataset = (node as HTMLElement).dataset;
node.innerHTML = formatter.format(dataset.enumerate!.split(","));
}
}
document.documentElement.lang = language;
document.documentElement.dir =
languages[language as keyof typeof languages].dir;
}

View File

@ -1,37 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import ar from "./translations/ar.json";
import de from "./translations/de.json";
import en from "./translations/en.json";
import es from "./translations/es.json";
import fr from "./translations/fr.json";
import nl from "./translations/nl.json";
import ru from "./translations/ru.json";
export const languages = {
ar: { autonym: "العربية", dir: "rtl" },
de: { autonym: "Deutsch", dir: "ltr" },
en: { autonym: "English", dir: "ltr" },
es: { autonym: "Español", dir: "ltr" },
fr: { autonym: "Français", dir: "ltr" },
nl: { autonym: "Nederlands", dir: "ltr" },
ru: { autonym: "Русский", dir: "ltr" },
};
export const strings: Record<keyof typeof languages, Record<string, string>> = {
ar,
de,
en,
es,
fr,
nl,
ru,
} as const;
export const defaultLanguage: keyof typeof strings = "en";

View File

@ -1,24 +0,0 @@
{
"privacyNotice": "إشعار الخصوصية",
"postText": "نص المنشور",
"fediverse": "الفديفرس",
"vercelPP": "سياسة الخصوصية لـ Vercel",
"description": "شير تو فيدي Share₂Fedi هو موقع مشاركة لـ {}. يمكنك من خلاله نشر محتوى على منصات متعددة تتبع نموذج الفديرالية من صفحة واحدة.",
"incl": "بما فيه",
"postTextPlaceholder": "فيمَ تفكّر؟",
"rememberInstance": "تذكر مثيل الخادم على هذا الجهاز",
"instance": "مثيل خادم الفديفرس",
"licence1": "شير تو فيدي Share₂Fedi هو برنامج حر: يمكنك إعادة توزيعه و/أو تعديله وفقًا لشروط الرخصة العامة GNU Affero، الإصدار 3، كما نَشرَتها مؤسسة البرمجيات الحرة.",
"previouslyUsed": "تم استخدامه مسبقًا:",
"metaDescription": "شير تو فيدي Share₂Fedi هي صفحة مشاركة لـ Mastodon و Misskey و Friendica وغيرها. اكتب نص منشورك وعنوان الرابط التشعبي لمثيل الخادم، ثم انقر على ”أنشر“!",
"nikita": "نيكيتا كاراموف",
"statusPage": "صفحة الحالة",
"publish": "أنشر",
"licence": "الرخصة",
"language": "اللغة:",
"supportedProjects": "المشاريع المدعومة:",
"privacy2": "عندما تنقر على زر ”أنشر“، سيتم توجيهك إلى مثيل خادم الفديفرس الذي حددته. قد يقوم بمعالجة و/أو تخزين بياناتك. يرجى الرجوع إلى سياسة الخصوصية للخادم المعني.",
"onGitHub": "على جت هب",
"credits": "تم تطوير Share₂Fedi وصيانته من طرف {}. الشيفرة المصدرية متوفرة على {}. مستضافة على {}. {}.",
"licence2": "برنامج Share₂Fedi موزع بأمل أن يكون مفيدًا، ولكن دون أي ضمان؛ بدون حتى الضمان المتضمن للتسويق أو اللياقة لغرض معين. راجع ترخيص غنو العام GNU Affero General لمزيد من التفاصيل."
}

View File

@ -1,25 +0,0 @@
{
"metaDescription": "Share₂Fedi ist eine Share-Seite für Mastodon, Misskey, Friendica und andere. Geben Sie Ihren Beitragstext und die Instanz-URL ein und klicken Sie auf „Veröffentlichen“!",
"language": "Sprache:",
"description": "Share₂Fedi ist eine instanzunabhängige Share-Seite für {}. Mit ihr können Sie von einer einzigen Seite aus auf verschiedenen föderierten Plattformen posten.",
"fediverse": "das Fediverse",
"supportedProjects": "Unterstützte Projekte:",
"incl": "inkl.",
"credits": "Share₂Fedi wird von {} entwickelt und gepflegt. Der Quellcode ist {}. Gehostet mit {}. {}.",
"nikita": "Nikita Karamov",
"onGitHub": "auf GitHub",
"statusPage": "Statusseite",
"licence": "Lizenz",
"licence1": "Share₂Fedi ist freie Software: Sie können es unter den Bedingungen der GNU Affero General Public License, Version 3, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren.",
"licence2": "Die Veröffentlichung von Share₂Fedi erfolgt in der Hoffnung, dass es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU Affero General Public License.",
"privacyNotice": "Datenschutzhinweis",
"privacy1": "s2f.kytta.dev wird auf Vercel gehostet. Vercel verarbeitet IP-Adressen, Systemkonfigurationsinformationen und andere Informationen über den Verkehr von und zu s2f.kytta.dev. Vercel speichert diese Informationen nicht und gibt sie auch nicht an Dritte weiter. Siehe {} für weitere Informationen.",
"privacy2": "Wenn Sie auf die „Veröffentlichen“ klicken, werden Sie zu einer Fediverse-Instanz weitergeleitet, die Sie angegeben haben. Diese kann Ihre Daten verarbeiten und/oder speichern. Bitte beachten Sie die Datenschutzrichtlinien der jeweiligen Instanz.",
"vercelPP": "Vercels Datenschutzpolitik",
"postText": "Beitragstext",
"postTextPlaceholder": "Was gibts Neues?",
"instance": "Fediverse-Instanz",
"previouslyUsed": "Bisher verwendet:",
"rememberInstance": "Instanz auf diesem Gerät merken",
"publish": "Veröffentlichen"
}

View File

@ -1,25 +0,0 @@
{
"metaDescription": "Share₂Fedi is a share page for Mastodon, Misskey, Friendica, and others. Type in your post text and the instance URL and click Publish!",
"language": "Language:",
"description": "Share₂Fedi is an instance-agnostic share page for {}. With it, you can post to various federated platforms from a single page.",
"fediverse": "the Fediverse",
"supportedProjects": "Supported projects:",
"incl": "incl.",
"credits": "Share₂Fedi is developed and maintained by {}. Source code is {}. Hosted with {}. {}.",
"nikita": "Nikita Karamov",
"onGitHub": "on GitHub",
"statusPage": "Status page",
"licence": "Licence",
"licence1": "Share₂Fedi is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License, version 3, as published by the Free Software Foundation.",
"licence2": "Share₂Fedi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.",
"privacyNotice": "Privacy Notice",
"privacy1": "s2f.kytta.dev is hosted on Vercel. Vercel processes IP addresses, system configuration information, and other information about traffic to and from s2f.kytta.dev. Vercel does not store this information nor does it get shared with third parties. See {} for more information.",
"privacy2": "When you click the Publish button, youll get redirected to a Fediverse instance youve specified. It may process and/or store your data. Please refer to the privacy policy of the respective instance.",
"vercelPP": "Vercels privacy policy",
"postText": "Post text",
"postTextPlaceholder": "Whats on your mind?",
"instance": "Fediverse instance",
"previouslyUsed": "Previously used:",
"rememberInstance": "Remember instance on this device",
"publish": "Publish"
}

View File

@ -1,25 +0,0 @@
{
"metaDescription": "Share₂Fedi es una página de compartir para Mastodon, Misskey, Friendica y otros. ¡Escriba su texto de publicación y la URL de la instancia y haga clic en «Publicar»!",
"language": "Idioma:",
"description": "Share₂Fedi es una página de compartir independiente de la instancia para {}. Con ella, puede publicar en varias plataformas federadas desde una sola página.",
"fediverse": "el Fediverso",
"supportedProjects": "Proyectos compatibles:",
"incl": "incl.",
"credits": "Share₂Fedi es desarrollado y mantenido por {}. El código fuente es {}. Alojado con {}. {}.",
"nikita": "Nikita Karamov",
"onGitHub": "en GitHub",
"statusPage": "Página de estado",
"licence": "Licencia",
"licence1": "Share₂Fedi es un software libre: puedes redistribuirlo y/o modificarlo bajo los términos de la Licencia Pública General GNU Affero, versión 3, publicada por la Free Software Foundation.",
"licence2": "Share₂Fedi se distribuye con la esperanza de que sea útil, pero SIN NINGUNA GARANTÍA; sin siquiera la garantía implícita de COMERCIABILIDAD o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. Consulte la Licencia Pública General Affero de GNU para obtener más detalles.",
"privacyNotice": "Aviso de privacidad",
"privacy1": "s2f.kytta.dev está alojado en Vercel. Vercel procesa las direcciones IP, la información de configuración del sistema y otra información sobre el tráfico hacia y desde s2f.kytta.dev. Vercel no almacena esta información ni la comparte con terceros. Consulte {} para obtener más información.",
"privacy2": "Cuando hace clic en el botón «Publicar», se le redirige a una instancia de Fediverso que ha especificado. Puede procesar y/o almacenar sus datos. Consulte la política de privacidad de la instancia correspondiente.",
"vercelPP": "Política de privacidad de Vercel",
"postText": "Texto de la publicación",
"postTextPlaceholder": "¿Qué hay de nuevo?",
"instance": "Instancia del Fediverso",
"previouslyUsed": "Usado anteriormente:",
"rememberInstance": "Recordar instancia en este dispositivo",
"publish": "Publicar"
}

View File

@ -1,25 +0,0 @@
{
"metaDescription": "Share₂Fedi est une page de partage pour Mastodon, Misskey, Friendica et autres. Tapez votre texte de publication et lURL de linstance, puis cliquez sur « Publier »!",
"language": "Langue:",
"description": "Share₂Fedi est une page de partage indépendante pour {}. Avec elle, vous pouvez publier sur diverses plateformes fédérées depuis une seule page.",
"fediverse": "le Fediverse",
"supportedProjects": "Projets pris en charge:",
"incl": "dont",
"credits": "Share₂Fedi est développé et maintenu par {}. Le code source est {}. Hébergé avec {}. {}.",
"nikita": "Nikita Karamov",
"onGitHub": "sur GitHub",
"statusPage": "Page de statut",
"licence": "Licence",
"licence1": "Share₂Fedi est un logiciel libre: vous pouvez le redistribuer et/ou le modifier selon les termes de la licence publique générale Affero, version 3, telle que publiée par la Free Software Foundation.",
"licence2": "Share₂Fedi est distribué dans lespoir quil sera utile, mais SANS AUCUNE GARANTIE; sans même la garantie implicite de QUALITÉ MARCHANDE ou DADÉQUATION À UN USAGE PARTICULIER. Consultez la licence publique générale Affero de GNU pour plus de détails.",
"privacyNotice": "Avis de confidentialité",
"privacy1": "s2f.kytta.dev est hébergé sur Vercel. Vercel traite les adresses IP, les informations de configuration système et dautres informations sur le trafic vers et depuis s2f.kytta.dev. Vercel ne stocke pas ces informations et ne les partage pas avec des tiers. Voir {} pour plus dinformations.",
"privacy2": "Lorsque vous cliquez sur le bouton « Publier », vous êtes redirigé vers une instance du Fediverse que vous avez spécifiée. Elle peut traiter et/ou stocker vos données. Veuillez vous référer à la politique de confidentialité de linstance respective.",
"vercelPP": "Politique de confidentialité de Vercel",
"postText": "Texte de la publication",
"postTextPlaceholder": "Quoi de neuf?",
"instance": "Instance du Fediverse",
"previouslyUsed": "Utilisé précédemment:",
"rememberInstance": "Se souvenir de linstance sur cet appareil",
"publish": "Publier"
}

View File

@ -1,25 +0,0 @@
{
"metaDescription": "Share₂Fedi is een deelpagina voor Mastodon, Misskey, Friendica en andere fediversenetwerken. Voer een bericht in, plak de instantie-url en klik op Publiceren!",
"language": "Taal:",
"description": "Share₂Fedi is een instantie-onafhankelijke deelpagina voor {}. Zo kun je berichten plaatsen op meerdere fediversenetwerken tegelijk.",
"fediverse": "het Fediverse",
"supportedProjects": "Ondersteunde netwerken:",
"incl": "incl.",
"nikita": "Nikita Karamov",
"onGitHub": "op GitHub",
"statusPage": "Statuspagina",
"licence": "Licentie",
"privacyNotice": "Privacybeleid",
"privacy2": "Als je op publiceren klikt, wordt je doorgestuurd naar de opgegeven fediverse-instantie. Hierbij worden je gegevens mogelijk verwerkt en/of bewaard. Bekijk voor meer informatie het privacybeleid van je instantie.",
"vercelPP": "Vercels privacybeleid",
"postTextPlaceholder": "Wat gaat er door je hoofd?",
"instance": "Fediverse-instantie",
"postText": "Berichtinhoud",
"previouslyUsed": "Onlangs gebruikt:",
"rememberInstance": "Instantie onthouden op dit apparaat",
"publish": "Publiceren",
"credits": "Share₂Fedi wordt ontwikkeld en onderhouden door {}. Broncode: {} - Hosting: {}. {}.",
"licence1": "Share₂Fedi is vrije software: je mag de software opnieuw uitgeven en/of aanpassen onder de voorwaarden van de GNU Affero General Public License, versie 3, zoals omschreven door de Free Software Foundation.",
"licence2": "Share₂Fedi wordt verspreid in de hoop nuttig te zijn, maar wordt geleverd ZONDER ENIGE VORM VAN GARANTIE; zelfs zonder de garantie van VERKOOPBAARHEID of GESCHIKTHEID VOOR EEN BEPAALD DOEL. Bekijk voor meer informatie de GNU Affero General Public License.",
"privacy1": "s2f.kytta.dev wordt gehost door Vercel. Vercel verwerkt ip-adressen, systeemconfiguraties en andere informatie omtrent verkeer van en naar s2f.kytta.dev. Vercel bewaart deze informatie echter niet, noch deelt het de informatie met externe partijen. Bekijk voor meer informatie {}."
}

View File

@ -1,25 +0,0 @@
{
"metaDescription": "Share₂Fedi — это share-страница для Mastodon, Misskey, Friendica и других сервисов. Введите текст поста и URL-адрес инстанса и нажмите «Опубликовать»!",
"language": "Язык:",
"description": "Share₂Fedi — это инстанс-независимая share-страница для {}. С её помощью вы можете делиться информацией на различных федеративных платформах с одной страницы.",
"fediverse": "Федивёрса",
"supportedProjects": "Поддерживаемые проекты:",
"incl": "вкл.",
"credits": "Share₂Fedi разрабатывается и поддерживается {}. Исходный код {}. Хостится на {}. {}.",
"nikita": "Никитой Карамовым",
"onGitHub": "на GitHub",
"statusPage": "Статус",
"licence": "Лицензия",
"licence1": "Share₂Fedi является свободным программным обеспечением: вы можете распространять её и (или) изменять, соблюдая условия GNU Affero General Public License редакции 3, опубликованной Free Software Foundation.",
"licence2": "Share₂Fedi распространяется в расчёте на то, что она окажется полезной, но БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, включая подразумеваемую гарантию КАЧЕСТВА либо ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЁННЫХ ЦЕЛЕЙ. Ознакомьтесь с GNU Affero General Public License для получения более подробной информации.",
"privacyNotice": "Политика конфиденциальности",
"privacy1": "Сайт s2f.kytta.dev размещён на серверах Vercel. Vercel обрабатывает IP-адреса, информацию о конфигурации системы и другую информацию о трафике, идущем к s2f.kytta.dev и от него. Vercel не хранит эту информацию и не передает её третьим лицам. Более подробную информацию см. в {}.",
"privacy2": "Когда вы нажимаете кнопку «Опубликовать», вы попадаете на указанный вами инстанс Федивёрса. Он может обрабатывать и/или хранить ваши данные. Пожалуйста, ознакомьтесь с политикой конфиденциальности соответствующего инстанса.",
"vercelPP": "Политике конфиденциальности Vercel",
"postText": "Текст поста",
"postTextPlaceholder": "О чём думаете?",
"instance": "Инстанс Федивёрса",
"previouslyUsed": "Ранее использовались:",
"rememberInstance": "Запомнить инстанс на этом устройстве",
"publish": "Опубликовать"
}

View File

@ -1,25 +0,0 @@
{
"privacyNotice": "Політика конфіденційності",
"incl": "вкл.",
"postTextPlaceholder": "Що у вас на думці?",
"rememberInstance": "Запам'ятати інстанс на цьому пристрої",
"metaDescription": "Share₂Fedi — це share-сторінка для Mastodon, Misskey, Friendica та інших сервісів. Введіть текст посту та URL-адресу інстансу та натисніть «Опублікувати»!",
"statusPage": "Статус",
"publish": "Опублікувати",
"licence": "Ліцензія",
"language": "Мова:",
"supportedProjects": "Підтримувані проєкти:",
"onGitHub": "на GitHub",
"description": "Share₂Fedi - це інстанс-незалежна share-сторінка для {}. З її допомогою ви можете ділитися інформацією на різних федеративних платформах з однієї сторінки.",
"fediverse": "федіверсу",
"credits": "Share₂Fedi розробляється і підтримується {}. Вихідний код на {}. Розміщено на {}. {}.",
"nikita": "Микитою Карамовим",
"licence1": "Share₂Fedi є вільним програмним забезпеченням: ви можете розповсюджувати його та/або модифікувати відповідно до умов Загальної публічної ліцензії Affero GNU, версії 3, опублікованої Фондом вільного програмного забезпечення.",
"licence2": "Share₂Fedi розповсюджується з надією, що воно буде корисним, але БЕЗ ЖОДНИХ ГАРАНТІЙ; без навіть неявної гарантії ТОВАРНОСТІ або ПРИДАТНОСТІ ДЛЯ ПЕВНОЇ ЦІЛІ. Для більш детальної інформації див. Загальну публічну ліцензію Affero GNU.",
"privacy1": "Сайт s2f.kytta.dev розміщений на серверах Vercel. Vercel обробляє IP-адреси, інформацію про конфігурацію системи та іншу інформацію про трафік, що йде до s2f.kytta.dev і від нього. Vercel не зберігає цю інформацію і не передає її третім особам. Більш детальну інформацію див. у {}.",
"privacy2": "Коли ви натискаєте кнопку \"Опублікувати\", ви потрапляєте на вказаний вами інстанс федіверсу. Він може обробляти та/або зберігати ваші дані. Будь ласка, ознайомтеся з політикою конфіденційності відповідного інстансу.",
"vercelPP": "Політиці конфіденційності Vercel",
"postText": "Текст повідомлення",
"instance": "Інстанс федіверсу",
"previouslyUsed": "Раніше використовувалися:"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
src/icons/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
src/icons/icon-192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
src/icons/icon-512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="520" height="160" viewBox="0 0 260 80"><defs><clipPath id="pentagon"><path d="m38.802 1.632 23.656 29.212-20.473 31.524-36.307-9.729L3.71 15.102z"/></clipPath><filter id="blur"><feGaussianBlur stdDeviation="15"/></filter></defs><g clip-path="url(#pentagon)" transform="matrix(.6 0 0 .6 129 36)"><g filter="url(#blur)"><circle cy="10" r="39" fill="#F44336"/><circle cx="45" cy="-5" r="39" fill="#FFEB3B"/><circle cx="70" cy="25" r="39" fill="#4CAF50"/><circle cx="50" cy="65" r="39" fill="#03A9F4"/><circle cx="5" cy="70" r="39" fill="#673AB7"/><circle cx="50" cy="31.5" r="12" fill="#4CAF50"/><circle cx="37.5" cy="50.5" r="12" fill="#03A9F4"/><circle cx="15.5" cy="44.5" r="12" fill="#673AB7"/><circle cx="14" cy="22" r="12" fill="#F44336"/><circle cx="36" cy="14" r="12" fill="#FFEB3B"/></g></g><style>@media (prefers-color-scheme:dark){#text{fill:#fff}}</style><path id="text" fill="#000" d="M29.39 27.758h8.387C37.732 21.412 32.85 17.24 25.04 17.24c-7.678 0-13.092 4.127-13.047 10.251 0 5.06 3.461 7.855 9.186 9.098l3.24.665c3.594.8 4.792 1.687 4.836 3.196-.044 1.553-1.464 2.707-4.304 2.707-3.328 0-5.325-1.598-5.458-4.571H11.15c.044 8.12 5.547 11.76 13.934 11.76 8.21 0 13.091-3.55 13.136-9.896-.045-4.926-2.974-8.388-10.074-9.897l-2.663-.576c-3.062-.666-4.437-1.554-4.349-3.107 0-1.42 1.199-2.44 3.906-2.44 2.84 0 4.171 1.242 4.349 3.328zm21.002 8.564c0-2.396 1.375-3.816 3.505-3.816 2.22 0 3.506 1.42 3.462 3.816v13.624h8.698V34.503c.044-5.28-3.329-9.097-8.432-9.097-3.594 0-6.213 1.864-7.322 4.926h-.222V17.684h-8.387v32.262h8.698zm26.723 14.024c3.15 0 5.503-1.11 6.967-3.817h.222v3.417h8.121V33.35c0-4.438-4.26-7.943-11.183-7.943-7.233 0-10.783 3.816-11.094 8.21h8.032c.178-1.51 1.287-2.22 2.973-2.22 1.51 0 2.574.71 2.574 1.953v.089c0 1.376-1.553 1.82-5.636 2.13-4.97.355-8.875 2.396-8.875 7.677 0 4.837 3.24 7.1 7.9 7.1zm2.84-5.503c-1.509 0-2.53-.71-2.53-2.086 0-1.242.888-2.219 2.885-2.53 1.376-.221 2.574-.488 3.462-.887v2.041c0 2.22-1.864 3.462-3.817 3.462zm16.641 5.103h8.698V37.343c0-2.796 1.908-4.615 4.482-4.615.888 0 2.308.133 3.195.444V25.76a7.486 7.486 0 0 0-2.219-.355c-2.574 0-4.57 1.553-5.458 4.926h-.266V25.76h-8.432v24.185zm29.417.444c6.7 0 11.05-3.195 11.849-8.254h-7.944c-.488 1.376-1.952 2.13-3.728 2.13-2.573 0-4.082-1.686-4.082-4.038v-.355h15.754V37.83c0-7.677-4.704-12.425-12.027-12.425-7.5 0-12.292 5.014-12.292 12.514 0 7.81 4.704 12.47 12.47 12.47zm-3.905-15.31c.044-2.086 1.775-3.55 3.905-3.55 2.174 0 3.816 1.464 3.86 3.55zm35.893 14.866h8.743V37.343h12.558v-7.056h-12.558V24.74h13.934v-7.056h-22.677v32.262zm35.859.444c6.7 0 11.05-3.195 11.848-8.254h-7.944c-.488 1.376-1.952 2.13-3.727 2.13-2.574 0-4.083-1.686-4.083-4.038v-.355h15.754V37.83c0-7.677-4.704-12.425-12.026-12.425-7.5 0-12.293 5.014-12.293 12.514 0 7.81 4.704 12.47 12.47 12.47zm-3.906-15.31c.044-2.086 1.775-3.55 3.905-3.55 2.175 0 3.817 1.464 3.861 3.55zm28.042 15.177c3.417 0 5.725-1.82 6.746-4.26h.177v3.95h8.654V17.683h-8.698v12.293h-.133c-.932-2.486-3.196-4.571-6.79-4.571-4.793 0-9.452 3.683-9.452 12.425 0 8.388 4.349 12.426 9.496 12.426zm3.24-6.657c-2.397 0-3.817-2.174-3.817-5.769s1.42-5.724 3.817-5.724 3.816 2.13 3.816 5.724c0 3.55-1.42 5.77-3.816 5.77zm16.638 6.346h8.698V25.761h-8.698zm4.349-26.715c2.352 0 4.26-1.775 4.26-3.994 0-2.174-1.908-3.95-4.26-3.95-2.397 0-4.305 1.776-4.305 3.95 0 2.22 1.908 3.994 4.305 3.994z"/><path fill="#fff" d="M140.44 64.724h14.463v-4.088h-7.374v-.104l1.785-1.475c4.27-3.57 5.382-5.433 5.382-7.606 0-3.493-2.872-5.795-7.4-5.795-4.372 0-7.218 2.432-7.218 6.39h4.864c-.026-1.578.957-2.458 2.354-2.458 1.423 0 2.406.88 2.406 2.303 0 1.345-.853 2.199-2.225 3.363l-7.037 5.796v3.674z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="520" height="160" viewBox="0 0 260 80"><defs><clipPath id="pentagon"><path d="m38.802 1.632 23.656 29.212-20.473 31.524-36.307-9.729L3.71 15.102z"/></clipPath><filter id="blur"><feGaussianBlur stdDeviation="15"/></filter></defs><g clip-path="url(#pentagon)" transform="matrix(.6 0 0 .6 129 36)"><g filter="url(#blur)"><circle cy="10" r="39" fill="#F44336"/><circle cx="45" cy="-5" r="39" fill="#FFEB3B"/><circle cx="70" cy="25" r="39" fill="#4CAF50"/><circle cx="50" cy="65" r="39" fill="#03A9F4"/><circle cx="5" cy="70" r="39" fill="#673AB7"/><circle cx="50" cy="31.5" r="12" fill="#4CAF50"/><circle cx="37.5" cy="50.5" r="12" fill="#03A9F4"/><circle cx="15.5" cy="44.5" r="12" fill="#673AB7"/><circle cx="14" cy="22" r="12" fill="#F44336"/><circle cx="36" cy="14" r="12" fill="#FFEB3B"/></g></g><style>@media (prefers-color-scheme:dark){#text{fill:#fff}}</style><path id="text" fill="#000" d="M29.39 27.758h8.387C37.732 21.412 32.85 17.24 25.04 17.24c-7.678 0-13.092 4.127-13.047 10.251 0 5.06 3.461 7.855 9.186 9.098l3.24.665c3.594.8 4.792 1.687 4.836 3.196-.044 1.553-1.464 2.707-4.304 2.707-3.328 0-5.325-1.598-5.458-4.571H11.15c.044 8.12 5.547 11.76 13.934 11.76 8.21 0 13.091-3.55 13.136-9.896-.045-4.926-2.974-8.388-10.074-9.897l-2.663-.576c-3.062-.666-4.437-1.554-4.349-3.107 0-1.42 1.199-2.44 3.906-2.44 2.84 0 4.171 1.242 4.349 3.328zm21.002 8.564c0-2.396 1.375-3.816 3.505-3.816 2.22 0 3.506 1.42 3.462 3.816v13.624h8.698V34.503c.044-5.28-3.329-9.097-8.432-9.097-3.594 0-6.213 1.864-7.322 4.926h-.222V17.684h-8.387v32.262h8.698zm26.723 14.024c3.15 0 5.503-1.11 6.967-3.817h.222v3.417h8.121V33.35c0-4.438-4.26-7.943-11.183-7.943-7.233 0-10.783 3.816-11.094 8.21h8.032c.178-1.51 1.287-2.22 2.973-2.22 1.51 0 2.574.71 2.574 1.953v.089c0 1.376-1.553 1.82-5.636 2.13-4.97.355-8.875 2.396-8.875 7.677 0 4.837 3.24 7.1 7.9 7.1zm2.84-5.503c-1.509 0-2.53-.71-2.53-2.086 0-1.242.888-2.219 2.885-2.53 1.376-.221 2.574-.488 3.462-.887v2.041c0 2.22-1.864 3.462-3.817 3.462zm16.641 5.103h8.698V37.343c0-2.796 1.908-4.615 4.482-4.615.888 0 2.308.133 3.195.444V25.76a7.486 7.486 0 0 0-2.219-.355c-2.574 0-4.57 1.553-5.458 4.926h-.266V25.76h-8.432v24.185zm29.417.444c6.7 0 11.05-3.195 11.849-8.254h-7.944c-.488 1.376-1.952 2.13-3.728 2.13-2.573 0-4.082-1.686-4.082-4.038v-.355h15.754V37.83c0-7.677-4.704-12.425-12.027-12.425-7.5 0-12.292 5.014-12.292 12.514 0 7.81 4.704 12.47 12.47 12.47zm-3.905-15.31c.044-2.086 1.775-3.55 3.905-3.55 2.174 0 3.816 1.464 3.86 3.55zm35.893 14.866h8.743V37.343h12.558v-7.056h-12.558V24.74h13.934v-7.056h-22.677v32.262zm35.859.444c6.7 0 11.05-3.195 11.848-8.254h-7.944c-.488 1.376-1.952 2.13-3.727 2.13-2.574 0-4.083-1.686-4.083-4.038v-.355h15.754V37.83c0-7.677-4.704-12.425-12.026-12.425-7.5 0-12.293 5.014-12.293 12.514 0 7.81 4.704 12.47 12.47 12.47zm-3.906-15.31c.044-2.086 1.775-3.55 3.905-3.55 2.175 0 3.817 1.464 3.861 3.55zm28.042 15.177c3.417 0 5.725-1.82 6.746-4.26h.177v3.95h8.654V17.683h-8.698v12.293h-.133c-.932-2.486-3.196-4.571-6.79-4.571-4.793 0-9.452 3.683-9.452 12.425 0 8.388 4.349 12.426 9.496 12.426zm3.24-6.657c-2.397 0-3.817-2.174-3.817-5.769s1.42-5.724 3.817-5.724 3.816 2.13 3.816 5.724c0 3.55-1.42 5.77-3.816 5.77zm16.638 6.346h8.698V25.761h-8.698zm4.349-26.715c2.352 0 4.26-1.775 4.26-3.994 0-2.174-1.908-3.95-4.26-3.95-2.397 0-4.305 1.776-4.305 3.95 0 2.22 1.908 3.994 4.305 3.994z"/><path fill="#fff" d="M140.44 64.724h14.463v-4.088h-7.374v-.104l1.785-1.475c4.27-3.57 5.382-5.433 5.382-7.606 0-3.493-2.872-5.795-7.4-5.795-4.372 0-7.218 2.432-7.218 6.39h4.864c-.026-1.578.957-2.458 2.354-2.458 1.423 0 2.406.88 2.406 2.303 0 1.345-.853 2.199-2.225 3.363l-7.037 5.796v3.674z"/></svg>

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

93
src/index.html Normal file
View File

@ -0,0 +1,93 @@
<!--
@source: https://codeberg.org/kytta/toot/src/branch/main/src/index.html
share2fedi - Instance-agnostic share page for the Fediverse.
Copyright (c) 2020-2022 Nikita Karamov <me@kytta.dev>
SPDX-License-Identifier: ISC
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Share₂Fedi, the instance-agnostic share page for Mastodon.</title>
<meta
name="description"
content="Share₂Fedi allows you to share stuff on Mastodon, no matter the instance. Just type in your post text, select the instance URL, and click &lsquo;Post!&rsquo;"
/>
<link rel="canonical" href="https://toot.kytta.dev/" />
<link href="./scss/style.scss" rel="stylesheet" />
<link href="./icons/favicon.ico" rel="icon" type="image/x-icon" />
<link href="./icons/apple-touch-icon.png" rel="icon" type="image/svg+xml" />
<link href="./icons/apple-touch-icon.png" rel="apple-touch-icon" />
<link href="./site.webmanifest" rel="manifest" />
<meta name="theme-color" content="#3088d4" />
</head>
<body>
<header>
<h1>
<img
src="./images/share2fedi.svg"
alt="Share2Fedi"
title="Share₂Fedi"
width="260"
height="80"
/>
</h1>
</header>
<main>
<form action="/api/toot" method="POST">
<section>
<label for="text">Post text</label>
<textarea
name="text"
id="text"
rows="6"
placeholder="What's on your mind?"
required
></textarea>
</section>
<section>
<datalist id="instanceDatalist"></datalist>
<label for="instance">Choose your Mastodon instance</label>
<input
type="url"
name="instance"
id="instance"
placeholder="https://"
list="instanceDatalist"
required
/>
</section>
<section class="remember">
<input type="checkbox" id="remember" name="remember" />
<label for="remember">Remember my instance on this device</label>
</section>
<section class="submit">
<input type="submit" value="Post!" />
</section>
</form>
</main>
<footer>
<section>
<a href="https://joinmastodon.org/">What is Mastodon?</a>
</section>
<section>
<a href="https://codeberg.org/kytta/toot">Share₂Fedi on Codeberg</a>
</section>
<script
data-goatcounter="https://share2fedi.goatcounter.com/count"
async
src="//gc.zgo.at/count.js"
></script>
<noscript>
<img src="https://share2fedi.goatcounter.com/count?p=/" />
</noscript>
</footer>
<script src="./main.js"></script>
</body>
</html>

View File

@ -1,154 +0,0 @@
---
/*!
* This file is part of Share₂Fedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import "@styles/main.scss";
import LanguageSelect from "@components/language-select.astro";
import Licence from "@components/licence.html";
import Privacy from "@components/privacy.html";
import package_ from "../../package.json";
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<meta
name="robots"
content="noindex,nofollow"
/>
<title>Share₂Fedi</title>
<meta
name="description"
content="Share₂Fedi is a share page for Mastodon, Misskey, Friendica, and others. Type in your post text and the instance URL and click Publish!"
data-translate="metaDescription"
data-translate-attribute="content"
/>
<link
rel="canonical"
href={Astro.url}
/>
<meta
property="og:title"
content="Share₂Fedi, a share page for the Fediverse"
/>
<meta
property="og:type"
content="website"
/>
<meta
property="og:image"
content="/banner.png"
/>
<meta
property="og:url"
content={`${Astro.url}banner.png`}
/>
<link
rel="icon"
href="/favicon.ico"
sizes="32x32"
/>
<link
rel="icon"
href="/icon.svg"
type="image/svg+xml"
/>
<link
rel="apple-touch-icon"
href="/apple-touch-icon.png"
/>
<link
rel="manifest"
href="/site.webmanifest"
/>
<meta
name="generator"
content={Astro.generator}
/>
<meta
itemprop="version"
content={package_.version}
/>
</head>
<header>
<img
src="/logo.svg"
alt="Share2Fedi"
width="195"
height="60"
/>
<LanguageSelect />
</header>
<body>
<main>
<slot />
</main>
<aside>
<p data-translate="description">
Share₂Fedi is an instance-agnostic share page for
<a
href="https://en.wikipedia.org/wiki/Fediverse"
data-translate="fediverse"
>the Fediverse</a
>. With it, you can post to various federated platforms from a single
page.
</p>
<p><b data-translate="supportedProjects">Supported projects:</b></p>
<ul>
<li>
Mastodon (<span data-translate="incl">incl.</span>&#x0020;<span
data-enumerate="Hometown,Fedibird,GlitchCafé"
>Hometown, Fedibird, GlitchCafé</span
>)
</li>
<li>
Misskey (<span data-translate="incl">incl.</span>&#x0020;<span
data-enumerate="Firefish,Calckey,FoundKey,Meisskey"
>Firefish, Calckey, FoundKey, Meisskey</span
>)
</li>
<li>Friendica</li>
<li>Hubzilla</li>
<li>GNU Social</li>
</ul>
<p data-translate="credits">
Share₂Fedi is developed and maintained by
<a
href="https://www.kytta.dev/"
data-translate="nikita"
>Nikita Karamov</a
>. Source code is
<a
href="https://github.com/kytta/share2fedi"
data-translate="onGitHub"
>on GitHub</a
>. Hosted with
<a href="https://vercel.com">Vercel</a>.
<a
href="https://stats.uptimerobot.com/QOXj3uXPDX"
data-translate="statusPage"
>Status page</a
>.
</p>
<Licence />
<Privacy />
</aside>
</body>
</html>

View File

@ -1,59 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { supportedProjects } from "./project";
interface Instance {
domain: string;
score: number;
active_users_monthly: number;
total_users: number;
}
const getInstancesForProject = async (
project: keyof typeof supportedProjects,
): Promise<Instance[]> => {
let instances: Instance[];
try {
const response = await fetch("https://api.fediverse.observer/", {
headers: {
Accept: "*/*",
"Accept-Language": "en;q=1.0",
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `{nodes(status:"UP",softwarename:"${project}"){domain score active_users_monthly total_users}}`,
}),
method: "POST",
});
const json = await response.json();
instances = json.data.nodes;
} catch (error) {
console.error(`Could not fetch instances for "${project}"`, error);
return [];
}
return instances.filter(
(instance) =>
instance.score > 90 &&
// sanity check for some spammy-looking instances
instance.total_users >= instance.active_users_monthly,
);
};
export const getPopularInstanceDomains = async (): Promise<string[]> => {
const instancesPerProject = await Promise.all(
Object.keys(supportedProjects).map((project) =>
getInstancesForProject(project),
),
);
const instances = instancesPerProject.flat();
instances.sort((a, b) => b.active_users_monthly - a.active_users_monthly);
return instances.slice(0, 200).map((instance) => instance.domain);
};

View File

@ -1,60 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { normalizeURL } from "@lib/url";
interface NodeInfoList {
links: {
rel: string;
href: string;
}[];
}
interface NodeInfo {
software: {
name: string;
version: string;
[key: string]: unknown;
};
[key: string]: unknown;
}
export const getSoftwareName = async (
domain: string,
): Promise<string | undefined> => {
const nodeInfoListUrl = new URL(
"/.well-known/nodeinfo",
normalizeURL(domain),
);
let nodeInfoList: NodeInfoList;
try {
const nodeInfoListResponse = await fetch(nodeInfoListUrl);
nodeInfoList = await nodeInfoListResponse.json();
} catch (error) {
console.error("Could not fetch '.well-known/nodeinfo':", error);
return undefined;
}
for (const link of nodeInfoList.links) {
if (
/^http:\/\/nodeinfo\.diaspora\.software\/ns\/schema\/(1\.0|1\.1|2\.0|2\.1)/.test(
link.rel,
)
) {
const nodeInfoResponse = await fetch(link.href);
const nodeInfo = (await nodeInfoResponse.json()) as NodeInfo;
return nodeInfo.software.name;
}
}
// not found
console.warn("No NodeInfo found for domain:", domain);
return undefined;
};

View File

@ -1,64 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
export interface ProjectPublishConfig {
endpoint: string;
params: {
text: string;
};
}
const mastodonConfig: ProjectPublishConfig = {
endpoint: "share",
params: {
text: "text",
},
};
const misskeyConfig: ProjectPublishConfig = {
endpoint: "share",
params: {
text: "text",
},
};
/**
* Mapping of the supported fediverse projects.
*
* The keys of this mapping can be used as keys for the fediverse.observer API,
* icon names, etc.
*/
export const supportedProjects: Record<string, ProjectPublishConfig> = {
calckey: misskeyConfig,
fedibird: mastodonConfig,
firefish: misskeyConfig,
foundkey: misskeyConfig,
friendica: {
endpoint: "compose",
params: {
text: "body",
},
},
glitchcafe: mastodonConfig,
gnusocial: {
endpoint: "notice/new",
params: {
text: "status_textarea",
},
},
hometown: mastodonConfig,
hubzilla: {
endpoint: "rpost",
params: {
text: "body",
},
},
mastodon: mastodonConfig,
meisskey: misskeyConfig,
misskey: misskeyConfig,
};

View File

@ -1,30 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
export const json = (
body: unknown,
status: number = 200,
headers: Record<string, string> = {},
) => {
return new Response(JSON.stringify(body), {
headers: {
"Content-Type": "application/json",
...headers,
},
status,
});
};
export const error = (message: string, status: number = 400) => {
return json(
{
error: message,
},
status,
);
};

View File

@ -1,35 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
/**
* Adds missing "https://" and ending slash to the URL
*
* @param url URL to normalize
* @return normalized URL
*/
export const normalizeURL = (url: string): string => {
if (!(url.startsWith("https://") || url.startsWith("http://"))) {
url = "https://" + url;
}
if (!url.endsWith("/")) {
url += "/";
}
return url;
};
export const getUrlDomain = (url: string | URL): string => {
if (typeof url === "string") {
url = url.trim();
if (!/^https?:\/\//.test(url)) {
url = `https://${url}`;
}
}
return new URL(url).host;
};

1
src/logo.svg Normal file
View File

@ -0,0 +1 @@
<svg viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M473.266 301.162c-6.855 35.271-61.403 73.871-124.051 81.352-32.669 3.898-64.833 7.48-99.131 5.908-56.092-2.57-100.352-13.389-100.352-13.389 0 5.46.337 10.66 1.01 15.522 7.293 55.356 54.89 58.672 99.977 60.218 45.508 1.558 86.028-11.22 86.028-11.22l1.87 41.141s-31.83 17.093-88.533 20.236c-31.268 1.719-70.092-.786-115.31-12.755C36.7 462.217 19.833 357.677 17.253 251.604c-.786-31.494-.302-61.191-.302-86.028C16.952 57.11 88.02 25.318 88.02 25.318c35.834-16.457 97.32-23.378 161.243-23.9h1.57c63.923.522 125.45 7.443 161.281 23.9 0 0 71.064 31.792 71.064 140.258 0 0 .892 80.026-9.91 135.586" fill="#3088d4" fill-rule="nonzero"/><g fill="#fff"><path d="M476.925 278.214c-4.531 1.19-9.3 1.72-14.272 1.72-15.137 0-26.834-3.956-35.088-11.868-8.256-7.915-12.386-19.439-12.386-34.576v-66.309h-22.704V141.38h22.704v-31.477h32.253v31.477h34.342c.961 7.6 1.403 15.66 1.403 24.197l-.003 1.605h-35.742v65.536c0 6.708 1.633 11.826 4.9 15.352 3.27 3.527 7.999 5.288 14.192 5.288 5.035 0 9.482-.918 13.318-2.817l-.471 5.996-2.446 21.678z"/><path d="M326.94 279.935c-13.933 0-26.492-3.012-37.672-9.033-11.182-6.02-19.91-14.404-26.19-25.155-6.276-10.75-9.417-22.922-9.417-36.51 0-13.587 3.141-25.715 9.418-36.38 6.28-10.665 15.007-19.008 26.19-25.026 11.179-6.02 23.738-9.032 37.67-9.032 14.105 0 26.747 3.011 37.927 9.032 11.182 6.018 19.91 14.361 26.19 25.026 6.276 10.665 9.417 22.793 9.417 36.38 0 13.588-3.14 25.76-9.418 36.51-6.279 10.751-15.007 19.135-26.19 25.155-11.179 6.021-23.82 9.033-37.926 9.033zm0-27.61c11.866 0 21.671-3.954 29.41-11.868 7.743-7.912 11.614-18.319 11.614-31.22 0-12.9-3.871-23.307-11.613-31.219-7.74-7.911-17.545-11.869-29.412-11.869-11.869 0-21.631 3.958-29.285 11.87-7.656 7.911-11.48 18.318-11.48 31.219 0 12.9 3.824 23.307 11.48 31.219 7.654 7.914 17.416 11.869 29.285 11.869z" fill-rule="nonzero"/><path d="M181.159 279.935c-13.933 0-26.489-3.012-37.668-9.033-11.182-6.02-19.91-14.404-26.19-25.155-6.28-10.75-9.418-22.922-9.418-36.51 0-13.587 3.139-25.715 9.418-36.38 6.28-10.665 15.008-19.008 26.19-25.026 11.18-6.02 23.735-9.032 37.668-9.032 14.105 0 26.747 3.011 37.93 9.032 11.179 6.018 19.91 14.361 26.189 25.026 6.276 10.665 9.415 22.793 9.415 36.38 0 13.588-3.139 25.76-9.415 36.51-6.28 10.751-15.01 19.135-26.19 25.155-11.182 6.021-23.824 9.033-37.93 9.033zm0-27.61c11.869 0 21.674-3.954 29.414-11.868 7.742-7.912 11.61-18.319 11.61-31.22 0-12.9-3.868-23.307-11.61-31.219-7.74-7.911-17.545-11.869-29.414-11.869-11.867 0-21.63 3.958-29.285 11.87-7.653 7.911-11.481 18.318-11.481 31.219 0 12.9 3.828 23.307 11.48 31.219 7.657 7.914 17.42 11.869 29.286 11.869z" fill-rule="nonzero"/><path d="M18.353 141.38h21.158v-31.478h32.25v31.477h36.896v25.802H71.762v65.536c0 6.708 1.635 11.826 4.902 15.352 3.268 3.527 7.998 5.288 14.192 5.288 7.222 0 13.243-1.89 18.06-5.676l9.029 22.963c-3.782 3.098-8.383 5.42-13.803 6.969-5.418 1.546-11.137 2.322-17.158 2.322-15.136 0-26.833-3.957-35.09-11.87-8.256-7.914-12.383-19.438-12.383-34.575v-66.309H16.947l.005-1.605c0-8.537.44-16.597 1.401-24.197z"/></g></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

100
src/main.js Normal file
View File

@ -0,0 +1,100 @@
/*!
* @source: https://codeberg.org/kytta/toot/src/branch/main/src/main.js
*
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* share2fedi - Instance-agnostic share page for the Fediverse.
* Copyright (c) 2020-2022 Nikita Karamov <me@kytta.dev>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* @licend The above is the entire license notice
* for the JavaScript code in this page.
*
* SPDX-License-Identifier: ISC
*/
const INSTANCE_LIST_URL = "https://api.joinmastodon.org/servers";
const $instance = document.getElementById("instance");
const $instanceDatalist = document.getElementById("instanceDatalist");
/**
* Adds missing "https://" and ending slash to the URL
*
* @param {string} url URL to normalize
* @return {string} normalized URL
*/
function normalizeUrl(url) {
if (url.indexOf("http://") == -1 && url.indexOf("https://") == -1) {
url = "https://" + url;
}
if (url.charAt(url.length - 1) !== "/") {
url = url + "/";
}
return url;
}
function onLoadInstancesError() {
console.error("Couldn't load instance list");
}
function onLoadInstancesSuccess() {
if (this.status >= 400) {
return onLoadInstancesError();
}
const currentInstance = $instance.value;
const instanceDomains = JSON.parse(this.responseText).map((i) => i.domain);
if (currentInstance && instanceDomains.indexOf(currentInstance) < 0) {
instanceDomains.push(currentInstance);
}
instanceDomains.sort();
for (let i = 0; i < instanceDomains.length; i++) {
const $option = document.createElement("option");
$option.value = normalizeUrl(instanceDomains[i]);
$instanceDatalist.appendChild($option);
}
}
function loadInstances() {
if ($instanceDatalist.children.length === 0) {
const request = new XMLHttpRequest();
request.addEventListener("load", onLoadInstancesSuccess);
request.addEventListener("error", onLoadInstancesError);
request.open("GET", INSTANCE_LIST_URL);
request.send();
}
}
const prefillInstance = window.localStorage.getItem("mastodon_instance");
const URLParams = window.location.search.substr(1).split("&");
for (let i = 0; i < URLParams.length; i++) {
const URLParamPair = URLParams[i].split("=");
if (URLParamPair[0] === "text") {
document.getElementById("text").value = decodeURIComponent(URLParamPair[1]);
} else if (URLParamPair[0] === "instance") {
prefillInstance = decodeURIComponent(URLParamPair[1]);
}
}
if (prefillInstance != null) {
$instance.value = normalizeUrl(prefillInstance);
}
$instance.addEventListener("focus", loadInstances);

View File

@ -1,43 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { getSoftwareName } from "@lib/nodeinfo";
import { type ProjectPublishConfig, supportedProjects } from "@lib/project";
import { error, json } from "@lib/response";
import type { APIRoute } from "astro";
export type Detection = {
domain: string;
project: keyof typeof supportedProjects;
} & ProjectPublishConfig;
export const GET: APIRoute = async ({ params }) => {
const domain = params.domain as string;
const softwareName = await getSoftwareName(domain);
if (softwareName === undefined) {
return error("Could not detect Fediverse project.");
}
if (!(softwareName in supportedProjects)) {
return error(`Fediverse project "${softwareName}" is not supported yet.`);
}
const publishConfig = supportedProjects[softwareName] as ProjectPublishConfig;
return json(
{
domain,
project: softwareName,
...publishConfig,
},
200,
{
"Cache-Control": "public, s-maxage=86400, max-age=604800",
},
);
};

View File

@ -1,22 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { APIRoute } from "astro";
import { getPopularInstanceDomains } from "@lib/instance";
import { json } from "@lib/response";
export const GET: APIRoute = async () => {
const popularInstanceDomains = await getPopularInstanceDomains();
return json(popularInstanceDomains, 200, {
"Cache-Control":
popularInstanceDomains.length > 0
? "public, s-maxage=86400, max-age=604800"
: "public, s-maxage=60, max-age=3600",
});
};

View File

@ -1,104 +0,0 @@
---
/*!
* This file is part of Share₂Fedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import Layout from "@layouts/layout.astro";
import InstanceSelect from "@components/instance-select.astro";
import { getUrlDomain } from "@lib/url";
import type { Detection } from "./api/detect/[domain]";
const searchParameters = new URL(Astro.request.url).searchParams;
let text: string | null = searchParameters.get("text");
let instance: string | null = searchParameters.get("instance");
const errors = { text: "", instance: "" };
if (Astro.request.method === "POST") {
const formData = await Astro.request.formData();
text = formData.get("text") as string | null;
instance = formData.get("instance") as string | null;
if (typeof text !== "string" || text.length === 0) {
errors.text += "Please enter post text. ";
}
let detection: Detection | undefined;
if (typeof instance !== "string" || instance.length === 0) {
errors.instance += "Please enter instance domain. ";
} else {
instance = getUrlDomain(instance);
const detectResponse = await fetch(
new URL(`/api/detect/${instance}`, Astro.url),
);
const detectJson = await detectResponse.json();
if (detectJson.error) {
errors.instance += detectJson.error + " ";
} else {
detection = detectJson;
}
}
const hasErrors = Object.values(errors).some(Boolean);
if (!hasErrors && detection !== undefined) {
const { domain, endpoint, params } = detection;
const publishUrl = new URL(endpoint, `https://${domain}/`);
publishUrl.search = new URLSearchParams([
[params.text, text as string],
]).toString();
// eslint-disable-next-line unicorn/prefer-module
return Astro.redirect(publishUrl.toString(), 303);
}
}
---
<Layout>
<form
id="form"
method="POST"
>
<label>
<span data-translate="postText">Post text</span>
<textarea
name="text"
id="text"
rows="7"
placeholder="Whats on your mind?"
required
aria-invalid={Boolean(errors.text)}
aria-errormessage={errors.text ? "text-error" : undefined}
data-translate="postTextPlaceholder"
data-translate-attribute="placeholder"
>{text}</textarea
>
{
errors.text && (
<p
class="error"
id="text-error"
aria-live="assertive"
>
{errors.text}
</p>
)
}
</label>
<InstanceSelect
{instance}
errors={errors.instance}
/>
<input
type="submit"
value="Publish"
class="mt1r"
data-translate="publish"
data-translate-attribute="value"
/>
</form>
</Layout>

View File

@ -1,2 +1,2 @@
User-agent: *
Disallow: /
Allow: /

25
src/scss/_fonts.scss Normal file
View File

@ -0,0 +1,25 @@
/*
* @source: https://codeberg.org/kytta/toot/src/branch/main/src/scss/_fonts.scss
*
* share2fedi - Instance-agnostic share page for the Fediverse.
* Copyright (c) 2020-2022 Nikita Karamov <me@kytta.dev>
*
* SPDX-License-Identifier: ISC
*/
@font-face {
font-family: "Roboto";
font-style: normal;
font-weight: 400;
src: local("Roboto"), url("../fonts/Roboto-400.woff2?v=29") format("woff2"),
url("../fonts/Roboto-400.woff?v=29") format("woff");
}
@font-face {
font-family: "Roboto";
font-style: normal;
font-weight: 500;
src: local("Roboto Medium"), local("Roboto-Medium"),
url("../fonts/Roboto-500.woff2?v=29") format("woff2"),
url("../fonts/Roboto-500.woff?v=29") format("woff");
}

28
src/scss/_variables.scss Normal file
View File

@ -0,0 +1,28 @@
/*
* @source: https://codeberg.org/kytta/toot/src/branch/main/src/scss/_variables.scss
*
* share2fedi - Instance-agnostic share page for the Fediverse.
* Copyright (c) 2020-2022 Nikita Karamov <me@kytta.dev>
*
* SPDX-License-Identifier: ISC
*/
$text-font: "Roboto", sans-serif;
$font-family-sans: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue",
"Segoe UI", Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
$color-bg-light: #fff;
$color-bg-dark: #000;
$color-text-light: #000;
$color-text-dark: #fff;
$color-border: #80808060;
$color-textarea-bg-light: #eee;
$color-textarea-bg-dark: #111;
$color-textarea-border-light: #80808060;
$color-textarea-border-dark: #80808060;
$color-accent: oklch(63.16% 0.202 142.93);
$color-accent-rgb: rgb(26.86, 165.96, 30.56);
$color-accent-lighter: oklch(68.16% 0.202 142.93);

174
src/scss/style.scss Normal file
View File

@ -0,0 +1,174 @@
/*!
* @source: https://codeberg.org/kytta/toot/src/branch/main/src/scss/style.scss
*
* share2fedi - Instance-agnostic share page for the Fediverse.
* Copyright (c) 2020-2022 Nikita Karamov <me@kytta.dev>
*
* SPDX-License-Identifier: ISC
*/
@use "sass:color";
@import "fonts";
@import "variables";
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
background-color: $color-bg-light;
color: $color-text-light;
font-family: $font-family-sans;
font-size: 16px;
font-weight: 400;
line-height: 1;
height: 100%;
width: 100%;
}
body {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
header {
padding: 1.5rem 0;
margin-bottom: 1.5rem;
text-align: center;
width: 100%;
h1 {
display: inline-block;
margin: 0 1rem 0 0;
vertical-align: middle;
}
}
main {
width: 100%;
max-width: 600px;
margin: 0 auto auto;
padding: 0 0.75rem;
form {
section {
margin-bottom: 1rem;
&.remember,
&.submit {
text-align: center;
}
&.submit {
margin-top: 2rem;
}
}
label {
font-size: 14px;
margin-bottom: 8px;
display: inline-block;
}
textarea,
input {
font-size: 1rem;
border-radius: 4px;
&[type="checkbox"] {
margin-right: 8px;
accent-color: $color-accent-rgb;
}
&[type="submit"] {
display: inline-block;
text-align: center;
background-color: $color-accent;
color: $color-text-dark;
font-weight: 500;
font-family: inherit;
height: 2.5rem;
padding: 0 1rem;
line-height: 36px;
border: 0;
cursor: pointer;
&:hover {
background-color: $color-accent-lighter;
}
}
transition: background-color 300ms ease, border 300ms ease;
}
textarea,
input[type="url"] {
color: inherit;
width: 100%;
outline: 0;
font-family: inherit;
resize: vertical;
background-color: $color-textarea-bg-light;
border: 1px solid $color-textarea-border-light;
padding: 10px;
&:focus,
&:active {
border: 1px solid $color-accent;
}
&::placeholder {
color: inherit;
opacity: 0.3;
}
}
}
}
footer {
border-top: 1px solid $color-border;
padding: 1rem 0;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
flex-wrap: wrap;
section {
margin: 0.5rem 1rem;
a {
color: inherit;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
}
@media (prefers-color-scheme: dark) {
html,
body {
background-color: $color-bg-dark;
color: $color-text-dark;
}
main {
form {
textarea,
input[type="url"] {
background-color: $color-textarea-bg-dark;
border: 1px solid $color-textarea-border-dark;
}
}
}
}

View File

@ -1,19 +1,17 @@
{
"name": "Share₂Fedi",
"short_name": "Share₂Fedi",
"background_color": "#000",
"display": "standalone",
"icons": [
{
"src": "/icon-192.png",
"src": "./icons/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icon-512.png",
"src": "./icons/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#40665c"
"theme_color": "#3088d4"
}

View File

@ -1,11 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { persistentAtom } from "@nanostores/persistent";
export const $locale = persistentAtom<string | undefined>("locale");

View File

@ -1,46 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { persistentAtom } from "@nanostores/persistent";
import { onMount, task } from "nanostores";
const UPDATE_INTERVAL_MS = 1000 * 60 * 60 * 24; // one day
export const $popularInstances = persistentAtom<string[]>(
"popularInstances",
[],
{
encode: JSON.stringify,
decode: JSON.parse,
},
);
export const $lastFetched = persistentAtom<Date>(
"popularInstancesLastFetched",
new Date(0),
{
encode: (date) => date.toISOString(),
decode: (encoded) => new Date(encoded),
},
);
onMount($popularInstances, () => {
task(async () => {
if (Date.now() - $lastFetched.get().getTime() < UPDATE_INTERVAL_MS) {
return;
}
try {
const response = await fetch("/api/instances");
$popularInstances.set(await response.json());
$lastFetched.set(new Date());
} catch (error) {
console.error("Could not fetch popular instances:", error);
}
});
});

View File

@ -1,48 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { persistentAtom } from "@nanostores/persistent";
import { getUrlDomain } from "@lib/url";
import { action, onMount } from "nanostores";
const OLD_LOCAL_STORAGE_KEY = "recentInstances";
const LOCAL_STORAGE_KEY = "savedInstances";
const CAPACITY = 5;
export const $savedInstances = persistentAtom<Set<string>>(
LOCAL_STORAGE_KEY,
new Set(),
{
encode: (set) => JSON.stringify([...set]),
decode: (value) => new Set(JSON.parse(value)),
},
);
onMount($savedInstances, () => {
// XXX: The conversion to a domain need to be done to support legacy
// users, who may have full URLs in their Storage
const oldItem = localStorage.getItem(OLD_LOCAL_STORAGE_KEY);
if (!oldItem) {
return;
}
$savedInstances.set(
new Set(
JSON.parse(oldItem).map((instanceUrl: string) =>
getUrlDomain(instanceUrl),
),
),
);
localStorage.removeItem(OLD_LOCAL_STORAGE_KEY);
});
export const save = action($savedInstances, "save", (store, instance) => {
store.set(
new Set([getUrlDomain(instance), ...store.get()].slice(0, CAPACITY)),
);
});

View File

@ -1,184 +0,0 @@
/*!
* This file is part of ShareFedi
* https://github.com/kytta/share2fedi
*
* SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
* SPDX-License-Identifier: AGPL-3.0-only
*/
@use "sass:math";
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
--s2f-accent-color: #40665c;
--s2f-accent-color-light: #5d8379;
--s2f-accent-color-contrast: #005e4e;
--s2f-error-color: #a12f2d;
--s2f-border-color: #ccc;
--s2f-border-width: 1px;
--s2f-input-group-bg-color: #eee;
--s2f-input-bg-color: #fff;
--s2f-input-text-color: #000;
--s2f-button-text-color: #fff;
color-scheme: light dark;
accent-color: var(--s2f-accent-color);
font-family: "Helvetica Neue", Helvetica, FreeSans, "Nimbus Sans L", Inter,
Arial, system-ui, sans-serif;
font-size: 16px;
}
html {
line-height: 1.5;
}
body {
max-width: 60em;
margin-block: 0;
margin-inline: auto;
display: flex;
flex-flow: row wrap;
> * {
flex-shrink: 0;
width: 100%;
max-width: 100%;
}
}
header {
padding: 1rem;
display: flex;
align-items: center;
justify-content: space-between;
}
main {
margin-block-end: 2rem;
}
main,
aside {
padding-block: 0;
padding-inline: 1rem;
}
hr {
height: 0;
color: inherit;
border-color: var(--s2f-border-color);
border-width: 0.5px;
}
details {
font-size: smaller;
}
summary {
font-weight: bolder;
}
a {
color: var(--s2f-accent-color-contrast);
}
b,
strong {
font-weight: bolder;
}
label {
display: block;
}
input,
textarea {
font-family: inherit;
font-size: 100%;
line-height: 1.15;
margin: 0;
padding: 0.5rem;
border-radius: 4px;
}
textarea {
resize: vertical;
resize: block;
}
input[type="text"],
textarea {
width: 100%;
color: var(--s2f-input-text-color);
background-color: var(--s2f-input-bg-color);
border: var(--s2f-border-width) solid var(--s2f-border-color);
}
input[type="checkbox"],
input[type="radio"] {
vertical-align: middle;
}
input[type="submit"] {
background-color: var(--s2f-accent-color);
color: var(--s2f-button-text-color);
font-weight: bolder;
height: 2.5rem;
padding-block: 0.5rem;
padding-inline: 1.5rem;
border: 0;
cursor: pointer;
appearance: button;
&:hover {
background-color: var(--s2f-accent-color-light);
}
}
@media (prefers-color-scheme: dark) {
:root {
--s2f-accent-color: #43776a;
--s2f-accent-color-light: #619587;
--s2f-accent-color-contrast: #a8f7e2;
--s2f-border-color: #333;
--s2f-input-group-bg-color: #111;
}
}
@media screen and (width >= 768px) {
main,
aside {
flex: 0 0 auto;
}
main {
width: math.div(200%, 3);
}
aside {
width: math.div(100%, 3);
}
}
[aria-invalid="true"],
[aria-errormessage] {
--s2f-input-text-color: var(--s2f-error-color);
--s2f-border-color: var(--s2f-error-color);
accent-color: var(--s2f-error-color);
}
p.error {
color: var(--s2f-error-color);
margin-block: 0 1rem;
margin-inline: 0;
}
.mt1r {
margin-block-start: 1rem !important;
}

View File

@ -1,22 +0,0 @@
// This TypeScript config is part of ShareFedi
// https://github.com/kytta/share2fedi
//
// SPDX-FileCopyrightText: © 2023 Nikita Karamov <me@kytta.dev>
// SPDX-License-Identifier: CC0-1.0
{
"extends": "astro/tsconfigs/strictest",
"compilerOptions": {
"ignoreDeprecations": "5.0",
"baseUrl": ".",
"resolveJsonModule": true,
"paths": {
"@components/*": ["src/components/*"],
"@i18n/*": ["src/i18n/*"],
"@layouts/*": ["src/layouts/*"],
"@pages/*": ["src/pages/*"],
"@lib/*": ["src/lib/*"],
"@stores/*": ["src/stores/*"],
"@styles/*": ["src/styles/*"]
}
}
}

View File

@ -1,7 +0,0 @@
{
"framework": "astro",
"installCommand": "pnpm install",
"buildCommand": "pnpm run build",
"outputDirectory": "dist",
"devCommand": "pnpm run dev"
}