build(aio): run the upload server as a non-previleged user
closes #19352 Previously, the upload server (for PR previews) was run as root and "downleveled" to a non-privileged user from inside the node script. Now, with the latest version of `pm2` (which is used to run the upload server scripts), we can get rid of that workaround and set the desired UID directly through `pm2`.
This commit is contained in:

committed by
Victor Berchet

parent
620407720c
commit
68078fd620
@ -13,10 +13,8 @@ const AIO_REPO_SLUG = getEnvVar('AIO_REPO_SLUG');
|
||||
const AIO_TRUSTED_PR_LABEL = getEnvVar('AIO_TRUSTED_PR_LABEL');
|
||||
const AIO_UPLOAD_HOSTNAME = getEnvVar('AIO_UPLOAD_HOSTNAME');
|
||||
const AIO_UPLOAD_PORT = +getEnvVar('AIO_UPLOAD_PORT');
|
||||
const AIO_WWW_USER = getEnvVar('AIO_WWW_USER');
|
||||
|
||||
// Run
|
||||
process.setuid(AIO_WWW_USER); // TODO(gkalpak): Find more suitable way to run as `www-data`.
|
||||
_main();
|
||||
|
||||
// Functions
|
||||
|
Reference in New Issue
Block a user