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

Exegol 4.0.2 #92

Merged
merged 22 commits into from
May 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ad0d390
Improv env detection
Dramelac May 8, 2022
9b32339
Add custom NAT port CLI parameter
Dramelac May 8, 2022
42a037b
Show docker NAT ports
Dramelac May 8, 2022
3d96744
Update network mode incompatible with docker desktop
Dramelac May 8, 2022
10dd665
Add powershell execution policy setup instruction.
Dramelac May 8, 2022
ce85f54
Upgrade dev version
Dramelac May 8, 2022
2d4c642
Merge GUI static env config
Dramelac May 8, 2022
d930d9b
Fix WSL detection with docker-desktop-data as default
Dramelac May 9, 2022
d1d31c0
Update missing git module message
Dramelac May 12, 2022
b432ebb
Adding macOS "in progress" support and shortcut install info
ShutdownRepo May 13, 2022
933d930
Adding more logging info for timezone/localtime sharing
ShutdownRepo May 13, 2022
7ff9071
Update mac xhost directive
Dramelac May 13, 2022
fdae2dc
Handle mac env + detect xquartz
Dramelac May 13, 2022
fa80828
Added todo for wrapper update process
ShutdownRepo May 14, 2022
e8e692c
Add Max xquartz GUI tests (config + up)
Dramelac May 16, 2022
ac91a07
Editing "already up to date" from success to info
ShutdownRepo May 17, 2022
bfd4f6f
Fixing xquartz config detection and message
ShutdownRepo May 17, 2022
f5ce8d6
Updating XQuartz start message
ShutdownRepo May 17, 2022
043f8ed
Fix timezone config parsing
Dramelac May 17, 2022
a12ee3a
Fix xquartz starting on container start
Dramelac May 20, 2022
a3f7fda
Block device sharing with docker desktop
Dramelac May 20, 2022
49a8f5b
Prepare 4.0.2 release
Dramelac May 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<br>
<img alt="current version" src="https://img.shields.io/badge/linux-supported-success">
<img alt="current version" src="https://img.shields.io/badge/windows-supported-success">
<img alt="current version" src="https://img.shields.io/badge/mac-need%20testing-important">
<img alt="current version" src="https://img.shields.io/badge/mac-in%20progress-important">
<br>
<a href="https://twitter.com/intent/follow?screen_name=_nwodtuhs" title="Follow"><img src="https://img.shields.io/twitter/follow/_nwodtuhs?label=Shutdown&style=social"></a>
<a href="https://twitter.com/intent/follow?screen_name=Dramelac_" title="Follow"><img src="https://img.shields.io/twitter/follow/Dramelac_?label=Dramelac&style=social"></a>
Expand Down Expand Up @@ -86,10 +86,10 @@ cd Exegol
python3 -m pip install --user --requirement requirements.txt
```

### Add exegol command
## Add exegol command

<details>
<summary><h4>On Linux</h4></summary>
<summary><h4>On Linux / macOS</h4></summary>

The exegol wrapper can then be added to the `PATH` throw symlink for direct access.

Expand All @@ -100,7 +100,7 @@ sudo ln -s $(pwd)/exegol.py /usr/local/bin/exegol
</details>

<details>
<summary><h4>On Windows (powershell)</h4></summary>
<summary><h4>On Windows (with Powershell)</h4></summary>

The exegol wrapper can be added as a powershell command aliases and saved for persistence
in `$HOME\PowershellAliasesExport.txt`
Expand All @@ -113,6 +113,15 @@ Get-Alias -Name "exegol" | Export-Alias -Path $AliasFile
echo "Import-Alias '$AliasFile'" >> $PROFILE
```

> Warning! To automatically load aliases from the .ps1 file, the `Get-ExecutionPolicy` powershell must be set
> to `RemoteSigned`

If the configuration is not correct it can be configured as **administrator** with the following command:

```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
```

</details>

## User configuration
Expand Down
3 changes: 2 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
- handle encrypted volumes
- after interactive mode: show the full command for next time so that users don't always have to go through interactive mode
- add multi image selection to `exegol install`
- add templates and help for contributors: PRs and issues docs and templates, etc.
- add templates and help for contributors: PRs and issues docs and templates, etc.
- implement an update checker similar to oh-my-zsh for the wrapper
2 changes: 1 addition & 1 deletion exegol-docker-build
10 changes: 8 additions & 2 deletions exegol/console/TUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,17 @@ def __buildContainerTable(table: Table, data: Sequence[ExegolContainer]):
if verbose_mode:
table.add_column("Mounts")
table.add_column("Devices")
table.add_column("Ports")
table.add_column("Envs")
# Load data into the table
for container in data:
if verbose_mode:
table.add_row(container.getId(), container.name, container.getTextStatus(), container.image.getDisplayName(),
container.config.getTextFeatures(verbose_mode),
container.config.getTextMounts(debug_mode),
container.config.getTextDevices(debug_mode), container.config.getTextEnvs(debug_mode))
container.config.getTextDevices(debug_mode),
container.config.getTextPorts(),
container.config.getTextEnvs(debug_mode))
else:
table.add_row(container.name, container.getTextStatus(), container.image.getDisplayName(),
container.config.getTextFeatures(verbose_mode))
Expand Down Expand Up @@ -358,6 +361,7 @@ def printContainerRecap(cls, container: ExegolContainerTemplate):
# Fetch data
devices = container.config.getTextDevices(logger.isEnabledFor(ExeLog.VERBOSE))
envs = container.config.getTextEnvs(logger.isEnabledFor(ExeLog.VERBOSE))
ports = container.config.getTextPorts()
sysctls = container.config.getSysctls()
capabilities = container.config.getCapabilities()
volumes = container.config.getTextMounts(logger.isEnabledFor(ExeLog.VERBOSE))
Expand All @@ -379,7 +383,7 @@ def printContainerRecap(cls, container: ExegolContainerTemplate):
recap.add_column(container_info_header)
# Main features
recap.add_row("[bold blue]GUI[/bold blue]", boolFormatter(container.config.isGUIEnable()))
recap.add_row("[bold blue]Network[/bold blue]", container.config.getNetworkMode())
recap.add_row("[bold blue]Network[/bold blue]", container.config.getTextNetworkMode())
recap.add_row("[bold blue]Timezone[/bold blue]", boolFormatter(container.config.isTimezoneShared()))
recap.add_row("[bold blue]Exegol resources[/bold blue]", boolFormatter(container.config.isExegolResourcesEnable()) +
f"{'[bright_black](/opt/resources)[/bright_black]' if container.config.isExegolResourcesEnable() else ''}")
Expand All @@ -402,6 +406,8 @@ def printContainerRecap(cls, container: ExegolContainerTemplate):
recap.add_row("[bold blue]Devices[/bold blue]", devices.strip())
if len(envs) > 0:
recap.add_row("[bold blue]Envs[/bold blue]", envs.strip())
if len(ports) > 0:
recap.add_row("[bold blue]Ports[/bold blue]", ports.strip())
if len(volumes) > 0:
recap.add_row("[bold blue]Volumes[/bold blue]", volumes.strip())
if len(sysctls) > 0:
Expand Down
6 changes: 6 additions & 0 deletions exegol/console/cli/actions/GenericParameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ def __init__(self, groupArgs: List[GroupArg]):
default=[],
dest="volumes",
help="Share a new volume between host and exegol (format: --volume /host/path/:/exegol/mount/)")
self.ports = Option("-p", "--port",
action="append",
default=[],
dest="ports",
help="Share a network port between host and exegol (format: --port [<host_ipv4>:]<host_port>[:<container_port>][:<protocol>]. This configuration will disable the shared network with the host.")
self.privileged = Option("--privileged",
dest="privileged",
action="store_true",
Expand All @@ -159,6 +164,7 @@ def __init__(self, groupArgs: List[GroupArg]):
groupArgs.append(GroupArg({"arg": self.workspace_path, "required": False},
{"arg": self.mount_current_dir, "required": False},
{"arg": self.volumes, "required": False},
{"arg": self.ports, "required": False},
{"arg": self.privileged, "required": False},
{"arg": self.devices, "required": False},
{"arg": self.X11, "required": False},
Expand Down
14 changes: 10 additions & 4 deletions exegol/manager/ExegolManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ def print_version(cls):
logger.debug(f"Git source installation: {boolFormatter(ConstantConfig.git_source_installation)}")
logger.debug(f"Host OS: {EnvInfo.getHostOs()}")
if EnvInfo.isWindowsHost():
logger.debug(f"Windows release: {EnvInfo.getWindowsRelease()}")
logger.debug(f"Python environment: {EnvInfo.current_platform}")
logger.debug(f"Docker engine: {EnvInfo.getDockerEngine().upper()}")
logger.debug(f"Windows release: {EnvInfo.getWindowsRelease()}")
logger.debug(f"Docker desktop: {boolFormatter(EnvInfo.isDockerDesktop())}")
logger.debug(f"Shell type: {EnvInfo.getShellType()}")
logger.empty_line(log_level=logging.DEBUG)

@classmethod
def __loadOrInstallImage(cls,
Expand Down Expand Up @@ -395,6 +398,9 @@ def __prepareContainerConfig(cls):
if ParametersManager().share_timezone:
config.enableSharedTimezone()
config.setNetworkMode(ParametersManager().host_network)
if ParametersManager().ports is not None:
for port in ParametersManager().ports:
config.addRawPort(port)
if ParametersManager().shared_resources:
config.enableSharedResources()
if ParametersManager().exegol_resources:
Expand All @@ -413,7 +419,7 @@ def __prepareContainerConfig(cls):
config.addRawVolume(volume)
if ParametersManager().devices is not None:
for device in ParametersManager().devices:
config.addDevice(device)
config.addUserDevice(device)
if ParametersManager().vpn is not None:
config.enableVPN()
if ParametersManager().envs is not None:
Expand Down Expand Up @@ -450,7 +456,7 @@ def __createContainer(cls, name: Optional[str]) -> ExegolContainer:
"read CLI options with [green]exegol start -h[/green]")

container = DockerUtils.createContainer(model)
container.postStartSetup()
container.postCreateSetup()
return container

@classmethod
Expand All @@ -471,7 +477,7 @@ def __createTmpContainer(cls, image_name: Optional[str] = None) -> ExegolContain
model = ExegolContainerTemplate(name, config, image)

container = DockerUtils.createContainer(model, temporary=True)
container.postStartSetup()
container.postCreateSetup()
return container

@classmethod
Expand Down
Loading