Skip to content

feat: added public directory + merge /home + /public#2049

Merged
RohitKushvaha01 merged 3 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:add_public
Apr 19, 2026
Merged

feat: added public directory + merge /home + /public#2049
RohitKushvaha01 merged 3 commits into
Acode-Foundation:mainfrom
RohitKushvaha01:add_public

Conversation

@RohitKushvaha01

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR consolidates the terminal's home directory storage by replacing the gated "Terminal Home" file-browser entry (which required the Terminal plugin to be installed) with an unconditional "Terminal Public" entry, and migrates existing alpine/home/alpine/root contents into a unified public/ directory that is then bound to /public, /home, and /root inside the proot environment.

Confidence Score: 5/5

Safe to merge; all prior P1 concerns have been addressed by the developer and only a P2 improvement suggestion remains.

All meaningful prior review concerns (Terminal guard, collision during migration, shared /home+/root path) have been acknowledged and explicitly accepted by the developer as intentional trade-offs. The only new finding is a P2 suggestion to add a sentinel file so the migration logic is skipped on subsequent terminal launches, which is a quality improvement rather than a correctness issue.

init-sandbox.sh — migration runs on every launch without a completion marker.

Important Files Changed

Filename Overview
src/pages/fileBrowser/fileBrowser.js Replaced the gated "Terminal Home" entry (behind Terminal.isInstalled/isSupported) with an unconditional "Terminal Public" entry pointing to cordova.file.dataDirectory + "public". Logic is straightforward and correct; the try/catch handles edge cases gracefully.
src/plugins/terminal/scripts/init-sandbox.sh Adds a one-time migration (move_all) that runs on every terminal launch to move contents of alpine/home and alpine/root into the new public/ directory; also binds public/ to both /home and /root inside proot. Migration logic is correct but runs unconditionally on every launch without a completion marker.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[init-sandbox.sh runs on every terminal launch] --> B[mkdir -p PREFIX/public]
    B --> C[move_all: alpine/home to public/]
    C --> D{alpine/home non-empty?}
    D -- No --> E[skip]
    D -- Yes --> F[mv -f files to public/]
    F --> G[move_all: alpine/root to public/]
    E --> G
    G --> H{alpine/root non-empty?}
    H -- No --> I[skip]
    H -- Yes --> J[mv -f files to public/ - silent overwrite on name collision]
    I --> K[proot launch]
    J --> K
    K --> L[bind PREFIX/public to /public]
    K --> M[bind PREFIX/public to /home]
    K --> N[bind PREFIX/public to /root]
    L & M & N --> O[All three paths share the same host directory]

    P[fileBrowser.js getAllStorages] --> Q{terminal-public already listed?}
    Q -- No --> R[pushFolder Terminal Public]
    Q -- Yes --> S[skip]
Loading

Reviews (4): Last reviewed commit: "feat: merged /root /home and /public" | Re-trigger Greptile

Comment thread src/pages/fileBrowser/fileBrowser.js
Comment thread src/pages/fileBrowser/fileBrowser.js
@RohitKushvaha01

This comment was marked as outdated.

@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@bajrangCoder, I think the public and home directories should be merged. They just cause more confusion and don’t benefit security much either.

@bajrangCoder

Copy link
Copy Markdown
Member

@bajrangCoder, I think the public and home directories should be merged. They just cause more confusion and don’t benefit security much either.

Hm, Merge it but keep the public(for users , APIs built around it)

@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptileai

Comment thread src/plugins/terminal/scripts/init-sandbox.sh
Comment thread src/plugins/terminal/scripts/init-sandbox.sh
@RohitKushvaha01 RohitKushvaha01 changed the title feat: added public directory feat: added public directory + merge /home + /public Apr 19, 2026
@RohitKushvaha01

Copy link
Copy Markdown
Member Author

@greptileai

@RohitKushvaha01 RohitKushvaha01 merged commit 2ef5d86 into Acode-Foundation:main Apr 19, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants