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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ attachments/

# Visual Studio Code
.vscode/

# Git reader data
git-reader/data
27 changes: 25 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ services:
user: root
ports:
- 8000:8000

web:
build:
dockerfile: RemoteSettings.Dockerfile
Expand All @@ -36,21 +37,33 @@ services:
- db
- memcached
- autograph
# ports:
# - 8888:8888
environment:
- KINTO_CACHE_BACKEND=kinto.core.cache.memcached
- KINTO_CACHE_HOSTS=memcached:11211 memcached:11212
- KINTO_STORAGE_BACKEND=kinto.core.storage.postgresql
- KINTO_STORAGE_URL=postgresql://postgres@db/postgres
- KINTO_PERMISSION_BACKEND=kinto.core.permission.postgresql
- KINTO_PERMISSION_URL=postgresql://postgres@db/postgres
ports:
- 8888:8888
volumes:
- ./config:/app/config
- ./kinto-remote-settings:/app/kinto-remote-settings
- debug-mail:/app/mail
- attachments:/tmp/attachments

git-reader:
build:
context: git-reader/
args:
UID: 1000
GID: 1000
environment:
- GIT_REPO_PATH=/mnt/data/latest
- SELF_CONTAINED=true
volumes:
- ./git-reader/data:/mnt/data

browser-tests:
build:
context: browser-tests/
Expand All @@ -68,3 +81,13 @@ services:
context: cronjobs/
image: remotesettings/cronjobs
profiles: [cronjobs]

web-proxy:
image: openresty/openresty
ports:
- 8888:8888
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- web
- git-reader
12 changes: 9 additions & 3 deletions git-reader/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
ARG UID=10001
ARG GID=10001

FROM python:3.14.0-slim-trixie

ARG UID
ARG GID

ENV PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
POETRY_NO_INTERACTION=1 \
Expand All @@ -16,9 +22,9 @@ RUN python -m venv $VIRTUAL_ENV && \

WORKDIR /app

RUN chown 10001:10001 /app && \
groupadd --gid 10001 app && \
useradd --no-create-home --uid 10001 --gid 10001 --home-dir /app app
RUN chown ${UID}:${GID} /app
RUN groupadd --gid ${GID} app
RUN useradd --no-create-home --uid ${UID} --gid ${GID} --home-dir /app app

RUN mkdir /app/.ssh && \
ssh-keyscan github.com >> /app/.ssh/known_hosts && \
Expand Down
1 change: 1 addition & 0 deletions git-reader/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ def _get_file_content(
refobj = self.repo.lookup_reference(f"refs/heads/{branch}")
commit = self.repo[refobj.target]
node = commit.tree
print(node)

parts = [p for p in path.strip("/").split("/") if p]
for i, name in enumerate(parts):
Expand Down
60 changes: 58 additions & 2 deletions git-reader/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions git-reader/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pygit2 = "^1.18.2"
uvicorn = "^0.35.0"
uvloop = "^0.21.0"
pyjwt = "^2.10.1"
lz4 = "^4.4.4"

[tool.pytest.ini_options]
pythonpath = ["."]
16 changes: 16 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server {
listen 8888;
server_name localhost;

location / {
proxy_pass http://web:8888/;
}

location /v1 {
proxy_pass http://web:8888/v1;
}

location /v2 {
proxy_pass http://git-reader:8000/v2;
}
}
Loading