Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(terminal): restrict default allowed commands to 'ls' and 'echo' #372

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

Open
RonithManikonda wants to merge 8 commits into main
base: main
Choose a base branch
Loading
from ronith/hide-toggle-terminal-button

Conversation

@RonithManikonda
Copy link
Collaborator

@RonithManikonda RonithManikonda commented Oct 13, 2024

Change the default value of terminal.allowCommands from an empty array to ['ls', 'echo']. This change prevents users from running all available commands by default in tutorials, enhancing security and focus. Lesson authors can still allow all commands by specifying terminal.allowCommands: [] in the metadata.

BREAKING CHANGE: The default value of terminal.allowCommands is now restricted to ['ls', 'echo']. To allow all commands, explicitly set terminal.allowCommands: [] in the metadata.

Closes #302

AriPerkkio and Nemikolh reacted with hooray emoji
Change the default value of `terminal.allowCommands` from an empty array to `['ls', 'echo']`. This change prevents users from running all available commands by default in tutorials, enhancing security and focus. Lesson authors can still allow all commands by specifying `terminal.allowCommands: []` in the metadata.
BREAKING CHANGE: The default value of `terminal.allowCommands` is now restricted to `['ls', 'echo']`. To allow all commands, explicitly set `terminal.allowCommands: []` in the metadata.
Closes #302 
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@AriPerkkio AriPerkkio left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start, these changes look good to me! 💯

Though there are some failing unit tests - could you take a look at those? You can run them with:

$ cd packages/runtime/
$ pnpm test

adjust tests to expect ['ls', 'echo'] as default allowCommands when undefined, aligning tests with updated functionality
closes #302 
Copy link

cloudflare-workers-and-pages bot commented Oct 31, 2024
edited
Loading

Deploying tutorialkit-demo-page with Cloudflare Pages Cloudflare Pages

Latest commit: 43c24c4
Status: ✅ Deploy successful!

View logs

Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the tests are still failing, could you take a look at those? 👀

RonithManikonda and others added 2 commits January 15, 2025 16:56
Change the default value of `terminal.allowCommands` from an empty array to `['ls', 'echo']`. This update enhances security and focus by limiting the commands available in tutorials by default.
Lesson authors can still enable all commands by setting `terminal.allowCommands: []` explicitly in the metadata.
BREAKING CHANGE: The default value of `terminal.allowCommands` is now restricted to `['ls', 'echo']`. To allow all commands, explicitly set `terminal.allowCommands: []` in the metadata.
Closes #372 
Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, great work @RonithManikonda! 💯

As this change is a breaking change, we'll merge this into main before releasing version 2.0.0 of TutorialKit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AriPerkkio AriPerkkio AriPerkkio approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.0.0

Development

Successfully merging this pull request may close these issues.

terminal.allowCommands should have more strict default value

AltStyle によって変換されたページ (->オリジナル) /