cgitize 5.0.0__tar.gz → 5.0.2__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.
Files changed (64) hide show
  1. {cgitize-5.0.0 → cgitize-5.0.2}/.github/workflows/ci.yml +1 -1
  2. {cgitize-5.0.0 → cgitize-5.0.2}/DEVELOPMENT.md +2 -0
  3. {cgitize-5.0.0/cgitize.egg-info → cgitize-5.0.2}/PKG-INFO +7 -2
  4. {cgitize-5.0.0 → cgitize-5.0.2}/README.md +1 -1
  5. {cgitize-5.0.0 → cgitize-5.0.2/cgitize.egg-info}/PKG-INFO +7 -2
  6. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize.egg-info/SOURCES.txt +2 -0
  7. {cgitize-5.0.0 → cgitize-5.0.2}/docker/Dockerfile +1 -1
  8. {cgitize-5.0.0 → cgitize-5.0.2}/docker/README.md +29 -5
  9. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/Dockerfile +2 -2
  10. {cgitize-5.0.0 → cgitize-5.0.2}/docker-compose.yml +3 -9
  11. cgitize-5.0.2/docs/api.md +57 -0
  12. cgitize-5.0.2/examples/docker/cgitize.toml +7 -0
  13. {cgitize-5.0.0 → cgitize-5.0.2}/prelude.mk +1 -1
  14. {cgitize-5.0.0 → cgitize-5.0.2}/requirements.txt +7 -7
  15. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/docker/git_server/Dockerfile +1 -1
  16. {cgitize-5.0.0 → cgitize-5.0.2}/.dockerignore +0 -0
  17. {cgitize-5.0.0 → cgitize-5.0.2}/.gitattributes +0 -0
  18. {cgitize-5.0.0 → cgitize-5.0.2}/.gitignore +0 -0
  19. {cgitize-5.0.0 → cgitize-5.0.2}/.pylintrc +0 -0
  20. {cgitize-5.0.0 → cgitize-5.0.2}/.python-version +0 -0
  21. {cgitize-5.0.0 → cgitize-5.0.2}/LICENSE.txt +0 -0
  22. {cgitize-5.0.0 → cgitize-5.0.2}/Makefile +0 -0
  23. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/__init__.py +0 -0
  24. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/bitbucket.py +0 -0
  25. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/cgit.py +0 -0
  26. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/config.py +0 -0
  27. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/git.py +0 -0
  28. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/github.py +0 -0
  29. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/gitlab.py +0 -0
  30. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/main.py +0 -0
  31. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/repo.py +0 -0
  32. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/utils.py +0 -0
  33. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize/version.py +0 -0
  34. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize.egg-info/dependency_links.txt +0 -0
  35. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize.egg-info/entry_points.txt +0 -0
  36. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize.egg-info/requires.txt +0 -0
  37. {cgitize-5.0.0 → cgitize-5.0.2}/cgitize.egg-info/top_level.txt +0 -0
  38. {cgitize-5.0.0 → cgitize-5.0.2}/docker/cgitize.sh +0 -0
  39. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/cmd.sh +0 -0
  40. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/etc/cgit/common +0 -0
  41. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/etc/cgitrc +0 -0
  42. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/etc/nginx/conf.d/default.conf +0 -0
  43. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/usr/lib/cgit/filters/about-formatting.sh +0 -0
  44. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes +0 -0
  45. {cgitize-5.0.0 → cgitize-5.0.2}/docker/frontend/usr/lib/cgit/filters/html-converters/md2html +0 -0
  46. {cgitize-5.0.0 → cgitize-5.0.2}/docker/get_output_dir.py +0 -0
  47. {cgitize-5.0.0 → cgitize-5.0.2}/docker/in_cron.sh +0 -0
  48. {cgitize-5.0.0 → cgitize-5.0.2}/docs/auth.md +0 -0
  49. {cgitize-5.0.0 → cgitize-5.0.2}/examples/cgitize.toml +0 -0
  50. {cgitize-5.0.0 → cgitize-5.0.2}/pyproject.toml +0 -0
  51. {cgitize-5.0.0 → cgitize-5.0.2}/setup.cfg +0 -0
  52. {cgitize-5.0.0 → cgitize-5.0.2}/test/__init__.py +0 -0
  53. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/docker/.dockerignore +0 -0
  54. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/docker/cgitize/.gitignore +0 -0
  55. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/docker/cgitize/etc/cgitize.toml +0 -0
  56. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/docker/docker-compose.yml +0 -0
  57. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/docker/git_server/setup_repo.sh +0 -0
  58. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/docker/test.sh +0 -0
  59. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/example/test.sh +0 -0
  60. {cgitize-5.0.0 → cgitize-5.0.2}/test/integration/local/test.sh +0 -0
  61. {cgitize-5.0.0 → cgitize-5.0.2}/test/unit/__init__.py +0 -0
  62. {cgitize-5.0.0 → cgitize-5.0.2}/test/unit/test_bitbucket.py +0 -0
  63. {cgitize-5.0.0 → cgitize-5.0.2}/test/unit/test_github.py +0 -0
  64. {cgitize-5.0.0 → cgitize-5.0.2}/test/unit/test_gitlab.py +0 -0
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
15
+ python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
16
16
  name: 'Test / ${{ matrix.python-version }}'
17
17
  env:
18
18
  CGITIZE_GITHUB_USERNAME: cgitize-test
@@ -43,3 +43,5 @@ Releases
43
43
 
44
44
  * Make a git tag for a new minor version using `make tag`.
45
45
  You can then review it and push using `git push --tags`.
46
+ * For a new major version, update the version in the docker-compose definition
47
+ in docker/README.md.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cgitize
3
- Version: 5.0.0
3
+ Version: 5.0.2
4
4
  Summary: Self-host your repositories using cgit
5
5
  Author-email: Egor Tensin <Egor.Tensin@gmail.com>
6
6
  License: MIT
@@ -13,6 +13,11 @@ Classifier: Topic :: Software Development :: Version Control :: Git
13
13
  Requires-Python: >=3.6
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE.txt
16
+ Requires-Dist: atlassian-python-api~=3.28.0
17
+ Requires-Dist: importlib-metadata~=4.0; python_version < "3.8"
18
+ Requires-Dist: PyGithub~=1.0
19
+ Requires-Dist: python-gitlab~=2.0
20
+ Requires-Dist: tomli~=1.0
16
21
 
17
22
  cgitize
18
23
  =======
@@ -27,7 +32,7 @@ Supports cloning all of your repositories from major hosting providers:
27
32
  * Bitbucket,
28
33
  * GitLab.
29
34
 
30
- Example output can be found at https://git.egort.name/.
35
+ Example output can be found at https://git.tensin.name/.
31
36
 
32
37
  Installation
33
38
  ------------
@@ -11,7 +11,7 @@ Supports cloning all of your repositories from major hosting providers:
11
11
  * Bitbucket,
12
12
  * GitLab.
13
13
 
14
- Example output can be found at https://git.egort.name/.
14
+ Example output can be found at https://git.tensin.name/.
15
15
 
16
16
  Installation
17
17
  ------------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cgitize
3
- Version: 5.0.0
3
+ Version: 5.0.2
4
4
  Summary: Self-host your repositories using cgit
5
5
  Author-email: Egor Tensin <Egor.Tensin@gmail.com>
6
6
  License: MIT
@@ -13,6 +13,11 @@ Classifier: Topic :: Software Development :: Version Control :: Git
13
13
  Requires-Python: >=3.6
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE.txt
16
+ Requires-Dist: atlassian-python-api~=3.28.0
17
+ Requires-Dist: importlib-metadata~=4.0; python_version < "3.8"
18
+ Requires-Dist: PyGithub~=1.0
19
+ Requires-Dist: python-gitlab~=2.0
20
+ Requires-Dist: tomli~=1.0
16
21
 
17
22
  cgitize
18
23
  =======
@@ -27,7 +32,7 @@ Supports cloning all of your repositories from major hosting providers:
27
32
  * Bitbucket,
28
33
  * GitLab.
29
34
 
30
- Example output can be found at https://git.egort.name/.
35
+ Example output can be found at https://git.tensin.name/.
31
36
 
32
37
  Installation
33
38
  ------------
@@ -42,8 +42,10 @@ docker/frontend/etc/nginx/conf.d/default.conf
42
42
  docker/frontend/usr/lib/cgit/filters/about-formatting.sh
43
43
  docker/frontend/usr/lib/cgit/filters/html-converters/.gitattributes
44
44
  docker/frontend/usr/lib/cgit/filters/html-converters/md2html
45
+ docs/api.md
45
46
  docs/auth.md
46
47
  examples/cgitize.toml
48
+ examples/docker/cgitize.toml
47
49
  test/__init__.py
48
50
  test/integration/docker/.dockerignore
49
51
  test/integration/docker/docker-compose.yml
@@ -1,4 +1,4 @@
1
- FROM python:3.11-alpine AS base
1
+ FROM python:3.12-alpine AS base
2
2
 
3
3
  FROM base AS deps
4
4
 
@@ -39,11 +39,35 @@ It could look like this:
39
39
  Compose
40
40
  -------
41
41
 
42
- See the root docker-compose.yml file for a possible services definition.
43
- In this configuration, cgitize pulls my repositories from GitHub every 3 hours.
44
- You can test it by running
42
+ Here's an example docker-compose.yml file:
43
+
44
+ version: '3'
45
+
46
+ services:
47
+ cgitize:
48
+ environment:
49
+ # Every 3 hours:
50
+ SCHEDULE: '0 */3 * * *'
51
+ # Set CGITIZE_{GITHUB,BITBUCKET,GITLAB}_{USERNAME,TOKEN} variables
52
+ # here or in the config file.
53
+ image: egortensin/cgitize:5
54
+ restart: unless-stopped
55
+ volumes:
56
+ - ./example.toml:/etc/cgitize/cgitize.toml:ro
57
+ - /srv/volumes/cgitize:/mnt/cgitize
58
+ frontend:
59
+ image: egortensin/cgitize-frontend:5
60
+ ports:
61
+ - '127.0.0.1:80:80'
62
+ restart: unless-stopped
63
+ volumes:
64
+ - /srv/volumes/cgitize:/mnt/cgitize:ro
65
+
66
+ In this configuration, cgitize pulls repositories defined in example.toml every
67
+ 3 hours and puts them to /srv/volumes/cgitize on the host.
68
+
69
+ To launch containers, run:
45
70
 
46
- docker-compose build
47
71
  docker-compose up -d
48
72
 
49
- and visiting http://localhost:80/.
73
+ To inspect the repositories, visit http://localhost:80/.
@@ -1,9 +1,9 @@
1
- FROM nginx:1.24-alpine AS base
1
+ FROM nginx:1.25-alpine AS base
2
2
 
3
3
  FROM base AS builder
4
4
 
5
5
  # Install cmark-gfm:
6
- ARG CMARK_GFM_VERSION=0.29.0.gfm.11
6
+ ARG CMARK_GFM_VERSION=0.29.0.gfm.13
7
7
  ADD ["https://github.com/github/cmark-gfm/archive/refs/tags/$CMARK_GFM_VERSION.zip", "/"]
8
8
 
9
9
  RUN apk add -q --no-cache cmake g++ make python3 && \
@@ -1,14 +1,7 @@
1
- version: '3.4'
2
-
3
- x-default-settings:
4
- &default-settings
5
- logging:
6
- driver: journald
7
- restart: unless-stopped
1
+ version: '3'
8
2
 
9
3
  services:
10
4
  cgitize:
11
- << : *default-settings
12
5
  build:
13
6
  context: .
14
7
  dockerfile: docker/Dockerfile
@@ -16,16 +9,17 @@ services:
16
9
  # Every 3 hours:
17
10
  SCHEDULE: '0 */3 * * *'
18
11
  image: egortensin/cgitize:latest
12
+ restart: unless-stopped
19
13
  volumes:
20
14
  - ./examples/docker:/etc/cgitize:ro
21
15
  - repositories:/mnt/cgitize
22
16
  frontend:
23
- << : *default-settings
24
17
  build:
25
18
  context: ./docker/frontend
26
19
  image: egortensin/cgitize-frontend:latest
27
20
  ports:
28
21
  - '127.0.0.1:80:80'
22
+ restart: unless-stopped
29
23
  volumes:
30
24
  - repositories:/mnt/cgitize:ro
31
25
 
@@ -0,0 +1,57 @@
1
+ This project supports GitHub, Bitbucket & GitLab. All of them are,
2
+ unfortunately, peculiar in their own way.
3
+
4
+ Tokens
5
+ ------
6
+
7
+ All of the forges support access tokens, of course (although they're called
8
+ "app passwords" on Bitbucket). They can be used to do `git clone https://`
9
+ with authentication info in the URL. For GitHub, it's enough to just specify
10
+ the token:
11
+
12
+ git clone https://TOKEN@github.com/USER/REPO.git
13
+
14
+ For Bitbucket & GitLab, however, you need to specify both the user and the
15
+ token in the URL:
16
+
17
+ git clone https://USER:TOKEN@bitbucket.org/USER/REPO.git
18
+
19
+ Terminology
20
+ -----------
21
+
22
+ * GitHub has users and organizations; both of which can have repositories.
23
+ * A user can be a collaborator on a different user's repository, while an
24
+ organization (I think) can only fully own its repositories.
25
+ * Bitbucket has user accounts, workspaces & projects. User accounts own (or
26
+ are invited to) workspaces, which include projects.
27
+ * Not so long ago, when workspaces were introduced, all users got a default
28
+ workspace matching their username (with an untitled project).
29
+ * Each repository belongs to a project, which belongs to a workspace.
30
+ There can be multiple users collaborating on a workspace, which includes one or
31
+ more projects, which include repositories. What an amazing concept! I
32
+ couldn't be happier to deal with this.
33
+ * GitLab sorta has users and organizations (called "groups") here. I'm pretty
34
+ sure they're called "namespaces" really, and are the same as Bitbucket's
35
+ "workspaces", but whatever.
36
+
37
+ API
38
+ ---
39
+
40
+ * If you authenticate with GitHub and call `/users/USER/repos` for the
41
+ authenticated user, you will [only get public repositories]. Why? Who knows.
42
+ * You need to call `/user/repos` to include private repositories.
43
+ * You _might_ want to use the `affiliation` parameter to only get owned
44
+ repositories. Otherwise, you'll get all repositories in all orgs you're a
45
+ member of, etc.
46
+ * For Bitbucket, `/repositories/WORKSPACE` does [include private repositories]
47
+ (if you're authenticated, of course).
48
+ * When somebody else invites you to collaborate on a repository, you get
49
+ access to a different workspace; this repository is not added to your workspace
50
+ or anything.
51
+ * GitLab will, helpfully, only return projects [owned by the user] when
52
+ `/users/USER/projects` is called.
53
+
54
+ [only get public repositories]: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-a-user
55
+ [call /user/repos]: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user
56
+ [include private repositories]: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-get
57
+ [owned by the user]: https://docs.gitlab.com/ee/api/projects.html#list-user-projects
@@ -0,0 +1,7 @@
1
+ clone_via_ssh = false
2
+ clone_url = "http://localhost/{repo}"
3
+
4
+ [github]
5
+
6
+ [github.users.me]
7
+ name = "egor-tensin"
@@ -1,4 +1,4 @@
1
- # Please see https://egort.name/blog/notes/makefile.html
1
+ # Please see https://tensin.name/blog/notes/makefile.html
2
2
 
3
3
  MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
4
4
  unexport MAKEFLAGS
@@ -1,10 +1,10 @@
1
1
  atlassian-python-api==3.28.1
2
- certifi==2023.7.22
3
- cffi==1.15.1
4
- charset-normalizer==3.2.0
5
- cryptography==41.0.3
2
+ certifi==2023.11.17
3
+ cffi==1.16.0
4
+ charset-normalizer==3.3.2
5
+ cryptography==41.0.7
6
6
  Deprecated==1.2.14
7
- idna==3.4
7
+ idna==3.6
8
8
  oauthlib==3.2.2
9
9
  pycparser==2.21
10
10
  PyGithub==1.59.1
@@ -16,5 +16,5 @@ requests-oauthlib==1.3.1
16
16
  requests-toolbelt==1.0.0
17
17
  six==1.16.0
18
18
  tomli==1.2.3
19
- urllib3==2.0.4
20
- wrapt==1.15.0
19
+ urllib3==2.1.0
20
+ wrapt==1.16.0
@@ -1,4 +1,4 @@
1
- FROM alpine:3.18
1
+ FROM alpine:3.19
2
2
 
3
3
  RUN apk add -q --no-cache bash git openssh-server tini && \
4
4
  echo 'root:root' | chpasswd && \
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