-
Notifications
You must be signed in to change notification settings - Fork 57
feat: add ACTOR_PERMISSION_LEVEL to env var interface
#516
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
Changes from 1 commit
4f4e637
335e6b5
d7df7db
a76574a
90672e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,11 @@ export interface ApifyEnv { | |
| */ | ||
| actorBuildId: string | null; | ||
|
|
||
| /** | ||
| * [Permission level](https://docs.apify.com/platform/actors/development/permissions) the Actor is run under. (ACTOR_PERMISSION_LEVEL) | ||
| */ | ||
| actorPermissionLevel: string | null; | ||
|
|
||
| /** | ||
| * ID of the user who started the Actor - note that it might be | ||
| * different than the owner of the Actor (APIFY_USER_ID) | ||
|
|
@@ -497,6 +502,10 @@ export class Actor<Data extends Dictionary = Dictionary> { | |
| // reset global config instance to respect APIFY_ prefixed env vars | ||
| CoreConfiguration.globalConfig = Configuration.getGlobalConfig(); | ||
|
|
||
| log.info('Permissions', { | ||
| actorPermissionLevel: this.getEnv().actorPermissionLevel, | ||
| }); | ||
|
||
|
|
||
| if (this.isAtHome()) { | ||
| this.config.set('availableMemoryRatio', 1); | ||
| this.config.set('disableBrowserSandbox', true); // for browser launcher, adds `--no-sandbox` to args | ||
|
|
||
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.
Since this is an enum, I'm wondering if we could type this strictly (
'LIMITED_PERMISSIONS' | 'FULL_PERMISSIONS' | null).It would help users with adoption, but might require some well-placed casts.
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.
I typed it using the
ACTOR_PERMISSION_LEVELfrom@apify/consts