Go to file
Rikudou_Sage 655cfc6c0f
Feat: Configure delay for redirect (#4)
2024-01-02 16:58:28 +01:00
.github/workflows Fix wrong name of field 2023-07-22 02:10:10 +02:00
assets Feat: Configure delay for redirect (#4) 2024-01-02 16:58:28 +01:00
bin Initial commit 2023-07-21 22:27:51 +02:00
config Feat: Configure delay for redirect (#4) 2024-01-02 16:58:28 +01:00
doc/assets Add README 2023-07-21 23:36:10 +02:00
php/conf.d Add deploy and instructions 2023-07-22 01:57:23 +02:00
public Add initial set of files 2023-07-21 18:31:22 +02:00
src Feat: Configure delay for redirect (#4) 2024-01-02 16:58:28 +01:00
templates Feat: Configure delay for redirect (#4) 2024-01-02 16:58:28 +01:00
tests Add support for redirecting users 2023-10-24 20:14:33 +02:00
translations Feat: Configure delay for redirect (#4) 2024-01-02 16:58:28 +01:00
.env Add deploy and instructions 2023-07-22 01:57:23 +02:00
.env.test Initial commit 2023-07-21 22:27:51 +02:00
.gitignore Add deploy and instructions 2023-07-22 01:57:23 +02:00
.php-cs-fixer.dist.php Initial commit 2023-07-21 22:27:51 +02:00
LICENSE Add license 2023-07-22 08:57:02 +02:00
README.md Add deploy and instructions 2023-07-22 01:57:23 +02:00
composer.json Fix stuff broken by Lemmy devs in 0.19 2023-12-19 21:05:59 +01:00
composer.lock Fix stuff broken by Lemmy devs in 0.19 2023-12-19 21:05:59 +01:00
package.json Add a form to create a link 2023-07-22 09:41:52 +02:00
phpstan.neon.dist Initial commit 2023-07-21 22:27:51 +02:00
phpunit.xml.dist Initial commit 2023-07-21 22:27:51 +02:00
serverless.yml Fix resource name 2023-07-22 13:56:05 +02:00
shell.nix Feat: Configure delay for redirect (#4) 2024-01-02 16:58:28 +01:00
symfony.lock Add deploy and instructions 2023-07-22 01:57:23 +02:00
webpack.config.js Add deploy and instructions 2023-07-22 01:57:23 +02:00
yarn.lock Add a form to create a link 2023-07-22 09:41:52 +02:00

README.md

Coverage Status Tests

Lemmyverse.link

This is a redirect service for linking to Lemmy communities throughout the internet. When you're on Lemmy, universal links work (either in the form of relative link or the !community_name@instance.tld form).

But when linking to a Lemmy community from outside Lemmy, you face the problem of forcing the user to go to the instance you linked to instead of their own.

Using this project you can create a link like this: https://lemmyverse.link/c/community_name@instance.tld, the user will be given the option to set their home instance and every further link to lemmyverse.link will work as usual.

Preview of a screen for setting instance to redirect

Preview of a screen with redirect to target instance

Available domains

This project is currently hosted on:

  • lemmyverse.link
  • threadiverse.link

Translating

If you'd like to translate this project to your language, run the following command:

./bin/console translation:extract --force --format yaml [language]

Replace [language] with your two-letter country code, for example for German it would be:

./bin/console translation:extract --force --format yaml de

Edit the file translations/messages+intl-icu.[language].yaml

Deploying

If you want to deploy this project using serverless, follow these steps:

  • export DOMAIN_NAME=lemmyverse.link (replace lemmyverse.link with your domain)
  • export AWS_REGION=eu-central-1
  • rm -rf ./var/{cache,log} public/build
  • APP_ENV=prod composer install --no-dev --no-scripts
  • yarn install
  • yarn build
  • ./bin/console cache:warmup --env=prod
  • export DOMAIN_ZONE=XXX (replace XXX with your AWS domain zone id)
  • export DOMAIN_ID=Lemmyverse (replace Lemmyverse with any identifier for your domain)
  • serverless deploy --stage prod --verbose --region $AWS_REGION
  • export ASSETS_BUCKET=$(aws cloudformation describe-stacks --stack-name LemmyverseLink-$DOMAIN_ID-prod --query "Stacks[0].Outputs[?OutputKey=='AssetsBucket'].OutputValue" --output=text --region $AWS_REGION)
  • export CDN_ID=$(aws cloudformation describe-stacks --stack-name LemmyverseLink-$DOMAIN_ID-prod --query "Stacks[0].Outputs[?OutputKey=='Cdn'].OutputValue" --output=text --region $AWS_REGION)
  • aws s3 sync public/build s3://$ASSETS_BUCKET/build --delete
  • aws cloudfront create-invalidation --distribution-id $CDN_ID --paths "/*"

Removing deployed code

  • export DOMAIN_ID=Lemmyverse (replace Lemmyverse with any identifier for your domain)
  • export AWS_REGION=eu-central-1
  • export ASSETS_BUCKET=$(aws cloudformation describe-stacks --stack-name LemmyverseLink-$DOMAIN_ID --query "Stacks[0].Outputs[?OutputKey=='AssetsBucket'].OutputValue" --output=text --region $AWS_REGION)
  • aws s3 rm s3://$ASSETS_BUCKET/ --recursive
  • serverless remove --stage prod --verbose --region $AWS_REGION