Skip to content

Commit

Permalink
WIP: make upgrading demo accounts available via a config option.
Browse files Browse the repository at this point in the history
This fixes sandstorm-io#3239 by providing a config option to re-enable the ability
to upgrade demo accounts to full accounts, which was removed in order to
allow alpha to act as the demo server when oasis was shut down.

Unfortunately, this seems to break *other* tests. The handful I examined
resulted in permission errors trying to upload the test app; presumably
when this is enabled our test accounts are somehow getting marked as
not allowed to upload their own apps.
  • Loading branch information
zenhack committed Apr 3, 2022
1 parent 6d4ed35 commit 0c16e31
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sandstorm/config.c++
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ Config readConfig(const char *path, bool parseUids) {
config.allowDemoAccounts = value == "true" || value == "yes";
} else if (key == "ALLOW_DEV_ACCOUNTS") {
config.allowDevAccounts = value == "true" || value == "yes";
} else if (key == "ALLOW_UNINVITED") {
config.allowUninvited = value == "true" || value == "yes";
} else if (key == "IS_TESTING") {
config.isTesting = value == "true" || value == "yes";
} else if (key == "HIDE_TROUBLESHOOTING") {
Expand Down
1 change: 1 addition & 0 deletions src/sandstorm/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct Config {
kj::String sandcatsHostname = nullptr;
bool allowDemoAccounts = false;
bool isTesting = false;
bool allowUninvited = false;
bool allowDevAccounts = false;
bool hideTroubleshooting = false;
uint smtpListenPort = 30025;
Expand Down
1 change: 1 addition & 0 deletions src/sandstorm/run-bundle.c++
Original file line number Diff line number Diff line change
Expand Up @@ -2659,6 +2659,7 @@ private:
"{ \"build\":", buildstamp,
", \"allowDemoAccounts\":", config.allowDemoAccounts ? "true" : "false",
", \"allowDevAccounts\":", config.allowDevAccounts ? "true" : "false",
", \"allowUninvited\":", config.allowUninvited ? "true" : "false",
", \"isTesting\":", config.isTesting ? "true" : "false",
", \"hideTroubleshooting\":", config.hideTroubleshooting ? "true" : "false",
", \"wildcardHost\":\"", config.wildcardHost, "\"",
Expand Down
1 change: 1 addition & 0 deletions tests/run-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ rm -rf "$SANDSTORM_DIR"

echo "IS_TESTING=true
ALLOW_DEMO_ACCOUNTS=true
ALLOW_UNINVITED=true
BASE_URL=http://local.sandstorm.io:$PORT
WILDCARD_HOST=*.local.sandstorm.io:$PORT
PORT=$PORT
Expand Down

0 comments on commit 0c16e31

Please sign in to comment.