Skip to content
Draft
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/tmp/
/environment*
/.vscode
/ssh

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ENV LANG=C.UTF-8 \
DEBIAN_FRONTEND=noninteractive

ARG PY=3.12
# UID / GID needed for git by ssh
ARG UID
ARG GID

# binutils is needed for the ar command, used by pypandoc.ensure_pandoc_installed()
RUN set -x \
Expand Down Expand Up @@ -55,5 +58,17 @@ RUN pip install --no-cache-dir -e /app/src/oca-github-bot

# make work and home directory
RUN mkdir /app/run && chmod ogu+rwx /app/run
RUN groupadd -g $GID -o app
RUN useradd -m -u $UID -g $GID -o -s /bin/bash app

ENV HOME=/app/run
WORKDIR /app/run

# git: change all url to ssh instead of HTTP
# in order to avoid GITHUB_TOKEN leaks in error messages
RUN git config --global url.ssh://[email protected]/.insteadOf https://github.com/
COPY ./ssh /home/app/.ssh/
RUN chown app /home/app/.ssh
RUN chown app /home/app/.ssh/*

USER app
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ The bot URL must be exposed on the internet through a reverse
proxy and configured as a GitHub webhook, using the secret configured
in ``GITHUB_SECRET``.

Private repo support
===========

If the bot needs to access private github repository, you should generate
a new key, and give access to this key on github.
If running from docker, it should be placed on a `ssh` directory on the root of this
repo.

Development
===========

Expand Down Expand Up @@ -233,6 +241,7 @@ Contributors
* Sylvain Le Gal (https://twitter.com/legalsylvain)
* Tecnativa - Pedro M. Baeza
* Tecnativa - Víctor Martínez
* Raphaël Reverdy <[email protected]>

Maintainers
===========
Expand Down
Loading