cgitize 8.0.6__tar.gz → 9.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cgitize-9.0.0/CHANGELOG.md +64 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/DEVELOPMENT.md +3 -2
- {cgitize-8.0.6 → cgitize-9.0.0}/PKG-INFO +1 -1
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize.egg-info/PKG-INFO +1 -1
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize.egg-info/SOURCES.txt +6 -8
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize.egg-info/scm_file_list.json +6 -8
- cgitize-9.0.0/cgitize.egg-info/scm_version.json +8 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/Dockerfile +3 -5
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/README.md +8 -5
- cgitize-9.0.0/test/integration/docker/docker-compose.yml +29 -0
- cgitize-9.0.0/test/integration/docker/git_server/Dockerfile +16 -0
- cgitize-9.0.0/test/integration/docker/git_server/entrypoint.sh +64 -0
- cgitize-9.0.0/test/integration/docker/git_server/setup.sh +68 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/integration/docker/test.sh +3 -82
- cgitize-8.0.6/.dockerignore +0 -5
- cgitize-8.0.6/cgitize.egg-info/scm_version.json +0 -8
- cgitize-8.0.6/docker-compose.yml +0 -25
- cgitize-8.0.6/examples/docker/cgitize.toml +0 -7
- cgitize-8.0.6/test/integration/docker/.dockerignore +0 -5
- cgitize-8.0.6/test/integration/docker/docker-compose.yml +0 -21
- cgitize-8.0.6/test/integration/docker/git_server/Dockerfile +0 -24
- cgitize-8.0.6/test/integration/docker/git_server/setup_repo.sh +0 -30
- {cgitize-8.0.6 → cgitize-9.0.0}/.git-blame-ignore-revs +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/.gitattributes +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/.github/dependabot.yml +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/.github/workflows/ci.yml +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/.github/workflows/maintenance.yml +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/.gitignore +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/.python-version +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/LICENSE.txt +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/Makefile +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/README.md +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/__init__.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/bitbucket.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/cgit.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/config.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/git.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/github.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/gitlab.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/header.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/main.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/repo.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/url.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/utils.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize/version.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize.egg-info/dependency_links.txt +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize.egg-info/entry_points.txt +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize.egg-info/requires.txt +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/cgitize.egg-info/top_level.txt +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/Dockerfile +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/cmd.sh +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/etc/cgit/common +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/etc/cgitrc +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/etc/nginx/conf.d/default.conf +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/usr/lib/cgit/filters/about-formatting.sh +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/get_output_dir.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docker/in_cron.sh +0 -0
- /cgitize-8.0.6/docker/cgitize.sh → /cgitize-9.0.0/docker/run.sh +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docs/api.md +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/docs/auth.md +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/examples/cgitize.toml +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/prelude.mk +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/pyproject.toml +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/requirements.txt +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/setup.cfg +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/__init__.py +0 -0
- {cgitize-8.0.6/test/integration/docker/cgitize → cgitize-9.0.0/test/integration/docker}/.gitignore +0 -0
- {cgitize-8.0.6/test/integration/docker/cgitize → cgitize-9.0.0/test/integration/docker}/etc/cgitize.toml +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/integration/example/test.sh +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/integration/local/test.sh +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/set_credentials.sh +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/unit/__init__.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/unit/test_bitbucket.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/unit/test_github.py +0 -0
- {cgitize-8.0.6 → cgitize-9.0.0}/test/unit/test_gitlab.py +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
v9.0
|
|
2
|
+
====
|
|
3
|
+
|
|
4
|
+
### Breaking changes
|
|
5
|
+
|
|
6
|
+
* Docker images: SSH agent should now be mapped to /ssh/agent.sock (instead of
|
|
7
|
+
/ssh-agent.sock).
|
|
8
|
+
|
|
9
|
+
v8.0
|
|
10
|
+
====
|
|
11
|
+
|
|
12
|
+
### Breaking changes
|
|
13
|
+
|
|
14
|
+
* Since Bitbucket deprecated "app passwords", an Atlassian API token is now
|
|
15
|
+
required in place of those.
|
|
16
|
+
* In cgitize.toml, the field `bitbucket.username` is replaced with
|
|
17
|
+
`bitbucket.email`, since the API tokens are tied to the Atlassian account now.
|
|
18
|
+
|
|
19
|
+
v7.0
|
|
20
|
+
====
|
|
21
|
+
|
|
22
|
+
### Breaking changes
|
|
23
|
+
|
|
24
|
+
* For forge users, only publicly visible repositories are fetched by default.
|
|
25
|
+
* New fields in cgitize.toml `{github,bitbucket,gitlab}.users.*.{public,private}`
|
|
26
|
+
control whether to fetch public or private repositories, or both.
|
|
27
|
+
* The `public` field is set to `true` by default; `private` is `false`.
|
|
28
|
+
|
|
29
|
+
v6.0
|
|
30
|
+
====
|
|
31
|
+
|
|
32
|
+
* Major version bumps for the dependencies.
|
|
33
|
+
* Otherwise, no breaking changes.
|
|
34
|
+
|
|
35
|
+
v5.0
|
|
36
|
+
====
|
|
37
|
+
|
|
38
|
+
### Breaking changes
|
|
39
|
+
|
|
40
|
+
* GitHub: private user repositories are also cloned now.
|
|
41
|
+
* This change is consistent with how Gitlab and Bitbucket backend work.
|
|
42
|
+
* If `github.token` is set in cgitize.toml, `github.username` must also be
|
|
43
|
+
set.
|
|
44
|
+
|
|
45
|
+
v5.1
|
|
46
|
+
----
|
|
47
|
+
|
|
48
|
+
### New features
|
|
49
|
+
|
|
50
|
+
* In case of an error, a message is displayed in the frontend's header.
|
|
51
|
+
|
|
52
|
+
v4.0
|
|
53
|
+
====
|
|
54
|
+
|
|
55
|
+
### Breaking changes
|
|
56
|
+
|
|
57
|
+
* Fields `access_token` & `app_password` in cgitize.toml renamed to simply
|
|
58
|
+
`token`.
|
|
59
|
+
* Repositories are cloned into directories with the ".git" suffix now.
|
|
60
|
+
|
|
61
|
+
v3.0
|
|
62
|
+
====
|
|
63
|
+
|
|
64
|
+
* The latest release that I'm still not too lazy to look up.
|
|
@@ -61,9 +61,10 @@ Upgrading dependencies
|
|
|
61
61
|
Releases
|
|
62
62
|
--------
|
|
63
63
|
|
|
64
|
-
* Make a new tag using the semantic versioning policy (you can use [tag-release]
|
|
65
|
-
to do that), review and push it.
|
|
66
64
|
* For a new major version, update the version in the docker-compose definition
|
|
67
65
|
in docker/README.md.
|
|
66
|
+
* Update CHANGELOG.md if necessary.
|
|
67
|
+
* Make a new tag using the semantic versioning policy (you can use [tag-release]
|
|
68
|
+
to do that), review and push it.
|
|
68
69
|
|
|
69
70
|
[tag-release]: https://github.com/egor-tensin/tag-release
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
.dockerignore
|
|
2
1
|
.git-blame-ignore-revs
|
|
3
2
|
.gitattributes
|
|
4
3
|
.gitignore
|
|
5
4
|
.python-version
|
|
5
|
+
CHANGELOG.md
|
|
6
6
|
DEVELOPMENT.md
|
|
7
7
|
LICENSE.txt
|
|
8
8
|
Makefile
|
|
9
9
|
README.md
|
|
10
|
-
docker-compose.yml
|
|
11
10
|
prelude.mk
|
|
12
11
|
pyproject.toml
|
|
13
12
|
requirements.txt
|
|
@@ -37,9 +36,9 @@ cgitize.egg-info/scm_version.json
|
|
|
37
36
|
cgitize.egg-info/top_level.txt
|
|
38
37
|
docker/Dockerfile
|
|
39
38
|
docker/README.md
|
|
40
|
-
docker/cgitize.sh
|
|
41
39
|
docker/get_output_dir.py
|
|
42
40
|
docker/in_cron.sh
|
|
41
|
+
docker/run.sh
|
|
43
42
|
docker/frontend/Dockerfile
|
|
44
43
|
docker/frontend/cmd.sh
|
|
45
44
|
docker/frontend/etc/cgitrc
|
|
@@ -51,16 +50,15 @@ docker/frontend/usr/lib/cgit/filters/html-converters/md2html
|
|
|
51
50
|
docs/api.md
|
|
52
51
|
docs/auth.md
|
|
53
52
|
examples/cgitize.toml
|
|
54
|
-
examples/docker/cgitize.toml
|
|
55
53
|
test/__init__.py
|
|
56
54
|
test/set_credentials.sh
|
|
57
|
-
test/integration/docker/.
|
|
55
|
+
test/integration/docker/.gitignore
|
|
58
56
|
test/integration/docker/docker-compose.yml
|
|
59
57
|
test/integration/docker/test.sh
|
|
60
|
-
test/integration/docker/cgitize
|
|
61
|
-
test/integration/docker/cgitize/etc/cgitize.toml
|
|
58
|
+
test/integration/docker/etc/cgitize.toml
|
|
62
59
|
test/integration/docker/git_server/Dockerfile
|
|
63
|
-
test/integration/docker/git_server/
|
|
60
|
+
test/integration/docker/git_server/entrypoint.sh
|
|
61
|
+
test/integration/docker/git_server/setup.sh
|
|
64
62
|
test/integration/example/test.sh
|
|
65
63
|
test/integration/local/test.sh
|
|
66
64
|
test/unit/__init__.py
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": [
|
|
3
|
-
".dockerignore",
|
|
4
3
|
".git-blame-ignore-revs",
|
|
5
4
|
".gitattributes",
|
|
6
5
|
".github/dependabot.yml",
|
|
@@ -8,6 +7,7 @@
|
|
|
8
7
|
".github/workflows/maintenance.yml",
|
|
9
8
|
".gitignore",
|
|
10
9
|
".python-version",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
11
|
"DEVELOPMENT.md",
|
|
12
12
|
"LICENSE.txt",
|
|
13
13
|
"Makefile",
|
|
@@ -25,10 +25,8 @@
|
|
|
25
25
|
"cgitize/url.py",
|
|
26
26
|
"cgitize/utils.py",
|
|
27
27
|
"cgitize/version.py",
|
|
28
|
-
"docker-compose.yml",
|
|
29
28
|
"docker/Dockerfile",
|
|
30
29
|
"docker/README.md",
|
|
31
|
-
"docker/cgitize.sh",
|
|
32
30
|
"docker/frontend/Dockerfile",
|
|
33
31
|
"docker/frontend/cmd.sh",
|
|
34
32
|
"docker/frontend/etc/cgit/common",
|
|
@@ -39,20 +37,20 @@
|
|
|
39
37
|
"docker/frontend/usr/lib/cgit/filters/html-converters/md2html",
|
|
40
38
|
"docker/get_output_dir.py",
|
|
41
39
|
"docker/in_cron.sh",
|
|
40
|
+
"docker/run.sh",
|
|
42
41
|
"docs/api.md",
|
|
43
42
|
"docs/auth.md",
|
|
44
43
|
"examples/cgitize.toml",
|
|
45
|
-
"examples/docker/cgitize.toml",
|
|
46
44
|
"prelude.mk",
|
|
47
45
|
"pyproject.toml",
|
|
48
46
|
"requirements.txt",
|
|
49
47
|
"test/__init__.py",
|
|
50
|
-
"test/integration/docker/.
|
|
51
|
-
"test/integration/docker/cgitize/.gitignore",
|
|
52
|
-
"test/integration/docker/cgitize/etc/cgitize.toml",
|
|
48
|
+
"test/integration/docker/.gitignore",
|
|
53
49
|
"test/integration/docker/docker-compose.yml",
|
|
50
|
+
"test/integration/docker/etc/cgitize.toml",
|
|
54
51
|
"test/integration/docker/git_server/Dockerfile",
|
|
55
|
-
"test/integration/docker/git_server/
|
|
52
|
+
"test/integration/docker/git_server/entrypoint.sh",
|
|
53
|
+
"test/integration/docker/git_server/setup.sh",
|
|
56
54
|
"test/integration/docker/test.sh",
|
|
57
55
|
"test/integration/example/test.sh",
|
|
58
56
|
"test/integration/local/test.sh",
|
|
@@ -35,11 +35,9 @@ RUN apk add -q --no-cache bash git openssh-client tini
|
|
|
35
35
|
COPY --from=build ["/deps", "/deps/"]
|
|
36
36
|
ENV PYTHONPATH="/deps:/usr/src"
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
ARG ssh_sock_path="$ssh_sock_dir/ssh-agent.sock"
|
|
40
|
-
ENV SSH_AUTH_SOCK="$ssh_sock_path"
|
|
38
|
+
ENV SSH_AUTH_SOCK="/ssh/agent.sock"
|
|
41
39
|
|
|
42
|
-
COPY ["docker/
|
|
40
|
+
COPY ["docker/run.sh", "/"]
|
|
43
41
|
COPY ["docker/get_output_dir.py", "/"]
|
|
44
42
|
COPY ["docker/in_cron.sh", "/"]
|
|
45
43
|
COPY ["cgitize/", "/usr/src/cgitize/"]
|
|
@@ -48,6 +46,6 @@ ENV SCHEDULE_ON_START=1
|
|
|
48
46
|
ENTRYPOINT ["/sbin/tini", "--", "/in_cron.sh"]
|
|
49
47
|
|
|
50
48
|
WORKDIR /usr/src
|
|
51
|
-
CMD ["/
|
|
49
|
+
CMD ["/run.sh"]
|
|
52
50
|
|
|
53
51
|
HEALTHCHECK --interval=5m --retries=3 CMD ! test -f /fail
|
|
@@ -8,7 +8,7 @@ The `SCHEDULE` environment variable controls how often it gets run (see below).
|
|
|
8
8
|
* Volumes:
|
|
9
9
|
* `/etc/cgitize/cgitize.toml`: configuration file path.
|
|
10
10
|
* `/mnt/cgitize`: by default, cloned repositories will be written here.
|
|
11
|
-
* `/ssh
|
|
11
|
+
* `/ssh/agent.sock`: if you use SSH, map the agent socket here.
|
|
12
12
|
* Environment variables:
|
|
13
13
|
* `SCHEDULE`: defaults to "once", which makes the container exit after the
|
|
14
14
|
first run.
|
|
@@ -49,18 +49,21 @@ services:
|
|
|
49
49
|
SCHEDULE: '0 */3 * * *'
|
|
50
50
|
# Set CGITIZE_{GITHUB,BITBUCKET,GITLAB}_{USERNAME,TOKEN} variables
|
|
51
51
|
# here or in the config file.
|
|
52
|
-
image: egortensin/cgitize:
|
|
52
|
+
image: egortensin/cgitize:9
|
|
53
53
|
restart: unless-stopped
|
|
54
54
|
volumes:
|
|
55
55
|
- ./example.toml:/etc/cgitize/cgitize.toml:ro
|
|
56
|
-
-
|
|
56
|
+
- repositories:/mnt/cgitize
|
|
57
57
|
frontend:
|
|
58
|
-
image: egortensin/cgitize-frontend:
|
|
58
|
+
image: egortensin/cgitize-frontend:9
|
|
59
59
|
ports:
|
|
60
60
|
- '127.0.0.1:80:80'
|
|
61
61
|
restart: unless-stopped
|
|
62
62
|
volumes:
|
|
63
|
-
-
|
|
63
|
+
- repositories:/mnt/cgitize:ro
|
|
64
|
+
|
|
65
|
+
volumes:
|
|
66
|
+
repositories:
|
|
64
67
|
```
|
|
65
68
|
|
|
66
69
|
In this configuration, cgitize pulls repositories defined in example.toml every
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
services:
|
|
2
|
+
git_server:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: git_server/Dockerfile
|
|
6
|
+
volumes:
|
|
7
|
+
- ssh:/ssh
|
|
8
|
+
cgitize:
|
|
9
|
+
build:
|
|
10
|
+
context: ../../..
|
|
11
|
+
dockerfile: docker/Dockerfile
|
|
12
|
+
depends_on:
|
|
13
|
+
- git_server
|
|
14
|
+
environment:
|
|
15
|
+
SCHEDULE: once
|
|
16
|
+
volumes:
|
|
17
|
+
- ./etc:/etc/cgitize:ro
|
|
18
|
+
- ./output:/mnt/cgitize
|
|
19
|
+
- ssh:/ssh:ro
|
|
20
|
+
frontend:
|
|
21
|
+
build:
|
|
22
|
+
context: ../../../docker/frontend
|
|
23
|
+
ports:
|
|
24
|
+
- '127.0.0.1:80:80'
|
|
25
|
+
volumes:
|
|
26
|
+
- ./output:/mnt/cgitize:ro
|
|
27
|
+
|
|
28
|
+
volumes:
|
|
29
|
+
ssh:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
FROM alpine:3.24
|
|
2
|
+
|
|
3
|
+
RUN apk add -q --no-cache bash git openssh-client-common openssh-server tini && \
|
|
4
|
+
echo 'root:root' | chpasswd && \
|
|
5
|
+
sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
6
|
+
|
|
7
|
+
USER root
|
|
8
|
+
WORKDIR /root
|
|
9
|
+
|
|
10
|
+
COPY ["git_server/setup.sh", "./"]
|
|
11
|
+
RUN ./setup.sh
|
|
12
|
+
|
|
13
|
+
COPY ["git_server/entrypoint.sh", "/"]
|
|
14
|
+
ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
|
|
15
|
+
|
|
16
|
+
CMD ["/usr/sbin/sshd", "-D"]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -o errexit -o nounset -o pipefail
|
|
4
|
+
shopt -s inherit_errexit lastpipe
|
|
5
|
+
|
|
6
|
+
script_name="$( basename -- "${BASH_SOURCE[0]}" )"
|
|
7
|
+
readonly script_name
|
|
8
|
+
|
|
9
|
+
dump() {
|
|
10
|
+
local prefix="${FUNCNAME[0]}"
|
|
11
|
+
[ "${#FUNCNAME[@]}" -gt 1 ] && prefix="${FUNCNAME[1]}"
|
|
12
|
+
|
|
13
|
+
local msg
|
|
14
|
+
for msg; do
|
|
15
|
+
echo "$script_name: $prefix: $msg"
|
|
16
|
+
done
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
readonly ssh_dir=/ssh
|
|
20
|
+
readonly ssh_client_key="$ssh_dir/client_key"
|
|
21
|
+
readonly ssh_client_password='password'
|
|
22
|
+
|
|
23
|
+
spawn_ssh_agent() {
|
|
24
|
+
if ! command -v ssh-agent > /dev/null 2>&1; then
|
|
25
|
+
dump "could not find ssh-agent" >&2
|
|
26
|
+
return 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
local output
|
|
30
|
+
output="$( ssh-agent -s -a "$ssh_dir/agent.sock" )"
|
|
31
|
+
|
|
32
|
+
echo "$output"
|
|
33
|
+
eval "$output"
|
|
34
|
+
|
|
35
|
+
if [ -z "${SSH_AGENT_PID:+x}" ]; then
|
|
36
|
+
dump "could not start ssh-agent" >&2
|
|
37
|
+
return 1
|
|
38
|
+
fi
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setup_ssh_agent() {
|
|
42
|
+
echo
|
|
43
|
+
echo ----------------------------------------------------------------------
|
|
44
|
+
echo Setting up ssh-agent
|
|
45
|
+
echo ----------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
spawn_ssh_agent
|
|
48
|
+
|
|
49
|
+
local askpass_path
|
|
50
|
+
askpass_path="$( mktemp )"
|
|
51
|
+
chmod 0700 -- "$askpass_path"
|
|
52
|
+
|
|
53
|
+
echo "#!/usr/bin/env sh" >> "$askpass_path"
|
|
54
|
+
printf -- 'echo %q' "$ssh_client_password" >> "$askpass_path"
|
|
55
|
+
|
|
56
|
+
SSH_ASKPASS="$askpass_path" SSH_ASKPASS_REQUIRE=force DISPLAY= ssh-add "$ssh_client_key" < /dev/null
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
main() {
|
|
60
|
+
setup_ssh_agent
|
|
61
|
+
exec "$@"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
main "$@"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -o errexit -o nounset -o pipefail
|
|
4
|
+
shopt -s inherit_errexit lastpipe
|
|
5
|
+
|
|
6
|
+
readonly ssh_dir=/ssh
|
|
7
|
+
readonly ssh_client_password='password'
|
|
8
|
+
|
|
9
|
+
configure_git() {
|
|
10
|
+
echo
|
|
11
|
+
echo ----------------------------------------------------------------------
|
|
12
|
+
echo Configuring git
|
|
13
|
+
echo ----------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
git config --global user.name 'John Doe'
|
|
16
|
+
git config --global user.email 'John.Doe@example.com'
|
|
17
|
+
git config --global init.defaultBranch main
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
generate_ssh_keys() {
|
|
21
|
+
echo
|
|
22
|
+
echo ----------------------------------------------------------------------
|
|
23
|
+
echo Generating SSH keys
|
|
24
|
+
echo ----------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
mkdir -p -- "$ssh_dir"
|
|
27
|
+
|
|
28
|
+
ssh-keygen -t rsa -b 4096 -f "$ssh_dir/client_key" -N "$ssh_client_password"
|
|
29
|
+
ssh-keygen -t rsa -b 4096 -f "$ssh_dir/server_key" -N ''
|
|
30
|
+
|
|
31
|
+
mkdir ~/.ssh
|
|
32
|
+
|
|
33
|
+
cp "$ssh_dir/server_key" /etc/ssh/ssh_host_ed25519_key
|
|
34
|
+
cp "$ssh_dir/server_key.pub" /etc/ssh/ssh_host_ed25519_key.pub
|
|
35
|
+
cp "$ssh_dir/client_key.pub" ~/.ssh/authorized_keys
|
|
36
|
+
|
|
37
|
+
chmod 0600 -- /etc/ssh/ssh_host_ed25519_key
|
|
38
|
+
chmod 0700 -- ~/.ssh/
|
|
39
|
+
chmod 0600 -- ~/.ssh/authorized_keys
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
readonly repo_path="$HOME/test_repo"
|
|
43
|
+
|
|
44
|
+
create_repo() {
|
|
45
|
+
echo
|
|
46
|
+
echo ----------------------------------------------------------------------
|
|
47
|
+
echo Setting up upstream repository
|
|
48
|
+
echo ----------------------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
mkdir -p -- "$repo_path"
|
|
51
|
+
pushd -- "$repo_path" > /dev/null
|
|
52
|
+
git init
|
|
53
|
+
echo '1' > 1.txt
|
|
54
|
+
git add .
|
|
55
|
+
git commit -m 'first commit'
|
|
56
|
+
echo '2' > 2.txt
|
|
57
|
+
git add .
|
|
58
|
+
git commit -m 'second commit'
|
|
59
|
+
popd > /dev/null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
main() {
|
|
63
|
+
configure_git
|
|
64
|
+
generate_ssh_keys
|
|
65
|
+
create_repo
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
main
|
|
@@ -12,10 +12,8 @@ readonly script_name
|
|
|
12
12
|
# This is still required with older Compose versions to use TARGETARCH:
|
|
13
13
|
export DOCKER_BUILDKIT=1
|
|
14
14
|
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly output_dir="$script_dir/cgitize/output"
|
|
18
|
-
readonly frontend_host=localhost
|
|
15
|
+
readonly output_dir="$script_dir/output"
|
|
16
|
+
readonly frontend_host=127.0.0.1
|
|
19
17
|
|
|
20
18
|
dump() {
|
|
21
19
|
local prefix="${FUNCNAME[0]}"
|
|
@@ -40,8 +38,6 @@ cleanup() {
|
|
|
40
38
|
echo Cleaning up
|
|
41
39
|
echo ----------------------------------------------------------------------
|
|
42
40
|
|
|
43
|
-
remove_ssh_keys
|
|
44
|
-
kill_ssh_agent
|
|
45
41
|
docker_cleanup
|
|
46
42
|
|
|
47
43
|
rm -rf -- "$output_dir"
|
|
@@ -85,74 +81,6 @@ curl_check_code() {
|
|
|
85
81
|
fi
|
|
86
82
|
}
|
|
87
83
|
|
|
88
|
-
generate_ssh_keys() {
|
|
89
|
-
echo
|
|
90
|
-
echo ----------------------------------------------------------------------
|
|
91
|
-
echo Generating SSH keys
|
|
92
|
-
echo ----------------------------------------------------------------------
|
|
93
|
-
|
|
94
|
-
mkdir -p -- "$ssh_dir"
|
|
95
|
-
|
|
96
|
-
ssh-keygen -t rsa -b 4096 -f "$ssh_dir/client_key" -N "$client_key_password"
|
|
97
|
-
ssh-keygen -t rsa -b 4096 -f "$ssh_dir/server_key" -N ''
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
remove_ssh_keys() {
|
|
101
|
-
rm -rf -- "$ssh_dir"
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
kill_ssh_agent() {
|
|
105
|
-
[ -n "${this_ssh_agent_pid:+x}" ] || return 0
|
|
106
|
-
dump "killing ssh-agent with PID $this_ssh_agent_pid"
|
|
107
|
-
kill "$this_ssh_agent_pid"
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
spawn_ssh_agent() {
|
|
111
|
-
if ! command -v ssh-agent > /dev/null 2>&1; then
|
|
112
|
-
dump "could not find ssh-agent" >&2
|
|
113
|
-
return 1
|
|
114
|
-
fi
|
|
115
|
-
|
|
116
|
-
local output
|
|
117
|
-
output="$( ssh-agent -s )"
|
|
118
|
-
|
|
119
|
-
eval "$output"
|
|
120
|
-
|
|
121
|
-
if [ -z "${SSH_AGENT_PID:+x}" ]; then
|
|
122
|
-
dump "could not start ssh-agent" >&2
|
|
123
|
-
return 1
|
|
124
|
-
fi
|
|
125
|
-
|
|
126
|
-
this_ssh_agent_pid="$SSH_AGENT_PID"
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
setup_ssh_agent() {
|
|
130
|
-
echo
|
|
131
|
-
echo ----------------------------------------------------------------------
|
|
132
|
-
echo Setting up ssh-agent
|
|
133
|
-
echo ----------------------------------------------------------------------
|
|
134
|
-
|
|
135
|
-
spawn_ssh_agent
|
|
136
|
-
|
|
137
|
-
local key="$ssh_dir/client_key"
|
|
138
|
-
chmod 0600 -- "$key"
|
|
139
|
-
|
|
140
|
-
local askpass_path
|
|
141
|
-
askpass_path="$( mktemp --tmpdir="$script_dir" )"
|
|
142
|
-
|
|
143
|
-
local askpass_rm
|
|
144
|
-
askpass_rm="$( printf -- 'rm -- %q; trap - RETURN' "$askpass_path" )"
|
|
145
|
-
trap "$askpass_rm" RETURN
|
|
146
|
-
|
|
147
|
-
chmod 0700 -- "$askpass_path"
|
|
148
|
-
|
|
149
|
-
local echo_password
|
|
150
|
-
echo_password="$( printf -- 'echo %q' "$client_key_password" )"
|
|
151
|
-
echo "$echo_password" > "$askpass_path"
|
|
152
|
-
|
|
153
|
-
SSH_ASKPASS="$askpass_path" SSH_ASKPASS_REQUIRE=force DISPLAY= ssh-add "$key" < /dev/null
|
|
154
|
-
}
|
|
155
|
-
|
|
156
84
|
docker_build() {
|
|
157
85
|
echo
|
|
158
86
|
echo ----------------------------------------------------------------------
|
|
@@ -169,8 +97,6 @@ docker_cleanup() {
|
|
|
169
97
|
}
|
|
170
98
|
|
|
171
99
|
setup() {
|
|
172
|
-
generate_ssh_keys
|
|
173
|
-
setup_ssh_agent
|
|
174
100
|
docker_build
|
|
175
101
|
}
|
|
176
102
|
|
|
@@ -189,11 +115,6 @@ run_cgitize() {
|
|
|
189
115
|
echo Running cgitize
|
|
190
116
|
echo ----------------------------------------------------------------------
|
|
191
117
|
|
|
192
|
-
if [ -z "${SSH_AUTH_SOCK:+x}" ]; then
|
|
193
|
-
dump 'SSH_AUTH_SOCK is not defined' >&2
|
|
194
|
-
return 1
|
|
195
|
-
fi
|
|
196
|
-
dump "SSH_AUTH_SOCK: $SSH_AUTH_SOCK"
|
|
197
118
|
docker compose run --rm cgitize
|
|
198
119
|
}
|
|
199
120
|
|
|
@@ -219,7 +140,7 @@ verify_git() {
|
|
|
219
140
|
echo Checking the pulled repository
|
|
220
141
|
echo ----------------------------------------------------------------------
|
|
221
142
|
|
|
222
|
-
pushd -- "$script_dir/
|
|
143
|
+
pushd -- "$script_dir/output/test_repo.git" > /dev/null
|
|
223
144
|
git log --oneline
|
|
224
145
|
popd > /dev/null
|
|
225
146
|
}
|
cgitize-8.0.6/.dockerignore
DELETED
cgitize-8.0.6/docker-compose.yml
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
cgitize:
|
|
3
|
-
build:
|
|
4
|
-
context: .
|
|
5
|
-
dockerfile: docker/Dockerfile
|
|
6
|
-
environment:
|
|
7
|
-
# Every 3 hours:
|
|
8
|
-
SCHEDULE: '0 */3 * * *'
|
|
9
|
-
image: egortensin/cgitize:latest
|
|
10
|
-
restart: unless-stopped
|
|
11
|
-
volumes:
|
|
12
|
-
- ./examples/docker:/etc/cgitize:ro
|
|
13
|
-
- repositories:/mnt/cgitize
|
|
14
|
-
frontend:
|
|
15
|
-
build:
|
|
16
|
-
context: ./docker/frontend
|
|
17
|
-
image: egortensin/cgitize-frontend:latest
|
|
18
|
-
ports:
|
|
19
|
-
- '127.0.0.1:80:80'
|
|
20
|
-
restart: unless-stopped
|
|
21
|
-
volumes:
|
|
22
|
-
- repositories:/mnt/cgitize:ro
|
|
23
|
-
|
|
24
|
-
volumes:
|
|
25
|
-
repositories:
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
services:
|
|
2
|
-
git_server:
|
|
3
|
-
build:
|
|
4
|
-
context: .
|
|
5
|
-
dockerfile: git_server/Dockerfile
|
|
6
|
-
cgitize:
|
|
7
|
-
extends:
|
|
8
|
-
file: ../../../docker-compose.yml
|
|
9
|
-
service: cgitize
|
|
10
|
-
environment:
|
|
11
|
-
SCHEDULE: once
|
|
12
|
-
volumes:
|
|
13
|
-
- ./cgitize/etc:/etc/cgitize:ro
|
|
14
|
-
- "$SSH_AUTH_SOCK:/ssh-agent.sock"
|
|
15
|
-
- ./cgitize/output:/mnt/cgitize
|
|
16
|
-
frontend:
|
|
17
|
-
extends:
|
|
18
|
-
file: ../../../docker-compose.yml
|
|
19
|
-
service: frontend
|
|
20
|
-
volumes:
|
|
21
|
-
- ./cgitize/output:/mnt/cgitize:ro
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
FROM alpine:3.24
|
|
2
|
-
|
|
3
|
-
RUN apk add -q --no-cache bash git openssh-server tini && \
|
|
4
|
-
echo 'root:root' | chpasswd && \
|
|
5
|
-
git config --global user.name 'John Doe' && \
|
|
6
|
-
git config --global user.email 'John.Doe@example.com' && \
|
|
7
|
-
git config --global init.defaultBranch main && \
|
|
8
|
-
sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
|
|
9
|
-
|
|
10
|
-
WORKDIR /root
|
|
11
|
-
|
|
12
|
-
COPY ["ssh/server_key", "/etc/ssh/ssh_host_ed25519_key"]
|
|
13
|
-
COPY ["ssh/server_key.pub", "/etc/ssh/ssh_host_ed25519_key.pub"]
|
|
14
|
-
COPY ["ssh/client_key.pub", "./.ssh/authorized_keys"]
|
|
15
|
-
|
|
16
|
-
RUN chmod 0600 -- /etc/ssh/ssh_host_ed25519_key && \
|
|
17
|
-
chmod 0700 -- ./.ssh/ && \
|
|
18
|
-
chmod 0600 -- ./.ssh/authorized_keys
|
|
19
|
-
|
|
20
|
-
COPY ["git_server/setup_repo.sh", "./"]
|
|
21
|
-
RUN ./setup_repo.sh
|
|
22
|
-
|
|
23
|
-
ENTRYPOINT ["/sbin/tini", "--"]
|
|
24
|
-
CMD ["/usr/sbin/sshd", "-D"]
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -o errexit -o nounset -o pipefail
|
|
4
|
-
shopt -s inherit_errexit lastpipe
|
|
5
|
-
|
|
6
|
-
readonly local_repo_path="$HOME/test_repo"
|
|
7
|
-
|
|
8
|
-
setup_local_repo() {
|
|
9
|
-
echo
|
|
10
|
-
echo ----------------------------------------------------------------------
|
|
11
|
-
echo Setting up upstream repository
|
|
12
|
-
echo ----------------------------------------------------------------------
|
|
13
|
-
|
|
14
|
-
mkdir -p -- "$local_repo_path"
|
|
15
|
-
pushd -- "$local_repo_path" > /dev/null
|
|
16
|
-
git init
|
|
17
|
-
echo '1' > 1.txt
|
|
18
|
-
git add .
|
|
19
|
-
git commit -m 'first commit'
|
|
20
|
-
echo '2' > 2.txt
|
|
21
|
-
git add .
|
|
22
|
-
git commit -m 'second commit'
|
|
23
|
-
popd > /dev/null
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
main() {
|
|
27
|
-
setup_local_repo
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
main
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes
RENAMED
|
File without changes
|
{cgitize-8.0.6 → cgitize-9.0.0}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cgitize-8.0.6/test/integration/docker/cgitize → cgitize-9.0.0/test/integration/docker}/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|