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

Update doc #472

Merged
merged 2 commits into from
Jan 2, 2025
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
18 changes: 9 additions & 9 deletions README.ja_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
これは、エンタープライズ向けの汎用プロキシソリューションを構築するために使用されるプロジェクトです。
プロキシ / リバースプロキシ(作業中) / ロードバランサー(未定) / NATトラバーサル(未定)などを含むがこれらに限定されません。

## コンポーネント
## アプリ

G3 プロジェクトには多くのコンポーネントが含まれており、各コンポーネントには独自のコード、ドキュメントなどが含まれる個別のサブディレクトリがあります
G3 プロジェクトは多数のアプリケーションで構成されており、各アプリケーションには独自のコード、ドキュメントなどを含む個別のサブディレクトリがあります

コンポーネント ディレクトリに加えて、いくつかのパブリック ディレクトリもあります。
アプリ ディレクトリに加えて、いくつかのパブリック ディレクトリもあります。

- [doc](doc) プロジェクトレベルのドキュメントが含まれます。
- [sphinx](sphinx) は、各コンポーネントの HTML リファレンス ドキュメントを生成するために使用されます。
- [sphinx](sphinx) は、各アプリの HTML リファレンス ドキュメントを生成するために使用されます。
- [scripts](scripts) には、カバレッジ テスト、パッケージ化スクリ

### g3proxy
Expand Down Expand Up @@ -97,9 +97,9 @@ Cloudflare keylessサーバーの簡単な実装。

## リリースとパッケージング

各コンポーネントの各リリースには *\<name\>-v\<version\>* の形式でタグが設定されます。
各アプリの各リリースには *\<name\>-v\<version\>* の形式でタグが設定されます。
これらのタグを使用してソースtarballを生成できます。
また、配布準備が整った各コンポーネントにはdebおよびrpmパッケージファイルが追加されています
また、配布準備が整った各アプリにはdebおよびrpmパッケージファイルが追加されています

リリースビルドを行う場合:

Expand Down Expand Up @@ -155,13 +155,13 @@ gitリポジトリから直接パッケージをビルドする場合:

### Dockerイメージのビルド

各コンポーネントの *docker* フォルダーの下にDockerfile(s)があります。ビルドコマンドは次のようになります
各アプリの *docker* フォルダーの下にDockerfile(s)があります。ビルドコマンドは次のようになります

```shell
# ソースルートディレクトリで実行します
docker build -f <component>/docker/debian.Dockerfile . -t <component>:<tag>
docker build -f <app>/docker/debian.Dockerfile . -t <app>:<tag>
# ソースコードなしでビルドします
docker build -f <component>/docker/debian.Dockerfile github.com/bytedance/g3 -t <component>:<tag>
docker build -f <app>/docker/debian.Dockerfile github.com/bytedance/g3 -t <app>:<tag>
# ソースtarballがある場合、そのtarballのURLも使用できます
```

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
This is the project we used to build enterprise-oriented generic proxy solutions,
including but not limited to proxy / reverse proxy (WIP) / load balancer (TBD) / nat traversal (TBD).

## Components
## Applications

The G3 project contains many components, each of which has a separate subdirectory containing its own code,
The G3 project is consisted of many applications, each of which has a separate subdirectory containing its own code,
documentation, etc.

In addition to the component directories, there are some public directories:
In addition to the application directories, there are some public directories:

- [doc](doc) Contains project-level documentation.
- [sphinx](sphinx) is used to generate HTML reference documents for each component.
- [sphinx](sphinx) is used to generate HTML reference documents for each application.
- [scripts](scripts) Contains various auxiliary scripts, including coverage testing, packaging scripts, etc.

### g3proxy
Expand Down Expand Up @@ -98,9 +98,9 @@ Follow [Standards](doc/standards.md).

## Release and Packaging

We will set tags for each release of each component in the form *\<name\>-v\<version\>*.
We will set tags for each release of each application in the form *\<name\>-v\<version\>*.
You can use these tags to generate source tarballs.
And we have added deb and rpm package files for each component that is ready for distribution.
And we have added deb and rpm package files for each application that is ready for distribution.

If you want to do a release build:

Expand Down Expand Up @@ -157,13 +157,13 @@ For testing purpose, we have built and uploaded some packages to

### Build Docker Image

You can find Dockerfile(s) under *docker* folder of each component. The build command will be like
You can find Dockerfile(s) under *docker* folder of each application. The build command will be like

```shell
# run this in the source root dir
docker build -f <component>/docker/debian.Dockerfile . -t <component>:<tag>
docker build -f <app>/docker/debian.Dockerfile . -t <app>:<tag>
# build without the source code
docker build -f <component>/docker/debian.Dockerfile github.com/bytedance/g3 -t <component>:<tag>
docker build -f <app>/docker/debian.Dockerfile github.com/bytedance/g3 -t <app>:<tag>
# if you have a source tarball, you can also use the URL of that tarball
```

Expand Down
20 changes: 10 additions & 10 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

本项目用于构建面向企业的通用代理解决方案,包括但不限于代理、反向代理(开发中)、负载均衡(待定)、NAT穿透(待定)等。

## 组件
## 应用程序

G3项目包含许多组件,每一个组件单独一个子目录,包含各自的代码、文档等。
G3项目包含许多应用,每一个应用程序单独一个子目录,包含各自的代码、文档等。

除了组件目录,还有一些公共目录:
除了应用程序目录,还有一些公共目录:

- [doc](doc) 包含项目级别文档。
- [sphinx](sphinx) 用于为各组件生成HTML参考文档
- [sphinx](sphinx) 用于为各应用生成HTML参考文档
- [scripts](scripts) 包含各种辅助脚本,包括覆盖率测试、打包脚本等。

### g3proxy
Expand Down Expand Up @@ -66,11 +66,11 @@ G3项目包含许多组件,每一个组件单独一个子目录,包含各自

### g3fcgen

适用于g3proxy TLS劫持功能的的伪造证书生成服务组件
适用于g3proxy TLS劫持功能的的伪造证书生成服务应用

### g3iploc

适用于g3proxy GeoIP功能的IP Location查找服务组件
适用于g3proxy GeoIP功能的IP Location查找服务应用

### g3keymess

Expand All @@ -92,7 +92,7 @@ Cloudflare Keyless Server的简单实现。

## 发布及打包

每个组件的每个发布版本都会有对应的tag,格式为 *\<name\>-v\<version\>* 。
每个应用程序的每个发布版本都会有对应的tag,格式为 *\<name\>-v\<version\>* 。
使用对应的tag生成源码tar包,该tar包可以用于生成deb、rpm等发行版原生包文件。

如果需要对正式发布的版本打包:
Expand Down Expand Up @@ -146,13 +146,13 @@ Cloudflare Keyless Server的简单实现。

### 制作Docker镜像

每个组件的*docker*文件夹下有可参考的Dockerfile(s),命令如下:
每个应用的*docker*文件夹下有可参考的Dockerfile(s),命令如下:

```shell
# 在源码根目录可执行
docker build -f <component>/docker/debian.Dockerfile . -t <component>:<tag>
docker build -f <app>/docker/debian.Dockerfile . -t <app>:<tag>
# 本地没有源码时,可用远程URL执行
docker build -f <component>/docker/debian.Dockerfile github.com/bytedance/g3 -t <component>:<tag>
docker build -f <app>/docker/debian.Dockerfile github.com/bytedance/g3 -t <app>:<tag>
# 如果已经制作了源码tar包,也可以把URL路径换成源码tar包路径
```

Expand Down
3 changes: 3 additions & 0 deletions sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

# Define the projects that will share this configuration file.
multiproject_projects = {
"project": {
"path": "project",
},
"g3proxy": {
"path": "g3proxy",
},
Expand Down
1 change: 1 addition & 0 deletions sphinx/project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
20 changes: 20 additions & 0 deletions sphinx/project/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
27 changes: 27 additions & 0 deletions sphinx/project/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'G3'
copyright = '2025, Zhang Jingqiang'
author = 'Zhang Jingqiang'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
17 changes: 17 additions & 0 deletions sphinx/project/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

G3 documentation
================

G3 Project is an open source project to develop enterprise oriented proxy solutions.

You can visit the `code repo`_ to get more detailed introduction.

Follow the links below to see documentations for each application:

- `g3proxy`_
- `g3tiles`_

.. _code repo: https://github.com/bytedance/g3

.. _g3proxy: /projects/g3proxy/en/latest/
.. _g3tiles: /projects/g3tiles/en/latest/
35 changes: 35 additions & 0 deletions sphinx/project/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions sphinx/project/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
sphinx-rtd-theme
Loading