-
-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A first attempt at using deser-hjson. Fixes #1270 #1433
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f19c7a2
A first attempt at using deser-hjson. Fixes #1270
dessalines cddf9a6
Trying to fix tests, try 1
dessalines 1a02ab3
Trying to fix tests, try 2
dessalines 755c6b4
A few fixes to deser_hjson
dessalines 2b4e70e
Make clippy happy
dessalines 07dcbc9
hjson list strings must be quoted.
dessalines f411f51
Adding support for env vars.
dessalines f63ad49
Merge branch 'main' into try_hjson_deser
dessalines dd4d75a
Moving to structs and defaults file.
dessalines d86bc6e
Moving settings default and struct.
dessalines e959a78
Merge branch 'main' into try_hjson_deser
dessalines File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
export LEMMY_JWT_SECRET=changeme | ||
export LEMMY_FEDERATION__ENABLED=true | ||
export LEMMY_TLS_ENABLED=false | ||
export LEMMY_SETUP__ADMIN_PASSWORD=lemmy | ||
export LEMMY_RATE_LIMIT__POST=99999 | ||
export LEMMY_RATE_LIMIT__REGISTER=99999 | ||
export LEMMY_CAPTCHA__ENABLED=false | ||
export LEMMY_TEST_SEND_SYNC=1 | ||
export RUST_BACKTRACE=1 | ||
|
||
|
@@ -35,52 +28,40 @@ fi | |
|
||
killall lemmy_server || true | ||
|
||
echo "$PWD" | ||
|
||
echo "start alpha" | ||
LEMMY_HOSTNAME=lemmy-alpha:8541 \ | ||
LEMMY_PORT=8541 \ | ||
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_alpha.hjson \ | ||
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_alpha" \ | ||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta,lemmy-gamma,lemmy-delta,lemmy-epsilon \ | ||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_alpha \ | ||
LEMMY_SETUP__SITE_NAME=lemmy-alpha \ | ||
target/lemmy_server >/dev/null 2>&1 & | ||
LEMMY_HOSTNAME="lemmy-alpha:8541" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added an env var for hostname here, removed it from the config file |
||
target/lemmy_server >/tmp/lemmy_alpha.out 2>&1 & | ||
|
||
echo "start beta" | ||
LEMMY_HOSTNAME=lemmy-beta:8551 \ | ||
LEMMY_PORT=8551 \ | ||
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_beta.hjson \ | ||
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_beta" \ | ||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-gamma,lemmy-delta,lemmy-epsilon \ | ||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_beta \ | ||
LEMMY_SETUP__SITE_NAME=lemmy-beta \ | ||
target/lemmy_server >/dev/null 2>&1 & | ||
target/lemmy_server >/tmp/lemmy_beta.out 2>&1 & | ||
|
||
echo "start gamma" | ||
LEMMY_HOSTNAME=lemmy-gamma:8561 \ | ||
LEMMY_PORT=8561 \ | ||
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_gamma.hjson \ | ||
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_gamma" \ | ||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-alpha,lemmy-beta,lemmy-delta,lemmy-epsilon \ | ||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_gamma \ | ||
LEMMY_SETUP__SITE_NAME=lemmy-gamma \ | ||
target/lemmy_server >/dev/null 2>&1 & | ||
target/lemmy_server >/tmp/lemmy_gamma.out 2>&1 & | ||
|
||
echo "start delta" | ||
# An instance with only an allowlist for beta | ||
LEMMY_HOSTNAME=lemmy-delta:8571 \ | ||
LEMMY_PORT=8571 \ | ||
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_delta.hjson \ | ||
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_delta" \ | ||
LEMMY_FEDERATION__ALLOWED_INSTANCES=lemmy-beta \ | ||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_delta \ | ||
LEMMY_SETUP__SITE_NAME=lemmy-delta \ | ||
target/lemmy_server >/dev/null 2>&1 & | ||
target/lemmy_server >/tmp/lemmy_delta.out 2>&1 & | ||
|
||
echo "start epsilon" | ||
# An instance who has a blocklist, with lemmy-alpha blocked | ||
LEMMY_HOSTNAME=lemmy-epsilon:8581 \ | ||
LEMMY_PORT=8581 \ | ||
LEMMY_CONFIG_LOCATION=./docker/federation/lemmy_epsilon.hjson \ | ||
LEMMY_DATABASE_URL="${LEMMY_DATABASE_URL}/lemmy_epsilon" \ | ||
LEMMY_FEDERATION__BLOCKED_INSTANCES=lemmy-alpha \ | ||
LEMMY_SETUP__ADMIN_USERNAME=lemmy_epsilon \ | ||
LEMMY_SETUP__SITE_NAME=lemmy-epsilon \ | ||
target/lemmy_server >/dev/null 2>&1 & | ||
target/lemmy_server >/tmp/lemmy_epsilon.out 2>&1 & | ||
|
||
echo "wait for all instances to start" | ||
while [[ "$(curl -s -o /dev/null -w '%{http_code}' 'localhost:8541/api/v2/site')" != "200" ]]; do sleep 1; done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hjson needs quoted strings if its in a list.