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

Docker debugging docs #360

Merged
merged 2 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,13 @@ ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends python3 \
# To generate certificates
openssl \
# Required for the setup.py install
# Required for the setup.py install and progressbar (required by pyrdp-convert)
python3-distutils \
# GUI and notifications stuff
libgl1-mesa-glx libxcb-xinerama0 \
notify-osd dbus-x11 libxkbcommon-x11-0 \
# Runtime requirement for PyAV (pyrdp-convert to MP4)
libavcodec58 libavdevice58 \
# Runtime requirement by progressbar (required by pyrdp-convert)
python3-distutils \
&& rm -rf /var/lib/apt/lists/*

# Copy preinstalled dependencies from compile image
Expand Down
40 changes: 40 additions & 0 deletions docs/debugging-recipes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
= Debugging recipes

== Debugging from the docker container

Build the container (or use an existing tag):

docker build -t pyrdp -f Dockerfile .

Run it interactive to get a shell but specify root user (to be able to run `pip install`):

docker run -ti -v $PWD:/home/pyrdp/ --user root pyrdp bash

In the container, install pip:

apt update
apt install python3-pip

Now move away from `/home/pyrdp/` to avoid loading order conflicts and activate the `venv`:

cd /
source /opt/venv/bin/activate

Install the debugger:

pip install ipdb

Run pyrdp, for example:

ipdb3 /opt/venv/bin/pyrdp-convert.py -f mp4 /home/pyrdp/rdp_replay_20210112_16-14-08_535_Elizabeth685320.pyrdp

Run `c` to continue on loading breakpoint:

```
> /opt/venv/bin/pyrdp-convert.py(3)<module>()
2 # EASY-INSTALL-SCRIPT: 'pyrdp==1.1.1.dev0','pyrdp-convert.py'
----> 3 __requires__ = 'pyrdp==1.1.1.dev0'
4 __import__('pkg_resources').run_script('pyrdp==1.1.1.dev0', 'pyrdp-convert.py')

ipdb> c
```