Skip to content
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

sub-modules of exegol-resources are missing #180

Closed
LucasVanHaaren opened this issue Sep 16, 2023 · 5 comments
Closed

sub-modules of exegol-resources are missing #180

LucasVanHaaren opened this issue Sep 16, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@LucasVanHaaren
Copy link

LucasVanHaaren commented Sep 16, 2023

Describe the bug

Hi folks,

I just did a fresh install of exegol and find that all exegol-resources which are sub-modules are missing in my ~/.exegol/exegol-resources.
I have been able to reproduce in another environment using an older exegol version.

I'm currently looking at the codebase to identify where the problem might be coming from.

Thanks in advance 🤟

Steps To Reproduce

  1. Install exegol
  2. Install an image
  3. List files on host in ~/.exegol/exegol-resources/webshells/PHP/p0wny-shell/ => empty
  4. List files on host in ~/.exegol/exegol-resources/encrypted_disks/bitleaker/ => empty
  5. List files on host in ~/.exegol/exegol-resources/linux/mimipy/ => empty

Exegol Wrapper Version

[*] Exegol is currently in version v4.2.5
[*] Exegol Discord serv.: https://discord.gg/cXThyp7D6P
[*] Exegol documentation: https://exegol.rtfd.io/
[+] We thank Capgemini for supporting the project (helping with dev) 🙏                                                                                                                       
[+] We thank HackTheBox for sponsoring the multi-arch support 💚                                                                                                                              
[D] Pip installation: On ✔                                                                                                                                                                    
[D] Git source installation: Off 🪓                                                                                                                                                           
[D] Host OS: HostOs.LINUX (DockerEngine.LINUX)                                                                                                                                                
[D] Arch: amd64                                                                                                                                                                               
[D] Raw arch: x86_64                                                                                                                                                                          
[D] Docker desktop: Off 🪓                                                                                                                                                                    
[D] Shell type: HostOs.LINUX                                                                                                                                                                  
[D] Last wrapper update check: 2023-09-16 00:00:00

Host OS

Linux

Configuration of the concerned container

┌──────────────────┬───────────────────────────────────────────────────────────────────┐
│             Name │ test                                                              │
│            Image │ full - v.3.1.1 (Up to date) (amd64)                               │
├──────────────────┼───────────────────────────────────────────────────────────────────┤
│    Creation date │ 16/09/2023 20:43                                                  │
│              GUI │ On ✔                                                              │
│          Network │ host                                                              │
│         Timezone │ On ✔                                                              │
│ Exegol resources │ On ✔ (/opt/resources)                                             │
│     My resources │ On ✔ (/opt/my-resources)                                          │
│    Shell logging │ Off 🪓                                                            │
│       Privileged │ Off ✔                                                             │
│        Workspace │ Dedicated (/workspace)                                            │
│             Envs │ DISPLAY=:0                                                        │
│                  │ _JAVA_AWT_WM_NONREPARENTING=1                                     │
│                  │ QT_X11_NO_MITSHM=1                                                │
│                  │ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin │
│          Volumes │ /tmp/.X11-unix ➡ /tmp/.X11-unix                                   │
│                  │ /etc/timezone ➡ /etc/timezone (RO)                                │
│                  │ /etc/localtime ➡ /etc/localtime (RO)                              │
│                  │ /home/vhash/.exegol/my-resources ➡ /opt/my-resources              │
│                  │ /home/vhash/.exegol/exegol-resources ➡ /opt/resources             │
│                  │ /home/vhash/.exegol/workspaces/test ➡ /workspace                  │
└──────────────────┴───────────────────────────────────────────────────────────────────┘

Execution logs in debug mode

No logs as the issue is visible without running a container

Exception

No response

Anything else?

image

@LucasVanHaaren LucasVanHaaren added the bug Something isn't working label Sep 16, 2023
@LucasVanHaaren
Copy link
Author

Hi, I managed to reproduce this bug in 2 other environments (on OSX, and Ubuntu 22), all on pip installations.
Source installations don't seem to be affected, as all exegol-resources sub-modules are present during my testings !

I tried to look at the code in order to produce a fix, but I must admit I had some trouble understanding how the git wrapper was designed but I think I've identified the piece of code that do the update. Is it the GitUtils.submoduleSourceUpdate function that is used to update, even on pip installations ?

If so, according to this documentation, the recursive update of sub-modules may be done manually : https://stackoverflow.com/questions/22949068/using-gitpython-how-do-i-do-git-submodule-update-init

But this doesn't explain why this appears only on pip installs ...

Apart from the resource path specified in the exegol configuration, is the initialization and updating of exegol-resources differ depending on the installation mode ?

@ShutdownRepo
Copy link
Member

@Dramelac I'll let you handle this issue, you'll probably have more insight on this than me

@ShutdownRepo ShutdownRepo changed the title [BUG] sub-modules of exegol-resources are missing sub-modules of exegol-resources are missing Oct 19, 2023
@Dramelac
Copy link
Member

Apart from the resource path specified in the exegol configuration, is the initialization and updating of exegol-resources differ depending on the installation mode ?

Hello

Yes there is some difference, when using a source install, the ressources are a submoudle itself of the wrapper but when using a pip install, ressources are first git cloned and then submodules are supposed to be updated.

I will take a look at this, thank you for raising this issue

@Dramelac
Copy link
Member

Fixed in 9a54364 , will be available in the next Exegol release.
After the wrapper update, in order to force the update of exegol-resources, you just have to remove the folder, the wrapper will ask you to install exegol-resources again and everything should be good after that.

@LucasVanHaaren
Copy link
Author

Nice job, thank you !

@Dramelac Dramelac mentioned this issue Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants