Commit graph

30 commits

Author SHA1 Message Date
Sean Baker
847d66f8e4 Use original test 2026-04-07 19:39:31 +08:00
Sean Baker
fa185b0f90 Added support for MacOS and Linux ARM64 2026-03-25 14:49:02 -06:00
Sander Bruens
b5dbe650f5
test(server): remove custom util container (#1568) 2024-07-23 14:33:14 -04:00
Vinicius Fortuna
9bb9729279
Fix on macOS (#1539) 2024-04-18 16:49:55 -04:00
Vinicius Fortuna
6556d7e595
build: use Task (#1535) 2024-04-17 19:48:23 -04:00
Sander Bruens
a62b25b54c
test(server): add new PUT API to the integration test (#1504) 2024-02-15 12:24:55 -05:00
Vinicius Fortuna
71e4b52b80
chore(server): remove docker-compose and cleanup (#1484) 2024-01-30 14:05:34 -05:00
62w71st
7a2007b233
feat(server): add encryption method option to the access key creation API (#1002) 2022-10-17 16:12:43 -05:00
Jonathan Cohen
c9d3a48b62
Release Outline Manager on Github Actions (#978)
Release Outline Manager on Github Actions
2021-09-23 16:28:11 -04:00
Ben Schwartz
7d1fe0205c Require scripts to be shellcheck-compliant 2021-02-17 11:57:32 -05:00
Ben Schwartz
d41833b65a Slightly nontrivial shell cleanup
These are slightly nontrivial shell cleanups discovered in the course of
attempting shellcheck compliance.
2021-02-16 21:17:47 -05:00
Jonathan Cohen
cf355a6fee
Per-Key Data Limits in Shadowbox (#769)
* s/AccessKeyDataLimit/DefaultDataLimit/g for shadowbox

* Implement per-key custom data limits in shadowbox

* Shadowbox integration test

* Fix the manager service test to maintain backwards compatibility with
the GET /server response

* Fix integration test for Travis

* Fix lint errors

* Implement removal of access key data limits

* Persist custom data limits

* Bump Shadowbox version number

* Add a per key dat alimit count to the feature metrics endpoint

This also involved modifying the schema of
uproxysite:uproxy_metrics_dev.feature_metrics to include the new field.
See https://cloud.google.com/bigquery/docs/managing-table-schemas#bq_1
for how this was accomplished

Tested:
  yarn do metrics_server/test && yarn do metrics_server/test_integration

* Collect usage metrics for per-key data limits

* API documentation and cleanup

* Respond to review comments

* Respond to review comments

* Don't encode the data limit in the access key url

This should have been caught in the integration test, but the
integration test was miswritten with "echo" instead of "fail", cause the
test to mistakenly pass.

Fixing this exposed other errors in the test, which were fixed.  The
test has been confirmed to both pass and fail successfully.

* Fix the manager service unit test

* Remove stray files

* Split integration test into individual functions

* Clarify comment in the AccessKey interface

* Be more explicit about behavior when no data limits are set

* Remove spuriosu import added by vscode

* DOn't bump shadowbox version number yet

* Rename to accessKeyToApiJson

* Don't export AccessKeyJson and use "StorageJson"

* Don't await data limit enforcement

* Rename the defaultDataLimit getter

* Make dataLimit in the accesskey model readonly

* Use nullish coalescing operator
2020-12-23 13:52:50 -05:00
Vinicius Fortuna
f3b104a81a Bind SOCKS to localhost 2020-06-12 12:10:39 -04:00
Vinicius Fortuna
75a9c464e0 Add retry 2020-06-12 01:39:41 -04:00
Vinicius Fortuna
6a3d511ec0 Set timeout for client_curl 2020-06-12 01:37:28 -04:00
Vinicius Fortuna
a6b65b90ca Fix integration test cleanup 2020-06-12 01:37:28 -04:00
Jonathan Cohen
dafa1f5bc2
Allow users to change the hostname for new access keys (#565)
* Create an endpoint to change the server's hostname.

This is the backend only, and does not check if the hostname exists or points to a Shadowbox
server.  Users have the responsibility of double checking that the
hostname and DNS if necessary are properly set up and specified.

* Updates

Changes validation to use regex.

Gets rid of a bad test

Uses paramtereized tests for better test output

Adds setHostname to AccessKeyRepository and calls it in the endpoint

* Integration tests

Also fixes missing dependency on ip-regex

* Remove validator from lockfile

* Ensure we correctly use Python 2 for Cloud SDK

* API for the new endpoint to change the server hostname. (#534)

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* Remove 404 and 406 error states.  Checking for a functioning Shadowbox
server requires knowledge of the API prefix, which creates layering
challenges.  The UI will be able to make these checks, but users who
call the API directly will have to be careful not to put in an incorrect
hostname.  The consequence of this would be that newly made access keys
won't work.

* Clarify API, change name, add validation errors

* Clarify description

* Remove the API response corresponding to a failed check against the new
hostname that it points to the same server

* Respond to review comments

* Rename endpoint and related functions

From the server's perspective, this does change the hostname for
existing access keys since on server load time (in the Server Manager)
we recalculate access key hostnames from the key repository.

* Respond to review comments

* Use version 1.2.0 since data limits is taking 1.1.0

* Fix update_mmdb and the Docker image to work on Alpine (#559)

* Fix the for loop in update_mmdb to be `dash` compatible

for x in {a..b} is bash-only, and alpine's default shell is `dash`.

* Fix other issues related to using musl/Busybox/dash

* Use `[[` instead of `((` for the branch
* Make sure to update to GNU coreutils in the image in order to use
`date --date`

* Respond to review comments

* UI for setting the hostname for access key invitations (#553)

* Increase Shadowbox version for data limits experiment (#544)

* Return the port for new access keys from GET /server.  (#552)

This was accidentally removed in #537.

* UI for setting the hostname for access key invitations

This also includes some random typo fixes and QOL improvements.

To test, you can use

    export SB_IMAGE=cohenjongoogle/shadowbox:latest
    yarn do shadowbox/docker/run

then in a different terminal

    yarn do server_manager/electron_app/run

and add the server

* Add back in new files

Also fixes a backward compatibility issues for servers which don't
support changing the hostname

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Use DB-IP's Geolocation database instead of MaxMind's (#557)

* Use DB-IP's free IP-to-Country database instead of MaxMind's

This avoids the necesseity to either (1) bundle MaxMind's database in
our docker image or (2) require server admins to individually create
MaxMind accounts due to the new requirements for using GeoLite2
databases.  See https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/

* Add attribution to DB-IP for the GeoIP database

* Make sure that we deal with lag between the changeover of the current
month and release of new versions of the DB-IP database

* Respond to review comments

* Attribute DB-IP in the update script

* Respond to review comments

* Respond to review comments

* Fix update_mmdb and the Docker image to work on Alpine (#559)

* Fix the for loop in update_mmdb to be `dash` compatible

for x in {a..b} is bash-only, and alpine's default shell is `dash`.

* Fix other issues related to using musl/Busybox/dash

* Use `[[` instead of `((` for the branch
* Make sure to update to GNU coreutils in the image in order to use
`date --date`

* Respond to review comments

* Update to Typescript 3.7 (#558)

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html for more information.  Among the nice new features are optional chainging and null coalescing, and assertion functions, as well as some additional safety checks in the compiler

* Create an endpoint to change the server's hostname.

This is the backend only, and does not check if the hostname exists or points to a Shadowbox
server.  Users have the responsibility of double checking that the
hostname and DNS if necessary are properly set up and specified.

* Updates

Changes validation to use regex.

Gets rid of a bad test

Uses paramtereized tests for better test output

Adds setHostname to AccessKeyRepository and calls it in the endpoint

* Integration tests

Also fixes missing dependency on ip-regex

* Remove validator from lockfile

* Ensure we correctly use Python 2 for Cloud SDK

* API for the new endpoint to change the server hostname. (#534)

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* Remove 404 and 406 error states.  Checking for a functioning Shadowbox
server requires knowledge of the API prefix, which creates layering
challenges.  The UI will be able to make these checks, but users who
call the API directly will have to be careful not to put in an incorrect
hostname.  The consequence of this would be that newly made access keys
won't work.

* Clarify API, change name, add validation errors

* Clarify description

* Remove the API response corresponding to a failed check against the new
hostname that it points to the same server

* Respond to review comments

* Rename endpoint and related functions

From the server's perspective, this does change the hostname for
existing access keys since on server load time (in the Server Manager)
we recalculate access key hostnames from the key repository.

* Respond to review comments

* Use version 1.2.0 since data limits is taking 1.1.0

* Fix update_mmdb and the Docker image to work on Alpine (#559)

* Fix the for loop in update_mmdb to be `dash` compatible

for x in {a..b} is bash-only, and alpine's default shell is `dash`.

* Fix other issues related to using musl/Busybox/dash

* Use `[[` instead of `((` for the branch
* Make sure to update to GNU coreutils in the image in order to use
`date --date`

* Respond to review comments

* UI for setting the hostname for access key invitations

This also includes some random typo fixes and QOL improvements.

To test, you can use

    export SB_IMAGE=cohenjongoogle/shadowbox:latest
    yarn do shadowbox/docker/run

then in a different terminal

    yarn do server_manager/electron_app/run

and add the server

* Add back in new files

Also fixes a backward compatibility issues for servers which don't
support changing the hostname

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Fix messed up rebase

* merge

* Clear merge markers

Co-authored-by: alalamav <2132122+alalamav@users.noreply.github.com>

* Create an endpoint to change the server's hostname.

This is the backend only, and does not check if the hostname exists or points to a Shadowbox
server.  Users have the responsibility of double checking that the
hostname and DNS if necessary are properly set up and specified.

* Updates

Changes validation to use regex.

Gets rid of a bad test

Uses paramtereized tests for better test output

Adds setHostname to AccessKeyRepository and calls it in the endpoint

* Integration tests

Also fixes missing dependency on ip-regex

* Remove validator from lockfile

* Ensure we correctly use Python 2 for Cloud SDK

* API for the new endpoint to change the server hostname. (#534)

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* Remove 404 and 406 error states.  Checking for a functioning Shadowbox
server requires knowledge of the API prefix, which creates layering
challenges.  The UI will be able to make these checks, but users who
call the API directly will have to be careful not to put in an incorrect
hostname.  The consequence of this would be that newly made access keys
won't work.

* Clarify API, change name, add validation errors

* Clarify description

* Remove the API response corresponding to a failed check against the new
hostname that it points to the same server

* Respond to review comments

* Rename endpoint and related functions

From the server's perspective, this does change the hostname for
existing access keys since on server load time (in the Server Manager)
we recalculate access key hostnames from the key repository.

* Respond to review comments

* Use version 1.2.0 since data limits is taking 1.1.0

* UI for setting the hostname for access key invitations (#553)

* Increase Shadowbox version for data limits experiment (#544)

* Return the port for new access keys from GET /server.  (#552)

This was accidentally removed in #537.

* UI for setting the hostname for access key invitations

This also includes some random typo fixes and QOL improvements.

To test, you can use

    export SB_IMAGE=cohenjongoogle/shadowbox:latest
    yarn do shadowbox/docker/run

then in a different terminal

    yarn do server_manager/electron_app/run

and add the server

* Add back in new files

Also fixes a backward compatibility issues for servers which don't
support changing the hostname

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Use DB-IP's Geolocation database instead of MaxMind's (#557)

* Use DB-IP's free IP-to-Country database instead of MaxMind's

This avoids the necesseity to either (1) bundle MaxMind's database in
our docker image or (2) require server admins to individually create
MaxMind accounts due to the new requirements for using GeoLite2
databases.  See https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/

* Add attribution to DB-IP for the GeoIP database

* Make sure that we deal with lag between the changeover of the current
month and release of new versions of the DB-IP database

* Respond to review comments

* Attribute DB-IP in the update script

* Respond to review comments

* Respond to review comments

* Fix update_mmdb and the Docker image to work on Alpine (#559)

* Fix the for loop in update_mmdb to be `dash` compatible

for x in {a..b} is bash-only, and alpine's default shell is `dash`.

* Fix other issues related to using musl/Busybox/dash

* Use `[[` instead of `((` for the branch
* Make sure to update to GNU coreutils in the image in order to use
`date --date`

* Respond to review comments

* Update to Typescript 3.7 (#558)

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html for more information.  Among the nice new features are optional chainging and null coalescing, and assertion functions, as well as some additional safety checks in the compiler

* Create an endpoint to change the server's hostname.

This is the backend only, and does not check if the hostname exists or points to a Shadowbox
server.  Users have the responsibility of double checking that the
hostname and DNS if necessary are properly set up and specified.

* Updates

Changes validation to use regex.

Gets rid of a bad test

Uses paramtereized tests for better test output

Adds setHostname to AccessKeyRepository and calls it in the endpoint

* Integration tests

Also fixes missing dependency on ip-regex

* Remove validator from lockfile

* Ensure we correctly use Python 2 for Cloud SDK

* API for the new endpoint to change the server hostname. (#534)

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* API for the new endpoint to change the server hostname.

I am sending it up now so we can iterate on it while I'm busy
implementing the endpoint.  I will merge it into the feature branch when
it's done as opposed as into master.

* Remove 404 and 406 error states.  Checking for a functioning Shadowbox
server requires knowledge of the API prefix, which creates layering
challenges.  The UI will be able to make these checks, but users who
call the API directly will have to be careful not to put in an incorrect
hostname.  The consequence of this would be that newly made access keys
won't work.

* Clarify API, change name, add validation errors

* Clarify description

* Remove the API response corresponding to a failed check against the new
hostname that it points to the same server

* Respond to review comments

* Rename endpoint and related functions

From the server's perspective, this does change the hostname for
existing access keys since on server load time (in the Server Manager)
we recalculate access key hostnames from the key repository.

* Respond to review comments

* Use version 1.2.0 since data limits is taking 1.1.0

* Fix update_mmdb and the Docker image to work on Alpine (#559)

* Fix the for loop in update_mmdb to be `dash` compatible

for x in {a..b} is bash-only, and alpine's default shell is `dash`.

* Fix other issues related to using musl/Busybox/dash

* Use `[[` instead of `((` for the branch
* Make sure to update to GNU coreutils in the image in order to use
`date --date`

* Respond to review comments

* UI for setting the hostname for access key invitations

This also includes some random typo fixes and QOL improvements.

To test, you can use

    export SB_IMAGE=cohenjongoogle/shadowbox:latest
    yarn do shadowbox/docker/run

then in a different terminal

    yarn do server_manager/electron_app/run

and add the server

* Add back in new files

Also fixes a backward compatibility issues for servers which don't
support changing the hostname

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Respond to review comments

* Fix messed up rebase

* merge

* Clear merge markers

Co-authored-by: alalamav <2132122+alalamav@users.noreply.github.com>

Co-authored-by: alalamav <2132122+alalamav@users.noreply.github.com>
2020-01-30 15:22:57 -05:00
Jonathan Cohen
46b7ee0e33
Use the server config instead of env variables for the API port and the server hostname (#488)
* Get public hostname from config file

* Tidy up

* Respond to Review Comments

At some point down the line I royally screwed up my git history and
reverted a bunch of changes.  I'm not sure what or when, so I `git reset --hard 1cd28e4` and tried to redo my
past responses to comments from there.

* Export SB_PUBLIC_IP in cmd.sh

* respond to review comments

* Review response
2019-11-18 18:16:24 -05:00
Jonathan Cohen
a9aef69d3b
Set -x in the integration test (#522)
* Set -x in the integration test

The integration test has been flaking from time to time on Travis with
no obvious failures, indicating this is happening unexpectedly outside a
`fail` call.  `set -x` will help us diagnose when it happens again.

* Only show logs on test failure

* Correctly continue if test.sh fails

* Only cleanup the logfile on success.  The logfile should stick around on
failure for easier sharing of test results.  It will eventually get
cleaned up whenever the tmp directory gets cleaned.
2019-10-24 14:45:35 -04:00
Jonathan Cohen
16f6c158e1
Create an endpoint to change the default port for new access keys (#461)
* Add an endpoint to set a new port for access keys

* post commit formatting

* Document the new api

* Remove enum in errors

* Respond to review comments

* Respond to review comments

* Rename to ShadowboxError and add copywright header

* Move to errors.ts

* Respond to coments in access_key.ts

* Move to errors.ts

* More renames

* post commit formatting

* More review responses

* Correctly convert invalid port number to string

* More renaming

* post commit formatting

* Respond to review comments

* Fix issue using parseInt

* Change endpoint URL

* formatting

* Respond to more review comments

* Respond to comments, add to integration test

* post commit formatting

* Move invalidPortArgument into a local

* formatting

* More review

* more review

* formatting

* disambiguate errors using restify types

* formatting

* fix the integration test
2019-08-15 15:21:29 -04:00
alalamav
c6b3e3a4ea
Update outline-ss-server to v1.0.4 (#390) 2019-02-01 13:13:22 -05:00
fortuna
e3a6538ef9 Several documentation fixes 2019-01-08 19:45:52 -05:00
trevj
86b711c5ba
print shadowbox logs on integration test failures (#299) 2018-11-01 13:03:41 -04:00
fortuna
9056fd6448 Remove remove_color. No longer needed 2018-10-29 13:30:17 -04:00
fortuna
4ea0152d5d Test key deletion 2018-10-26 12:25:18 -04:00
fortuna
1731f09bb1 Remove color 2018-10-25 17:34:48 -04:00
fortuna
2f241b9dfd Fix update 2018-10-25 16:25:51 -04:00
fortuna
151babcf0f Add outline-ss-server based on rollout 2018-10-11 11:13:41 -04:00
Vinicius Fortuna
b5099a7faf
Simplify Metrics (#258)
This also adds significant testing, including for the time-based behaviors.
2018-10-02 14:13:37 -04:00
Trevor Johnston
c44d9f2fb9 import code 2018-03-14 17:52:39 -04:00