From 4b9070385877fb43ceffe5697602ec8d634d4225 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sun, 26 Nov 2017 16:44:32 -0500 Subject: [PATCH 0001/1282] Import docs into main repository (#2874) * import docs into main repository Signed-off-by: Matti Ranta --- doc/advanced.en-us.md | 13 + doc/advanced.zh-cn.md | 13 + doc/advanced/config-cheat-sheet.en-us.md | 218 ++++++++++++++ doc/advanced/config-cheat-sheet.zh-cn.md | 191 ++++++++++++ doc/advanced/customizing-gitea.en-us.md | 54 ++++ doc/advanced/hacking-on-gitea.en-us.md | 42 +++ doc/advanced/hacking-on-gitea.zh-cn.md | 42 +++ doc/advanced/make.en-us.md | 44 +++ doc/advanced/specific-variables.en-us.md | 67 +++++ doc/features.en-us.md | 13 + doc/features.zh-cn.md | 13 + doc/features.zh-tw.md | 13 + doc/features/authentication.en-us.md | 194 ++++++++++++ doc/features/authentication.zh-cn.md | 18 ++ doc/features/authentication.zh-tw.md | 18 ++ doc/features/localization.en-us.md | 18 ++ doc/features/localization.zh-cn.md | 18 ++ doc/features/localization.zh-tw.md | 18 ++ doc/features/webhooks.en-us.md | 103 +++++++ doc/features/webhooks.zh-cn.md | 18 ++ doc/features/webhooks.zh-tw.md | 18 ++ doc/help.zh-cn.md | 13 + doc/help/seek-help.zh-cn.md | 23 ++ doc/help/troubleshooting.en-us.md | 69 +++++ doc/installation.en-us.md | 13 + doc/installation.zh-cn.md | 13 + doc/installation.zh-tw.md | 13 + doc/installation/from-binary.en-us.md | 45 +++ doc/installation/from-binary.zh-cn.md | 35 +++ doc/installation/from-binary.zh-tw.md | 35 +++ doc/installation/from-package.en-us.md | 57 ++++ doc/installation/from-package.zh-cn.md | 37 +++ doc/installation/from-package.zh-tw.md | 53 ++++ doc/installation/from-source.en-us.md | 79 +++++ doc/installation/from-source.zh-cn.md | 84 ++++++ doc/installation/from-source.zh-tw.md | 73 +++++ .../run-as-service-in-ubuntu.en-us.md | 68 +++++ doc/installation/windows-service.en-us.md | 34 +++ doc/installation/windows-service.zh-cn.md | 34 +++ doc/installation/windows-service.zh-tw.md | 34 +++ doc/installation/with-docker.en-us.md | 196 ++++++++++++ doc/installation/with-docker.zh-cn.md | 42 +++ doc/installation/with-docker.zh-tw.md | 40 +++ doc/upgrade.en-us.md | 13 + doc/upgrade.zh-cn.md | 13 + doc/upgrade.zh-tw.md | 13 + doc/upgrade/from-gogs.en-us.md | 82 +++++ doc/upgrade/from-gogs.zh-cn.md | 26 ++ doc/upgrade/from-gogs.zh-tw.md | 26 ++ doc/usage.en-us.md | 13 + doc/usage/backup-and-restore.en-us.md | 46 +++ doc/usage/backup-and-restore.zh-tw.md | 45 +++ doc/usage/command-line.md | 80 +++++ page/index.en-us.md | 279 ++++++++++++++++++ page/index.zh-cn.md | 75 +++++ page/index.zh-tw.md | 67 +++++ 56 files changed, 3014 insertions(+) create mode 100644 doc/advanced.en-us.md create mode 100644 doc/advanced.zh-cn.md create mode 100644 doc/advanced/config-cheat-sheet.en-us.md create mode 100644 doc/advanced/config-cheat-sheet.zh-cn.md create mode 100644 doc/advanced/customizing-gitea.en-us.md create mode 100644 doc/advanced/hacking-on-gitea.en-us.md create mode 100644 doc/advanced/hacking-on-gitea.zh-cn.md create mode 100644 doc/advanced/make.en-us.md create mode 100644 doc/advanced/specific-variables.en-us.md create mode 100644 doc/features.en-us.md create mode 100644 doc/features.zh-cn.md create mode 100644 doc/features.zh-tw.md create mode 100644 doc/features/authentication.en-us.md create mode 100644 doc/features/authentication.zh-cn.md create mode 100644 doc/features/authentication.zh-tw.md create mode 100644 doc/features/localization.en-us.md create mode 100644 doc/features/localization.zh-cn.md create mode 100644 doc/features/localization.zh-tw.md create mode 100644 doc/features/webhooks.en-us.md create mode 100644 doc/features/webhooks.zh-cn.md create mode 100644 doc/features/webhooks.zh-tw.md create mode 100644 doc/help.zh-cn.md create mode 100644 doc/help/seek-help.zh-cn.md create mode 100644 doc/help/troubleshooting.en-us.md create mode 100644 doc/installation.en-us.md create mode 100644 doc/installation.zh-cn.md create mode 100644 doc/installation.zh-tw.md create mode 100644 doc/installation/from-binary.en-us.md create mode 100644 doc/installation/from-binary.zh-cn.md create mode 100644 doc/installation/from-binary.zh-tw.md create mode 100644 doc/installation/from-package.en-us.md create mode 100644 doc/installation/from-package.zh-cn.md create mode 100644 doc/installation/from-package.zh-tw.md create mode 100644 doc/installation/from-source.en-us.md create mode 100644 doc/installation/from-source.zh-cn.md create mode 100644 doc/installation/from-source.zh-tw.md create mode 100644 doc/installation/run-as-service-in-ubuntu.en-us.md create mode 100644 doc/installation/windows-service.en-us.md create mode 100644 doc/installation/windows-service.zh-cn.md create mode 100644 doc/installation/windows-service.zh-tw.md create mode 100644 doc/installation/with-docker.en-us.md create mode 100644 doc/installation/with-docker.zh-cn.md create mode 100644 doc/installation/with-docker.zh-tw.md create mode 100644 doc/upgrade.en-us.md create mode 100644 doc/upgrade.zh-cn.md create mode 100644 doc/upgrade.zh-tw.md create mode 100644 doc/upgrade/from-gogs.en-us.md create mode 100644 doc/upgrade/from-gogs.zh-cn.md create mode 100644 doc/upgrade/from-gogs.zh-tw.md create mode 100644 doc/usage.en-us.md create mode 100644 doc/usage/backup-and-restore.en-us.md create mode 100644 doc/usage/backup-and-restore.zh-tw.md create mode 100644 doc/usage/command-line.md create mode 100644 page/index.en-us.md create mode 100644 page/index.zh-cn.md create mode 100644 page/index.zh-tw.md diff --git a/doc/advanced.en-us.md b/doc/advanced.en-us.md new file mode 100644 index 00000000..de2bfeed --- /dev/null +++ b/doc/advanced.en-us.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Advanced" +slug: "advanced" +weight: 30 +toc: false +draft: false +menu: + sidebar: + name: "Advanced" + weight: 40 + identifier: "advanced" +--- diff --git a/doc/advanced.zh-cn.md b/doc/advanced.zh-cn.md new file mode 100644 index 00000000..1f7ebf81 --- /dev/null +++ b/doc/advanced.zh-cn.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "进阶" +slug: "advanced" +weight: 30 +toc: false +draft: false +menu: + sidebar: + name: "进阶" + weight: 40 + identifier: "advanced" +--- diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md new file mode 100644 index 00000000..55fe5c11 --- /dev/null +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -0,0 +1,218 @@ +--- +date: "2016-12-26T16:00:00+02:00" +title: "Config Cheat Sheet" +slug: "config-cheat-sheet" +weight: 20 +toc: false +draft: false +menu: + sidebar: + parent: "advanced" + name: "Config Cheat Sheet" + weight: 20 + identifier: "config-cheat-sheet" +--- + +# Configuration Cheat Sheet + +This is a cheat sheet for the Gitea configuration file. It is helpful for more fully understanding how it powers Gitea. + +Before getting started, make sure you know that any change to the configuration should be made in `custom/conf/app.ini` or any corresponding location. + +All default settings can be found in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) (replace master in URL with name of tag for released versions). If you see anything which looks like `%(X)s`, it is a feature powered by [ini](https://github.com/go-ini/ini/#recursive-values) for reading values recursively. + +Any configuration option that is marked by :exclamation: means that you should keep the default value unless you fully understand what you are doing. + +Values containing `#` or `;` must be quoted using `` ` `` or `"""`. + +**Note** that you have to restart Gitea for changes to take effect. + +## Overall (`DEFAULT`) + +- `APP_NAME`: Application name, change to whatever you want. +- `RUN_USER`: The user to run Gitea as, we recommend it be `git`; however, change this to whatever your username is if you run Gitea on your personal computer. Gitea may crash if this value is not set properly. +- `RUN_MODE`: For performance and other purposes, change this to `prod` when deployed to a production environment. The installation process will set this to `prod` automatically. + +## Repository (`repository`) + +- `ROOT`: Root path for storing all users' repository data. It must be an absolute path. The default is `~//gitea-repositories`. +- `SCRIPT_TYPE`: The script type your server supports, usually this is `bash`, but some customers report that they only have `sh`. +- `ANSI_CHARSET`: The default charset for an unrecognized charset. +- `FORCE_PRIVATE`: Force every new repository to be private. +- `MAX_CREATION_LIMIT`: Global maximum creation limit of repositories per user, `-1` means no limit. +- `PULL_REQUEST_QUEUE_LENGTH`:exclamation:: Length of pull request patch test queue, make it as large as possible. + +## UI (`ui`) + +- `EXPLORE_PAGING_NUM`: Number of repositories that are shown in one explore page. +- `ISSUE_PAGING_NUM`: Number of issues that are shown in one page (for all pages that list issues). +- `FEED_MAX_COMMIT_NUM`: Number of maximum commits shown in one activity feed. + +### UI - Admin (`ui.admin`) + +- `USER_PAGING_NUM`: Number of users that are shown in one page. +- `REPO_PAGING_NUM`: Number of repos that are shown in one page. +- `NOTICE_PAGING_NUM`: Number of notices that are shown in one page. +- `ORG_PAGING_NUM`: Number of organizations that are shown in one page. + +## Markdown (`markdown`) + +- `ENABLE_HARD_LINE_BREAK`: Whether or not to enable hard the line break extension. + +## Server (`server`) + +- `PROTOCOL`: Either `http`, `https`, `fcgi`, or `unix`. +- `DOMAIN`: Domain name of your server. +- `ROOT_URL`: Full public URL of Gitea server. +- `HTTP_ADDR`: HTTP listen address. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use. +- `HTTP_PORT`: HTTP listen port. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. +- `UNIX_SOCKET_PERMISSION`: Permisson mode for Unix socket, default is 666. +- `DISABLE_SSH`: Disables SSH feature when it's not available. +- `START_SSH_SERVER`: Starts built-in SSH server when enabled. +- `SSH_DOMAIN`: Domain name of your ssh server. +- `SSH_PORT`: SSH port displayed in clone URL, in case yours is not `22`. +- `SSH_LISTEN_PORT`: Port for the built-in SSH server. Defaults to `SSH_PORT`. +- `OFFLINE_MODE`: Disables use of CDN for static files and Gravatar for profile pictures. +- `DISABLE_ROUTER_LOG`: Mutes printing of the router log. +- `CERT_FILE`: Cert file path used for HTTPS. +- `KEY_FILE`: Key file path used for HTTPS. +- `STATIC_ROOT_PATH`: Upper level of template and static files path, default is the path where Gitea is located. +- `ENABLE_GZIP`: Enables application-level GZIP support. +- `LANDING_PAGE`: Non-logged-in users' landing page, either `home` or `explore`. +- `LFS_START_SERVER`: Enables git-lfs support. `true` or `false`, default is `false`. +- `LFS_CONTENT_PATH`: Where your lfs files put on, default is `data/lfs`. +- `LFS_JWT_SECRET`: LFS authentication secret, changed this to yourself. + +## Database (`database`) + +- `DB_TYPE`: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`. +- `HOST`: Database host address and port. +- `NAME`: Database name. +- `USER`: Database username. +- `PASSWD`: Database user password. +- `SSL_MODE`: For PostgreSQL only. +- `PATH`: For SQLite3 only, the database file path. + +## Security (`security`) + +- `INSTALL_LOCK`: Indicates whether to allow the open install page (setting admin account is involved, so it's a very important value). +- `SECRET_KEY`: Global secret key for your server security, **you'd better change it** (will generate a random string every time you install). +- `LOGIN_REMEMBER_DAYS`: Cookie lifetime, in days. +- `COOKIE_USERNAME`: Name of the cookie that saves username. +- `COOKIE_REMEMBER_NAME`: Name of cookie that saves auto-login information. +- `REVERSE_PROXY_AUTHENTICATION_USER`: Header name for reverse proxy authentication username. +- `DISABLE_GIT_HOOKS`: Prevent all users (including admin) from creating custom git hooks (defaults to false) + +## OpenID (`openid`) + +- `ENABLE_OPENID_SIGNIN`: Whether to allow signin in via OpenID (defaults to false). +- `ENABLE_OPENID_SIGNUP`: Whether to allow registering via OpenID (defaults to `!DISABLE_REGISTRATION`). +- `WHITELISTED_URIS`: Space separated list of POSIX regexp patterns. If non empty OpenID URIs should match any of these to be granted access. +- `BLACKLISTED_URIS`: Space separated list of POSIX regexp pattenrs. OpenID URI matching any of these is refused access. + +## Service (`service`) + +- `ACTIVE_CODE_LIVE_MINUTES`: The minutes of active code life time. +- `RESET_PASSWD_CODE_LIVE_MINUTES`: The minutes of reset password code life time. +- `REGISTER_EMAIL_CONFIRM`: Enable this to ask for mail confirmation of registration, requires `Mailer` to be enabled. +- `DISABLE_REGISTRATION`: Disable registration, after which only admin can create accounts for users. +- `SHOW_REGISTRATION_BUTTON`: Indicate whether to show registration button or not. +- `REQUIRE_SIGNIN_VIEW`: Enable this to force users to log in to view any page. +- `ENABLE_CACHE_AVATAR`: Enable this to cache avatar from Gravatar. +- `ENABLE_NOTIFY_MAIL`: Enable this to send e-mail to watchers of repository when something happens like creating issues, requires `Mailer` to be enabled. +- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: Enable this to allow reverse proxy authentication, more detail: https://github.com/gogits/gogs/issues/165 +- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: Enable this to allow auto-registration for reverse authentication. +- `DISABLE_MINIMUM_KEY_SIZE_CHECK`: Do not check minimum key size with corresponding type. +- `ENABLE_CAPTCHA`: Enable this to use captcha validation for registration. + +## Webhook (`webhook`) + +- `QUEUE_LENGTH`:exclamation:: Hook task queue length. +- `DELIVER_TIMEOUT`: Delivery timeout in seconds for shooting webhooks. +- `SKIP_TLS_VERIFY`: Indicate whether to allow insecure certification or not. +- `PAGING_NUM`: Number of webhook history that are shown in one page. + +## Mailer (`mailer`) + +- `ENABLED`: Enable this to use a mail service. +- `DISABLE_HELO`: Disable HELO operation. +- `HELO_HOSTNAME`: Custom hostname for HELO operation. +- `HOST`: SMTP mail host address and port (example: smtp.gitea.io:587). +- `FROM`: Mail from address, RFC 5322. This can be just an email address, or the "Name" \ format. +- `USER`: Username of mailer (usually just your e-mail address). +- `PASSWD`: Password of mailer. +- `SKIP_VERIFY`: Do not verify the self-signed certificates. +- `USE_SENDMAIL`: Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems. Valid values are `true` to use sendmail and `false` to use SMTP (default). Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`. +- `SENDMAIL_PATH`: The location of sendmail on the operating system. This can be an absolute path (eg: `/usr/sbin/sendmail`) or just the name of the command (eg: `sendmail` - default) if it can be found in the `PATH` environment variable. + +Note: Actually, Gitea supports only SMTP with STARTTLS. + +## Cache (`cache`) + +- `ADAPTER`: Cache engine adapter, either `memory`, `redis`, or `memcache`. If you want to use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or `memcache`: `go build -tags='redis'`. +- `INTERVAL`: for memory cache only, GC interval in seconds. +- `HOST`: For redis and memcache, the host address and port number. + - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180` + - Memache: `127.0.0.1:9090;127.0.0.1:9091` + +## Session (`session`) + +- `PROVIDER`: Session engine provider, either `memory`, `file`, `redis`, or `mysql`. +- `PROVIDER_CONFIG`: For file, it's the root path; for others, it's the host address and port number. +- `COOKIE_SECURE`: Enable this to force using HTTPS for all session access. +- `COOKIE_NAME`: The name of the cookie used for the session ID, defaults to `i_like_gitea`. +- `GC_INTERVAL_TIME`: GC interval in seconds. + +## Picture (`picture`) + +- `GRAVATAR_SOURCE`: Can be `gravatar`, `duoshuo` or anything like `http://cn.gravatar.com/avatar/`. +- `DISABLE_GRAVATAR`: Enable this to use local avatars only. +- `ENABLE_FEDERATED_AVATAR`: Enable support for federated avatars (see http://www.libravatar.org) +- `AVATAR_UPLOAD_PATH`: Path to store local and cached files. + +## Attachment (`attachment`) + +- `ENABLED`: Enable this to allow users upload attachments. +- `PATH`: Path to store attachments. +- `ALLOWED_TYPES`: Allowed MIME types, e.g. `image/jpeg|image/png`, use `*/*` for all types. +- `MAX_SIZE`: Maximum size in MB, e.g. `4` +- `MAX_FILES`: Maximum number of attachments can be uploaded at once, e.g. `5`. + +## Log (`log`) + +- `ROOT_PATH`: Root path for log files. +- `MODE`: Logging mode, default is `console`. For multiple modes, use comma to separate it. +- `LEVEL`: General log level, default is `Trace`. + +## Cron (`cron`) + +- `ENABLED`: Enable this to run cron tasks periodically. +- `RUN_AT_START`: Enable this to run cron tasks at start time. + +### Cron - Update Mirrors (`cron.update_mirrors`) + +- `SCHEDULE`: Cron syntax for scheduling update mirrors, e.g. `@every 1h`. + +### Cron - Repository Health Check (`cron.repo_health_check`) + +- `SCHEDULE`: Cron syntax for scheduling repository health check, e.g. `@every 24h`. +- `TIMEOUT`: Time duration syntax for health check execution timeout, e.g. `60s`. +- `ARGS`: Arguments for command `git fsck`, e.g. `--unreachable --tags`. + +### Cron - Repository Statistics Check (`cron.check_repo_stats`) + +- `RUN_AT_START`: Enable this to run repository statistics check at start time. +- `SCHEDULE`: Cron syntax for scheduling repository statistics check, e.g. `@every 24h`. + +## Git (`git`) + +- `MAX_GIT_DIFF_LINES`: Max number of lines allowed of a single file in diff view. +- `MAX_GIT_DIFF_LINE_CHARACTERS`: Max number of characters of a line allowed in diff view. +- `MAX_GIT_DIFF_FILES`: Max number of files shown in diff view. +- `GC_ARGS`: Arguments for command `git gc`, e.g. `--aggressive --auto`. + +## Other (`other`) + +- `SHOW_FOOTER_BRANDING`: Enable this to show Gitea branding in the footer. +- `SHOW_FOOTER_VERSION`: Enable this to show Gitea version information in the footer. +- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: Enable this to show time of template execution in the footer. diff --git a/doc/advanced/config-cheat-sheet.zh-cn.md b/doc/advanced/config-cheat-sheet.zh-cn.md new file mode 100644 index 00000000..7ec650dd --- /dev/null +++ b/doc/advanced/config-cheat-sheet.zh-cn.md @@ -0,0 +1,191 @@ +--- +date: "2016-12-26T16:00:00+02:00" +title: "配置说明" +slug: "config-cheat-sheet" +weight: 20 +toc: false +draft: false +menu: + sidebar: + parent: "advanced" + name: "配置说明" + weight: 20 + identifier: "config-cheat-sheet" +--- + +# 配置说明 + +这是针对Gitea配置文件的说明,你可以了解Gitea的强大配置。需要说明的是,你的所有改变请修改 `custom/conf/app.ini` 文件而不是源文件。所有默认值可以通过 [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) 查看到。如果你发现 `%(X)s` 这样的内容,请查看 [ini](https://github.com/go-ini/ini/#recursive-values) 这里的说明。标注了 :exclamation: 的配置项表明除非你真的理解这个配置项的意义,否则最好使用默认值。 + +## Overall (`DEFAULT`) + +- `APP_NAME`: 应用名称,改成你希望的名字。 +- `RUN_USER`: 运行Gitea的用户,推荐使用 `git`;如果在你自己的个人电脑使用改成你自己的用户名。如果设置不正确,Gitea可能崩溃。 +- `RUN_MODE`: 从性能考虑,如果在产品级的服务上改成 `prod`。如果您使用安装向导安装的那么会自动设置为 `prod`。 + +## Repository (`repository`) + +- `ROOT`: 存放git工程的根目录。这里必须填绝对路径,默认值是 `~//gitea-repositories`。 +- `SCRIPT_TYPE`: 服务器支持的Shell类型,通常是 `bash`,但有些服务器也有可能是 `sh`。 +- `ANSI_CHARSET`: 默认字符编码。 +- `FORCE_PRIVATE`: 强制所有git工程必须私有。 +- `MAX_CREATION_LIMIT`: 全局最大每个用户创建的git工程数目, `-1` 表示没限制。 +- `PULL_REQUEST_QUEUE_LENGTH`: 小心:合并请求测试队列的长度,尽量放大。 + +## UI (`ui`) + +- `EXPLORE_PAGING_NUM`: 探索页面每页显示的仓库数量。 +- `ISSUE_PAGING_NUM`: 工单页面每页显示的工单数量。 +- `FEED_MAX_COMMIT_NUM`: 活动流页面显示的最大提交树木。 + +### UI - Admin (`ui.admin`) + +- `USER_PAGING_NUM`: 用户管理页面每页显示的用户数量。 +- `REPO_PAGING_NUM`: 仓库管理页面每页显示的仓库数量。 +- `NOTICE_PAGING_NUM`: 系统提示页面每页显示的提示数量。 +- `ORG_PAGING_NUM`: 组织管理页面每页显示的组织数量。 + +## Markdown (`markdown`) + +- `ENABLE_HARD_LINE_BREAK`: 是否启用硬换行扩展。 + +## Server (`server`) + +- `PROTOCOL`: 可选 `http` 或 `https`。 +- `DOMAIN`: 服务器域名。 +- `ROOT_URL`: Gitea服务器的对外 URL。 +- `HTTP_ADDR`: HTTP 监听地址。 +- `HTTP_PORT`: HTTP 监听端口。 +- `DISABLE_SSH`: 是否禁用SSH。 +- `START_SSH_SERVER`: 是否启用内部SSH服务器。 +- `SSH_PORT`: SSH端口,默认为 `22`。 +- `OFFLINE_MODE`: 针对静态和头像文件禁用 CDN。 +- `DISABLE_ROUTER_LOG`: 关闭日志中的路由日志。 +- `CERT_FILE`: 启用HTTPS的证书文件。 +- `KEY_FILE`: 启用HTTPS的密钥文件。 +- `STATIC_ROOT_PATH`: 存放模板和静态文件的根目录,默认是 Gitea 的根目录。 +- `ENABLE_GZIP`: 启用应用级别的 GZIP 压缩。 +- `LANDING_PAGE`: 未登录用户的默认页面,可选 `home` 或 `explore`。 +- `LFS_START_SERVER`: 是否启用 git-lfs 支持. 可以为 `true` 或 `false`, 默认是 `false`。 +- `LFS_CONTENT_PATH`: 存放 lfs 命令上传的文件的地方,默认是 `data/lfs`。 +- `LFS_JWT_SECRET`: LFS 认证密钥,改成自己的。 + +## Database (`database`) + +- `DB_TYPE`: 数据库类型,可选 `mysql`, `postgres`, `mssql`, `tidb` 或 `sqlite3`。 +- `HOST`: 数据库服务器地址和端口。 +- `NAME`: 数据库名称。 +- `USER`: 数据库用户名。 +- `PASSWD`: 数据库用户密码。 +- `SSL_MODE`: PostgreSQL数据库是否启用SSL模式。 +- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。 + +## Security (`security`) + +- `INSTALL_LOCK`: 是否允许运行安装向导,(跟管理员账号有关,十分重要)。 +- `SECRET_KEY`: 全局服务器安全密钥 **最好改成你自己的** (当你运行安装向导的时候会被设置为一个随机值)。 +- `LOGIN_REMEMBER_DAYS`: Cookie 保存时间,单位天。 +- `COOKIE_USERNAME`: 保存用户名的 cookie 名称。 +- `COOKIE_REMEMBER_NAME`: 保存自动登录信息的 cookie 名称。 +- `REVERSE_PROXY_AUTHENTICATION_USER`: 反向代理认证的 HTTP 头名称。 + +## Service (`service`) + +- `ACTIVE_CODE_LIVE_MINUTES`: 登陆验证码失效时间,单位分钟。 +- `RESET_PASSWD_CODE_LIVE_MINUTES`: 重置密码失效时间,单位分钟。 +- `REGISTER_EMAIL_CONFIRM`: 启用注册邮件激活,前提是 `Mailer` 已经启用。 +- `DISABLE_REGISTRATION`: 禁用注册,启用后只能用管理员添加用户。 +- `SHOW_REGISTRATION_BUTTON`: 是否显示注册按钮。 +- `REQUIRE_SIGNIN_VIEW`: 是否所有页面都必须登录后才可访问。 +- `ENABLE_CACHE_AVATAR`: 是否缓存来自 Gravatar 的头像。 +- `ENABLE_NOTIFY_MAIL`: 是否发送工单创建等提醒邮件,需要 `Mailer` 被激活。 +- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: 允许反向代理认证,更多细节见:https://github.com/gogits/gogs/issues/165 +- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: 允许通过反向认证做自动注册。 +- `ENABLE_CAPTCHA`: 注册时使用图片验证码。 + +## Webhook (`webhook`) + +- `QUEUE_LENGTH`: 说明: Hook 任务队列长度。 +- `DELIVER_TIMEOUT`: 请求webhooks的超时时间,单位秒。 +- `SKIP_TLS_VERIFY`: 是否允许不安全的证书。 +- `PAGING_NUM`: 每页显示的Webhook 历史数量。 + +## Mailer (`mailer`) + +- `ENABLED`: 是否启用邮件服务。 +- `DISABLE_HELO`: 禁用 HELO 命令。 +- `HELO_HOSTNAME`: 自定义主机名来回应 HELO 命令。 +- `HOST`: SMTP 主机地址和端口 (例如:smtp.gitea.io:587)。 +- `FROM`: 邮件发送地址,RFC 5322. 这里可以填一个邮件地址或者 "Name" \ 格式。 +- `USER`: 用户名(通常就是邮件地址)。 +- `PASSWD`: 密码。 +- `SKIP_VERIFY`: 忽略证书验证。 + +说明:实际上 Gitea 仅仅支持基于 STARTTLS 的 SMTP。 + +## Cache (`cache`) + +- `ADAPTER`: 缓存引擎,可以为 `memory`, `redis` 或 `memcache`。 +- `INTERVAL`: 只对内存缓存有效,GC间隔,单位秒。 +- `HOST`: 针对redis和memcache有效,主机地址和端口。 + - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180` + - Memache: `127.0.0.1:9090;127.0.0.1:9091` + +## Session (`session`) + +- `PROVIDER`: Session 内容存储方式,可选 `memory`, `file`, `redis` 或 `mysql`。 +- `PROVIDER_CONFIG`: 如果是文件,那么这里填根目录;其他的要填主机地址和端口。 +- `COOKIE_SECURE`: 强制使用 HTTPS 作为session访问。 +- `GC_INTERVAL_TIME`: Session失效时间。 + +## Picture (`picture`) + +- `GRAVATAR_SOURCE`: 头像来源,可以是 `gravatar`, `duoshuo` 或者类似 `http://cn.gravatar.com/avatar/` 的来源 +- `DISABLE_GRAVATAR`: 开启则只使用内部头像。 +- `ENABLE_FEDERATED_AVATAR`: 启用头像联盟支持 (参见 http://www.libravatar.org) + +## Attachment (`attachment`) + +- `ENABLED`: 是否允许用户上传附件。 +- `PATH`: 附件存储路径 +- `ALLOWED_TYPES`: 允许上传的附件类型。比如:`image/jpeg|image/png`,用 `*/*` 表示允许任何类型。 +- `MAX_SIZE`: 附件最大限制,单位 MB,比如: `4`。 +- `MAX_FILES`: 一次最多上传的附件数量,比如: `5`。 + +## Log (`log`) + +- `ROOT_PATH`: 日志文件根目录。 +- `MODE`: 日志记录模式,默认是为 `console`。如果要写到多个通道,用逗号分隔 +- `LEVEL`: 日志级别,默认为`Trace`。 + +## Cron (`cron`) + +- `ENABLED`: 是否在后台运行定期任务。 +- `RUN_AT_START`: 是否启动时自动运行。 + +### Cron - Update Mirrors (`cron.update_mirrors`) + +- `SCHEDULE`: 自动同步镜像仓库的Cron语法,比如:`@every 1h`。 + +### Cron - Repository Health Check (`cron.repo_health_check`) + +- `SCHEDULE`: 仓库健康监测的Cron语法,比如:`@every 24h`。 +- `TIMEOUT`: 仓库健康监测的超时时间,比如:`60s`. +- `ARGS`: 执行 `git fsck` 命令的参数,比如:`--unreachable --tags`。 + +### Cron - Repository Statistics Check (`cron.check_repo_stats`) + +- `RUN_AT_START`: 是否启动时自动运行仓库统计。 +- `SCHEDULE`: 藏亏统计时的Cron 语法,比如:`@every 24h`. + +## Git (`git`) + +- `MAX_GIT_DIFF_LINES`: 比较视图中,一个文件最多显示行数。 +- `MAX_GIT_DIFF_LINE_CHARACTERS`: 比较视图中一行最大字符数。 +- `MAX_GIT_DIFF_FILES`: 比较视图中的最大现实文件数目。 +- `GC_ARGS`: 执行 `git gc` 命令的参数, 比如: `--aggressive --auto`。 + +## Other (`other`) + +- `SHOW_FOOTER_BRANDING`: 为真则在页面底部显示Gitea的字样。 +- `SHOW_FOOTER_VERSION`: 为真则在页面底部显示Gitea的版本。 diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/advanced/customizing-gitea.en-us.md new file mode 100644 index 00000000..4fdf4377 --- /dev/null +++ b/doc/advanced/customizing-gitea.en-us.md @@ -0,0 +1,54 @@ +--- +date: "2017-04-15T14:56:00+02:00" +title: "Customizing Gitea" +slug: "customizing-gitea" +weight: 9 +toc: false +draft: false +menu: + sidebar: + parent: "advanced" + name: "Customizing Gitea" + weight: 9 + identifier: "customizing-gitea" +--- + +# Customizing Gitea + +The main way to customize Gitea is by using the `custom` folder. This is the central place to override and configure features. + +If you install Gitea from binary, after the installation process ends, you can find the `custom` folder next to the binary. +Gitea will create the folder for you and prepopulate it with a `conf` folder inside, where Gitea stores all the configuration settings provided through the installation steps (have a look [here](https://docs.gitea.io/en-us/config-cheat-sheet/) for a complete list). + +If you can't find the `custom` folder next to the binary, please check the `GITEA_CUSTOM` environment variable, that can be used to override the default path to something else. `GITEA_CUSTOM` might be set for example in your launch script file. Please have a look [here](https://docs.gitea.io/en-us/specific-variables/) for a complete list of environment variables. + +**Note** that you have to restart Gitea for it to notice the changes. + +## Customizing /robots.txt + +To make Gitea serve your own `/robots.txt` (by default, an empty 404 status is served), simply create a file called `robots.txt` in the `custom` folder with the [expected contents](http://www.robotstxt.org/). + +## Serving custom public files + +To make Gitea serve custom public files (like pages and images), use the folder `custom/public/` as the webroot. Symbolic links will be followed. + +For example, a file `image.png` stored in `custom/public`, can be accessed with the url `http://your-gitea-url/image.png`. + +## Changing the default avatar + +Place the png image at the following path: `custom/public/img/avatar_default.png` + +## Customizing Gitea pages + +The `custom/templates` folder allows you to change every single page of Gitea. + +You need to be aware of the template you want to change. All templates can be found in the `templates` folder of the Gitea sources. + +When you find the correct .tmpl file, you need to copy it in the `custom/templates` folder of your installation, __respecting__ any subfolder you found in the source template. + +You can now customize the template you copied in `custom/templates`, being carefully to not break the Gitea syntax. +Any statement contained inside `{{` and `}}` are Gitea templete's syntax and shouldn't be touch, unless you know what are you doing. + +## Customizing gitignores, labels, licenses, locales, and readmes. + +Place your own files in corresponding sub-folder under `custom/options`. \ No newline at end of file diff --git a/doc/advanced/hacking-on-gitea.en-us.md b/doc/advanced/hacking-on-gitea.en-us.md new file mode 100644 index 00000000..368d1744 --- /dev/null +++ b/doc/advanced/hacking-on-gitea.en-us.md @@ -0,0 +1,42 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Hacking on Gitea" +slug: "hacking-on-gitea" +weight: 10 +toc: false +draft: false +menu: + sidebar: + parent: "advanced" + name: "Hacking on Gitea" + weight: 10 + identifier: "hacking-on-gitea" +--- + +# Hacking on Gitea + +We won't cover the basics of a Golang setup within this guide. If you don't know how to get the environment up and running you should follow the official [install instructions](https://golang.org/doc/install). + +If you want to contribute to Gitea you should fork the project and work on the `master` branch. There is a catch though, some internal packages are referenced by their GitHub URL. So you have to trick the Go tool to think that you work on a clone of the official repository. Start by downloading the source code as you normally would: + +``` +go get -d code.gitea.io/gitea +``` + +Now it's time to fork the [Gitea repository](https://github.com/go-gitea/gitea) on GitHub, after that you should have to switch to the source directory on the command line: + +``` +cd $GOPATH/src/code.gitea.io/gitea +``` + +To be able to create pull requests you should add your forked repository as a remote to the Gitea sources, otherwise you can not apply the changes to our repository because of lacking write permissions: + +``` +git remote rename origin upstream +git remote add origin git@github.com:/gitea.git +git fetch --all --prune +``` + +You've got a working development environment for Gitea now. Take a look at the `Makefile` to get an overview about the available tasks. The most common tasks should be `make test` which will start our test environment and `make build` which will build a `gitea` binary into your working directory. Writing test cases is not mandatory to contribute, but we will be happy if you do. + +That’s it! You are ready to hack on Gitea. Test your changes, push them to your repository and open a pull request. diff --git a/doc/advanced/hacking-on-gitea.zh-cn.md b/doc/advanced/hacking-on-gitea.zh-cn.md new file mode 100644 index 00000000..85726029 --- /dev/null +++ b/doc/advanced/hacking-on-gitea.zh-cn.md @@ -0,0 +1,42 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "加入 Gitea 开源" +slug: "hacking-on-gitea" +weight: 10 +toc: false +draft: false +menu: + sidebar: + parent: "advanced" + name: "加入 Gitea 开源" + weight: 10 + identifier: "hacking-on-gitea" +--- + +# Hacking on Gitea + +首先你需要一些运行环境,这和 [从源代码安装]({{< relref "from-source.zh-cn.md" >}}) 相同,如果你还没有设置好,可以先阅读那个章节。 + +如果你想为 Gitea 贡献代码,你需要 Fork 这个项目并且以 `master` 为开发分支。Gitea使用Govendor来管理依赖,因此所有依赖项都被工具自动copy在vendor子目录下。用下面的命令来下载源码: + +``` +go get -d code.gitea.io/gitea +``` + +然后你可以在 Github 上 fork [Gitea 项目](https://github.com/go-gitea/gitea),之后可以通过下面的命令进入源码目录: + +``` +cd $GOPATH/src/code.gitea.io/gitea +``` + +要创建 pull requests 你还需要在源码中新增一个 remote 指向你 Fork 的地址,直接推送到 origin 的话会告诉你没有写权限: + +``` +git remote rename origin upstream +git remote add origin git@github.com:/gitea.git +git fetch --all --prune +``` + +然后你就可以开始开发了。你可以看一下 `Makefile` 的内容。`make test` 可以运行测试程序, `make build` 将生成一个 `gitea` 可运行文件在根目录。如果你的提交比较复杂,尽量多写一些单元测试代码。 + +好了,到这里你已经设置好了所有的开发Gitea所需的环境。欢迎成为 Gitea 的 Contributor。 diff --git a/doc/advanced/make.en-us.md b/doc/advanced/make.en-us.md new file mode 100644 index 00000000..836c5443 --- /dev/null +++ b/doc/advanced/make.en-us.md @@ -0,0 +1,44 @@ +--- +date: "2017-01-14T11:00:00-02:00" +title: "Make" +slug: "make" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "advanced" + name: "Make" + weight: 30 + identifier: "make" +--- + +# Make + +Gitea makes heavy use of Make to automate tasks and have a faster development. This guide cover how to install Make. + +### On Linux + +You can install with your package manager. + +On Ubuntu/Debian: + +```bash +sudo apt-get install build-essential +``` + +On Fedora/RHEL/CentOS: + +```bash +sudo yum install make +``` + +### On Windows + +If you are using Windows, you can download and use one of these distributions of Make: + +- [Single binary build](http://www.equation.com/servlet/equation.cmd?fa=make). Copy somewhere and add to `PATH`. + - [32-bits version](ftp://ftp.equation.com/make/32/make.exe) + - [64-bits version](ftp://ftp.equation.com/make/64/make.exe) +- [MinGW](http://www.mingw.org/) includes a build. The binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to your `PATH`. +- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make` diff --git a/doc/advanced/specific-variables.en-us.md b/doc/advanced/specific-variables.en-us.md new file mode 100644 index 00000000..1fe705aa --- /dev/null +++ b/doc/advanced/specific-variables.en-us.md @@ -0,0 +1,67 @@ +--- +date: "2017-04-08T11:34:00+02:00" +title: "Specific variables" +slug: "specific-variables" +weight: 20 +toc: false +draft: false +menu: + sidebar: + parent: "advanced" + name: "Specific variables" + weight: 20 + identifier: "specific-variables" +--- + +# Specific variables + +This is an inventory of Gitea environment variables. They change Gitea behaviour. + +Initialize them before Gitea command to be effective, for example: + +``` +GITEA_CUSTOM=/home/gitea/custom ./gitea web +``` + +## From Go language + +As Gitea is written in Go, it uses some Go variables as: + + * `GOOS` + * `GOARCH` + * `GOPATH` + +For `GOPATH`, check [official documentation about GOPATH environment variable](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable). + +For others, check [official documentation about variables used when it runs the generator](https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source). + +## Gitea files + + * `GITEA_WORK_DIR`: Gitea absolute path of work directory. + * `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable to change *custom* directory. + * `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR` + * `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM` + +## Operating system specifics + + * `USER`: system user that launch Gitea. Useful for repository URL address on Gitea interface + * `USERNAME`: if no USER found, Gitea will try `USERNAME` + * `HOME`: User home directory path (**except if** you're running on Windows, check the following `USERPROFILE` variable) + +### Only on Windows + + * `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH` + * `HOMEDRIVE`: Main drive path you will use to get home directory + * `HOMEPATH`: Home relative path in the given home drive path + +## Macaron (framework used by Gitea) + + * `HOST`: Host Macaron will listen on + * `PORT`: Port Macaron will listen on + * `MACARON_ENV`: global variable to provide special functionality for development environments vs production environments. If MACARON_ENV is set to "" or "development" then templates will be recompiled on every request. For more performance, set the MACARON_ENV environment variable to "production". + +## Miscellaneous + + * `SKIP_MINWINSVC`: Do not run as a service on Windows if set to 1 + * `ZOOKEEPER_PATH`: [Zookeeper](http://zookeeper.apache.org/) jar file path + diff --git a/doc/features.en-us.md b/doc/features.en-us.md new file mode 100644 index 00000000..9cc90b46 --- /dev/null +++ b/doc/features.en-us.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Features" +slug: "features" +weight: 20 +toc: false +draft: false +menu: + sidebar: + name: "Features" + weight: 30 + identifier: "features" +--- diff --git a/doc/features.zh-cn.md b/doc/features.zh-cn.md new file mode 100644 index 00000000..68d2f71b --- /dev/null +++ b/doc/features.zh-cn.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "特性" +slug: "features" +weight: 20 +toc: false +draft: false +menu: + sidebar: + name: "特性" + weight: 30 + identifier: "features" +--- diff --git a/doc/features.zh-tw.md b/doc/features.zh-tw.md new file mode 100644 index 00000000..889e0df8 --- /dev/null +++ b/doc/features.zh-tw.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "功能" +slug: "features" +weight: 20 +toc: false +draft: false +menu: + sidebar: + name: "功能" + weight: 30 + identifier: "features" +--- diff --git a/doc/features/authentication.en-us.md b/doc/features/authentication.en-us.md new file mode 100644 index 00000000..37a0d6fa --- /dev/null +++ b/doc/features/authentication.en-us.md @@ -0,0 +1,194 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Authentication" +slug: "authentication" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "Authentication" + weight: 10 + identifier: "authentication" +--- + +--- +name: Authentication +--- + +# Authentication + +## LDAP (Lightweight Directory Access Protocol) + +Both the LDAP via BindDN and the simple auth LDAP share the following fields: + +- Authorization Name **(required)** + - A name to assign to the new method of authorization. + +- Host **(required)** + - The address where the LDAP server can be reached. + - Example: `mydomain.com` + +- Port **(required)** + - The port to use when connecting to the server. + - Example: `389` for LDAP or `636` for LDAP SSL + +- Enable TLS Encryption (optional) + - Whether to use TLS when connecting to the LDAP server. + +- Admin Filter (optional) + - An LDAP filter specifying if a user should be given administrator + privileges. If a user account passes the filter, the user will be + privileged as an administrator. + - Example: `(objectClass=adminAccount)` + - Example for Microsoft Active Directory (AD): `(memberOf=CN=admin-group,OU=example,DC=example,DC=org)` + +- Username attribute (optional) + - The attribute of the user's LDAP record containing the user name. Given + attribute value will be used for new Gitea account user name after first + successful sign-in. Leave empty to use login name given on sign-in form. + - This is useful when supplied login name is matched against multiple + attributes, but only single specific attribute should be used for Gitea + account name, see "User Filter". + - Example: `uid` + - Example for Microsoft Active Directory (AD): `sAMAccountName` + +- First name attribute (optional) + - The attribute of the user's LDAP record containing the user's first name. + This will be used to populate their account information. + - Example: `givenName` + +- Surname attribute (optional) + - The attribute of the user's LDAP record containing the user's surname. + This will be used to populate their account information. + - Example: `sn` + +- E-mail attribute **(required)** + - The attribute of the user's LDAP record containing the user's email + address. This will be used to populate their account information. + - Example: `mail` + +**LDAP via BindDN** adds the following fields: + +- Bind DN (optional) + - The DN to bind to the LDAP server with when searching for the user. This + may be left blank to perform an anonymous search. + - Example: `cn=Search,dc=mydomain,dc=com` + +- Bind Password (optional) + - The password for the Bind DN specified above, if any. _Note: The password + is stored in plaintext at the server. As such, ensure that your Bind DN + has as few privileges as possible._ + +- User Search Base **(required)** + - The LDAP base at which user accounts will be searched for. + - Example: `ou=Users,dc=mydomain,dc=com` + +- User Filter **(required)** + - An LDAP filter declaring how to find the user record that is attempting to + authenticate. The `%s` matching parameter will be substituted with login + name given on sign-in form. + - Example: `(&(objectClass=posixAccount)(uid=%s))` + - Example for Microsoft Active Directory (AD): `(&(objectCategory=Person)(memberOf=CN=user-group,OU=example,DC=example,DC=org)(sAMAccountName=%s)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))` + - To substitute more than once `%[1]s` should be used instead, e.g. when + matching supplied login name against multiple attributes such as user + identifier, email or even phone number. + - Example: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))` + +**LDAP using simple auth** adds the following fields: + +- User DN **(required)** + - A template to use as the user's DN. The `%s` matching parameter will be substituted with login name given on sign-in form. + - Example: `cn=%s,ou=Users,dc=mydomain,dc=com` + - Example: `uid=%s,ou=Users,dc=mydomain,dc=com` + +- User Filter **(required)** + - An LDAP filter declaring when a user should be allowed to log in. The `%s` + matching parameter will be substituted with login name given on sign-in + form. + - Example: `(&(objectClass=posixAccount)(cn=%s))` + - Example: `(&(objectClass=posixAccount)(uid=%s))` + +**Verify group membership in LDAP** uses the following fields: + +* Group Search Base (optional) + * The LDAP DN used for groups. + * Example: `ou=group,dc=mydomain,dc=com` + +* Group Name Filter (optional) + * An LDAP filter declaring how to find valid groups in the above DN. + * Example: `(|(cn=gitea_users)(cn=admins))` + +* User Attribute in Group (optional) + * Which user LDAP attribute is listed in the group. + * Example: `uid` + +* Group Attribute for User (optional) + * Which group LDAP attribute contains an array above user attribute names. + * Example: `memberUid` + +## PAM (Pluggable Authentication Module) + +To configure this you just need to set the 'PAM Service Name' to a filename in `/etc/pam.d/`. +If you want it to work with normal Linux passwords, the user running Gitea must have read access to `/etc/shadow`. + +## SMTP (Simple Mail Transfer Protocol) + +This option allows Gitea to log in to your SMTP host as a Gitea user. To configure this, simply set the fields below: + +- Authentication Name **(required)** + - A name to assign to the new method of authorization. + +- SMTP Authentication Type **(required)** + - Type of authentication for use on your SMTP host, PLAIN or LOGIN. + +- Host **(required)** + - The address where the SMTP host can be reached. + - Example: `smtp.mydomain.com` + +- Port **(required)** + - The port to use when connecting to the server. + - Example: `587` + +- Allowed Domains + - Restrict what domains can log in if you're using public SMTP host or SMTP host with multiple domains. + - Example: `gitea.io,mydomain.com,mydomain2.com` + +- Enable TLS Encryption + - Enable TLS encryption on authentication. + +- Skip TLS Verify + - Disable TLS verify on authentication. + +- This authentication is activate + - Enable or disable this auth. + +## FreeIPA + +- In order to log in to Gitea using FreeIPA credentials, you need to create a bind account for Gitea to use: + +- On the FreeIPA server, create a `gitea.ldif` file, replacing `dc=example,dc=com` with your DN, and providing an appropriately secure password: +``` + dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com + changetype: add + objectclass: account + objectclass: simplesecurityobject + uid: gitea + userPassword: secure password + passwordExpirationTime: 20380119031407Z + nsIdleTimeout: 0 +``` + +- Import the LDIF (change localhost to an IPA server if needed), you’ll be prompted for your Directory Manager password: +``` + ldapmodify -h localhost -p 389 -x -D \ + "cn=Directory Manager" -W -f gitea.ldif +``` +- Add an IPA group for gitea_users : +``` + ipa group-add --desc="Gitea Users" gitea_users +``` +- Note: If you get an error about IPA credentials, please run `kinit admin` and give your admin account password. + +- Now login to the Gitea as an Administrator, click on "Authentication" under Admin Panel. Then click `Add New Source` and fill in the details, changing all where appropriate to your own domain. diff --git a/doc/features/authentication.zh-cn.md b/doc/features/authentication.zh-cn.md new file mode 100644 index 00000000..4ed91332 --- /dev/null +++ b/doc/features/authentication.zh-cn.md @@ -0,0 +1,18 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "认证" +slug: "authentication" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "认证" + weight: 10 + identifier: "authentication" +--- + +# 认证 + +## TBD diff --git a/doc/features/authentication.zh-tw.md b/doc/features/authentication.zh-tw.md new file mode 100644 index 00000000..4dd02489 --- /dev/null +++ b/doc/features/authentication.zh-tw.md @@ -0,0 +1,18 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "認證" +slug: "authentication" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "認證" + weight: 10 + identifier: "authentication" +--- + +# 認證 + +## TBD diff --git a/doc/features/localization.en-us.md b/doc/features/localization.en-us.md new file mode 100644 index 00000000..1bb7beff --- /dev/null +++ b/doc/features/localization.en-us.md @@ -0,0 +1,18 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Localization" +slug: "localization" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "Localization" + weight: 20 + identifier: "localization" +--- + +# Localization + +## TBD diff --git a/doc/features/localization.zh-cn.md b/doc/features/localization.zh-cn.md new file mode 100644 index 00000000..81de966e --- /dev/null +++ b/doc/features/localization.zh-cn.md @@ -0,0 +1,18 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "本地化" +slug: "localization" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "本地化" + weight: 20 + identifier: "localization" +--- + +# 本地化 + +## TBD diff --git a/doc/features/localization.zh-tw.md b/doc/features/localization.zh-tw.md new file mode 100644 index 00000000..534ff89f --- /dev/null +++ b/doc/features/localization.zh-tw.md @@ -0,0 +1,18 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "在地化" +slug: "localization" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "在地化" + weight: 20 + identifier: "localization" +--- + +# Localization + +## TBD diff --git a/doc/features/webhooks.en-us.md b/doc/features/webhooks.en-us.md new file mode 100644 index 00000000..5fad6881 --- /dev/null +++ b/doc/features/webhooks.en-us.md @@ -0,0 +1,103 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Webhooks" +slug: "webhooks" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "Webhooks" + weight: 30 + identifier: "webhooks" +--- + +# Webhooks + +Gitea supports web hooks for repository events, you can find it in settings page(`/:username/:reponame/settings/hooks`). All event pushes are POST requests, and we currently support two formats: Gitea and Slack. + +### Event information + +Following shows an example of event information that will be sent by Gitea to Payload URL: + + +``` +X-Github-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 +X-Github-Event: push +X-Gogs-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 +X-Gogs-Event: push +X-Gitea-Delivery: f6266f16-1bf3-46a5-9ea4-602e06ead473 +X-Gitea-Event: push +``` + +```json +{ + "secret": "3gEsCfjlV2ugRwgpU#w1*WaW*wa4NXgGmpCfkbG3", + "ref": "refs/heads/develop", + "before": "28e1879d029cb852e4844d9c718537df08844e03", + "after": "bffeb74224043ba2feb48d137756c8a9331c449a", + "compare_url": "http://localhost:3000/gitea/webhooks/compare/28e1879d029cb852e4844d9c718537df08844e03...bffeb74224043ba2feb48d137756c8a9331c449a", + "commits": [ + { + "id": "bffeb74224043ba2feb48d137756c8a9331c449a", + "message": "Webhooks Yay!", + "url": "http://localhost:3000/gitea/webhooks/commit/bffeb74224043ba2feb48d137756c8a9331c449a", + "author": { + "name": "Gitea", + "email": "someone@gitea.io", + "username": "gitea" + }, + "committer": { + "name": "Gitea", + "email": "someone@gitea.io", + "username": "gitea" + }, + "timestamp": "2017-03-13T13:52:11-04:00" + } + ], + "repository": { + "id": 140, + "owner": { + "id": 1, + "login": "gitea", + "full_name": "Gitea", + "email": "someone@gitea.io", + "avatar_url": "https://localhost:3000/avatars/1", + "username": "gitea" + }, + "name": "webhooks", + "full_name": "gitea/webhooks", + "description": "", + "private": false, + "fork": false, + "html_url": "http://localhost:3000/gitea/webhooks", + "ssh_url": "ssh://gitea@localhost:2222/gitea/webhooks.git", + "clone_url": "http://localhost:3000/gitea/webhooks.git", + "website": "", + "stars_count": 0, + "forks_count": 1, + "watchers_count": 1, + "open_issues_count": 7, + "default_branch": "master", + "created_at": "2017-02-26T04:29:06-05:00", + "updated_at": "2017-03-13T13:51:58-04:00" + }, + "pusher": { + "id": 1, + "login": "gitea", + "full_name": "Gitea", + "email": "someone@gitea.io", + "avatar_url": "https://localhost:3000/avatars/1", + "username": "gitea" + }, + "sender": { + "id": 1, + "login": "gitea", + "full_name": "Gitea", + "email": "someone@gitea.io", + "avatar_url": "https://localhost:3000/avatars/1", + "username": "gitea" + } +} +``` diff --git a/doc/features/webhooks.zh-cn.md b/doc/features/webhooks.zh-cn.md new file mode 100644 index 00000000..d3bb4797 --- /dev/null +++ b/doc/features/webhooks.zh-cn.md @@ -0,0 +1,18 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Webhooks" +slug: "webhooks" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "Webhooks" + weight: 30 + identifier: "webhooks" +--- + +# Webhooks + +## TBD diff --git a/doc/features/webhooks.zh-tw.md b/doc/features/webhooks.zh-tw.md new file mode 100644 index 00000000..d3bb4797 --- /dev/null +++ b/doc/features/webhooks.zh-tw.md @@ -0,0 +1,18 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Webhooks" +slug: "webhooks" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "features" + name: "Webhooks" + weight: 30 + identifier: "webhooks" +--- + +# Webhooks + +## TBD diff --git a/doc/help.zh-cn.md b/doc/help.zh-cn.md new file mode 100644 index 00000000..6af7aa17 --- /dev/null +++ b/doc/help.zh-cn.md @@ -0,0 +1,13 @@ +--- +date: "2017-01-20T15:00:00+08:00" +title: "帮助" +slug: "help" +weight: 50 +toc: false +draft: false +menu: + sidebar: + name: "帮助" + weight: 50 + identifier: "help" +--- diff --git a/doc/help/seek-help.zh-cn.md b/doc/help/seek-help.zh-cn.md new file mode 100644 index 00000000..ac62b9b8 --- /dev/null +++ b/doc/help/seek-help.zh-cn.md @@ -0,0 +1,23 @@ +--- +date: "2017-01-20T15:00:00+08:00" +title: "需要帮助" +slug: "seek-help" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "help" + name: "需要帮助" + weight: 20 + identifier: "seek-help" +--- + +## 需要帮助? + +如果您在使用或者开发过程中遇到问题,请到以下渠道咨询: + +- 到[Github issue](https://github.com/go-gitea/gitea/issues)提问(因为项目维护人员来自世界各地,为保证沟通顺畅,请使用英文提问) +- 中文问题到[gocn.io](https://gocn.io/topic/Gitea)提问 +- 访问 [Discord server - 英文](https://discord.gg/NsatcWJ) +- 加入 QQ群 328432459 获得进一步的支持 diff --git a/doc/help/troubleshooting.en-us.md b/doc/help/troubleshooting.en-us.md new file mode 100644 index 00000000..aa9af456 --- /dev/null +++ b/doc/help/troubleshooting.en-us.md @@ -0,0 +1,69 @@ +--- +date: "2016-11-08T16:00:00+02:00" +title: "Troubleshooting" +slug: "troubleshooting" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "Help" + name: "Troubleshooting" + weight: 20 + identifier: "troubleshooting" +--- + +# Troubleshooting + +This page contains some common issues you can run into and their solutions. + +## SSH issues + +If you are having issues with reaching your repositories over `ssh` while the +Gitea web front-end and `https` based git operations work fine, consider +looking at the following items. + +``` +Permission denied (publickey). +fatal: Could not read from remote repository. + +Please make sure you have the correct access rights +and the repository exists. +``` + +This error signifies that the server rejected your log in attempt, check the +following things: + +* On the client: + * Ensure the public and private ssh keys are added to the correct Gitea user. + * Make sure there are no issues in your remote url, ensure the name of the + git user (before the `@`) is spelled correctly. + * Ensure the public and private ssh keys are available and reachable on the + client machine. + * Try to `ssh git@myremote.example` to ensure that everything is set up + properly. +* On the server: + * Check the permissions of the `.ssh` directory in the home directory of your + `git` user. + * Verify that the correct public keys are added to `.ssh/authorized_keys`. + Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the + Gitea admin panel. + +If you get a similar error without the public key part (shown below) then +authentication succeeded, but some other setting is preventing ssh from +reaching the correct repository. + +``` +fatal: Could not read from remote repository. + +Please make sure you have the correct access rights +and the repository exists. +``` + +In this case, look into the following settings: + +* On the server: + * Make sure that your `git` user has a usable shell set. You can verify this + with `getent passwd git | cut -d: -f7`, `chsh` can be used to modify this. + * Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the + proper configuration file. diff --git a/doc/installation.en-us.md b/doc/installation.en-us.md new file mode 100644 index 00000000..4257521d --- /dev/null +++ b/doc/installation.en-us.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation" +slug: "installation" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "Installation" + weight: 10 + identifier: "installation" +--- diff --git a/doc/installation.zh-cn.md b/doc/installation.zh-cn.md new file mode 100644 index 00000000..8f57e0f0 --- /dev/null +++ b/doc/installation.zh-cn.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "安装" +slug: "installation" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "安装" + weight: 10 + identifier: "installation" +--- diff --git a/doc/installation.zh-tw.md b/doc/installation.zh-tw.md new file mode 100644 index 00000000..f955e994 --- /dev/null +++ b/doc/installation.zh-tw.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "安裝" +slug: "installation" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "安裝" + weight: 10 + identifier: "installation" +--- diff --git a/doc/installation/from-binary.en-us.md b/doc/installation/from-binary.en-us.md new file mode 100644 index 00000000..9503ac82 --- /dev/null +++ b/doc/installation/from-binary.en-us.md @@ -0,0 +1,45 @@ +--- +date: "2017-06-19T12:00:00+02:00" +title: "Installation from binary" +slug: "install-from-binary" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "From binary" + weight: 20 + identifier: "install-from-binary" +--- + +# Installation from binary + +All downloads come with SQLite, MySQL and PostgreSQL support, and are built with embedded assets. Keep in mind that this can be different for older releases. The installation based on our binaries is quite simple, just choose the file matching your platform from the [downloads page](https://dl.gitea.io/gitea), copy the URL and replace the URL within the commands below: + +``` +wget -O gitea https://dl.gitea.io/gitea/1.0.1/gitea-1.0.1-linux-amd64 +chmod +x gitea +``` + +## Test + +After following the steps above you will have a `gitea` binary within your working directory, first you can test it if it works like expected and afterwards you can copy it to the destination where you want to store it. When you launch Gitea manually from your CLI you can always kill it by hitting `Ctrl + C`. + +``` +./gitea web +``` + +## Troubleshooting + +### Old glibc versions + +Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to load the Gitea binary, usually resulting an error like ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. This is due to the integrated SQLite support in the binaries we provide. In the future, we will provide binaries without the requirement for glibc. As a workaround, you can upgrade your distribution or [install from source]({{< relref "from-source.en-us.md" >}}). + +### Running gitea on another port + +If getting an error like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: bind: address already in use` gitea needs to be started on another free port. This is possible using `./gitea web -p $PORT`. + +## Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/doc/installation/from-binary.zh-cn.md b/doc/installation/from-binary.zh-cn.md new file mode 100644 index 00000000..c8ceb7c6 --- /dev/null +++ b/doc/installation/from-binary.zh-cn.md @@ -0,0 +1,35 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "从二进制安装" +slug: "install-from-binary" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "从二进制安装" + weight: 20 + identifier: "install-from-binary" +--- + +# 从二进制安装 + +所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 基于二进制的安装非常简单,只要从 [下载页面](https://dl.gitea.io/gitea) 选择对应平台,拷贝下载URL,执行以下命令即可(以Linux为例): + +``` +wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64 +chmod +x gitea +``` + +## 测试 + +在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。 + +``` +./gitea web +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/doc/installation/from-binary.zh-tw.md b/doc/installation/from-binary.zh-tw.md new file mode 100644 index 00000000..e6b4637b --- /dev/null +++ b/doc/installation/from-binary.zh-tw.md @@ -0,0 +1,35 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "執行檔安裝" +slug: "install-from-binary" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "執行檔" + weight: 20 + identifier: "install-from-binary" +--- + +# 從執行檔安裝 + +所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.io/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了: + +``` +wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64 +chmod +x gitea +``` + +## 測試 + +執行完上述步驟,您將會得到 `gita` 執行檔,在複製到遠端伺服器前,您可以先測試看看,在命令列執行完成後,可以透過 `Ctrl + C` 關閉程式。 + +``` +./gitea web +``` + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 diff --git a/doc/installation/from-package.en-us.md b/doc/installation/from-package.en-us.md new file mode 100644 index 00000000..94f0815d --- /dev/null +++ b/doc/installation/from-package.en-us.md @@ -0,0 +1,57 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation from package" +slug: "install-from-package" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "From package" + weight: 20 + identifier: "install-from-package" +--- + +# Installation from package + +## Linux + +We have not published any real package yet, we will update this page directly when we start to publish packages for any Linux distribution, in the meantime you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. + +## Windows + +We have not published any package for Windows yet, we will update this page directly when we start to publish packages in the form of `MSI` installers or via [Chocolatey](https://chocolatey.org/), in the meantime you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. + +## macOS + +Currently we only support the installation via `brew` for macOS. If you are not using [Homebrew](http://brew.sh/) you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. To install Gitea via `brew` you just need to execute the following commands: + +``` +brew tap go-gitea/gitea +brew install gitea +``` + +## FreeBSD + +A FreeBSD port `www/gitea` is available. You can install a pre-built binary package: + +``` +pkg install gitea +``` + +For the most up to date version, or to build the port with custom options, [install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html): + +``` +su - +cd /usr/ports/www/gitea +make install clean +``` + +The port uses the standard FreeBSD file system layout: config files are in `/usr/local/etc/gitea`, bundled templates, options, plugins and themes are in `/usr/local/share/gitea`, and a start script is in `/usr/local/etc/rc.d/gitea`. + +To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it with `service gitea start`. + +## Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/doc/installation/from-package.zh-cn.md b/doc/installation/from-package.zh-cn.md new file mode 100644 index 00000000..c56a54fe --- /dev/null +++ b/doc/installation/from-package.zh-cn.md @@ -0,0 +1,37 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "选择包安装" +slug: "install-from-package" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "选择包安装" + weight: 20 + identifier: "install-from-package" +--- + +# 使用包安装 + +## Linux + +目前还没有对应的Linux安装包发布,如果我们发布了,我们将更新本页面。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。 + +## Windows + +目前还没有对应的Windows安装包发布,如果我们发布了,我们将更新本页面。我们计划使用 `MSI` 安装器或者 [Chocolatey](https://chocolatey.org/)来制作安装包。当前你可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。 + +## macOS + +macOS 平台下当前我们仅支持通过 `brew` 来安装。如果您没有安装 [Homebrew](http://brew.sh/),你冶可以查看 [从二进制安装]({{< relref "from-binary.zh-cn.md" >}})。在你安装了 `brew` 之后, 你可以执行以下命令: + +``` +brew tap go-gitea/gitea +brew install gitea +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/doc/installation/from-package.zh-tw.md b/doc/installation/from-package.zh-tw.md new file mode 100644 index 00000000..f37579d6 --- /dev/null +++ b/doc/installation/from-package.zh-tw.md @@ -0,0 +1,53 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "套件安裝" +slug: "install-from-package" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "套件安裝" + weight: 20 + identifier: "install-from-package" +--- + +# 從套件安裝 + +## Linux + +目前尚未發佈任何 Linux 套件,如果我們發佈了,會直接更新此網頁。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。 + +## Windows + +目前尚未發佈任何 Windows 套件,如果我們發佈了,會直接更新此網頁。我們計畫使用 `MSI`,或 [Chocolatey](https://chocolatey.org/) 來製作套件。在這之前請先參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。 + +## macOS + +目前我們只支援透過 `brew` 來安裝套件。假如您尚未使用 [Homebrew](http://brew.sh/),您就必須參考[執行檔安裝]({{< relref "from-binary.zh-tw.md" >}})方式。透過 `brew` 安裝 Gitea,您只需要執行底下指令: + +``` +brew tap go-gitea/gitea +brew install gitea +``` + +## FreeBSD + +下載 FreeBSD port `www/gitea` 套件。你可以安裝 pre-built 執行檔: + +``` +pkg install gitea +``` + +對於最新版本或想要自行編譯特定選項,請使用 [port 安裝](https://www.freebsd.org/doc/handbook/ports-using.html): + +``` +su - +cd /usr/ports/www/gitea +make install clean +``` + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 diff --git a/doc/installation/from-source.en-us.md b/doc/installation/from-source.en-us.md new file mode 100644 index 00000000..a6686d8b --- /dev/null +++ b/doc/installation/from-source.en-us.md @@ -0,0 +1,79 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation from source" +slug: "install-from-source" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "From source" + weight: 30 + identifier: "install-from-source" +--- + +# Installation from source + +We won't cover the basics of a Golang setup within this guide. If you don't know how to get the environment up and running you should follow the official [install instructions](https://golang.org/doc/install). + +**Note**: Go version 1.7 or higher is required + +## Download + +First of all you have to retrieve the source code, the easiest way is to simply use directly Go for that. Just call the following commands to fetch the source and to switch into the working directory. + +``` +go get -d -u code.gitea.io/gitea +cd $GOPATH/src/code.gitea.io/gitea +``` + +Now it's time to decide which version of Gitea you want to build and install. Currently there are multiple options you can choose from. If you want to build our `master` branch you can directly go ahead to the [build section](#build), this branch represents our current development version and this is not intended for production use. + +If you want to build the latest stable version that acts as a development branch for the tagged releases you can see the available branches and how to checkout this branch with these commands: + +``` +git branch -a +git checkout v1.0 +``` + +If you would validate a Pull Request, first your must enable this new branch : (`xyz` is the PR id, for example `2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)) + +``` +git fetch origin pull/xyz/head:pr-xyz +``` + +Last but not least you can also directly build our tagged versions like `v1.0.0`, if you want to build Gitea from the source this is the suggested way for that. To use the tags you need to list the available tags and checkout a specific tag with the following commands: + +``` +git tag -l +git checkout v1.0.0 +git checkout pr-xyz +``` + +## Build + +Since we already bundle all required libraries to build Gitea you can continue with the build process itself. We provide various [make tasks](https://github.com/go-gitea/gitea/blob/master/Makefile) to keep the build process as simple as possible. See here how to get Make. Depending on your requirements you possibly want to add various build tags, you can choose between these tags: + +* `bindata`: With this tag you can embed all assets required to run an instance of Gitea, this makes a deployment quite easy because you don't need to care about any additional file. +* `sqlite`: With this tag you can enable support for a [SQLite3](https://sqlite.org/) database, this is only suggested for tiny Gitea installations. +* `tidb`: With this tag you can enable support for a [TiDB](https://github.com/pingcap/tidb) database, it's a quite simple file-based database comparable with SQLite. +* `pam`: With this tag you can enable support for PAM (Linux Pluggable Authentication Modules), this is useful if your users should be authenticated via your available system users. + +Now it's time to build the binary, we suggest to embed the assets with the `bindata` build tag, to include the assets you also have to execute the `generate` make task, otherwise the assets are not prepared to get embedded: + +``` +TAGS="bindata" make generate build +``` + +## Test + +After following the steps above you will have a `gitea` binary within your working directory, first you can test it if it works like expected and afterwards you can copy it to the destination where you want to store it. When you launch Gitea manually from your CLI you can always kill it by hitting `Ctrl + C`. + +``` +./gitea web +``` + +## Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/doc/installation/from-source.zh-cn.md b/doc/installation/from-source.zh-cn.md new file mode 100644 index 00000000..78cae35b --- /dev/null +++ b/doc/installation/from-source.zh-cn.md @@ -0,0 +1,84 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "从源代码安装" +slug: "install-from-source" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "从源代码安装" + weight: 30 + identifier: "install-from-source" +--- + +# 从源代码安装 + +首先你需要安装Golang,关于Golang的安装,参见官方文档 [install instructions](https://golang.org/doc/install)。 + +## 下载 + +你需要获取Gitea的源码,最方便的方式是使用 go 命令。执行以下命令: + +``` +go get -d -u code.gitea.io/gitea +cd $GOPATH/src/code.gitea.io/gitea +``` + +然后你可以选择编译和安装的版本,当前你有多个选择。如果你想编译 `master` 版本,你可以直接跳到 [编译](#build) 部分,这是我们的开发分支,虽然也很稳定但不建议您在正式产品中使用。 + +如果你想编译最新稳定分支,你可以执行以下命令签出源码: + +``` +git branch -a +git checkout v1.0 +``` + +最后,你也可以直接使用标签版本如 `v1.0.0`。你可以执行以下命令列出可用的版本并选择某个版本签出: + +``` +git tag -l +git checkout v1.0.0 +``` + +## 编译 + +我们已经将所有的依赖项拷贝到本工程,我们提供了一些 [编译选项](https://github.com/go-gitea/gitea/blob/master/Makefile) 来让编译更简单。你可以按照你的需求来设置编译开关,可用编译选项如下: + +* `bindata`: 这个编译选项将会把运行Gitea所需的所有外部资源都打包到可执行文件中,这样部署将非常简单因为除了可执行程序将不再需要任何其他文件。 +* `sqlite`: 这个编译选项将启用SQLite3数据库的支持,建议只在少数人使用时使用这个模式。 +* `tidb`: 这个编译选项启用tidb嵌入式数据库的支持,他跟SQLite类似但是是用纯Go编写的。 +* `pam`: 这个编译选项将会启用 PAM (Linux Pluggable Authentication Modules) 认证,如果你使用这一认证模式的话需要开启这个选项。 + +我们支持两种方式进行编译,Make 工具 和 Go 工具。不过我们推荐使用 Make工具,因为他将会给出更多的编译选项。 + +**Note**: We recommend the Go version 1.6 or higher because we are using vendoring and we don't set the required env variable for 1.5 anywhere. + +* Make 工具 + +这个编译方式要求你先安装Make工具,关于Make工具的安装你可以参考Make相关资料。同样如果要使用bindata选项,你可能需要先执行make generate: + +``` +TAGS="bindata" make generate build +``` + +* Go 工具 + +使用 Go 工具编译需要你至少安装了Go 1.5以上版本并且将 govendor 的支持打开。执行命令如下: + +``` +go build +``` + +## 测试 + +在执行了以上步骤之后,你将会获得 `gitea` 的二进制文件,在你复制到部署的机器之前可以先测试一下。在命令行执行完后,你可以 `Ctrl + C` 关掉程序。 + +``` +./gitea web +``` + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/doc/installation/from-source.zh-tw.md b/doc/installation/from-source.zh-tw.md new file mode 100644 index 00000000..9fdb9ccf --- /dev/null +++ b/doc/installation/from-source.zh-tw.md @@ -0,0 +1,73 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "原始碼安裝" +slug: "install-from-source" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "原始碼安裝" + weight: 30 + identifier: "install-from-source" +--- + +# 從原始碼安裝 + +我們不會在本文教大家如何安裝 Golang 環境。假如您不知道如何設定環境,請直接參考[官方安裝文件](https://golang.org/doc/install)。 + +## 下載 + +首先您必須先下載原始碼,最簡單的方式就是透過 Go 指令下載,請透過底下指令下載原始碼並且切換到工作目錄。 + +``` +go get -d -u code.gitea.io/gitea +cd $GOPATH/src/code.gitea.io/gitea +``` + +現在該決定您要編譯或安裝的 Gitea 版本,您有很多可以選擇。如果您想編譯 `master` 版本,你可以直接跳到[編譯章節](#build),這是我們開發分支,雖然很穩定,但是不建議用在正式環境。 + +假如您想要編譯最新穩定版本,可以執行底下命令切換到正確版本: + +``` +git branch -a +git checkout v1.0 +``` + +最後您也可以直接編譯最新的標籤版本像是 `v1.0.0`,假如您想要從原始碼編譯,這方法是最合適的,在編譯標籤版本前,您需要列出當下所有標籤,並且直接切換到標籤版本,請使用底下指令:: + +``` +git tag -l +git checkout v1.0.0 +``` + +## 編譯 + +完成設定相依性套件環境等工作後,您就可以開始編譯工作了。我們提供了不同的[編譯選項](https://github.com/go-gitea/gitea/blob/master/Makefile) ,讓編譯過程更加簡單。您可以根據需求來調整編譯選項,底下是可用的編譯選項說明: + +* `bindata`: 使用此標籤來嵌入所有 Gitea 相關資源,您不用擔心其他額外檔案,對於部署來說非常方便。 +* `sqlite`: 使用此標籤來啟用 [SQLite3](https://sqlite.org/) 資料庫,建議只有少數人時才使用此模式。 +* `tidb`: 使用此標籤來啟用 [TiDB](https://github.com/pingcap/tidb) 資料庫,它是檔案形式的資料庫,跟 SQLite 類似。 +* `pam`: 使用此標籤來啟用 PAM (Linux Pluggable Authentication Modules) 認證,對於系統使用者來說,此方式最方便了。 + +現在您可以開始編譯執行檔了,我們建議使用 `bindata` 編譯選項,使用 `bindata` 選項前,您必須執行 `generate` 任務將所有資源都一起編譯進去,否則相關資源都不會被編譯進執行檔: + +``` +TAGS="bindata" make generate build +``` + +**注意**: 因為使用了套件管理工具,我們建議 Go 環境版本為 1.6 或者是更高,這樣不用在 Go 1.5 版本設定全域變數 `GO15VENDOREXPERIMENT`。 + +## 測試 + +完成上述步驟後,您可以在當下目錄發現 `gitea` 執行檔,在複製執行檔到遠端環境之前,您必須透過底下指令執行測試,使用 `Ctrl + C` 則可以關閉當下 gitea 程序。 + +``` +./gitea web +``` + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 + diff --git a/doc/installation/run-as-service-in-ubuntu.en-us.md b/doc/installation/run-as-service-in-ubuntu.en-us.md new file mode 100644 index 00000000..3d58167b --- /dev/null +++ b/doc/installation/run-as-service-in-ubuntu.en-us.md @@ -0,0 +1,68 @@ +--- +date: "2017-07-21T12:00:00+02:00" +title: "Run as service in Linux" +slug: "linux-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Linux service" + weight: 20 + identifier: "linux-service" +--- + +### Run as service in Ubuntu 16.04 LTS + +#### Using systemd + +Run below command in terminal: +``` +sudo vim /etc/systemd/system/gitea.service +``` + +Add code to the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service). + +Uncomment any service need to be enabled like mysql in this case in Unit section. + +Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. + +Lastly start and enable gitea at boot: +``` +sudo systemctl start gitea +``` +``` +sudo systemctl enable gitea +``` + + +#### Using supervisor + +Install supervisor by running below command in terminal: +``` +sudo apt install supervisor +``` + +Create a log dir for the supervisor logs(assuming gitea is installed in /home/git/gitea/): +``` +mkdir /home/git/gitea/log/supervisor +``` + +Open supervisor config file in vi/vim/nano etc. +``` +sudo vim /etc/supervisor/supervisord.conf +``` + +And append the code at the end of the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea). + +Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. + +Lastly start and enable supervisor at boot: +``` +sudo systemctl start supervisor +``` +``` +sudo systemctl enable supervisor +``` + diff --git a/doc/installation/windows-service.en-us.md b/doc/installation/windows-service.en-us.md new file mode 100644 index 00000000..0092c261 --- /dev/null +++ b/doc/installation/windows-service.en-us.md @@ -0,0 +1,34 @@ +--- +date: "2016-12-21T15:00:00-02:00" +title: "Register as a Windows Service" +slug: "windows-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Windows Service" + weight: 30 + identifier: "windows-service" +--- + +# Register as a Windows Service + +To register Gitea as a Windows service, first run `cmd` as an Administrator, and then run the following command: + +``` +sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini"" +``` + +Do not forget to replace `C:\gitea` with your real Gitea folder. + +After, open "Windows Services", search for the service named "gitea", right-click it and click on "Run". If everything is OK you should be able to reach Gitea on `http://localhost:3000` (or the port is was configured, if different than 3000). + +## Unregister as a service + +To unregister Gitea as a service, open `cmd` as an Administrator and run: + +``` +sc delete gitea +``` diff --git a/doc/installation/windows-service.zh-cn.md b/doc/installation/windows-service.zh-cn.md new file mode 100644 index 00000000..6f03f38b --- /dev/null +++ b/doc/installation/windows-service.zh-cn.md @@ -0,0 +1,34 @@ +--- +date: "2016-12-21T15:00:00-02:00" +title: "注册为Windows服务" +slug: "windows-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Windows服务" + weight: 30 + identifier: "windows-service" +--- + +# 注册为Windows服务 + +要注册为Windows服务,首先以Administrator身份运行 `cmd`,然后执行以下命令: + +``` +sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini"" +``` + +别忘了将 `C:\gitea` 替换成你的 Gitea 安装目录。 + +之后在控制面板打开 "Windows Services",搜索 "gitea",右键选择 "Run"。在浏览器打开 `http://localhost:3000` 就可以访问了。(如果你修改了端口,请访问对应的端口,3000是默认端口)。 + +## 从Windows服务中删除 + +以Administrator身份运行 `cmd`,然后执行以下命令: + +``` +sc delete gitea +``` diff --git a/doc/installation/windows-service.zh-tw.md b/doc/installation/windows-service.zh-tw.md new file mode 100644 index 00000000..23dba7f8 --- /dev/null +++ b/doc/installation/windows-service.zh-tw.md @@ -0,0 +1,34 @@ +--- +date: "2016-12-21T15:00:00-02:00" +title: "註冊為 Windows 服務" +slug: "windows-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Windows 服務" + weight: 30 + identifier: "windows-service" +--- + +# 註冊為 Windows 服務 + +要註冊為 Windows 服務,首先要以管理者身份執行 `cmd`,跳出命令列視窗後執行底下指令: + +``` +sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini"" +``` + +別忘記將 `C:\gitea` 取代為您的 Gitea 安裝路徑。 + +之後打開 "Windows Services",並且搜尋服務名稱 "gitea",按右鍵選擇 "Run"。在瀏覽器打開 `http://localhost:3000` 就可以成功看到畫面 (如果修改過連接埠,請自行修正,3000 是預設值)。 + +## 刪除服務 + +要刪除 Gitea 服務,請用管理者身份執行 `cmd` 並且執行底下指令: + +``` +sc delete gitea +``` diff --git a/doc/installation/with-docker.en-us.md b/doc/installation/with-docker.en-us.md new file mode 100644 index 00000000..74460778 --- /dev/null +++ b/doc/installation/with-docker.en-us.md @@ -0,0 +1,196 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation with Docker" +slug: "install-with-docker" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "With Docker" + weight: 10 + identifier: "install-with-docker" +--- + +# Installation with Docker + +We provide automatically updated Docker images within our Docker Hub organization. It is up to you and your deployment to always use the latest stable tag or to use another service that updates the Docker image for you. + +This reference setup guides you through the setup based on `docker-compose`, the installation of `docker-compose` is out of scope of this documentation. To install `docker-compose` follow the official [install instructions](https://docs.docker.com/compose/install/). + +## Basics + +The most simple setup just creates a volume and a network and starts the `gitea/gitea:latest` image as a service. Since there is no database available you can start it only with SQLite3. Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`. + +```yaml +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: + - 3000:3000 + - 222:22 +``` + +## Custom port + +To bind the integrated openSSH daemon and the webserver on a different port, you just need to adjust the port section. It's common to just change the host port and keep the ports within the container like they are. + +```diff +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: +- - 3000:3000 +- - 222:22 ++ - 8080:3000 ++ - 2221:22 +``` + +## MySQL database + +To start Gitea in combination with a MySQL database you should apply these changes to the `docker-compose.yml` file created above. + +```diff +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: + - 3000:3000 + - 222:22 ++ depends_on: ++ - db ++ ++ db: ++ image: mysql:5.7 ++ restart: always ++ environment: ++ - MYSQL_ROOT_PASSWORD=gitea ++ - MYSQL_USER=gitea ++ - MYSQL_PASSWORD=gitea ++ - MYSQL_DATABASE=gitea ++ networks: ++ - gitea ++ volumes: ++ - ./mysql:/var/lib/mysql +``` + +## PostgreSQL database + +To start Gitea in combination with a PostgreSQL database you should apply these changes to the `docker-compose.yml` file created above. + +```diff +version: "2" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + ports: + - 3000:3000 + - 222:22 ++ depends_on: ++ - db ++ ++ db: ++ image: postgres:9.6 ++ restart: always ++ environment: ++ - POSTGRES_USER=gitea ++ - POSTGRES_PASSWORD=gitea ++ - POSTGRES_DB=gitea ++ networks: ++ - gitea ++ volumes: ++ - ./postgres:/var/lib/postgresql/data +``` + +## Named volumes + +To use named volumes instead of host volumes you just have to define and use the named volume within the `docker-compose.yml` configuration. This change will automatically create the required volume. + +```diff +version: "2" + +networks: + gitea: + external: false + ++volumes: ++ gitea: ++ driver: local ++ +services: + server: + image: gitea/gitea:latest + restart: always + networks: + - gitea + volumes: +- - ./gitea:/data ++ - gitea:/data + ports: + - 3000:3000 + - 222:22 +``` + +If you are using MySQL or PostgreSQL it's up to you to create named volumes for these containers as well. + +## Start + +To start this setup based on `docker-compose` you just have to execute `docker-compose up -d` to launch Gitea in the background. You can see if it started properly via `docker-compose ps`, and you can tail the log output via `docker-compose logs`. + +If you want to shutdown the setup again just execute `docker-compose down`, this will stop and kill the containers, the volumes will still exist. + +## Install + +After starting the Docker setup via `docker-compose` you should access Gitea with your favorite browser to finalize the installation. Please visit http://server-ip:3000 and follow the installation wizard. If you have started a database with the `docker-compose` setup as documented above please note that you have to use `db` as the database hostname. + +# Customization + +Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should be placed in `/data/gitea` directory. If you are using host volumes it's quite easy to access these files, for named volumes you have to do it through another container or you should directly access `/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at `/data/gitea/conf/app.ini` after the installation. + +# Anything missing? + +Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/doc/installation/with-docker.zh-cn.md b/doc/installation/with-docker.zh-cn.md new file mode 100644 index 00000000..983a0d1f --- /dev/null +++ b/doc/installation/with-docker.zh-cn.md @@ -0,0 +1,42 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "从Docker安装" +slug: "install-with-docker" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "从Docker安装" + weight: 10 + identifier: "install-with-docker" +--- + +# 从Docker安装 + +阅读本章之前我们已经假设您对docker已经有了解并能够正常使用docker。 + +我们在 Docker Hub 的 Gitea 组织中提供了自动更新的 Docker 镜像,它会保持最新的稳定版。你也可以用其它 Docker 服务来更新。首先你需要pull镜像: + +``` +docker pull gitea/gitea:latest +``` + +如果要将git和其它数据持久化,你需要创建一个目录来作为数据存储的地方: + +``` +sudo mkdir -p /var/lib/gitea +``` + +然后就可以运行 docker 容器了,这很简单。 当然你需要定义端口数数据目录: + +``` +docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest +``` + +然后 容器已经运行成功,在浏览器中访问 http://hostname:10080 就可以看到界面了。你可以尝试在上面创建项目,clone操作 `git clone ssh://git@hostname:10022/username/repo.git`. + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/doc/installation/with-docker.zh-tw.md b/doc/installation/with-docker.zh-tw.md new file mode 100644 index 00000000..960c2318 --- /dev/null +++ b/doc/installation/with-docker.zh-tw.md @@ -0,0 +1,40 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Docker 安裝" +slug: "install-with-docker" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Docker 安裝" + weight: 10 + identifier: "install-with-docker" +--- + +# 用 Docker 安裝 + +我們在 Docker Hub 提供了自動更新的映像檔,它會保持最新穩定版。根據您的部屬環境來使用最新版本或用其他服務來更新 Docker 映像檔。首先您需要下載映像檔: + +``` +docker pull gitea/gitea:latest +``` + +為了儲存您的所有 Git 儲存庫資料,您應該建立一個目錄,用來存放資料的地方。 + +``` +sudo mkdir -p /var/lib/gitea +``` + +現在就可以直接啟動 Docker 容器,這是一個非常簡單的過程,您必須定義啟動連接埠,並且提供上面所建立的資料儲存路徑: + +``` +docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest +``` + +然後 Gitea 容器已經開始運行,您可以透過個人喜愛的瀏覽器來訪問 http://hostname:10080,假如您想要開始 Clone 儲存庫,可以直接執行 `git clone ssh://git@hostname:10022/username/repo.git` 指令。 + +## 需要協助? + +如果本頁中無法解決您的問題,請直接到 [Discord server](https://discord.gg/NsatcWJ),在那邊可以快速得到協助。 diff --git a/doc/upgrade.en-us.md b/doc/upgrade.en-us.md new file mode 100644 index 00000000..9623ff9f --- /dev/null +++ b/doc/upgrade.en-us.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Upgrade" +slug: "upgrade" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "Upgrade" + weight: 20 + identifier: "upgrade" +--- diff --git a/doc/upgrade.zh-cn.md b/doc/upgrade.zh-cn.md new file mode 100644 index 00000000..d12e150b --- /dev/null +++ b/doc/upgrade.zh-cn.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "升级" +slug: "upgrade" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "升级" + weight: 20 + identifier: "upgrade" +--- diff --git a/doc/upgrade.zh-tw.md b/doc/upgrade.zh-tw.md new file mode 100644 index 00000000..b57fccbd --- /dev/null +++ b/doc/upgrade.zh-tw.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "升級" +slug: "upgrade" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "升級" + weight: 20 + identifier: "upgrade" +--- diff --git a/doc/upgrade/from-gogs.en-us.md b/doc/upgrade/from-gogs.en-us.md new file mode 100644 index 00000000..67bcc8d4 --- /dev/null +++ b/doc/upgrade/from-gogs.en-us.md @@ -0,0 +1,82 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Upgrade from Gogs" +slug: "upgrade-from-gogs" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "upgrade" + name: "From Gogs" + weight: 10 + identifier: "upgrade-from-gogs" +--- + +# Upgrade from Gogs + +Gogs versions up to 0.9.146 (db schema version 15) can be smoothly upgraded to Gitea. + +There are some steps to do so below. On Unix run as your Gogs user: + +* Create a Gogs backup with `gogs dump`. This creates `gogs-dump-[timestamp].zip` file containing all your Gogs data. +* Download the file matching your platform from the [downloads page](https://dl.gitea.io/gitea). +* Put the binary at the desired install location. +* Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini`. +* If you have custom `templates, public` in `gogs/custom/` copy them to `gitea/custom/`. +* If you have any other custom folders like `gitignore, label, license, locale, readme` in `gogs/custom/conf` copy them to `gitea/custom/options`. +* Copy `gogs/data/` to `gitea/data/`. It contains issue attachments and avatars. +* Verify by starting Gitea with `gitea web`. +* Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file`, then run `Rewrite all update hook of repositories` (needed when custom config path is changed). + +### Change gogs specific information: + +* Rename `gogs-repositories/` to `gitea-repositories/` +* Rename `gogs-data/` to `gitea-data/` +* In your `gitea/custom/conf/app.ini` change: + +FROM: +``` +[database] +PATH = /home/:USER/gogs/data/:DATABASE.db +[attachment] +PATH = /home/:USER/gogs-data/attachments +[picture] +AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars +[log] +ROOT_PATH = /home/:USER/gogs/log +``` + +TO: +``` +[database] +PATH = /home/:USER/gitea/data/:DATABASE.db +[attachment] +PATH = /home/:USER/gitea-data/attachments +[picture] +AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars +[log] +ROOT_PATH = /home/:USER/gitea/log +``` + +* Verify by starting Gitea with `gitea web` + +### Troubleshooting + +* If you encounter errors relating to custom templates in the `gitea/custom/templates` folder, try moving the templates causing the errors away one by one. They may not be compatible with Gitea. + +### Add Gitea to startup on Unix + +Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib) with the right environment variables. + +For distro's with systemd: + +* Copy the updated script to `/etc/systemd/system/gitea.service` +* Add the service to the startup with: `sudo systemctl enable gitea` +* Disable old gogs startup script: `sudo systemctl disable gogs` + +For distro's with SysVinit: + +* Copy the updated script to `/etc/init.d/gitea` +* Add the service to the startup with: `sudo rc-update add gitea` +* Disable old gogs startup script: `sudo rc-update del gogs` diff --git a/doc/upgrade/from-gogs.zh-cn.md b/doc/upgrade/from-gogs.zh-cn.md new file mode 100644 index 00000000..95bca2d7 --- /dev/null +++ b/doc/upgrade/from-gogs.zh-cn.md @@ -0,0 +1,26 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "从 Gogs 升级" +slug: "upgrade-from-gogs" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "upgrade" + name: "从 Gogs 升级" + weight: 10 + identifier: "upgrade-from-gogs" +--- + +# 从 Gogs 升级 + +如果你正在运行Gogs 0.9.146以下版本,你可以平滑的升级到Gitea。该升级需要如下的步骤: + +* 停止 Gogs 的运行 +* 拷贝 Gogs 的配置文件 `custom/conf/app.ini` 到 Gitea 的相应位置。 +* 拷贝 Gitea 的 `options/` 到 Home 目录下。 +* 如果你还有更多的自定义内容,比如templates和localization文件,你需要手工合并你的修改到 Gitea 的 Options 下对应目录。 +* 拷贝 Gogs 的数据目录 `data/` 到 Gitea 相应位置。这个目录包含附件和头像文件。 +* 运行 Gitea +* 登陆 Gitea 并进入 管理面板, 运行 `重新生成 '.ssh/authorized_keys' 文件(警告:不是 Gitea 的密钥也会被删除)` 和 `重新生成所有仓库的 Update 钩子(用于自定义配置文件被修改)`。 diff --git a/doc/upgrade/from-gogs.zh-tw.md b/doc/upgrade/from-gogs.zh-tw.md new file mode 100644 index 00000000..c3d84707 --- /dev/null +++ b/doc/upgrade/from-gogs.zh-tw.md @@ -0,0 +1,26 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "從 Gogs 升級" +slug: "upgrade-from-gogs" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "upgrade" + name: "從 Gogs 升級" + weight: 10 + identifier: "upgrade-from-gogs" +--- + +# 從 Gogs 升級 + +假如您正在運行 Gogs 0.9.146 以下版本,你可以很平順的升級到 Gitea,請參考底下升級步驟: + +* 停止 Gogs 服務。 +* 複製 Gogs 設定檔 `custom/conf/app.ini` 到 Gitea 相對應位置。 +* 複製 Gogs `conf/` 目錄到 Gitea `options/` 目錄。 +* 假如您還有更多自訂的檔案在 `custom/` 目錄,像是多國語系檔案或模板,你應該手動將設定轉移到 Gitea 上,因為這些檔案在 Gitea 上有些不同。 +* 複製 `data/` 目錄到 Gitea 相對應目錄,此目錄包含 issue 附件檔及頭像。 +* 啟動 Gitea 服務 +* 進入 Gitea 管理介面,執行 `重新產生 '.ssh/authorized_keys' 檔案` (警告: 非 Gitea 金鑰將被刪除) 和 `重新產生全部倉庫 update hook` (當自訂設定檔已經被修改,則需要此步驟)。 diff --git a/doc/usage.en-us.md b/doc/usage.en-us.md new file mode 100644 index 00000000..6be9769d --- /dev/null +++ b/doc/usage.en-us.md @@ -0,0 +1,13 @@ +--- +date: "2016-12-27T16:00:00+02:00" +title: "Usage" +slug: "usage" +weight: 35 +toc: false +draft: false +menu: + sidebar: + name: "Usage" + weight: 35 + identifier: "usage" +--- diff --git a/doc/usage/backup-and-restore.en-us.md b/doc/usage/backup-and-restore.en-us.md new file mode 100644 index 00000000..4346c6da --- /dev/null +++ b/doc/usage/backup-and-restore.en-us.md @@ -0,0 +1,46 @@ +--- +date: "2017-01-01T16:00:00+02:00" +title: "Usage: Backup and Restore" +slug: "backup-and-restore" +weight: 11 +toc: true +draft: false +menu: + sidebar: + parent: "usage" + name: "Backup and Restore" + weight: 11 + identifier: "backup-and-restore" +--- + +# Backup and Restore + +Gitea currently has a `dump` command that will save your installation to a zip file. There will be a `restore` command implemented at some point in the future. You will be able to use this to back up your installation, as well as make migrating servers easier. + +## Backup Command (`dump`) + +First, switch to the user running gitea: `su git` (or whatever user you are using). Run `./gitea dump` in the gitea installation directory. You should see some output similar to this: + +``` +2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 +2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories +2016/12/27 22:32:22 Dumping database... +2016/12/27 22:32:22 Packing dump files... +2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001 +2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip +``` + +Inside the `gitea-dump-1482906742.zip` file, you will find the following: + +* `custom/conf/app.ini` - This is your server config. +* `gitea-db.sql` - SQL dump of your database. +* `gitea-repo.zip` - This zip will be a complete copy of your repo folder. + See Config -> repository -> `ROOT` for the location. +* `log/` - this will contain various logs. You don't need these if you are doing + a migration. + +Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable. + +## Restore Command (`restore`) + +WIP: Does not exist yet. diff --git a/doc/usage/backup-and-restore.zh-tw.md b/doc/usage/backup-and-restore.zh-tw.md new file mode 100644 index 00000000..6f548588 --- /dev/null +++ b/doc/usage/backup-and-restore.zh-tw.md @@ -0,0 +1,45 @@ +--- +date: "2017-01-01T16:00:00+02:00" +title: "用法: 備份與還原" +slug: "backup-and-restore" +weight: 11 +toc: true +draft: false +menu: + sidebar: + parent: "usage" + name: "備份與還原" + weight: 11 + identifier: "backup-and-restore" +--- + +# 備份與還原 + +Gitea 目前支援 `dump` 指令,用來將資料備份成 zip 檔案,後續會提供還原指令,讓你可以輕易的將備份資料及還原到另外一台機器。 + +## 備份指令 (`dump`) + +首先,切換到執行 Gitea 的使用者: `su git` (請修改成您指定的使用者),並在安裝目錄內執行 `./gitea dump` 指令,你可以看到 console 畫面如下: + +``` +2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 +2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories +2016/12/27 22:32:22 Dumping database... +2016/12/27 22:32:22 Packing dump files... +2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001 +2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip +``` + +備份出來的 `gitea-dump-1482906742.zip` 檔案,檔案內會包含底下內容: + +* `custom/conf/app.ini` - 伺服器設定檔。 +* `gitea-db.sql` - SQL 備份檔案。 +* `gitea-repo.zip` - 此 zip 檔案為全部的 repo 目錄。 + 請參考 Config -> repository -> `ROOT` 所設定的路徑。 +* `log/` - 全部 logs 檔案,如果你要 migrate 到其他伺服器,此目錄不用保留。 + +你可以透過設定 `--tempdir` 指令參數來指定備份檔案目錄,或者是設定 `TMPDIR` 環境變數來達到此功能。 + +## 還原指令 (`restore`) + +持續更新中: 此文件尚未完成. diff --git a/doc/usage/command-line.md b/doc/usage/command-line.md new file mode 100644 index 00000000..e3e1f235 --- /dev/null +++ b/doc/usage/command-line.md @@ -0,0 +1,80 @@ +--- +date: "2017-01-01T16:00:00+02:00" +title: "Usage: Command Line" +slug: "command-line" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "usage" + name: "Command Line" + weight: 10 + identifier: "command-line" +--- + +## Command Line + +### Usage + +`gitea [global options] command [command options] [arguments...]` + +### Global options + - `--help`, `-h`: Show help text and exit. Optional. This can be used with any of the subcommands to see help text for it. + - `--version`, `-v`: Show version and exit. Optional. (example: `Gitea version 1.1.0+218-g7b907ed built with: bindata, sqlite`). + +### Commands + +#### web +Starts the server +- Options: + - `--port number`, `-p number`: Port number. Optional. (default: 3000). Overrides configuration file. + - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini). + - `--pid path`, `-P path`: Pidfile path. Optional. +- Examples: + - `gitea web` + - `gitea web --port 80` + - `gitea web --config /etc/gitea.ini --pid /var/run/gitea.pid` +- Notes: + - Gitea should not be run as root. To bind to a port below 1000, you can use setcap on Linux: `sudo setcap 'cap_net_bind_service=+ep' /path/to/gitea`. This will need to be redone every time you update Gitea. + +#### admin +Admin operations +- Commands: + - `create-user` + - Options: + - `--name value`: Username. Required. + - `--password value`: Password. Required. + - `--email value`: Email. Required. + - `--admin`: If provided, this makes the user an admin. Optional. + - `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini). + - Examples: + - `gitea admin create-user --name myname --password asecurepassword --email me@example.com` + - `change-password` + - Arguments: + - `--username value`, `-u value`: Username. Required. + - `--password value`, `-p value`: New password. Required. + - Examples: + - `gitea admin change-password --username myname --password asecurepassword` + +#### cert +Generates a self-signed SSL certificate. Outputs to `cert.pem` and `key.pem` in the current directory and will overwrite any existing files. +- Options: + - `--host value`: Comma seperated hostnames and ips which this certificate is valid for. Wildcards are supported. Required. + - `--ecdsa-curve value`: ECDSA curve to use to generate a key. Optional. Valid options are P224, P256, P384, P521. + - `--rsa-bits value`: Size of RSA key to generate. Optional. Ignored if --ecdsa-curve is set. (default: 2048). + - `--start-date value`: Creation date. Optional. (format: `Jan 1 15:04:05 2011`). + - `--duration value`: Duration which the certificate is valid for. Optional. (default: 8760h0m0s) + - `--ca`: If provided, this cert generates it's own certificate authority. Optional. +- Examples: + - `gitea cert --host git.example.com,example.com,www.example.com --ca` + +#### dump +Dumps all files and databases into a zip file. Outputs into a file like `gitea-dump-1482906742.zip` in the current directory. +- Options: + - `--config path`, `-c path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini). + - `--tempdir path`, `-t path`: Path to the temporary directory used. Optional. (default: /tmp). + - `--verbose`, `-v`: If provided, shows additional details. Optional. +- Examples: + - `gitea dump` + - `gitea dump --verbose` diff --git a/page/index.en-us.md b/page/index.en-us.md new file mode 100644 index 00000000..abf5fb22 --- /dev/null +++ b/page/index.en-us.md @@ -0,0 +1,279 @@ +--- +date: "2016-11-08T16:00:00+02:00" +title: "Documentation" +slug: "documentation" +weight: 10 +toc: true +draft: false +--- + +# What is Gitea? + +Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on [Gogs](http://gogs.io) but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read [this](https://blog.gitea.io/2016/12/welcome-to-gitea/) blog post. + +## Purpose + +The goal of this project is to make the easiest, fastest, and most painless way of setting up a self-hosted Git service. With Go, this can be done with an independent binary distribution across ALL platforms that Go supports, including Linux, macOS and Windows, even on architectures like ARM or PowerPC. + +## Features + +- User Dashboard + - Context switcher (organization or current user) + - Activity timeline + - Commits + - Issues + - Pull requests + - Repository creation + - Searchable repository list + - List of your organizations + - A list of mirror repositories +- Issues dashboard + - Context switcher (organization or current user) + - Filter by + - Open + - Closed + - Your repositories + - Assigned issues + - Your issues + - Repository + - Sort by + - Oldest + - Last updated + - Number of comments +- Pull request dashboard + - Same as issue dashboard +- Repository types + - Mirror + - Normal + - Migrated +- Notifications (email and web) + - Read + - Unread + - Pin +- Explore page + - Users + - Repos + - Organizations + - Search +- Custom templates +- Override public files (logo, css, etc) +- CSRF and XSS protection +- HTTPS support +- Set allowed upload sizes and types +- Logging +- Configuration + - Databases + - MySQL + - PostgreSQL + - SQLite3 + - MSSQL + - [TiDB](https://github.com/pingcap/tidb) (experimental) + - Configuration file + - See [here](https://github.com/go-gitea/gitea/blob/master/conf/app.ini) + - Admin panel + - Statistics + - Actions + - Delete inactive accounts + - Delete cached repository archives + - Delete repositories records which are missing their files + - Run garbage collection on repositories + - Rewrite SSH keys + - Resync hooks + - Recreate repositories which are missing + - Server status + - Uptime + - Memory + - Current # of goroutines + - And more + - User management + - Search + - Sort + - Last login + - Authentication source + - Maximum repositories + - Disable account + - Admin permissions + - Permission to create git hooks + - Permission to create organizations + - Permission to import repositories + - Organization management + - People + - Teams + - Avatar + - Hooks + - Repository management + - See all repository information and manage repositories + - Authentication sources + - OAuth + - PAM + - LDAP + - SMTP + - Configuration viewer + - Everything in config file + - System notices + - When somthing unexpected happens + - Monitoring + - Current processes + - Cron jobs + - Update mirrors + - Repository health check + - Check repository statstics + - Clean up old archives + - Environment variables + - Command line options +- Multi-language support ([21 languages](https://github.com/go-gitea/gitea/tree/master/options/locale)) +- Mail service + - Notifications + - Registration confirmation + - Password reset +- Reverse proxy support + - Includes subpaths +- Users + - Profile + - Name + - Username + - Email + - Website + - Join date + - Followers and following + - Organizations + - Repositories + - Activity + - Starred repositories + - Settings + - Same as profile and more below + - Keep email private + - Avatar + - Gravatar + - Libravatar + - Custom + - Password + - Mutiple email addresses + - SSH Keys + - Connected applications + - Two factor authentication + - Linked OAuth2 sources + - Delete account +- Repositories + - Clone with SSH/HTTP/HTTPS + - Git LFS + - Watch, Star, Fork + - View watchers, stars, and forks + - Code + - Branch browser + - Web based file upload and creation + - Clone urls + - Download + - ZIP + - TAR.GZ + - Web based editor + - Markdown editor + - Plain text editor + - Syntax highlighting + - Diff preview + - Preview + - Choose where to commit to + - View file history + - Delete file + - View raw + - Issues + - Issue templates + - Milestones + - Labels + - Assign issues + - Filter + - Open + - Closed + - Assigned person + - Created by you + - Mentioning you + - Sort + - Oldest + - Last updated + - Number of comments + - Search + - Comments + - Attachments + - Pull requests + - Same features as issues + - Commits + - Commit graph + - Commits by branch + - Search + - Search in all branches + - View diff + - View SHA + - View author + - Browse files in commit + - Releases + - Attachments + - Title + - Content + - Delete + - Mark as pre-release + - Choose branch + - Wiki + - Import + - Markdown editor + - Settings + - Options + - Name + - Description + - Private/Public + - Website + - Wiki + - Enabled/disabled + - Internal/external + - Issues + - Enabled/disabled + - Internal/external + - External supports url rewriting for better integration + - Enable/disable pull requests + - Transfer repository + - Delete wiki + - Delete repository + - Collaboration + - Read/write/admin + - Branches + - Default branch + - Branch protection + - Webhooks + - Git hooks + - Deploy keys + +## System Requirements + +- A cheap Raspberry Pi is powerful enough for basic functionality. +- 2 CPU cores and 1GB RAM would be the baseline for teamwork. +- Gitea is supposed to be run with a dedicated non-root user account on UNIX systems, no other mode of operation is supported. (**NOTE**: in case you run it with your own user account and the built-in SSH server disabled, Gitea modifies the `~/.ssh/authorized_keys` file so you will **not** be able to interactively log in.) + +## Browser Support + +- Please see [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) for specific versions of supported browsers. +- The official support minimal size is **1024*768**, UI may still looks right in smaller size but no promises and fixes. + +## Components + +* Web framework: [Macaron](http://go-macaron.com/) +* ORM: [XORM](https://github.com/go-xorm/xorm) +* UI components: + * [Semantic UI](http://semantic-ui.com/) + * [GitHub Octicons](https://octicons.github.com/) + * [Font Awesome](http://fontawesome.io/) + * [DropzoneJS](http://www.dropzonejs.com/) + * [Highlight](https://highlightjs.org/) + * [Clipboard](https://zenorocha.github.io/clipboard.js/) + * [Emojify](https://github.com/Ranks/emojify.js) + * [CodeMirror](https://codemirror.net/) + * [jQuery Date Time Picker](https://github.com/xdan/datetimepicker) + * [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) +* Database drivers: + * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + * [github.com/lib/pq](https://github.com/lib/pq) + * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + * [github.com/pingcap/tidb](https://github.com/pingcap/tidb) + * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) + +## Software and Service Support + +- [Drone](https://github.com/drone/drone) (CI) diff --git a/page/index.zh-cn.md b/page/index.zh-cn.md new file mode 100644 index 00000000..45a2e9f5 --- /dev/null +++ b/page/index.zh-cn.md @@ -0,0 +1,75 @@ +--- +date: "2016-11-08T16:00:00+02:00" +title: "文档" +slug: "documentation" +weight: 10 +toc: true +draft: false +--- + +# 关于Gitea + +Gitea 是一个自己托管的Git服务程序。他和GitHub, Bitbucket or Gitlab等比较类似。他是从 [Gogs](http://gogs.io) 发展而来,不过我们已经Fork并且命名为Gitea。对于我们Fork的原因可以看 [这里](https://blog.gitea.io/2016/12/welcome-to-gitea/)。 + +## 目标 + +Gitea的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用Go作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了x86,amd64,还包括 ARM 和 PowerPC。 + +## 功能特性 + +- 支持活动时间线 +- 支持 SSH 以及 HTTP/HTTPS 协议 +- 支持 SMTP、LDAP 和反向代理的用户认证 +- 支持反向代理子路径 +- 支持用户、组织和仓库管理系统 +- 支持添加和删除仓库协作者 +- 支持仓库和组织级别 Web 钩子(包括 Slack 集成) +- 支持仓库 Git 钩子和部署密钥 +- 支持仓库工单(Issue)、合并请求(Pull Request)以及 Wiki +- 支持迁移和镜像仓库以及它的 Wiki +- 支持在线编辑仓库文件和 Wiki +- 支持自定义源的 Gravatar 和 Federated Avatar +- 支持邮件服务 +- 支持后台管理面板 +- 支持 MySQL、PostgreSQL、SQLite3, MSSQL 和 TiDB(实验性支持) 数据库 +- 支持多语言本地化(21 种语言) + +## 系统要求 + +- 最低的系统硬件要求为一个廉价的树莓派 +- 如果用于团队项目,建议使用 2 核 CPU 及 1GB 内存 + +## 浏览器支持 + +- 请根据 [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) 查看具体支持的浏览器版本。 +- 官方支持的最小 UI 尺寸为 **1024*768**,UI 不一定会在更小尺寸的设备上被破坏,但我们无法保证且不会修复。 + +## 组件 + +* Web框架: [Macaron](http://go-macaron.com/) +* ORM: [XORM](https://github.com/go-xorm/xorm) +* UI组件: + * [Semantic UI](http://semantic-ui.com/) + * [GitHub Octicons](https://octicons.github.com/) + * [Font Awesome](http://fontawesome.io/) + * [DropzoneJS](http://www.dropzonejs.com/) + * [Highlight](https://highlightjs.org/) + * [Clipboard](https://zenorocha.github.io/clipboard.js/) + * [Emojify](https://github.com/Ranks/emojify.js) + * [CodeMirror](https://codemirror.net/) + * [jQuery Date Time Picker](https://github.com/xdan/datetimepicker) + * [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) +* 数据库驱动: + * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + * [github.com/lib/pq](https://github.com/lib/pq) + * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + * [github.com/pingcap/tidb](https://github.com/pingcap/tidb) + * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) + +## 软件及服务支持 + +- [Drone](https://github.com/drone/drone) (CI) + +## 需要帮助? + +如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) diff --git a/page/index.zh-tw.md b/page/index.zh-tw.md new file mode 100644 index 00000000..bbae83d3 --- /dev/null +++ b/page/index.zh-tw.md @@ -0,0 +1,67 @@ +--- +date: "2016-11-08T16:00:00+02:00" +title: "文件" +slug: "documentation" +weight: 10 +toc: true +draft: false +--- + +# 關於 Gitea + +Gitea 是一個可自行託管的 Git 服務。你可以拿 GitHub、Bitbucket 或 Gitlab 來比較看看。初期是從 [Gogs](http://gogs.io) 發展而來,不過我們已經 Fork 並且命名為 Gitea。如果您想更深入了解 Fork 原因,請直接參考[這裡](https://blog.gitea.io/2016/12/welcome-to-gitea/)。 + +## 目標 + +Gitea 的首要目標是建立一個容易安裝,運行快速,安装和使用體驗良好的自建 Git 服務。我們採用 GO 為後端語言,Go 可以產生各平台使用的執行檔。除了支援 Linux、macOS 和 Windows 外,甚至還包含 ARM 和 PowerPC。 + +## 功能 + +- 支援個人活動時間表 +- 支援 SSH 和 HTTP/HTTPS 協定 +- 支援 SMTP/LDAP/Reverse 代理認證 +- 支援反向代理子路徑 +- 支援帳號/組織/儲存庫管理 +- 支援新增/刪除儲存庫合作帳號 +- 支援儲存庫/組織 webhooks (包含 Slack) +- 支援儲存庫 Git hooks/部署金鑰 +- 支援儲存庫問題列表 (issues), 合併請求 (pull requests) 及 wiki +- 支援遷移及複製儲存庫及 wiki +- 支援線上編輯儲存庫檔案及 wiki +- 支援自訂來源 Gravatar 及 Federated avatar +- 支援郵件服務 +- 支援後台管理 +- 支援 MySQL, PostgreSQL, SQLite3, MSSQL 和 [TiDB](https://github.com/pingcap/tidb) (實驗性) +- 支援多國語言 ([21 國語言](https://github.com/go-gitea/gitea/tree/master/options/locale)) + +## 系統需求 + +- 最低的系統需求就是一片便宜的樹莓派 (Raspberry Pi)。 +- 如果用於團隊,建議使用 2 核 CPU 和 1GB 記憶體。 + +## 瀏覽器支援 + +- 請參考 [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) 所支援的瀏覽器列表。 +- 官方支援最小 UI 尺寸為 **1024*768**, UI 在更小尺寸也看起來不錯,但是我們並不保證。 + +## 元件 + +* Web 框架: [Macaron](http://go-macaron.com/) +* ORM: [XORM](https://github.com/go-xorm/xorm) +* UI 元件: + * [Semantic UI](http://semantic-ui.com/) + * [GitHub Octicons](https://octicons.github.com/) + * [Font Awesome](http://fontawesome.io/) + * [DropzoneJS](http://www.dropzonejs.com/) + * [Highlight](https://highlightjs.org/) + * [Clipboard](https://zenorocha.github.io/clipboard.js/) + * [Emojify](https://github.com/Ranks/emojify.js) + * [CodeMirror](https://codemirror.net/) + * [jQuery Date Time Picker](https://github.com/xdan/datetimepicker) + * [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) +* 資料庫: + * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + * [github.com/lib/pq](https://github.com/lib/pq) + * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + * [github.com/pingcap/tidb](https://github.com/pingcap/tidb) + * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) From b4783897850b61f4560a591baa2f4bbc498f18bf Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sun, 26 Nov 2017 21:47:43 -0500 Subject: [PATCH 0002/1282] Adding time tracking to feature list (#2982) Now that 1.3 is out time tracking is a new feature go-gitea/docs#148 --- page/index.en-us.md | 1 + 1 file changed, 1 insertion(+) diff --git a/page/index.en-us.md b/page/index.en-us.md index abf5fb22..638d6dfe 100644 --- a/page/index.en-us.md +++ b/page/index.en-us.md @@ -181,6 +181,7 @@ The goal of this project is to make the easiest, fastest, and most painless way - Milestones - Labels - Assign issues + - Track time - Filter - Open - Closed From cc28351407f6e6fd0c273593e4af9a8804c954c9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 30 Nov 2017 19:18:35 +0800 Subject: [PATCH 0003/1282] add notice for docker run gitea http port issue (#3020) --- doc/installation/with-docker.en-us.md | 2 ++ doc/installation/with-docker.zh-cn.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/doc/installation/with-docker.en-us.md b/doc/installation/with-docker.en-us.md index 74460778..3bab0990 100644 --- a/doc/installation/with-docker.en-us.md +++ b/doc/installation/with-docker.en-us.md @@ -183,6 +183,8 @@ To start this setup based on `docker-compose` you just have to execute `docker-c If you want to shutdown the setup again just execute `docker-compose down`, this will stop and kill the containers, the volumes will still exist. +Notice: if you use a non 3000 port on http, you need change app.ini `LOCAL_ROOT_URL = http://localhost:3000/`. + ## Install After starting the Docker setup via `docker-compose` you should access Gitea with your favorite browser to finalize the installation. Please visit http://server-ip:3000 and follow the installation wizard. If you have started a database with the `docker-compose` setup as documented above please note that you have to use `db` as the database hostname. diff --git a/doc/installation/with-docker.zh-cn.md b/doc/installation/with-docker.zh-cn.md index 983a0d1f..add51867 100644 --- a/doc/installation/with-docker.zh-cn.md +++ b/doc/installation/with-docker.zh-cn.md @@ -37,6 +37,8 @@ docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data git 然后 容器已经运行成功,在浏览器中访问 http://hostname:10080 就可以看到界面了。你可以尝试在上面创建项目,clone操作 `git clone ssh://git@hostname:10022/username/repo.git`. +注意:目前端口改为非3000时,需要修改配置文件 `LOCAL_ROOT_URL = http://localhost:3000/`。 + ## 需要帮助? 如果从本页中没有找到你需要的内容,请访问 [帮助页面]({{< relref "seek-help.zh-cn.md" >}}) From 3d25922ae7378982b520a43f6048ab67722efff8 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Thu, 30 Nov 2017 07:45:48 -0500 Subject: [PATCH 0004/1282] French translation for docs (#3030) original PR go-gitea/docs#147 and author @0xbaadf00d --- doc/advanced.fr-fr.md | 13 + doc/advanced/make.fr-fr.md | 44 ++++ doc/installation.fr-fr.md | 13 + doc/installation/from-binary.fr-fr.md | 45 ++++ doc/installation/from-package.fr-fr.md | 57 +++++ doc/installation/from-source.fr-fr.md | 80 +++++++ doc/installation/windows-service.fr-fr.md | 34 +++ doc/installation/with-docker.fr-fr.md | 110 +++++++++ doc/upgrade.fr-fr.md | 13 + doc/upgrade/from-gogs.fr-fr.md | 80 +++++++ page/index.fr-fr.md | 278 ++++++++++++++++++++++ 11 files changed, 767 insertions(+) create mode 100755 doc/advanced.fr-fr.md create mode 100755 doc/advanced/make.fr-fr.md create mode 100755 doc/installation.fr-fr.md create mode 100755 doc/installation/from-binary.fr-fr.md create mode 100755 doc/installation/from-package.fr-fr.md create mode 100755 doc/installation/from-source.fr-fr.md create mode 100755 doc/installation/windows-service.fr-fr.md create mode 100755 doc/installation/with-docker.fr-fr.md create mode 100755 doc/upgrade.fr-fr.md create mode 100755 doc/upgrade/from-gogs.fr-fr.md create mode 100755 page/index.fr-fr.md diff --git a/doc/advanced.fr-fr.md b/doc/advanced.fr-fr.md new file mode 100755 index 00000000..04734a8f --- /dev/null +++ b/doc/advanced.fr-fr.md @@ -0,0 +1,13 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Avancé" +slug: "advanced" +weight: 30 +toc: false +draft: false +menu: + sidebar: + name: "Avancé" + weight: 40 + identifier: "advanced" +--- diff --git a/doc/advanced/make.fr-fr.md b/doc/advanced/make.fr-fr.md new file mode 100755 index 00000000..427a8fc6 --- /dev/null +++ b/doc/advanced/make.fr-fr.md @@ -0,0 +1,44 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Make" +slug: "make" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "advanced" + name: "Make" + weight: 30 + identifier: "make" +--- + +# Make + +Gitea fait largement usage de Make pour automatiser les tâches et avoir un développement plus rapide. Ce guide explique comment installer Make. + +### Linux + +Vous pouvez installer Make avec votre gestionnaire de paquetages + +Depuis Ubuntu/Debian: + +```bash +sudo apt-get install build-essential +``` + +Depuis Fedora/RHEL/CentOS: + +```bash +sudo yum install make +``` + +### Windows + +Si vous utilisez Windows, vous pouvez télécharger une des versions suivantes de Make: + +- [Simple binaire](http://www.equation.com/servlet/equation.cmd?fa=make). Copiez le quelque part et mettez à jour `PATH`. + - [32-bits version](ftp://ftp.equation.com/make/32/make.exe) + - [64-bits version](ftp://ftp.equation.com/make/64/make.exe) +- [MinGW](http://www.mingw.org/) includes a build. The binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to your `PATH`. +- [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make` diff --git a/doc/installation.fr-fr.md b/doc/installation.fr-fr.md new file mode 100755 index 00000000..55b48bda --- /dev/null +++ b/doc/installation.fr-fr.md @@ -0,0 +1,13 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Installation" +slug: "installation" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "Installation" + weight: 10 + identifier: "installation" +--- diff --git a/doc/installation/from-binary.fr-fr.md b/doc/installation/from-binary.fr-fr.md new file mode 100755 index 00000000..5aeea0ea --- /dev/null +++ b/doc/installation/from-binary.fr-fr.md @@ -0,0 +1,45 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Installation avec le binaire pré-compilé" +slug: "install-from-binary" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Binaire pré-compilé" + weight: 20 + identifier: "install-from-binary" +--- + +# Installation avec le binaire pré-compilé + +Tous les binaires sont livrés avec le support de SQLite, MySQL et PostgreSQL, et sont construits avec les ressources incorporées. Gardez à l'esprit que cela peut être différent pour les versions antérieures. L'installation basée sur nos binaires est assez simple, il suffit de choisir le fichier correspondant à votre plateforme à partir de la [page de téléchargement](https://dl.gitea.io/gitea). Copiez l'URL et remplacer l'URL dans les commandes suivantes par la nouvelle: + +``` +wget -O gitea https://dl.gitea.io/gitea/1.0.1/gitea-1.0.1-linux-amd64 +chmod +x gitea +``` + +## Test + +Après avoir suivi les étapes ci-dessus, vous aurez un binaire `gitea` dans votre répertoire de travail. En premier lieu, vous pouvez tester si le binaire fonctionne comme prévu et ensuite vous pouvez le copier vers la destination où vous souhaitez le stocker. Lorsque vous lancez Gitea manuellement à partir de votre CLI, vous pouvez toujours le tuer en appuyant sur `Ctrl + C`. + +``` +./gitea web +``` + +## Dépannage + +### Anciennes version de glibc + +Les anciennes distributions Linux (comme Debian 7 ou CentOS 6) peuvent ne pas être capable d'exécuter le binaire Gitea, résultant généralement une erreur du type ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. Cette erreur est due au driver SQLite que nous intégrons dans le binaire Gitea. Dans le futur, nous fournirons des binaires sans la dépendance pour la bibliothèque glibc. En attendant, vous pouvez mettre à jour votre distribution ou installer Gitea depuis le [code source]({{< relref "from-source.fr-fr.md" >}}). + +### Exécuter Gitea avec un autre port + +Si vous obtenez l'erreur `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: bind: address already in use`, Gitea à besoin d'utiliser un autre port. Vous pouvez changer le port par défaut en utilisant `./gitea web -p $PORT`. + +## Il manque quelque chose ? + +Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/NsatcWJ), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/doc/installation/from-package.fr-fr.md b/doc/installation/from-package.fr-fr.md new file mode 100755 index 00000000..4e814923 --- /dev/null +++ b/doc/installation/from-package.fr-fr.md @@ -0,0 +1,57 @@ +--- +date: "2016-12-01T16:00:00+02:00" +title: "Installation depuis le gestionnaire de paquets" +slug: "install-from-package" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Gestionnaire de paquets" + weight: 20 + identifier: "install-from-package" +--- + +# Installation depuis le gestionnaire de paquets + +## Linux + +Nous n'avons pas encore publié de paquet pour Linux, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets pour toutes distributions Linux. En attendant, vous devriez suivre les [instructions d'installation]({{< relref "from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. + +## Windows + +Nous n'avons pas encore publié de paquet pour Windows, nous allons mettre à jour cette page directement lorsque nous commencerons à publier des paquets sous la forme de fichiers `MSI` ou via [Chocolatey](https://chocolatey.org/). En attendant, vous devriez suivre les [instructions d'installation]({{< relref "from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. + +## macOS + +Actuellement, nous ne supportons que l'installation via `brew` pour macOS. Si vous n'utilisez pas [Homebrew](http://brew.sh/), vous pouvez suivre les [instructions d'installation]({{< relref "from-binary.fr-fr.md" >}}) avec le binaire pré-compilé. Pour installer Gitea depuis `brew`, utilisez les commandes suivantes : + +``` +brew tap go-gitea/gitea +brew install gitea +``` + +## FreeBSD + +Le portage FreeBSD `www/gitea` est disponible. Vous pouvez également installer le paquet pré-compilé avec la commande suivante: + +``` +pkg install gitea +``` + +Pour une version plus récente, ou pour les instructions de compilations, veuillez consulter la documentation officielle de FreeBSD : [install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html) + +``` +su - +cd /usr/ports/www/gitea +make install clean +``` + +Le port utilise la schéma standard du système de fichiers FreeBSD : Les fichiers de configuration sont localisés dans le répertoire `/usr/local/etc/gitea`, les modèles, options, plugins et thèmes sont localisés dans le répertoire `/usr/local/share/gitea`, et le script de démarrage se situe dans `/usr/local/etc/rc.d/gitea`. + +Pour exécuter Gitea en tant que service, utilisez la commande `sysrc gitea_enable=YES` et la commande `service gitea start` pour démarrer le service. + +## Il manque quelque chose ? + +Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/NsatcWJ), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/doc/installation/from-source.fr-fr.md b/doc/installation/from-source.fr-fr.md new file mode 100755 index 00000000..7e407848 --- /dev/null +++ b/doc/installation/from-source.fr-fr.md @@ -0,0 +1,80 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Installation depuis le code source" +slug: "install-from-source" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Code source" + weight: 30 + identifier: "install-from-source" +--- + +# Installation depuis le code source + +Nous ne couvrirons pas les bases de la configuration de Golang dans ce guide. Si vous ne savez pas comment démarrer un environnement fonctionnel, vous devrez suivre les [instructions d'installation](https://golang.org/doc/install) officielles. + +**Attention**: La version 1.7 ou suppérieur de Go est nécessaire + +## Téléchargement + +Tout d'abord, vous devez récupérer le code source, la manière la plus simple est d'utiliser directement Go. Il suffit d'appeler les commandes suivantes pour récupérer le code source et passer au répertoire de travail. + +``` +go get -d -u code.gitea.io/gitea +cd $GOPATH/src/code.gitea.io/gitea +``` + +Maintenant, il est temps de décider quelle version de Gitea vous souhaitez compiler et installer. Actuellement, ils existent plusieurs options possibles. Si vous voulez compiler notre branche `master`, vous pouvez directement passer à la [section compilation](#compilation), cette branche représente la dernière version en cours de développement et n'a pas vocation à être utiliser en production. + + +Si vous souhaitez compiler la dernière version stable, utilisez les étiquettes ou les différentes branches disponibles. Vous pouvez voir les branches disponibles et comment utiliser cette branche avec ces commandes: + +``` +git branch -a +git checkout v1.0 +``` + +Si vous souhaitez valider une demande d'ajout (_Pull request_), vous devez activer cette branche en premier : + +``` +git fetch origin pull/xyz/head:pr-xyz # xyz is PR value +``` + +Enfin, vous pouvez directement utiliser les versions étiquettées (ex : `v1.0.0`). Pour utiliser les étiquettes, vous devez lister les étiquettes disponibles et choisir une étiquette spécifique avec les commandes suivantes : + +``` +git tag -l +git checkout v1.0.0 +git checkout pr-xyz +``` + +## Compilation + +Comme nous regroupons déjà toutes les bibliothèques requises pour compiler Gitea, vous pouvez continuer avec le processus de compilation lui-même. Nous fournissons diverses [tâches Make](https://github.com/go-gitea/gitea/blob/master/Makefile) pour rendre le processus de construction aussi simple que possible. Voyez ici comment obtenir Make. Selon vos besoins, vous pourrez éventuellement ajouter diverses options de compilation, vous pouvez choisir entre ces options : + +* `bindata`: Intègre toutes les ressources nécessaires à l'exécution d'une instance de Gitea, ce qui rend un déploiement facile car il n'est pas nécessaire de se préoccuper des fichiers supplémentaires. +* `sqlite`: Active la prise en charge d'une base de données [SQLite3](https://sqlite.org/), ceci n'est recommandé que pour les petites installations de Gitea. +* `tidb`: Active la prise en charge d'une base de données [TiDB](https://github.com/pingcap/tidb), c'est une base de données simplet et basée sur des fichiers. Elle est comparable à SQLite. +* `pam`: Active la prise en charge de PAM (mLinux Pluggable Authentication Modules), très utile si vos utilisateurs doivent être authentifiés avec les comptes du système. + +Il est temps de compiler le binaire, nous suggérons d'intégrer les ressources avec l'option de compilation `bindata`. Pour inclure les ressources, vous devrez également exécuter la tâche Make `generate`. Dans le cas échéant, les ressources ne pourront pas être intégrées: + +``` +TAGS="bindata" make generate build +``` + +## Test + +Après avoir suivi toutes les étapes, vous devriez avoir le binaire `gitea` dans votre répertoire courant. Dans un premier temps, vous pouvez tester qu'il fonctionne puis, dans un second temps, vous pouvez le copier dans la destination de votre choix. Lorsque vous lancez Gitea manuellement à partir de votre CLI, vous pouvez toujours le tuer en appuyant sur `Ctrl + C`. + +``` +./gitea web +``` + +## Il manque quelque chose ? + +Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/NsatcWJ), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/doc/installation/windows-service.fr-fr.md b/doc/installation/windows-service.fr-fr.md new file mode 100755 index 00000000..66cc5fc6 --- /dev/null +++ b/doc/installation/windows-service.fr-fr.md @@ -0,0 +1,34 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Démarrer en tant que service Windows" +slug: "windows-service" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Service Windows" + weight: 30 + identifier: "windows-service" +--- + +# Activer un service Windows + +Pour activer le service Windows Gitea, ouvrez une `cmd` en tant qu'Administrateur puis utilisez la commande suivante : + +``` +sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini"" +``` + +N'oubliez pas de remplacer `C:\gitea` par le chemin que vous avez utilisez pour votre installation. + +Ensuite, ouvrez "Services Windows", puis recherchez le service `gitea`, faites un clique droit et selectionnez "Run". Si tout fonctionne, vous devriez être capable d'accèder à Gitea à l'URL `http://localhost:3000` (ou sur le port configuré si différent de 3000). + +## Désactiver un service Windows + +Pour désactiver le service Windows Gitea, ouvrez une `cmd` en tant qu'Administrateur puis utilisez la commande suivante : + +``` +sc delete gitea +``` diff --git a/doc/installation/with-docker.fr-fr.md b/doc/installation/with-docker.fr-fr.md new file mode 100755 index 00000000..2f3567ee --- /dev/null +++ b/doc/installation/with-docker.fr-fr.md @@ -0,0 +1,110 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Installation avec Docker" +slug: "install-with-docker" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "installation" + name: "Docker" + weight: 10 + identifier: "install-with-docker" +--- + +# Installation avec Docker + +Nous fournissons des images Docker mises à jour automatiquement via le Docker Hub de notre organisation. C'est à vous, lors devotre déploiement, de vous assurez d'utiliser toujours la dernière version stable ou d'utiliser un autre service qui met à jour l'image Docker pour vous. + +## Données stockées sur l'hôte + +Tout d'abord, vous devez simplement récupérer l'image Docker avec la commande suivante : + +``` +docker pull gitea/gitea:latest +``` + +Pour garder vos dépôts et certaines autres données persistantes, vous devez créer un répertoire qui contiendra ces données à l'avenir. + +``` +sudo mkdir -p /var/lib/gitea +``` + +Il est temps de démarrer votre instance Docker, c'est un processus assez simple. Vous avez à définir le mappage des ports et le volume à utiliser pour la persistance de vos données : + +``` +docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest +``` + +Vous devriez avoir une instance fonctionnelle de Gitea. Pour accèder à l'interface web, visitez l'adresse http://hostname:10080 avec votre navigateur web préféré. Si vous voulez clôner un dépôt, vous pouvez le faire avec la commande `git clone ssh://git@hostname:10022/username/repo.git`. + +## Named Volumes + +Ce guide aboutira à une installation avec les données Gita et PostgreSQL stockées dans des volumes nommés. Cela permet une sauvegarde, une restauration et des mises à niveau en toute simplicité. + +### The Database + +Création du volume nommé pour la base de données : + +``` +$ docker volume create --name gitea-db-data +``` + +Une fois votre volume pret, vous pouvez récupérer l'image Docker de PostgreSQL et créer une instance. Tout comme Gitea, c'est également une image Docker basée sur Alpine Linux, Le montage des données se fera sans aucun problème. + +``` +$ docker pull postgres:alpine +$ docker run -d --name gitea-db \ + -e POSTGRES_PASSWORD= \ + -v gitea-db-data:/var/lib/postgresql/data \ + -p 5432:5432 \ + postgres:alpine +``` + +Maintenant que la base de données est démarrée, il faut la configurer. N'oubliez pas le mot de passe que vous avez choisi, vous en aurez besoin lors de l'installation de Gitea. + +``` +$ docker exec -it gitea-db psql -U postgres +psql (9.6.1) +Type "help" for help. + +postgres=# CREATE USER gitea WITH PASSWORD ''; +CREATE ROLE +postgres=# CREATE DATABASE gitea OWNER gitea; +CREATE DATABASE +postgres=# \q +$ +``` + +### Gitea + +Premièrement, le volume nommé : + +``` +$ docker volume create --name gitea-data +``` + +Puis l'instance de Gitea : + +``` +$ docker run -d --name gitea \ + --link gitea-db:gitea-db \ + --dns 10.12.10.160 \ + -p 11180:3000 \ + -p 8322:22 \ + -v gitea-data:/data \ + gitea/gitea:latest +``` + +Vous devriez maintenant avoir deux conteneurs Docker pour Gitea et PostgreSQL plus deux volumes nommés Docker. + +# Personnalisation + +Les fichier personnalisés ([voir les instructions](https://docs.gitea.io/en-us/customizing-gitea/)) peuvent être placés dans le répertoire `/data/gitea`. + +Le fichier de configuration sera sauvegardé à l'emplacement suivant : `/data/gitea/conf/app.ini` + +## Il manque quelque chose ? + +Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/NsatcWJ), vous obtiendrez des réponses à toute vos questions assez rapidement. diff --git a/doc/upgrade.fr-fr.md b/doc/upgrade.fr-fr.md new file mode 100755 index 00000000..ca08daf9 --- /dev/null +++ b/doc/upgrade.fr-fr.md @@ -0,0 +1,13 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Mise à jour" +slug: "upgrade" +weight: 10 +toc: false +draft: false +menu: + sidebar: + name: "Mise à jour" + weight: 20 + identifier: "upgrade" +--- diff --git a/doc/upgrade/from-gogs.fr-fr.md b/doc/upgrade/from-gogs.fr-fr.md new file mode 100755 index 00000000..aa7c7ae1 --- /dev/null +++ b/doc/upgrade/from-gogs.fr-fr.md @@ -0,0 +1,80 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Mise à jour depuis Gogs" +slug: "upgrade-from-gogs" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "upgrade" + name: "Depuis Gogs" + weight: 10 + identifier: "upgrade-from-gogs" +--- + +# Mise à jour depuis Gogs + +À partir de la version 0.9.146 (schéma de la base de données : version 15) de Gogs, Il est possible de migrer vers Gitea simplement et sans encombre. + +Veuillez suivre les étapes ci-dessous. Sur Unix, toute les commandes s'exécutent en tant que l'utilisateur utilisé pour votre installation de Gogs : + +* Crééer une sauvegarde de Gogs avec la commande `gogs dump`. Le fichier nouvellement créé `gogs-dump-[timestamp].zip` contient toutes les données de votre instance de Gogs. +* Téléchargez le fichier correspondant à votre plateforme à partir de la [page de téléchargements](https://dl.gitea.io/gitea). +* Mettez la binaire dans le répertoire d'installation souhaité. +* Copiez le fichier `gogs/custom/conf/app.ini` vers `gitea/custom/conf/app.ini`. +* Si vous avez personnalisé les répertoires `templates, public` dans `gogs/custom/`, copiez-les vers `gitea/custom/`. +* Si vous avez d'autres répertoires personnalisés comme `gitignore, label, license, locale, readme` dans `gogs/custom/conf` copiez-les vers `gitea/custom/options`. +* Copiez le répertoire `gogs/data/` vers `gitea/data/`. +* Vérifiez votre installation en exécutant Gitea avec la commande `gitea web`. +* Connectez vous au panel d'administration de Gitea et exécutez l'action `Rewrite '.ssh/authorized_keys' file`, puis l'action `Rewrite all update hook of repositories` (obligatoire si le chemin menant à votre configuration personnalisée à changé). + +### Modifier les informations spécifiques de gogs + +* Renommez `gogs-repositories/` vers `gitea-repositories/` +* Renommez `gogs-data/` to `gitea-data/` +* Dans votre fichier `gitea/custom/conf/app.ini`, modifiez les éléments suivants: + +DE : +``` +[database] +PATH = /home/:USER/gogs/data/:DATABASE.db +[attachment] +PATH = /home/:USER/gogs-data/attachments +[picture] +AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars +[log] +ROOT_PATH = /home/:USER/gogs/log +``` + +VERS : +``` +[database] +PATH = /home/:USER/gitea/data/:DATABASE.db +[attachment] +PATH = /home/:USER/gitea-data/attachments +[picture] +AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars +[log] +ROOT_PATH = /home/:USER/gitea/log +``` + +* Vérifiez votre installation en exécutant Gitea avec la commande `gitea web`. + +### Dépannage + +* Si vous rencontrez des erreurs relatives à des modèles personnalisés dans le dossier `gitea/custom/templates`, essayez de déplacer un par un les modèles provoquant les erreurs. Il est possible qu'ils ne soient pas compatibles avec Gitea. + +### Démarrer automatiquement Gitea (Unix) + +Distributions utilisant systemd: + +* Copiez le script mis à jour vers `/etc/systemd/system/gitea.service` +* Ajoutez le service avec la commande `sudo systemctl enable gitea` +* Désactivez Gogs avec la commande `sudo systemctl disable gogs` + +Distributions utilisant SysVinit: + +* Copiez le script mis à jour vers `/etc/init.d/gitea` +* Ajoutez le service avec la commande `sudo rc-update add gitea` +* Désactivez Gogs avec la commande `sudo rc-update del gogs` diff --git a/page/index.fr-fr.md b/page/index.fr-fr.md new file mode 100755 index 00000000..6876b669 --- /dev/null +++ b/page/index.fr-fr.md @@ -0,0 +1,278 @@ +--- +date: "2017-08-23T09:00:00+02:00" +title: "Documentation" +slug: "documentation" +weight: 10 +toc: true +draft: false +--- + +# A propos de Gitea + +Gitea est un service Git auto-hébergé très simple à installer et à utiliser. Il est similaire à GitHub, Bitbucket ou Gitlab. Le développement initial provient sur [Gogs] (http://gogs.io), mais nous l'avons forké puis renommé Gitea. Si vous souhaitez en savoir plus sur les raisons pour lesquelles nous avons fait cela, lisez [cette publication] (https://blog.gitea.io/2016/12/welcome-to-gitea/) sur le blog. + +## Objectif + +Le but de ce projet est de fournir de la manière la plus simple, la plus rapide et sans complication un service Git auto-hébergé. Grâce à Go, cela peut se faire via un binaire indépendant fonctionnant sur toutes les plateformes que Go prend en charge, y compris Linux, macOS et Windows, même sur des architectures comme ARM ou PowerPC. + +## Fonctionalités + +- Tableau de bord de l'utilisateur + - Choix du contexte (organisation ou utilisateur actuel) + - Chronologie de l'activité + - Révisions (_Commits_) + - Tickets + - Demande d'ajout (_Pull request_) + - Création de dépôts + - Liste des dépôts + - Liste de vos organisations + - Liste des dépôts miroires +- Tableau de bord des tickets + - Choix du contexte (organisation ou utilisateur actuel) + - Filtres + - Ouvert + - Fermé + - Vos dépôts + - Tickets assignés + - Vos tickets + - Dépôts + - Options de tri + - Plus vieux + - Dernière mise à jour + - Nombre de commentaires +- Tableau de bord des demandes d'ajout + - Identique au tableau de bord des tickets +- Types de dépôt + - Miroire + - Normal + - Migré +- Notifications (courriel et web) + - Lu + - Non lu + - Épinglé +- Page d'exploration + - Utilisateurs + - Dépôts + - Organisations + - Moteur de recherche +- Interface personnalisables +- Fichiers publiques remplaçables (logo, css, etc) +- Protection CSRF et XSS +- Support d'HTTPS +- Configuration des types et de la taille maximale des fichiers téléversés +- Journalisation (_Log_) +- Configuration + - Base de données + - MySQL + - PostgreSQL + - SQLite3 + - MSSQL + - [TiDB](https://github.com/pingcap/tidb) (expérimental) + - Fichier de configuration + - Voir [ici](https://github.com/go-gitea/gitea/blob/master/conf/app.ini) + - Panel d'administration + - Statistiques + - Actions + - Suppression des comptes inactifs + - Suppression des dépôts archivés + - Suppression des dépôts pour lesquels il manque leurs fichiers + - Exécution du _garbage collector_ sur les dépôts + - Ré-écriture des clefs SSH + - Resynchronisation des hooks + - Recreation des dépôts manquants + - Status du server + - Temps de disponibilité + - Mémoire + - Nombre de goroutines + - et bien plus... + - Gestion des utilisateurs + - Recherche + - Tri + - Dernière connexion + - Méthode d'authentification + - Nombre maximum de dépôts + - Désactivation du compte + - Permissions d'administration + - Permission pour crééer des hooks + - Permission pour crééer des organisations + - Permission pour importer des dépôts + - Gestion des organisations + - Membres + - Équipes + - Avatar + - Hooks + - Gestion des depôts + - Voir toutes les informations pour un dépôt donné et gérer tous les dépôts + - Méthodes d'authentification + - OAuth + - PAM + - LDAP + - SMTP + - Visualisation de la configuration + - Tout ce que contient le fichier de configuration + - Alertes du système + - Quand quelque chose d'inattendu survient + - Surveillance + - Processus courrants + - Tâches CRON + - Mise à jour des dépôts miroires + - Vérification de l'état des dépôts + - Vérification des statistiques des dépôts + - Nettoyage des anciennes archives + - Variables d'environement + - Options de ligne de commande +- Internationalisation ([21 langues](https://github.com/go-gitea/gitea/tree/master/options/locale)) +- Courriel + - Notifications + - Confirmation d'inscription + - Ré-initialisation du mot de passe +- Support de _reverse proxy_ + - _subpaths_ inclus +- Utilisateurs + - Profil + - Nom + - Prénom + - Courriel + - Site internet + - Date de création + - Abonnés et abonnements + - Organisations + - Dépôts + - Activité + - Dépôts suivis + - Paramètres + - Identiques au profil avec en plus les éléments ci-dessous + - Rendre l'adresse de courriel privée + - Avatar + - Gravatar + - Libravatar + - Personnalisé + - Mot de passe + - Courriels multiples + - Clefs SSH + - Applications connectées + - Authentification à double facteurs + - Identités OAuth2 attachées + - Suppression du compte +- Dépôts + - Clone à partir de SSH / HTTP / HTTPS + - Git LFS + - Suivre, Voter, Fork + - Voir les personnes qui suivent, les votes et les forks + - Code + - Navigation entre les branches + - Création ou téléversement de fichier depuis le navigateur + - URLs pour clôner le dépôt + - Téléchargement + - ZIP + - TAR.GZ + - Édition en ligne + - Éditeur Markdown + - Éditeur de texte + - Coloration syntaxique + - Visualisation des Diffs + - Visualisation + - Possibilité de choisir où sauvegarder la révision + - Historiques des fichiers + - Suppression de fichiers + - Voir le fichier brut + - Tickets + - Modèle de ticket + - Jalons + - Étiquettes + - Affecter des tickets + - Filtres + - Ouvert + - Ferme + - Personne assignée + - Créer par vous + - Qui vous mentionne + - Tri + - Plus vieux + - Dernière mise à jour + - Nombre de commentaires + - Moteur de recherche + - Commentaires + - Joindre des fichiers + - Demande d’ajout (_Pull request_) + - Les mêmes fonctionnalités que pour les tickets + - Révisions (_Commits_) + - Representation graphique des révisions + - Révisions par branches + - Moteur de recherche + - Voir les différences + - Voir les numéro de révision SHA + - Voir l'auteur + - Naviguer dans les fichiers d'une révision donnée + - Publication + - Pièces jointes + - Titre + - Contenu + - Suppression + - Définir comme une pré-publication + - Choix de la branche + - Wiki + - Import + - Éditeur Markdown + - Paramètres + - Options + - Nom + - Description + - Privé / Publique + - Site internet + - Wiki + - Activé / Désactivé + - Interne / externe + - Tickets + - Activé / Désactivé + - Interne / externe + - URL personnalisable pour une meilleur intégration avec un gestionnaire de tickets externe + - Activer / désactiver les demandes d'ajout (_Pull request_) + - Transfert du dépôt + - Suppression du wiki + - Suppression du dépôt + - Collaboration + - Lecture / Écriture / Administration + - Branches + - Branche par défaut + - Protection + - Webhooks + - Git hooks + - Clefs de déploiement + +## Configuration requise + +- Un simple Raspberry Pi est assez puissant pour les fonctionnalités de base. +- Un processeur double coeurs et 1Gb de RAM est une bonne base pour une utilisation en équipe. +- Gitea est censé être exécuté avec un compte utilisateur dédié et non root, aucun autre mode de fonctionnement n'est pris en charge. (**NOTE**: Dans le cas où vous l'exécutez avec votre propre compte d'utilisateur et que le serveur SSH intégré est désactivé, Gitea modifie le fichier `~ /.ssh /authorized_keys` afin que vous ne soyez **plus capable** de vous connecter interactivement). + +## Navigateurs supportés + +- Consultez [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) pour la liste des navigateurs supportés. +- La taille minimale supportée officielement est de **1024*768**, l'interface utilisateur peut toujours fonctionner à une taille plus petite, mais ce n'est pas garanti et les problèmes remontés ne seront pas corrigés. + +## Composants + +* Framework web : [Macaron](http://go-macaron.com/) +* ORM : [XORM](https://github.com/go-xorm/xorm) +* Interface graphique : + * [Semantic UI](http://semantic-ui.com/) + * [GitHub Octicons](https://octicons.github.com/) + * [Font Awesome](http://fontawesome.io/) + * [DropzoneJS](http://www.dropzonejs.com/) + * [Highlight](https://highlightjs.org/) + * [Clipboard](https://zenorocha.github.io/clipboard.js/) + * [Emojify](https://github.com/Ranks/emojify.js) + * [CodeMirror](https://codemirror.net/) + * [jQuery Date Time Picker](https://github.com/xdan/datetimepicker) + * [jQuery MiniColors](https://github.com/claviska/jquery-minicolors) +* Connecteurs de base de données : + * [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) + * [github.com/lib/pq](https://github.com/lib/pq) + * [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) + * [github.com/pingcap/tidb](https://github.com/pingcap/tidb) + * [github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) + +## Logiciels et services + +- [Drone](https://github.com/drone/drone) (Intégration continue) From 08b2a0c391ad436c2c63a1bd09f2f6ef96424e29 Mon Sep 17 00:00:00 2001 From: Mike Fellows Date: Thu, 30 Nov 2017 05:36:53 -0800 Subject: [PATCH 0005/1282] Update docs for LDAP (via BindDN) user sync option. (#2985) --- doc/features/authentication.en-us.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/features/authentication.en-us.md b/doc/features/authentication.en-us.md index 37a0d6fa..f4f5ee5f 100644 --- a/doc/features/authentication.en-us.md +++ b/doc/features/authentication.en-us.md @@ -95,6 +95,17 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields: matching supplied login name against multiple attributes such as user identifier, email or even phone number. - Example: `(&(objectClass=Person)(|(uid=%[1]s)(mail=%[1]s)(mobile=%[1]s)))` +- Enable user synchronization + - This option enables a periodic task that synchronizes the Gitea users with + the LDAP server. The default period is every 24 hours but that can be + changed in the app.ini file. See the *cron.sync_external_users* section in + the [sample + app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) + for detailed comments about that section. The *User Search Base* and *User + Filter* settings described above will limit which users can use Gitea and + which users will be synchronized. When initially run the task will create + all LDAP users that match the given settings so take care if working with + large Enterprise LDAP directories. **LDAP using simple auth** adds the following fields: From de0e3f1fa098d8c6e0c3a37392a566d6a935c443 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sat, 2 Dec 2017 19:26:06 -0500 Subject: [PATCH 0006/1282] Reduce overhead of upgrades for users with custom stylesheets/JS (#3051) --- doc/advanced/customizing-gitea.en-us.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/advanced/customizing-gitea.en-us.md index 4fdf4377..8c861757 100644 --- a/doc/advanced/customizing-gitea.en-us.md +++ b/doc/advanced/customizing-gitea.en-us.md @@ -49,6 +49,8 @@ When you find the correct .tmpl file, you need to copy it in the `custom/templat You can now customize the template you copied in `custom/templates`, being carefully to not break the Gitea syntax. Any statement contained inside `{{` and `}}` are Gitea templete's syntax and shouldn't be touch, unless you know what are you doing. +To add in custom HTML to the header or the footer of the page, in the `templates/custom` directory there are `header.tmpl` and `footer.tmpl` that can be modified. This is useful if you want to add in custom CSS files, or additional Javascript. + ## Customizing gitignores, labels, licenses, locales, and readmes. Place your own files in corresponding sub-folder under `custom/options`. \ No newline at end of file From b4a62ee6f186c87d9653b84cd8403c5c65a5a2b3 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Mon, 4 Dec 2017 01:14:26 +0200 Subject: [PATCH 0007/1282] Add reactions to issues/PR and comments (#2856) --- page/index.en-us.md | 1 + 1 file changed, 1 insertion(+) diff --git a/page/index.en-us.md b/page/index.en-us.md index 638d6dfe..9592830a 100644 --- a/page/index.en-us.md +++ b/page/index.en-us.md @@ -182,6 +182,7 @@ The goal of this project is to make the easiest, fastest, and most painless way - Labels - Assign issues - Track time + - Reactions - Filter - Open - Closed From 8b4833b3cc2c15fdc5abcdc00f9c644b00ba8c84 Mon Sep 17 00:00:00 2001 From: bibaijin Date: Tue, 5 Dec 2017 14:03:40 +0800 Subject: [PATCH 0008/1282] add quotation around ports in docker-compose.yml (#3090) --- doc/installation/with-docker.en-us.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/installation/with-docker.en-us.md b/doc/installation/with-docker.en-us.md index 3bab0990..c41c9328 100644 --- a/doc/installation/with-docker.en-us.md +++ b/doc/installation/with-docker.en-us.md @@ -39,8 +39,8 @@ services: volumes: - ./gitea:/data ports: - - 3000:3000 - - 222:22 + - "3000:3000" + - "222:22" ``` ## Custom port @@ -63,10 +63,10 @@ services: volumes: - ./gitea:/data ports: -- - 3000:3000 -- - 222:22 -+ - 8080:3000 -+ - 2221:22 +- - "3000:3000" +- - "222:22" ++ - "8080:3000" ++ - "2221:22" ``` ## MySQL database @@ -89,8 +89,8 @@ services: volumes: - ./gitea:/data ports: - - 3000:3000 - - 222:22 + - "3000:3000" + - "222:22" + depends_on: + - db + @@ -128,8 +128,8 @@ services: volumes: - ./gitea:/data ports: - - 3000:3000 - - 222:22 + - "3000:3000" + - "222:22" + depends_on: + - db + @@ -171,8 +171,8 @@ services: - - ./gitea:/data + - gitea:/data ports: - - 3000:3000 - - 222:22 + - "3000:3000" + - "222:22" ``` If you are using MySQL or PostgreSQL it's up to you to create named volumes for these containers as well. From 11236ebd7d55a8c0421548a97259ed2614f122ea Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sun, 17 Dec 2017 15:37:34 +0100 Subject: [PATCH 0009/1282] Improve cron.archive_cleanup docs in cheat sheet and app.ini.sample (#3215) Include defaults in cheat sheet, for that section --- doc/advanced/config-cheat-sheet.en-us.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 55fe5c11..440946c7 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -189,6 +189,13 @@ Note: Actually, Gitea supports only SMTP with STARTTLS. - `ENABLED`: Enable this to run cron tasks periodically. - `RUN_AT_START`: Enable this to run cron tasks at start time. +### Cron - Cleanup old repository archives (`cron.archive_cleanup`) + +- `ENABLED`: Enable service. Defaults to true. +- `RUN_AT_START`: Run tasks at start up time (if ENABLED). Defaults to true. +- `SCHEDULE`: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. Defaults to `@every 24h`. +- `OLDER_THAN`: Archives created more than `OLDER_THAN` ago are subject to deletion, e.g. `12h`. Defaults to `24h`. + ### Cron - Update Mirrors (`cron.update_mirrors`) - `SCHEDULE`: Cron syntax for scheduling update mirrors, e.g. `@every 1h`. From 20097c2807daaaa3d5da32651d8d113bb2fa7419 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 19 Dec 2017 11:40:21 +0100 Subject: [PATCH 0010/1282] Add missing repository setting docs in cheat sheet (#3230) --- doc/advanced/config-cheat-sheet.en-us.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 440946c7..ea01b07d 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -41,6 +41,10 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `FORCE_PRIVATE`: Force every new repository to be private. - `MAX_CREATION_LIMIT`: Global maximum creation limit of repositories per user, `-1` means no limit. - `PULL_REQUEST_QUEUE_LENGTH`:exclamation:: Length of pull request patch test queue, make it as large as possible. +- `MIRROR_QUEUE_LENGTH`: Patch test queue length, increase if pull request patch testing starts hanging. Defaults to 1000. +- `PREFERRED_LICENSES`: Preferred Licenses to place at the top of the List. Name must match file name in conf/license or custom/conf/license. Defaults to 'Apache License 2.0,MIT License' +- `DISABLE_HTTP_GIT`: Disable ability to interact with repositories by HTTP protocol. Defaults to false +- `USE_COMPAT_SSH_URI`: Force ssh:// clone url instead of scp-style uri when default SSH port is used. Defaults to false. ## UI (`ui`) From b92998c090bde497f5d735830aeaeb2276d61395 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 20 Dec 2017 06:59:56 -0600 Subject: [PATCH 0011/1282] Support default private when creating or migrating repository (#3239) * support default private when creating or migrating repository * fix fmt * use string constants on repository default private in app.ini * fix fmt --- doc/advanced/config-cheat-sheet.en-us.md | 1 + doc/advanced/config-cheat-sheet.zh-cn.md | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index ea01b07d..b5517080 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -39,6 +39,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `SCRIPT_TYPE`: The script type your server supports, usually this is `bash`, but some customers report that they only have `sh`. - `ANSI_CHARSET`: The default charset for an unrecognized charset. - `FORCE_PRIVATE`: Force every new repository to be private. +- `DEFAULT_PRIVATE`: Default private when create a new repository, could be: `last`, `private` and `public`. Default is last which means last user repo visiblity. - `MAX_CREATION_LIMIT`: Global maximum creation limit of repositories per user, `-1` means no limit. - `PULL_REQUEST_QUEUE_LENGTH`:exclamation:: Length of pull request patch test queue, make it as large as possible. - `MIRROR_QUEUE_LENGTH`: Patch test queue length, increase if pull request patch testing starts hanging. Defaults to 1000. diff --git a/doc/advanced/config-cheat-sheet.zh-cn.md b/doc/advanced/config-cheat-sheet.zh-cn.md index 7ec650dd..9a11d960 100644 --- a/doc/advanced/config-cheat-sheet.zh-cn.md +++ b/doc/advanced/config-cheat-sheet.zh-cn.md @@ -29,6 +29,7 @@ menu: - `SCRIPT_TYPE`: 服务器支持的Shell类型,通常是 `bash`,但有些服务器也有可能是 `sh`。 - `ANSI_CHARSET`: 默认字符编码。 - `FORCE_PRIVATE`: 强制所有git工程必须私有。 +- `DEFAULT_PRIVATE`: 默认创建的git工程为私有。 可以是`last`, `private` 或 `public`。默认值是 `last`表示用户最后创建的Repo的选择。 - `MAX_CREATION_LIMIT`: 全局最大每个用户创建的git工程数目, `-1` 表示没限制。 - `PULL_REQUEST_QUEUE_LENGTH`: 小心:合并请求测试队列的长度,尽量放大。 From f4cd1e6f8e90e92377c8c7bc9d3636db5fb1bd37 Mon Sep 17 00:00:00 2001 From: Mike Fellows Date: Wed, 27 Dec 2017 09:35:19 -0500 Subject: [PATCH 0012/1282] Add docs for REDIRECT_OTHER_PORT and PORT_TO_REDIRECT config options (#3262) --- doc/advanced/config-cheat-sheet.en-us.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index b5517080..424e4264 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -87,6 +87,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `LFS_START_SERVER`: Enables git-lfs support. `true` or `false`, default is `false`. - `LFS_CONTENT_PATH`: Where your lfs files put on, default is `data/lfs`. - `LFS_JWT_SECRET`: LFS authentication secret, changed this to yourself. +- `REDIRECT_OTHER_PORT`: If true and `PROTOCOL` is https, redirects http requests on another port to `ROOT_URL`, default is `false`. +- `PORT_TO_REDIRECT`: Port used when `REDIRECT_OTHER_PORT` is true, default is `80`. ## Database (`database`) From cb76d2b1fc30c09333bdf7e5d91f9bf82b0be7e0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 6 Jan 2018 05:28:31 -0600 Subject: [PATCH 0013/1282] add external tool docs (#3301) --- doc/advanced/config-cheat-sheet.en-us.md | 18 ++++++++++++++++++ doc/advanced/config-cheat-sheet.zh-cn.md | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 424e4264..63c4e7a3 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -225,6 +225,24 @@ Note: Actually, Gitea supports only SMTP with STARTTLS. - `MAX_GIT_DIFF_FILES`: Max number of files shown in diff view. - `GC_ARGS`: Arguments for command `git gc`, e.g. `--aggressive --auto`. +## markup (`markup`) + +Gitea supports external markup support, you can integrate all your favorite tool. For example, +below will add a markup named `asciidoc` which is followed `markup.` ini section. And there are some config items below. + +```ini +[markup.asciidoc] +ENABLED = false +FILE_EXTENSIONS = .adoc,.asciidoc +RENDER_COMMAND = "asciidoc --out-file=- -" +IS_INPUT_FILE = false +``` + +- ENABLED: Whether enable this tool. default is false. +- FILE_EXTENSIONS: List of file extensions that should be rendered by an external command. Multiple extentions needs a comma as splitter. +- RENDER_COMMAND: External command to render all matching extensions. +- IS_INPUT_FILE: Input is not a standard input but a file param followed `RENDER_COMMAND`, default is false. + ## Other (`other`) - `SHOW_FOOTER_BRANDING`: Enable this to show Gitea branding in the footer. diff --git a/doc/advanced/config-cheat-sheet.zh-cn.md b/doc/advanced/config-cheat-sheet.zh-cn.md index 9a11d960..6320d6a4 100644 --- a/doc/advanced/config-cheat-sheet.zh-cn.md +++ b/doc/advanced/config-cheat-sheet.zh-cn.md @@ -186,6 +186,25 @@ menu: - `MAX_GIT_DIFF_FILES`: 比较视图中的最大现实文件数目。 - `GC_ARGS`: 执行 `git gc` 命令的参数, 比如: `--aggressive --auto`。 +## markup (`markup`) + +外部渲染工具支持,你可以用你熟悉的文档渲染工具. 比如一下将新增一个名字为 `asciidoc` 的渲染工具which is followed `markup.` ini section. And there are some config items below. + +```ini +[markup.asciidoc] +ENABLED = false +FILE_EXTENSIONS = .adoc,.asciidoc +RENDER_COMMAND = "asciidoc --out-file=- -" +IS_INPUT_FILE = false +``` + +- ENABLED: 是否启用,默认为false。 +- FILE_EXTENSIONS: 关联的文档的扩展名,多个扩展名用都好分隔。 +- RENDER_COMMAND: 工具的命令行命令及参数。 +- IS_INPUT_FILE: 输入方式是最后一个参数为文件路径还是从标准输入读取。 + + + ## Other (`other`) - `SHOW_FOOTER_BRANDING`: 为真则在页面底部显示Gitea的字样。 From 40eb44b973523121e5221292a7c73a945d7b6a15 Mon Sep 17 00:00:00 2001 From: Michael Lustfield Date: Sat, 6 Jan 2018 14:15:14 -0600 Subject: [PATCH 0014/1282] Add defaults to config cheatsheet, and minor language cleanup. (#3290) * Add defaults to config cheatsheet, and clean up document. * Updates and touchups, per review. --- doc/advanced/config-cheat-sheet.en-us.md | 270 +++++++++++------------ 1 file changed, 134 insertions(+), 136 deletions(-) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 63c4e7a3..8adf7b3c 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -15,215 +15,213 @@ menu: # Configuration Cheat Sheet -This is a cheat sheet for the Gitea configuration file. It is helpful for more fully understanding how it powers Gitea. +This is a cheat sheet for the Gitea configuration file. It contains all settings that can configured. -Before getting started, make sure you know that any change to the configuration should be made in `custom/conf/app.ini` or any corresponding location. +Any changes to the Gitea configuration file should be made in `custom/conf/app.ini` or any corresponding location. When installing from a distribution, this will typically be found at `/etc/gitea/conf/app.ini`. -All default settings can be found in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) (replace master in URL with name of tag for released versions). If you see anything which looks like `%(X)s`, it is a feature powered by [ini](https://github.com/go-ini/ini/#recursive-values) for reading values recursively. - -Any configuration option that is marked by :exclamation: means that you should keep the default value unless you fully understand what you are doing. +The defaults provided here are best-effort (not built automatically). They are accurately recorded in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) (s/master/. Any string in the format `%(X)s` is a feature powered by [ini](https://github.com/go-ini/ini/#recursive-values), for reading values recursively. Values containing `#` or `;` must be quoted using `` ` `` or `"""`. -**Note** that you have to restart Gitea for changes to take effect. +**Note:** A full restart is required for Gitea configuration changes to take effect. ## Overall (`DEFAULT`) -- `APP_NAME`: Application name, change to whatever you want. -- `RUN_USER`: The user to run Gitea as, we recommend it be `git`; however, change this to whatever your username is if you run Gitea on your personal computer. Gitea may crash if this value is not set properly. -- `RUN_MODE`: For performance and other purposes, change this to `prod` when deployed to a production environment. The installation process will set this to `prod` automatically. +- `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title. +- `RUN_USER`: **git**: The user Gitea will run as. This should be a dedicated service (non-user) account. Setting this incorrectly will cause Gitea to not start. +- `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment. The installation process will set this to `prod` automatically. \[prod, dev, test\] ## Repository (`repository`) -- `ROOT`: Root path for storing all users' repository data. It must be an absolute path. The default is `~//gitea-repositories`. -- `SCRIPT_TYPE`: The script type your server supports, usually this is `bash`, but some customers report that they only have `sh`. -- `ANSI_CHARSET`: The default charset for an unrecognized charset. -- `FORCE_PRIVATE`: Force every new repository to be private. -- `DEFAULT_PRIVATE`: Default private when create a new repository, could be: `last`, `private` and `public`. Default is last which means last user repo visiblity. -- `MAX_CREATION_LIMIT`: Global maximum creation limit of repositories per user, `-1` means no limit. -- `PULL_REQUEST_QUEUE_LENGTH`:exclamation:: Length of pull request patch test queue, make it as large as possible. -- `MIRROR_QUEUE_LENGTH`: Patch test queue length, increase if pull request patch testing starts hanging. Defaults to 1000. -- `PREFERRED_LICENSES`: Preferred Licenses to place at the top of the List. Name must match file name in conf/license or custom/conf/license. Defaults to 'Apache License 2.0,MIT License' -- `DISABLE_HTTP_GIT`: Disable ability to interact with repositories by HTTP protocol. Defaults to false -- `USE_COMPAT_SSH_URI`: Force ssh:// clone url instead of scp-style uri when default SSH port is used. Defaults to false. +- `ROOT`: **~/gitea-repositories/**: Root path for storing all repository data. It must be an absolute path. +- `SCRIPT_TYPE`: **bash**: The script type your server supports, usually this is `bash`, but some users report that only `sh` is available. +- `ANSI_CHARSET`: **\**: The default charset for an unrecognized charset. +- `FORCE_PRIVATE`: **false**: Force every new repository to be private. +- `DEFAULT_PRIVATE`: **last**: Default private when create a new repository. \[last, private, public\] +- `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user, `-1` means no limit. +- `PULL_REQUEST_QUEUE_LENGTH`: **1000**: Length of pull request patch test queue, make it as large as possible. Use caution when editing this value. +- `MIRROR_QUEUE_LENGTH`: **1000**: Patch test queue length, increase if pull request patch testing starts hanging. +- `PREFERRED_LICENSES`: **Apache License 2.0,MIT License**: Preferred Licenses to place at the top of the List. Name must match file name in conf/license or custom/conf/license. +- `DISABLE_HTTP_GIT`: **false**: Disable the ability to interact with repositories over the HTTP protocol. +- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when default SSH port is used. ## UI (`ui`) -- `EXPLORE_PAGING_NUM`: Number of repositories that are shown in one explore page. -- `ISSUE_PAGING_NUM`: Number of issues that are shown in one page (for all pages that list issues). -- `FEED_MAX_COMMIT_NUM`: Number of maximum commits shown in one activity feed. +- `EXPLORE_PAGING_NUM`: **20**: Number of repositories that are shown in one explore page. +- `ISSUE_PAGING_NUM`: **10**: Number of issues that are shown in one page (for all pages that list issues). +- `FEED_MAX_COMMIT_NUM`: **5**: Number of maximum commits shown in one activity feed. ### UI - Admin (`ui.admin`) -- `USER_PAGING_NUM`: Number of users that are shown in one page. -- `REPO_PAGING_NUM`: Number of repos that are shown in one page. -- `NOTICE_PAGING_NUM`: Number of notices that are shown in one page. -- `ORG_PAGING_NUM`: Number of organizations that are shown in one page. +- `USER_PAGING_NUM`: **50**: Number of users that are shown in one page. +- `REPO_PAGING_NUM`: **50**: Number of repos that are shown in one page. +- `NOTICE_PAGING_NUM`: **25**: Number of notices that are shown in one page. +- `ORG_PAGING_NUM`: **50**: Number of organizations that are shown in one page. ## Markdown (`markdown`) -- `ENABLE_HARD_LINE_BREAK`: Whether or not to enable hard the line break extension. +- `ENABLE_HARD_LINE_BREAK`: **false**: Whether or not to enable hard the line break extension. ## Server (`server`) -- `PROTOCOL`: Either `http`, `https`, `fcgi`, or `unix`. -- `DOMAIN`: Domain name of your server. -- `ROOT_URL`: Full public URL of Gitea server. -- `HTTP_ADDR`: HTTP listen address. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use. -- `HTTP_PORT`: HTTP listen port. If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. -- `UNIX_SOCKET_PERMISSION`: Permisson mode for Unix socket, default is 666. -- `DISABLE_SSH`: Disables SSH feature when it's not available. -- `START_SSH_SERVER`: Starts built-in SSH server when enabled. -- `SSH_DOMAIN`: Domain name of your ssh server. -- `SSH_PORT`: SSH port displayed in clone URL, in case yours is not `22`. -- `SSH_LISTEN_PORT`: Port for the built-in SSH server. Defaults to `SSH_PORT`. -- `OFFLINE_MODE`: Disables use of CDN for static files and Gravatar for profile pictures. -- `DISABLE_ROUTER_LOG`: Mutes printing of the router log. -- `CERT_FILE`: Cert file path used for HTTPS. -- `KEY_FILE`: Key file path used for HTTPS. -- `STATIC_ROOT_PATH`: Upper level of template and static files path, default is the path where Gitea is located. -- `ENABLE_GZIP`: Enables application-level GZIP support. -- `LANDING_PAGE`: Non-logged-in users' landing page, either `home` or `explore`. -- `LFS_START_SERVER`: Enables git-lfs support. `true` or `false`, default is `false`. -- `LFS_CONTENT_PATH`: Where your lfs files put on, default is `data/lfs`. -- `LFS_JWT_SECRET`: LFS authentication secret, changed this to yourself. -- `REDIRECT_OTHER_PORT`: If true and `PROTOCOL` is https, redirects http requests on another port to `ROOT_URL`, default is `false`. -- `PORT_TO_REDIRECT`: Port used when `REDIRECT_OTHER_PORT` is true, default is `80`. +- `PROTOCOL`: **http**: Either `http`, `https`, `fcgi`, or `unix`. +- `DOMAIN`: **localhost**: Domain name of your server. +- `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**: Full public URL of Gitea server. +- `HTTP_ADDR`: **0.0.0.0**: HTTP listen address. + - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. + - If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use. +- `HTTP_PORT`: **3000**: HTTP listen port. + - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. +- `UNIX_SOCKET_PERMISSION`: **666**: Permisson mode for Unix socket. +- `DISABLE_SSH`: **false**: Disables SSH feature when it's not available. +- `START_SSH_SERVER`: **false**: When enabled, uses the built-in SSH server. +- `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of your ssh server, used for displayed clone URL. +- `SSH_PORT`: **22**: SSH port displayed in clone URL. +- `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server. +- `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures. +- `DISABLE_ROUTER_LOG`: **false**: Mutes printing of the router log. +- `CERT_FILE`: **custom/https/cert.pem**: Cert file path used for HTTPS. +- `KEY_FILE`: **custom/https/key.pem**: Key file path used for HTTPS. +- `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path. +- `ENABLE_GZIP`: **false**: Enables application-level GZIP support. +- `LANDING_PAGE`: **home**: Landing page for unauthenticated users, either `home` or `explore`. +- `LFS_START_SERVER`: **false**: Enables git-lfs support. +- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store lfs files. +- `LFS_JWT_SECRET`: **\**: LFS authentication secret, change this a unique string. +- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests on another (https) port. +- `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true. ## Database (`database`) -- `DB_TYPE`: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`. -- `HOST`: Database host address and port. -- `NAME`: Database name. -- `USER`: Database username. -- `PASSWD`: Database user password. -- `SSL_MODE`: For PostgreSQL only. -- `PATH`: For SQLite3 only, the database file path. +- `DB_TYPE`: **mysql**: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`. +- `HOST`: **127.0.0.1:3306**: Database host address and port. +- `NAME`: **gitea**: Database name. +- `USER`: **root**: Database username. +- `PASSWD`: **\**: Database user password. +- `SSL_MODE`: **disable**: For PostgreSQL only. +- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path. ## Security (`security`) -- `INSTALL_LOCK`: Indicates whether to allow the open install page (setting admin account is involved, so it's a very important value). -- `SECRET_KEY`: Global secret key for your server security, **you'd better change it** (will generate a random string every time you install). -- `LOGIN_REMEMBER_DAYS`: Cookie lifetime, in days. -- `COOKIE_USERNAME`: Name of the cookie that saves username. -- `COOKIE_REMEMBER_NAME`: Name of cookie that saves auto-login information. -- `REVERSE_PROXY_AUTHENTICATION_USER`: Header name for reverse proxy authentication username. -- `DISABLE_GIT_HOOKS`: Prevent all users (including admin) from creating custom git hooks (defaults to false) +- `INSTALL_LOCK`: **false**: Disable to allow accessing the install page. +- `SECRET_KEY`: **random at every install**: Global secret key. This should be changed. +- `LOGIN_REMEMBER_DAYS`: **7**: Cookie lifetime, in days. +- `COOKIE_USERNAME`: **gitea\_awesome**: Name of the cookie used to store the current username. +- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication information. +- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy authentication. +- `DISABLE_GIT_HOOKS`: **false**: Prevent all users (including admin) from creating custom git hooks. ## OpenID (`openid`) -- `ENABLE_OPENID_SIGNIN`: Whether to allow signin in via OpenID (defaults to false). -- `ENABLE_OPENID_SIGNUP`: Whether to allow registering via OpenID (defaults to `!DISABLE_REGISTRATION`). -- `WHITELISTED_URIS`: Space separated list of POSIX regexp patterns. If non empty OpenID URIs should match any of these to be granted access. -- `BLACKLISTED_URIS`: Space separated list of POSIX regexp pattenrs. OpenID URI matching any of these is refused access. +- `ENABLE_OPENID_SIGNIN`: **false**: Allow authentication in via OpenID. +- `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**: Allow registering via OpenID. +- `WHITELISTED_URIS`: **\**: If non-empty, list of POSIX regex patterns matching OpenID URI's to permit. +- `BLACKLISTED_URIS`: **\**: If non-empty, list of POSIX regex patterns matching OpenID URI's to block. ## Service (`service`) -- `ACTIVE_CODE_LIVE_MINUTES`: The minutes of active code life time. -- `RESET_PASSWD_CODE_LIVE_MINUTES`: The minutes of reset password code life time. -- `REGISTER_EMAIL_CONFIRM`: Enable this to ask for mail confirmation of registration, requires `Mailer` to be enabled. -- `DISABLE_REGISTRATION`: Disable registration, after which only admin can create accounts for users. -- `SHOW_REGISTRATION_BUTTON`: Indicate whether to show registration button or not. -- `REQUIRE_SIGNIN_VIEW`: Enable this to force users to log in to view any page. -- `ENABLE_CACHE_AVATAR`: Enable this to cache avatar from Gravatar. -- `ENABLE_NOTIFY_MAIL`: Enable this to send e-mail to watchers of repository when something happens like creating issues, requires `Mailer` to be enabled. -- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: Enable this to allow reverse proxy authentication, more detail: https://github.com/gogits/gogs/issues/165 -- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: Enable this to allow auto-registration for reverse authentication. -- `DISABLE_MINIMUM_KEY_SIZE_CHECK`: Do not check minimum key size with corresponding type. -- `ENABLE_CAPTCHA`: Enable this to use captcha validation for registration. +- `ACTIVE_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm account/email registration. +- `RESET_PASSWD_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm forgot password reset process. +- `REGISTER_EMAIL_CONFIRM`: **false**: Enable this to ask for mail confirmation of registration. Requires `Mailer` to be enabled. +- `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users. +- `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page. +- `ENABLE_NOTIFY_MAIL`: **false**: Enable this to send e-mail to watchers of a repository when something happens, like creating issues. Requires `Mailer` to be enabled. +- `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication. +- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration for reverse authentication. +- `ENABLE_CAPTCHA`: **true**: Enable this to use captcha validation for registration. ## Webhook (`webhook`) -- `QUEUE_LENGTH`:exclamation:: Hook task queue length. -- `DELIVER_TIMEOUT`: Delivery timeout in seconds for shooting webhooks. -- `SKIP_TLS_VERIFY`: Indicate whether to allow insecure certification or not. -- `PAGING_NUM`: Number of webhook history that are shown in one page. +- `QUEUE_LENGTH`: **1000**: Hook task queue length. Use caution when editing this value. +- `DELIVER_TIMEOUT`: **5**: Delivery timeout (sec) for shooting webhooks. +- `SKIP_TLS_VERIFY`: **false**: Allow insecure certification. +- `PAGING_NUM`: **10**: Number of webhook history events that are shown in one page. ## Mailer (`mailer`) -- `ENABLED`: Enable this to use a mail service. -- `DISABLE_HELO`: Disable HELO operation. -- `HELO_HOSTNAME`: Custom hostname for HELO operation. -- `HOST`: SMTP mail host address and port (example: smtp.gitea.io:587). -- `FROM`: Mail from address, RFC 5322. This can be just an email address, or the "Name" \ format. -- `USER`: Username of mailer (usually just your e-mail address). -- `PASSWD`: Password of mailer. -- `SKIP_VERIFY`: Do not verify the self-signed certificates. -- `USE_SENDMAIL`: Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems. Valid values are `true` to use sendmail and `false` to use SMTP (default). Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`. -- `SENDMAIL_PATH`: The location of sendmail on the operating system. This can be an absolute path (eg: `/usr/sbin/sendmail`) or just the name of the command (eg: `sendmail` - default) if it can be found in the `PATH` environment variable. - -Note: Actually, Gitea supports only SMTP with STARTTLS. +- `ENABLED`: **false**: Enable to use a mail service. +- `DISABLE_HELO`: **\**: Disable HELO operation. +- `HELO_HOSTNAME`: **\**: Custom hostname for HELO operation. +- `HOST`: **\**: SMTP mail host address and port (example: smtp.gitea.io:587). +- `FROM`: **\**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \ format. +- `USER`: **\**: Username of mailing user (usually the sender's e-mail address). +- `PASSWD`: **\**: Password of mailing user. +- `SKIP_VERIFY`: **\**: Do not verify the self-signed certificates. + - **Note:** Gitea only supports SMTP with STARTTLS. +- `USE_SENDMAIL`: **false** Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems. + - Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`. +- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system. (can be command or full path) ## Cache (`cache`) -- `ADAPTER`: Cache engine adapter, either `memory`, `redis`, or `memcache`. If you want to use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or `memcache`: `go build -tags='redis'`. -- `INTERVAL`: for memory cache only, GC interval in seconds. -- `HOST`: For redis and memcache, the host address and port number. +- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, or `memcache`. If you want to use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or `memcache`: `go build -tags='redis'`. +- `INTERVAL`: **60**: Garbage Collection interval (sec), for memory cache only. +- `HOST`: **\**: Connection string for `redis` and `memcache`. - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180` - Memache: `127.0.0.1:9090;127.0.0.1:9091` ## Session (`session`) -- `PROVIDER`: Session engine provider, either `memory`, `file`, `redis`, or `mysql`. -- `PROVIDER_CONFIG`: For file, it's the root path; for others, it's the host address and port number. -- `COOKIE_SECURE`: Enable this to force using HTTPS for all session access. -- `COOKIE_NAME`: The name of the cookie used for the session ID, defaults to `i_like_gitea`. -- `GC_INTERVAL_TIME`: GC interval in seconds. +- `PROVIDER`: **memory**: Session engine provider, either `memory`, `file`, `redis`, or `mysql`. +- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for others, the connection string. +- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access. +- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID, defaults to `i_like_gitea`. +- `GC_INTERVAL_TIME`: **86400**: GC interval in seconds. ## Picture (`picture`) -- `GRAVATAR_SOURCE`: Can be `gravatar`, `duoshuo` or anything like `http://cn.gravatar.com/avatar/`. -- `DISABLE_GRAVATAR`: Enable this to use local avatars only. -- `ENABLE_FEDERATED_AVATAR`: Enable support for federated avatars (see http://www.libravatar.org) -- `AVATAR_UPLOAD_PATH`: Path to store local and cached files. +- `GRAVATAR_SOURCE`: **gravatar**: Can be `gravatar`, `duoshuo` or anything like `http://cn.gravatar.com/avatar/`. +- `DISABLE_GRAVATAR`: **false**: Enable this to use local avatars only. +- `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see http://www.libravatar.org) +- `AVATAR_UPLOAD_PATH`: **data/avatars**: Path to store local and cached files. ## Attachment (`attachment`) -- `ENABLED`: Enable this to allow users upload attachments. -- `PATH`: Path to store attachments. -- `ALLOWED_TYPES`: Allowed MIME types, e.g. `image/jpeg|image/png`, use `*/*` for all types. -- `MAX_SIZE`: Maximum size in MB, e.g. `4` -- `MAX_FILES`: Maximum number of attachments can be uploaded at once, e.g. `5`. +- `ENABLED`: **true**: Enable this to allow uploading attachments. +- `PATH`: **data/attachments**: Path to store attachments. +- `ALLOWED_TYPES`: **see app.ini.sample**: Allowed MIME types, e.g. `image/jpeg|image/png`, use `*/*` for all types. +- `MAX_SIZE`: **4**: Maximum size (MB). +- `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once. ## Log (`log`) -- `ROOT_PATH`: Root path for log files. -- `MODE`: Logging mode, default is `console`. For multiple modes, use comma to separate it. -- `LEVEL`: General log level, default is `Trace`. +- `ROOT_PATH`: **\**: Root path for log files. +- `MODE`: **console**: Logging mode. For multiple modes, use a comma to separate values. +- `LEVEL`: **Trace**: General log level. \[Trace, Debug, Info, Warn, Error, Critical\] ## Cron (`cron`) -- `ENABLED`: Enable this to run cron tasks periodically. -- `RUN_AT_START`: Enable this to run cron tasks at start time. +- `ENABLED`: **true**: Run cron tasks periodically. +- `RUN_AT_START`: **false**: Run cron tasks at application start-up. ### Cron - Cleanup old repository archives (`cron.archive_cleanup`) -- `ENABLED`: Enable service. Defaults to true. -- `RUN_AT_START`: Run tasks at start up time (if ENABLED). Defaults to true. -- `SCHEDULE`: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. Defaults to `@every 24h`. -- `OLDER_THAN`: Archives created more than `OLDER_THAN` ago are subject to deletion, e.g. `12h`. Defaults to `24h`. +- `ENABLED`: **true**: Enable service. +- `RUN_AT_START`: **true**: Run tasks at start up time (if ENABLED). +- `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository archive cleanup, e.g. `@every 1h`. +- `OLDER_THAN`: **24h**: Archives created more than `OLDER_THAN` ago are subject to deletion, e.g. `12h`. ### Cron - Update Mirrors (`cron.update_mirrors`) -- `SCHEDULE`: Cron syntax for scheduling update mirrors, e.g. `@every 1h`. +- `SCHEDULE`: **@every 10m**: Cron syntax for scheduling update mirrors, e.g. `@every 3h`. ### Cron - Repository Health Check (`cron.repo_health_check`) -- `SCHEDULE`: Cron syntax for scheduling repository health check, e.g. `@every 24h`. -- `TIMEOUT`: Time duration syntax for health check execution timeout, e.g. `60s`. -- `ARGS`: Arguments for command `git fsck`, e.g. `--unreachable --tags`. +- `SCHEDULE`: **every 24h**: Cron syntax for scheduling repository health check. +- `TIMEOUT`: **60s**: Time duration syntax for health check execution timeout. +- `ARGS`: **\**: Arguments for command `git fsck`, e.g. `--unreachable --tags`. ### Cron - Repository Statistics Check (`cron.check_repo_stats`) -- `RUN_AT_START`: Enable this to run repository statistics check at start time. -- `SCHEDULE`: Cron syntax for scheduling repository statistics check, e.g. `@every 24h`. +- `RUN_AT_START`: **true**: Run repository statistics check at start time. +- `SCHEDULE`: **@every 24h**: Cron syntax for scheduling repository statistics check. ## Git (`git`) -- `MAX_GIT_DIFF_LINES`: Max number of lines allowed of a single file in diff view. -- `MAX_GIT_DIFF_LINE_CHARACTERS`: Max number of characters of a line allowed in diff view. -- `MAX_GIT_DIFF_FILES`: Max number of files shown in diff view. -- `GC_ARGS`: Arguments for command `git gc`, e.g. `--aggressive --auto`. +- `MAX_GIT_DIFF_LINES`: **100**: Max number of lines allowed of a single file in diff view. +- `MAX_GIT_DIFF_LINE_CHARACTERS`: **5000**: Max character count per line highlighted in diff view. +- `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view. +- `GC_ARGS`: **\**: Arguments for command `git gc`, e.g. `--aggressive --auto`. ## markup (`markup`) @@ -245,6 +243,6 @@ IS_INPUT_FILE = false ## Other (`other`) -- `SHOW_FOOTER_BRANDING`: Enable this to show Gitea branding in the footer. -- `SHOW_FOOTER_VERSION`: Enable this to show Gitea version information in the footer. -- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: Enable this to show time of template execution in the footer. +- `SHOW_FOOTER_BRANDING`: **false**: Show Gitea branding in the footer. +- `SHOW_FOOTER_VERSION`: **true**: Show Gitea version information in the footer. +- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer. From a48de0304a081883fa48b50f4516540c889c11eb Mon Sep 17 00:00:00 2001 From: Antoine GIRARD Date: Mon, 8 Jan 2018 06:03:52 +0100 Subject: [PATCH 0015/1282] Add missing indexer doc in configuration (#3324) * Add missing indexer doc in configuration * Unify MAX_FILE_SIZE to 1024 * 1024 --- doc/advanced/config-cheat-sheet.en-us.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 8adf7b3c..1615ee9c 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -101,6 +101,14 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `SSL_MODE`: **disable**: For PostgreSQL only. - `PATH`: **data/gitea.db**: For SQLite3 only, the database file path. +## Indexer (`indexer`) + +- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search. +- `REPO_INDEXER_ENABLED`: **false**: Enables code search (uses a lot of disk space). +- `REPO_INDEXER_PATH`: **indexers/repos.bleve**: Index file used for code search. +- `UPDATE_BUFFER_LEN`: **20**: Buffer length of index request. +- `MAX_FILE_SIZE`: **1048576**: Maximum size in bytes of each index files. + ## Security (`security`) - `INSTALL_LOCK`: **false**: Disable to allow accessing the install page. From 2c0960a9cd6d1ef6ad1ea306bdfbeb9328f169a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20=22BKC=22=20Carlb=C3=A4cker?= Date: Mon, 8 Jan 2018 23:48:05 +0100 Subject: [PATCH 0016/1282] Update gitea version on docs/install-from-binary (#3333) * Update gitea version on docs/install-from-binary * Update all versions --- doc/installation/from-binary.en-us.md | 2 +- doc/installation/from-binary.fr-fr.md | 2 +- doc/installation/from-binary.zh-cn.md | 2 +- doc/installation/from-binary.zh-tw.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/installation/from-binary.en-us.md b/doc/installation/from-binary.en-us.md index 9503ac82..f47f1de3 100644 --- a/doc/installation/from-binary.en-us.md +++ b/doc/installation/from-binary.en-us.md @@ -18,7 +18,7 @@ menu: All downloads come with SQLite, MySQL and PostgreSQL support, and are built with embedded assets. Keep in mind that this can be different for older releases. The installation based on our binaries is quite simple, just choose the file matching your platform from the [downloads page](https://dl.gitea.io/gitea), copy the URL and replace the URL within the commands below: ``` -wget -O gitea https://dl.gitea.io/gitea/1.0.1/gitea-1.0.1-linux-amd64 +wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64 chmod +x gitea ``` diff --git a/doc/installation/from-binary.fr-fr.md b/doc/installation/from-binary.fr-fr.md index 5aeea0ea..6cf9c039 100755 --- a/doc/installation/from-binary.fr-fr.md +++ b/doc/installation/from-binary.fr-fr.md @@ -18,7 +18,7 @@ menu: Tous les binaires sont livrés avec le support de SQLite, MySQL et PostgreSQL, et sont construits avec les ressources incorporées. Gardez à l'esprit que cela peut être différent pour les versions antérieures. L'installation basée sur nos binaires est assez simple, il suffit de choisir le fichier correspondant à votre plateforme à partir de la [page de téléchargement](https://dl.gitea.io/gitea). Copiez l'URL et remplacer l'URL dans les commandes suivantes par la nouvelle: ``` -wget -O gitea https://dl.gitea.io/gitea/1.0.1/gitea-1.0.1-linux-amd64 +wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64 chmod +x gitea ``` diff --git a/doc/installation/from-binary.zh-cn.md b/doc/installation/from-binary.zh-cn.md index c8ceb7c6..37719a61 100644 --- a/doc/installation/from-binary.zh-cn.md +++ b/doc/installation/from-binary.zh-cn.md @@ -18,7 +18,7 @@ menu: 所有下载均包括 SQLite, MySQL 和 PostgreSQL 的支持,同时所有资源均已嵌入到可执行程序中,这一点和老版本有所不同。 基于二进制的安装非常简单,只要从 [下载页面](https://dl.gitea.io/gitea) 选择对应平台,拷贝下载URL,执行以下命令即可(以Linux为例): ``` -wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64 +wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64 chmod +x gitea ``` diff --git a/doc/installation/from-binary.zh-tw.md b/doc/installation/from-binary.zh-tw.md index e6b4637b..a797d442 100644 --- a/doc/installation/from-binary.zh-tw.md +++ b/doc/installation/from-binary.zh-tw.md @@ -18,7 +18,7 @@ menu: 所有的執行檔皆支援 SQLite, MySQL and PostgreSQL,且所有檔案都已經包在執行檔內,這一點跟之前的版本有所不同。關於執行檔的安裝方式非常簡單,只要從[下載頁面](https://dl.gitea.io/gitea)選擇相對應平台,複製下載連結,使用底下指令就可以完成了: ``` -wget -O gitea https://dl.gitea.io/gitea/1.0.0/gitea-1.0.0-linux-amd64 +wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64 chmod +x gitea ``` From 3f7768d4e869c75ba5fdd7aa86af086a81aaf92c Mon Sep 17 00:00:00 2001 From: Michael Lustfield Date: Mon, 8 Jan 2018 16:48:42 -0600 Subject: [PATCH 0017/1282] General documentation cleanup (#3317) * Clean up spelling, grammar, perspective, whitespace, language, markup, etc. --- doc/advanced.fr-fr.md | 0 doc/advanced/config-cheat-sheet.en-us.md | 158 +++++++++++------- doc/advanced/customizing-gitea.en-us.md | 51 ++++-- doc/advanced/hacking-on-gitea.en-us.md | 25 ++- doc/advanced/make.en-us.md | 12 +- doc/advanced/make.fr-fr.md | 0 doc/advanced/specific-variables.en-us.md | 30 ++-- doc/features/authentication.en-us.md | 37 ++-- doc/features/webhooks.en-us.md | 7 +- doc/help.en-us.md | 13 ++ doc/help/seek-help.en-us.md | 28 ++++ doc/help/troubleshooting.en-us.md | 43 +++-- doc/installation.fr-fr.md | 0 doc/installation/from-binary.en-us.md | 24 ++- doc/installation/from-binary.fr-fr.md | 0 doc/installation/from-package.en-us.md | 36 ++-- doc/installation/from-package.fr-fr.md | 0 doc/installation/from-source.en-us.md | 52 +++--- doc/installation/from-source.fr-fr.md | 0 .../run-as-service-in-ubuntu.en-us.md | 69 ++++---- doc/installation/windows-service.en-us.md | 11 +- doc/installation/windows-service.fr-fr.md | 0 doc/installation/with-docker.en-us.md | 53 ++++-- doc/installation/with-docker.fr-fr.md | 0 doc/upgrade.fr-fr.md | 0 doc/upgrade/from-gogs.en-us.md | 30 ++-- doc/upgrade/from-gogs.fr-fr.md | 0 doc/usage/backup-and-restore.en-us.md | 38 +++-- doc/usage/command-line.md | 39 +++-- page/index.en-us.md | 23 ++- 30 files changed, 500 insertions(+), 279 deletions(-) mode change 100755 => 100644 doc/advanced.fr-fr.md mode change 100755 => 100644 doc/advanced/make.fr-fr.md create mode 100644 doc/help.en-us.md create mode 100644 doc/help/seek-help.en-us.md mode change 100755 => 100644 doc/installation.fr-fr.md mode change 100755 => 100644 doc/installation/from-binary.fr-fr.md mode change 100755 => 100644 doc/installation/from-package.fr-fr.md mode change 100755 => 100644 doc/installation/from-source.fr-fr.md mode change 100755 => 100644 doc/installation/windows-service.fr-fr.md mode change 100755 => 100644 doc/installation/with-docker.fr-fr.md mode change 100755 => 100644 doc/upgrade.fr-fr.md mode change 100755 => 100644 doc/upgrade/from-gogs.fr-fr.md diff --git a/doc/advanced.fr-fr.md b/doc/advanced.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 1615ee9c..941e08a7 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -15,11 +15,17 @@ menu: # Configuration Cheat Sheet -This is a cheat sheet for the Gitea configuration file. It contains all settings that can configured. +This is a cheat sheet for the Gitea configuration file. It contains most settings +that can configured as well as their default values. -Any changes to the Gitea configuration file should be made in `custom/conf/app.ini` or any corresponding location. When installing from a distribution, this will typically be found at `/etc/gitea/conf/app.ini`. +Any changes to the Gitea configuration file should be made in `custom/conf/app.ini` +or any corresponding location. When installing from a distribution, this will +typically be found at `/etc/gitea/conf/app.ini`. -The defaults provided here are best-effort (not built automatically). They are accurately recorded in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) (s/master/. Any string in the format `%(X)s` is a feature powered by [ini](https://github.com/go-ini/ini/#recursive-values), for reading values recursively. +The defaults provided here are best-effort (not built automatically). They are +accurately recorded in [app.ini.sample](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) +(s/master/). Any string in the format `%(X)s` is a feature powered +by [ini](https://github.com/go-ini/ini/#recursive-values), for reading values recursively. Values containing `#` or `;` must be quoted using `` ` `` or `"""`. @@ -28,22 +34,34 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. ## Overall (`DEFAULT`) - `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title. -- `RUN_USER`: **git**: The user Gitea will run as. This should be a dedicated service (non-user) account. Setting this incorrectly will cause Gitea to not start. -- `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment. The installation process will set this to `prod` automatically. \[prod, dev, test\] +- `RUN_USER`: **git**: The user Gitea will run as. This should be a dedicated system + (non-user) account. Setting this incorrectly will cause Gitea to not start. +- `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when + deployed to a production environment. The installation process will set this to `prod` + automatically. \[prod, dev, test\] ## Repository (`repository`) -- `ROOT`: **~/gitea-repositories/**: Root path for storing all repository data. It must be an absolute path. -- `SCRIPT_TYPE`: **bash**: The script type your server supports, usually this is `bash`, but some users report that only `sh` is available. +- `ROOT`: **~/gitea-repositories/**: Root path for storing all repository data. It must be + an absolute path. +- `SCRIPT_TYPE`: **bash**: The script type this server supports, usually this is `bash`, + but some users report that only `sh` is available. - `ANSI_CHARSET`: **\**: The default charset for an unrecognized charset. - `FORCE_PRIVATE`: **false**: Force every new repository to be private. -- `DEFAULT_PRIVATE`: **last**: Default private when create a new repository. \[last, private, public\] -- `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user, `-1` means no limit. -- `PULL_REQUEST_QUEUE_LENGTH`: **1000**: Length of pull request patch test queue, make it as large as possible. Use caution when editing this value. -- `MIRROR_QUEUE_LENGTH`: **1000**: Patch test queue length, increase if pull request patch testing starts hanging. -- `PREFERRED_LICENSES`: **Apache License 2.0,MIT License**: Preferred Licenses to place at the top of the List. Name must match file name in conf/license or custom/conf/license. -- `DISABLE_HTTP_GIT`: **false**: Disable the ability to interact with repositories over the HTTP protocol. -- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when default SSH port is used. +- `DEFAULT_PRIVATE`: **last**: Default private when creating a new repository. + \[last, private, public\] +- `MAX_CREATION_LIMIT`: **-1**: Global maximum creation limit of repositories per user, + `-1` means no limit. +- `PULL_REQUEST_QUEUE_LENGTH`: **1000**: Length of pull request patch test queue, make it + as large as possible. Use caution when editing this value. +- `MIRROR_QUEUE_LENGTH`: **1000**: Patch test queue length, increase if pull request patch + testing starts hanging. +- `PREFERRED_LICENSES`: **Apache License 2.0,MIT License**: Preferred Licenses to place at + the top of the list. Name must match file name in conf/license or custom/conf/license. +- `DISABLE_HTTP_GIT`: **false**: Disable the ability to interact with repositories over the + HTTP protocol. +- `USE_COMPAT_SSH_URI`: **false**: Force ssh:// clone url instead of scp-style uri when + default SSH port is used. ## UI (`ui`) @@ -60,40 +78,43 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. ## Markdown (`markdown`) -- `ENABLE_HARD_LINE_BREAK`: **false**: Whether or not to enable hard the line break extension. +- `ENABLE_HARD_LINE_BREAK`: **false**: Enable Markdown's hard line break extension. ## Server (`server`) -- `PROTOCOL`: **http**: Either `http`, `https`, `fcgi`, or `unix`. -- `DOMAIN`: **localhost**: Domain name of your server. +- `PROTOCOL`: **http**: \[http, https, fcgi, unix\] +- `DOMAIN`: **localhost**: Domain name of this server. - `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**: Full public URL of Gitea server. - `HTTP_ADDR`: **0.0.0.0**: HTTP listen address. - - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. + - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket + defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. - If `PROTOCOL` is set to `unix`, this should be the name of the Unix socket file to use. - `HTTP_PORT`: **3000**: HTTP listen port. - - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. -- `UNIX_SOCKET_PERMISSION`: **666**: Permisson mode for Unix socket. -- `DISABLE_SSH`: **false**: Disables SSH feature when it's not available. -- `START_SSH_SERVER`: **false**: When enabled, uses the built-in SSH server. -- `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of your ssh server, used for displayed clone URL. + - If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket + defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings. +- `UNIX_SOCKET_PERMISSION`: **666**: Permissions for the Unix socket. +- `DISABLE_SSH`: **false**: Disable SSH feature when it's not available. +- `START_SSH_SERVER`: **false**: When enabled, use the built-in SSH server. +- `SSH_DOMAIN`: **%(DOMAIN)s**: Domain name of this server, used for displayed clone URL. - `SSH_PORT`: **22**: SSH port displayed in clone URL. - `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server. - `OFFLINE_MODE`: **false**: Disables use of CDN for static files and Gravatar for profile pictures. -- `DISABLE_ROUTER_LOG`: **false**: Mutes printing of the router log. +- `DISABLE_ROUTER_LOG`: **false**: Mute printing of the router log. - `CERT_FILE`: **custom/https/cert.pem**: Cert file path used for HTTPS. - `KEY_FILE`: **custom/https/key.pem**: Key file path used for HTTPS. - `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path. - `ENABLE_GZIP`: **false**: Enables application-level GZIP support. -- `LANDING_PAGE`: **home**: Landing page for unauthenticated users, either `home` or `explore`. +- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore\]. - `LFS_START_SERVER`: **false**: Enables git-lfs support. -- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store lfs files. +- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files. - `LFS_JWT_SECRET`: **\**: LFS authentication secret, change this a unique string. -- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests on another (https) port. +- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests + on another (https) port. - `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true. ## Database (`database`) -- `DB_TYPE`: **mysql**: The database type you choose, either `mysql`, `postgres`, `mssql` or `sqlite3`. +- `DB_TYPE`: **mysql**: The database type in use \[mysql, postgres, mssql, sqlite3\]. - `HOST`: **127.0.0.1:3306**: Database host address and port. - `NAME`: **gitea**: Database name. - `USER`: **root**: Database username. @@ -111,31 +132,41 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. ## Security (`security`) -- `INSTALL_LOCK`: **false**: Disable to allow accessing the install page. -- `SECRET_KEY`: **random at every install**: Global secret key. This should be changed. +- `INSTALL_LOCK`: **false**: Disallow access to the install page. +- `SECRET_KEY`: **\**: Global secret key. This should be changed. - `LOGIN_REMEMBER_DAYS`: **7**: Cookie lifetime, in days. - `COOKIE_USERNAME`: **gitea\_awesome**: Name of the cookie used to store the current username. -- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication information. -- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy authentication. -- `DISABLE_GIT_HOOKS`: **false**: Prevent all users (including admin) from creating custom git hooks. +- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication + information. +- `REVERSE_PROXY_AUTHENTICATION_USER`: **X-WEBAUTH-USER**: Header name for reverse proxy + authentication. +- `DISABLE_GIT_HOOKS`: **false**: Prevent all users (including admin) from creating custom + git hooks. ## OpenID (`openid`) - `ENABLE_OPENID_SIGNIN`: **false**: Allow authentication in via OpenID. - `ENABLE_OPENID_SIGNUP`: **! DISABLE\_REGISTRATION**: Allow registering via OpenID. -- `WHITELISTED_URIS`: **\**: If non-empty, list of POSIX regex patterns matching OpenID URI's to permit. -- `BLACKLISTED_URIS`: **\**: If non-empty, list of POSIX regex patterns matching OpenID URI's to block. +- `WHITELISTED_URIS`: **\**: If non-empty, list of POSIX regex patterns matching + OpenID URI's to permit. +- `BLACKLISTED_URIS`: **\**: If non-empty, list of POSIX regex patterns matching + OpenID URI's to block. ## Service (`service`) - `ACTIVE_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm account/email registration. -- `RESET_PASSWD_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm forgot password reset process. -- `REGISTER_EMAIL_CONFIRM`: **false**: Enable this to ask for mail confirmation of registration. Requires `Mailer` to be enabled. -- `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create accounts for users. +- `RESET_PASSWD_CODE_LIVE_MINUTES`: **180**: Time limit (min) to confirm forgot password reset + process. +- `REGISTER_EMAIL_CONFIRM`: **false**: Enable this to ask for mail confirmation of registration. + Requires `Mailer` to be enabled. +- `DISABLE_REGISTRATION`: **false**: Disable registration, after which only admin can create + accounts for users. - `REQUIRE_SIGNIN_VIEW`: **false**: Enable this to force users to log in to view any page. -- `ENABLE_NOTIFY_MAIL`: **false**: Enable this to send e-mail to watchers of a repository when something happens, like creating issues. Requires `Mailer` to be enabled. +- `ENABLE_NOTIFY_MAIL`: **false**: Enable this to send e-mail to watchers of a repository when + something happens, like creating issues. Requires `Mailer` to be enabled. - `ENABLE_REVERSE_PROXY_AUTHENTICATION`: **false**: Enable this to allow reverse proxy authentication. -- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration for reverse authentication. +- `ENABLE_REVERSE_PROXY_AUTO_REGISTRATION`: **false**: Enable this to allow auto-registration + for reverse authentication. - `ENABLE_CAPTCHA`: **true**: Enable this to use captcha validation for registration. ## Webhook (`webhook`) @@ -151,43 +182,52 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `DISABLE_HELO`: **\**: Disable HELO operation. - `HELO_HOSTNAME`: **\**: Custom hostname for HELO operation. - `HOST`: **\**: SMTP mail host address and port (example: smtp.gitea.io:587). -- `FROM`: **\**: Mail from address, RFC 5322. This can be just an email address, or the "Name" \ format. +- `FROM`: **\**: Mail from address, RFC 5322. This can be just an email address, or + the "Name" \ format. - `USER`: **\**: Username of mailing user (usually the sender's e-mail address). - `PASSWD`: **\**: Password of mailing user. - `SKIP_VERIFY`: **\**: Do not verify the self-signed certificates. - **Note:** Gitea only supports SMTP with STARTTLS. -- `USE_SENDMAIL`: **false** Use the operating system's `sendmail` command instead of SMTP. This is common on linux systems. - - Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, `FROM` and `SENDMAIL_PATH`. -- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system. (can be command or full path) +- `USE_SENDMAIL`: **false** Use the operating system's `sendmail` command instead of SMTP. + This is common on linux systems. + - Note that enabling sendmail will ignore all other `mailer` settings except `ENABLED`, + `FROM` and `SENDMAIL_PATH`. +- `SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system. (can be + command or full path) ## Cache (`cache`) -- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, or `memcache`. If you want to use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or `memcache`: `go build -tags='redis'`. +- `ADAPTER`: **memory**: Cache engine adapter, either `memory`, `redis`, or `memcache`. + - To use `redis` or `memcache`, be sure to rebuild everything with build tags `redis` or + `memcache`: `go build -tags='redis'`. - `INTERVAL`: **60**: Garbage Collection interval (sec), for memory cache only. - `HOST`: **\**: Connection string for `redis` and `memcache`. - - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180` - - Memache: `127.0.0.1:9090;127.0.0.1:9091` + - Redis: `network=tcp,addr=127.0.0.1:6379,password=macaron,db=0,pool_size=100,idle_timeout=180` + - Memache: `127.0.0.1:9090;127.0.0.1:9091` ## Session (`session`) -- `PROVIDER`: **memory**: Session engine provider, either `memory`, `file`, `redis`, or `mysql`. +- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, mysql\]. - `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for others, the connection string. - `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access. -- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID, defaults to `i_like_gitea`. +- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID. - `GC_INTERVAL_TIME`: **86400**: GC interval in seconds. ## Picture (`picture`) -- `GRAVATAR_SOURCE`: **gravatar**: Can be `gravatar`, `duoshuo` or anything like `http://cn.gravatar.com/avatar/`. +- `GRAVATAR_SOURCE`: **gravatar**: Can be `gravatar`, `duoshuo` or anything like + `http://cn.gravatar.com/avatar/`. - `DISABLE_GRAVATAR`: **false**: Enable this to use local avatars only. -- `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see http://www.libravatar.org) +- `ENABLE_FEDERATED_AVATAR`: **false**: Enable support for federated avatars (see + http://www.libravatar.org) - `AVATAR_UPLOAD_PATH`: **data/avatars**: Path to store local and cached files. ## Attachment (`attachment`) - `ENABLED`: **true**: Enable this to allow uploading attachments. - `PATH`: **data/attachments**: Path to store attachments. -- `ALLOWED_TYPES`: **see app.ini.sample**: Allowed MIME types, e.g. `image/jpeg|image/png`, use `*/*` for all types. +- `ALLOWED_TYPES`: **see app.ini.sample**: Allowed MIME types, e.g. `image/jpeg|image/png`. + Use `*/*` for all types. - `MAX_SIZE`: **4**: Maximum size (MB). - `MAX_FILES`: **5**: Maximum number of attachments that can be uploaded at once. @@ -231,10 +271,9 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. - `MAX_GIT_DIFF_FILES`: **100**: Max number of files shown in diff view. - `GC_ARGS`: **\**: Arguments for command `git gc`, e.g. `--aggressive --auto`. -## markup (`markup`) +## Markup (`markup`) -Gitea supports external markup support, you can integrate all your favorite tool. For example, -below will add a markup named `asciidoc` which is followed `markup.` ini section. And there are some config items below. +Gitea can support Markup using external tools. The example below will add a markup named `asciidoc`. ```ini [markup.asciidoc] @@ -244,10 +283,11 @@ RENDER_COMMAND = "asciidoc --out-file=- -" IS_INPUT_FILE = false ``` -- ENABLED: Whether enable this tool. default is false. -- FILE_EXTENSIONS: List of file extensions that should be rendered by an external command. Multiple extentions needs a comma as splitter. -- RENDER_COMMAND: External command to render all matching extensions. -- IS_INPUT_FILE: Input is not a standard input but a file param followed `RENDER_COMMAND`, default is false. +- ENABLED: **false** Enable markup support. +- FILE\_EXTENSIONS: **\** List of file extensions that should be rendered by an external + command. Multiple extentions needs a comma as splitter. +- RENDER\_COMMAND: External command to render all matching extensions. +- IS\_INPUT\_FILE: **false** Input is not a standard input but a file param followed `RENDER_COMMAND`. ## Other (`other`) diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/advanced/customizing-gitea.en-us.md index 8c861757..5be30740 100644 --- a/doc/advanced/customizing-gitea.en-us.md +++ b/doc/advanced/customizing-gitea.en-us.md @@ -15,42 +15,57 @@ menu: # Customizing Gitea -The main way to customize Gitea is by using the `custom` folder. This is the central place to override and configure features. +Customizing Gitea is typically done using the `custom` folder. This is the central +place to override configuration settings, templates, etc. -If you install Gitea from binary, after the installation process ends, you can find the `custom` folder next to the binary. -Gitea will create the folder for you and prepopulate it with a `conf` folder inside, where Gitea stores all the configuration settings provided through the installation steps (have a look [here](https://docs.gitea.io/en-us/config-cheat-sheet/) for a complete list). +If Gitea is deployed from binary, all default paths will be relative to the gitea +binary. If installed from a distribution, these paths will likely be modified to +the Linux Filesystem Standard. Gitea will create required folders, including `custom/`. +Application settings are configured in `custom/conf/app.ini`. Distributions may +provide a symlink for `custom` using `/etc/gitea/`. -If you can't find the `custom` folder next to the binary, please check the `GITEA_CUSTOM` environment variable, that can be used to override the default path to something else. `GITEA_CUSTOM` might be set for example in your launch script file. Please have a look [here](https://docs.gitea.io/en-us/specific-variables/) for a complete list of environment variables. +- [Quick Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/) +- [Complete List](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample) -**Note** that you have to restart Gitea for it to notice the changes. +If the `custom` folder can't be found next to the binary, check the `GITEA_CUSTOM` +environment variable; this can be used to override the default path to something else. +`GITEA_CUSTOM` might, for example, be set by an init script. + +- [List of Environment Variables](https://docs.gitea.io/en-us/specific-variables/) + +**Note:** Gitea must perform a full restart to see configuration changes. ## Customizing /robots.txt -To make Gitea serve your own `/robots.txt` (by default, an empty 404 status is served), simply create a file called `robots.txt` in the `custom` folder with the [expected contents](http://www.robotstxt.org/). +To make Gitea serve a custom `/robots.txt` (default: empty 404), create a file called +`robots.txt` in the `custom` folder with [expected contents](http://www.robotstxt.org/). ## Serving custom public files -To make Gitea serve custom public files (like pages and images), use the folder `custom/public/` as the webroot. Symbolic links will be followed. +To make Gitea serve custom public files (like pages and images), use the folder +`custom/public/` as the webroot. Symbolic links will be followed. -For example, a file `image.png` stored in `custom/public`, can be accessed with the url `http://your-gitea-url/image.png`. +For example, a file `image.png` stored in `custom/public/`, can be accessed with +the url `http://gitea.domain.tld/image.png`. ## Changing the default avatar -Place the png image at the following path: `custom/public/img/avatar_default.png` +Place the png image at the following path: `custom/public/img/avatar\_default.png` ## Customizing Gitea pages -The `custom/templates` folder allows you to change every single page of Gitea. +The `custom/templates` folder allows changing every single page of Gitea. Templates +to override can be found in the `templates` directory of Gitea source. Override by +making a copy of the file under `custom/templates` using a full path structure +matching source. -You need to be aware of the template you want to change. All templates can be found in the `templates` folder of the Gitea sources. +Any statement contained inside `{{` and `}}` are Gitea's templete syntax and +shouldn't be touched without fully understanding these components. -When you find the correct .tmpl file, you need to copy it in the `custom/templates` folder of your installation, __respecting__ any subfolder you found in the source template. - -You can now customize the template you copied in `custom/templates`, being carefully to not break the Gitea syntax. -Any statement contained inside `{{` and `}}` are Gitea templete's syntax and shouldn't be touch, unless you know what are you doing. - -To add in custom HTML to the header or the footer of the page, in the `templates/custom` directory there are `header.tmpl` and `footer.tmpl` that can be modified. This is useful if you want to add in custom CSS files, or additional Javascript. +To add custom HTML to the header or the footer of the page, in the `templates/custom` +directory there is `header.tmpl` and `footer.tmpl` that can be modified. This can be +a useful place to add custom CSS files or additional Javascript. ## Customizing gitignores, labels, licenses, locales, and readmes. -Place your own files in corresponding sub-folder under `custom/options`. \ No newline at end of file +Place custom files in corresponding sub-folder under `custom/options`. diff --git a/doc/advanced/hacking-on-gitea.en-us.md b/doc/advanced/hacking-on-gitea.en-us.md index 368d1744..469c5a50 100644 --- a/doc/advanced/hacking-on-gitea.en-us.md +++ b/doc/advanced/hacking-on-gitea.en-us.md @@ -15,21 +15,28 @@ menu: # Hacking on Gitea -We won't cover the basics of a Golang setup within this guide. If you don't know how to get the environment up and running you should follow the official [install instructions](https://golang.org/doc/install). +Familiarity with the existing [installation instructions](https://golang.org/doc/install) +is required for this section. -If you want to contribute to Gitea you should fork the project and work on the `master` branch. There is a catch though, some internal packages are referenced by their GitHub URL. So you have to trick the Go tool to think that you work on a clone of the official repository. Start by downloading the source code as you normally would: +To contribute to Gitea, fork the project and work on the `master` branch. + +Some internal packages are referenced using their respective Github URL. This can +become problematic. To "trick" the Go tool into thinking this is a clone from the +official repository, download the source code using "go get" and follow these instructions. ``` go get -d code.gitea.io/gitea ``` -Now it's time to fork the [Gitea repository](https://github.com/go-gitea/gitea) on GitHub, after that you should have to switch to the source directory on the command line: +Fork the [Gitea repository](https://github.com/go-gitea/gitea) on GitHub, it should +then be possible to switch the source directory on the command line. ``` cd $GOPATH/src/code.gitea.io/gitea ``` -To be able to create pull requests you should add your forked repository as a remote to the Gitea sources, otherwise you can not apply the changes to our repository because of lacking write permissions: +To be able to create pull requests, the forked repository should be added as a remote +to the Gitea sources, otherwise changes can't be pushed. ``` git remote rename origin upstream @@ -37,6 +44,12 @@ git remote add origin git@github.com:/gitea.git git fetch --all --prune ``` -You've got a working development environment for Gitea now. Take a look at the `Makefile` to get an overview about the available tasks. The most common tasks should be `make test` which will start our test environment and `make build` which will build a `gitea` binary into your working directory. Writing test cases is not mandatory to contribute, but we will be happy if you do. +This should provide a working development environment for Gitea. Take a look at +the `Makefile` to get an overview about the available tasks. The most common tasks +should be `make test` which will start our test environment and `make build` which +will build a `gitea` binary into the working directory. Writing test cases is not +mandatory to contribute, but it is highly encouraged and helps developers sleep +at night. -That’s it! You are ready to hack on Gitea. Test your changes, push them to your repository and open a pull request. +That's it! You are ready to hack on Gitea. Test changes, push them to the repository, +and open a pull request. diff --git a/doc/advanced/make.en-us.md b/doc/advanced/make.en-us.md index 836c5443..f90367de 100644 --- a/doc/advanced/make.en-us.md +++ b/doc/advanced/make.en-us.md @@ -15,16 +15,17 @@ menu: # Make -Gitea makes heavy use of Make to automate tasks and have a faster development. This guide cover how to install Make. +Gitea makes heavy use of Make to automate tasks and improve development. This +guide covers how to install Make. ### On Linux -You can install with your package manager. +Install with the package manager. On Ubuntu/Debian: ```bash -sudo apt-get install build-essential +sudo apt-get install make ``` On Fedora/RHEL/CentOS: @@ -35,10 +36,11 @@ sudo yum install make ### On Windows -If you are using Windows, you can download and use one of these distributions of Make: +One of these three distributions of Make will run on Windows: - [Single binary build](http://www.equation.com/servlet/equation.cmd?fa=make). Copy somewhere and add to `PATH`. - [32-bits version](ftp://ftp.equation.com/make/32/make.exe) - [64-bits version](ftp://ftp.equation.com/make/64/make.exe) -- [MinGW](http://www.mingw.org/) includes a build. The binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to your `PATH`. +- [MinGW](http://www.mingw.org/) includes a build. + - The binary is called `mingw32-make.exe` instead of `make.exe`. Add the `bin` folder to `PATH`. - [Chocolatey package](https://chocolatey.org/packages/make). Run `choco install make` diff --git a/doc/advanced/make.fr-fr.md b/doc/advanced/make.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/advanced/specific-variables.en-us.md b/doc/advanced/specific-variables.en-us.md index 1fe705aa..8dbe9a8c 100644 --- a/doc/advanced/specific-variables.en-us.md +++ b/doc/advanced/specific-variables.en-us.md @@ -25,43 +25,45 @@ GITEA_CUSTOM=/home/gitea/custom ./gitea web ## From Go language -As Gitea is written in Go, it uses some Go variables as: +As Gitea is written in Go, it uses some Go variables, such as: * `GOOS` * `GOARCH` - * `GOPATH` + * [`GOPATH`](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable) -For `GOPATH`, check [official documentation about GOPATH environment variable](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable). - -For others, check [official documentation about variables used when it runs the generator](https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source). +For documentation about each of the variables available, refer to the +[official Go documentation](https://golang.org/cmd/go/#hdr-Environment_variables). ## Gitea files - * `GITEA_WORK_DIR`: Gitea absolute path of work directory. - * `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable to change *custom* directory. + * `GITEA_WORK_DIR`: Absolute path of working directory. + * `GITEA_CUSTOM`: Gitea uses `GITEA_WORK_DIR`/custom folder by default. Use this variable + to change *custom* directory. * `GOGS_WORK_DIR`: Deprecated, use `GITEA_WORK_DIR` * `GOGS_CUSTOM`: Deprecated, use `GITEA_CUSTOM` ## Operating system specifics - * `USER`: system user that launch Gitea. Useful for repository URL address on Gitea interface - * `USERNAME`: if no USER found, Gitea will try `USERNAME` - * `HOME`: User home directory path (**except if** you're running on Windows, check the following `USERPROFILE` variable) + * `USER`: System user that Gitea will run as. Used for some repository access strings. + * `USERNAME`: if no `USER` found, Gitea will use `USERNAME` + * `HOME`: User home directory path. The `USERPROFILE` environment variable is used in Windows. ### Only on Windows * `USERPROFILE`: User home directory path. If empty, uses `HOMEDRIVE` + `HOMEPATH` - * `HOMEDRIVE`: Main drive path you will use to get home directory + * `HOMEDRIVE`: Main drive path used to access the home directory (C:) * `HOMEPATH`: Home relative path in the given home drive path ## Macaron (framework used by Gitea) * `HOST`: Host Macaron will listen on * `PORT`: Port Macaron will listen on - * `MACARON_ENV`: global variable to provide special functionality for development environments vs production environments. If MACARON_ENV is set to "" or "development" then templates will be recompiled on every request. For more performance, set the MACARON_ENV environment variable to "production". + * `MACARON_ENV`: global variable to provide special functionality for development environments + vs. production environments. If MACARON_ENV is set to "" or "development" then templates will + be recompiled on every request. For more performance, set the MACARON_ENV environment variable + to "production". ## Miscellaneous - * `SKIP_MINWINSVC`: Do not run as a service on Windows if set to 1 + * `SKIP_MINWINSVC`: If set to 1, do not run as a service on Windows. * `ZOOKEEPER_PATH`: [Zookeeper](http://zookeeper.apache.org/) jar file path - diff --git a/doc/features/authentication.en-us.md b/doc/features/authentication.en-us.md index f4f5ee5f..ba0ec7fe 100644 --- a/doc/features/authentication.en-us.md +++ b/doc/features/authentication.en-us.md @@ -78,7 +78,7 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields: - Bind Password (optional) - The password for the Bind DN specified above, if any. _Note: The password - is stored in plaintext at the server. As such, ensure that your Bind DN + is stored in plaintext at the server. As such, ensure that the Bind DN has as few privileges as possible._ - User Search Base **(required)** @@ -110,7 +110,8 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields: **LDAP using simple auth** adds the following fields: - User DN **(required)** - - A template to use as the user's DN. The `%s` matching parameter will be substituted with login name given on sign-in form. + - A template to use as the user's DN. The `%s` matching parameter will be + substituted with login name given on sign-in form. - Example: `cn=%s,ou=Users,dc=mydomain,dc=com` - Example: `uid=%s,ou=Users,dc=mydomain,dc=com` @@ -141,18 +142,20 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields: ## PAM (Pluggable Authentication Module) -To configure this you just need to set the 'PAM Service Name' to a filename in `/etc/pam.d/`. -If you want it to work with normal Linux passwords, the user running Gitea must have read access to `/etc/shadow`. +To configure PAM, set the 'PAM Service Name' to a filename in `/etc/pam.d/`. To +work with normal Linux passwords, the user running Gitea must have read access +to `/etc/shadow`. ## SMTP (Simple Mail Transfer Protocol) -This option allows Gitea to log in to your SMTP host as a Gitea user. To configure this, simply set the fields below: +This option allows Gitea to log in to an SMTP host as a Gitea user. To +configure this, set the fields below: - Authentication Name **(required)** - A name to assign to the new method of authorization. - SMTP Authentication Type **(required)** - - Type of authentication for use on your SMTP host, PLAIN or LOGIN. + - Type of authentication to use to connect to SMTP host, PLAIN or LOGIN. - Host **(required)** - The address where the SMTP host can be reached. @@ -163,7 +166,8 @@ This option allows Gitea to log in to your SMTP host as a Gitea user. To configu - Example: `587` - Allowed Domains - - Restrict what domains can log in if you're using public SMTP host or SMTP host with multiple domains. + - Restrict what domains can log in if using a public SMTP host or SMTP host + with multiple domains. - Example: `gitea.io,mydomain.com,mydomain2.com` - Enable TLS Encryption @@ -171,15 +175,17 @@ This option allows Gitea to log in to your SMTP host as a Gitea user. To configu - Skip TLS Verify - Disable TLS verify on authentication. - + - This authentication is activate - Enable or disable this auth. ## FreeIPA -- In order to log in to Gitea using FreeIPA credentials, you need to create a bind account for Gitea to use: +- In order to log in to Gitea using FreeIPA credentials,a bind account needs to + be created for Gitea: -- On the FreeIPA server, create a `gitea.ldif` file, replacing `dc=example,dc=com` with your DN, and providing an appropriately secure password: +- On the FreeIPA server, create a `gitea.ldif` file, replacing `dc=example,dc=com` + with your DN, and provide an appropriately secure password: ``` dn: uid=gitea,cn=sysaccounts,cn=etc,dc=example,dc=com changetype: add @@ -191,15 +197,18 @@ This option allows Gitea to log in to your SMTP host as a Gitea user. To configu nsIdleTimeout: 0 ``` -- Import the LDIF (change localhost to an IPA server if needed), you’ll be prompted for your Directory Manager password: +- Import the LDIF (change localhost to an IPA server if needed). A prompt for + Directory Manager password will be presented: ``` ldapmodify -h localhost -p 389 -x -D \ "cn=Directory Manager" -W -f gitea.ldif ``` -- Add an IPA group for gitea_users : +- Add an IPA group for gitea\_users : ``` ipa group-add --desc="Gitea Users" gitea_users ``` -- Note: If you get an error about IPA credentials, please run `kinit admin` and give your admin account password. +- Note: For errors about IPA credentials, run `kinit admin` and provide the + domain admin account password. -- Now login to the Gitea as an Administrator, click on "Authentication" under Admin Panel. Then click `Add New Source` and fill in the details, changing all where appropriate to your own domain. +- Log in to Gitea as an Administrator and click on "Authentication" under Admin Panel. + Then click `Add New Source` and fill in the details, changing all where appropriate. diff --git a/doc/features/webhooks.en-us.md b/doc/features/webhooks.en-us.md index 5fad6881..2220c1ef 100644 --- a/doc/features/webhooks.en-us.md +++ b/doc/features/webhooks.en-us.md @@ -15,11 +15,14 @@ menu: # Webhooks -Gitea supports web hooks for repository events, you can find it in settings page(`/:username/:reponame/settings/hooks`). All event pushes are POST requests, and we currently support two formats: Gitea and Slack. +Gitea supports web hooks for repository events, this can be found in the settings +page(`/:username/:reponame/settings/hooks`). All event pushes are POST requests. +The two methods currently supported are Gitea and Slack. ### Event information -Following shows an example of event information that will be sent by Gitea to Payload URL: +The following is an example of event information that will be sent by Gitea to +a Payload URL: ``` diff --git a/doc/help.en-us.md b/doc/help.en-us.md new file mode 100644 index 00000000..5ad1dd7f --- /dev/null +++ b/doc/help.en-us.md @@ -0,0 +1,13 @@ +--- +date: "2017-01-20T15:00:00+08:00" +title: "Help" +slug: "help" +weight: 50 +toc: false +draft: false +menu: + sidebar: + name: "Help" + weight: 50 + identifier: "help" +--- diff --git a/doc/help/seek-help.en-us.md b/doc/help/seek-help.en-us.md new file mode 100644 index 00000000..1e6e2d28 --- /dev/null +++ b/doc/help/seek-help.en-us.md @@ -0,0 +1,28 @@ +--- +date: "2017-01-20T15:00:00+08:00" +title: "Support Options" +slug: "seek-help" +weight: 10 +toc: true +draft: false +menu: + sidebar: + parent: "help" + name: "Support Options" + weight: 20 + identifier: "seek-help" +--- + +# Support Options + +- [Discord](https://discord.gg/NsatcWJ) +- [#gitea on Freenode](http://webchat.freenode.net?nick=giteachat....&channels=%23gitea&prompt=1) +- [Matrix](https://matrix.to/#/#gitea-dev:matrix.org) + +## Bugs + +If you found a bug, please create an [issue on Github](https://github.com/go-gitea/gitea/issues). + +## Chinese Support + +Support for the Chinese language is provided at [gocn.io](https://gocn.io/topic/Gitea). diff --git a/doc/help/troubleshooting.en-us.md b/doc/help/troubleshooting.en-us.md index aa9af456..1b2a52ca 100644 --- a/doc/help/troubleshooting.en-us.md +++ b/doc/help/troubleshooting.en-us.md @@ -7,7 +7,7 @@ toc: true draft: false menu: sidebar: - parent: "Help" + parent: "help" name: "Troubleshooting" weight: 20 identifier: "troubleshooting" @@ -15,43 +15,41 @@ menu: # Troubleshooting -This page contains some common issues you can run into and their solutions. +This page contains some common seen issues and their solutions. ## SSH issues -If you are having issues with reaching your repositories over `ssh` while the -Gitea web front-end and `https` based git operations work fine, consider -looking at the following items. +For issues reaching repositories over `ssh` while the gitea web front-end, but +`https` based git repository access works fine, consider looking into the following. ``` Permission denied (publickey). fatal: Could not read from remote repository. - -Please make sure you have the correct access rights -and the repository exists. ``` -This error signifies that the server rejected your log in attempt, check the +This error signifies that the server rejected a log in attempt, check the following things: * On the client: * Ensure the public and private ssh keys are added to the correct Gitea user. - * Make sure there are no issues in your remote url, ensure the name of the + * Make sure there are no issues in the remote url, ensure the name of the git user (before the `@`) is spelled correctly. - * Ensure the public and private ssh keys are available and reachable on the - client machine. - * Try to `ssh git@myremote.example` to ensure that everything is set up - properly. + * Ensure public and private ssh keys are correct on client machine. + * Try to connect using ssh (ssh git@myremote.example) to ensure a connection + can be made. * On the server: - * Check the permissions of the `.ssh` directory in the home directory of your - `git` user. + * Make sure the repository exists and is correctly named. + * Check the permissions of the `.ssh` directory in the system user's home directory. * Verify that the correct public keys are added to `.ssh/authorized_keys`. Try to run `Rewrite '.ssh/authorized_keys' file (for Gitea SSH keys)` on the Gitea admin panel. + * Read gitea logs. + * Read /var/log/auth (or similar). + * Check permissions of repositories. -If you get a similar error without the public key part (shown below) then -authentication succeeded, but some other setting is preventing ssh from -reaching the correct repository. +The following is an example of a missing public SSH key where authentication +succeeded, but some other setting is preventing SSH from reaching the correct +repository. ``` fatal: Could not read from remote repository. @@ -63,7 +61,8 @@ and the repository exists. In this case, look into the following settings: * On the server: - * Make sure that your `git` user has a usable shell set. You can verify this - with `getent passwd git | cut -d: -f7`, `chsh` can be used to modify this. + * Make sure that the `git` system user has a usable shell set + * Verify this with `getent passwd git | cut -d: -f7` + * `usermod` or `chsh` can be used to modify this. * Ensure that the `gitea serv` command in `.ssh/authorized_keys` uses the - proper configuration file. + correct configuration file. diff --git a/doc/installation.fr-fr.md b/doc/installation.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/installation/from-binary.en-us.md b/doc/installation/from-binary.en-us.md index f47f1de3..91f81f73 100644 --- a/doc/installation/from-binary.en-us.md +++ b/doc/installation/from-binary.en-us.md @@ -15,7 +15,10 @@ menu: # Installation from binary -All downloads come with SQLite, MySQL and PostgreSQL support, and are built with embedded assets. Keep in mind that this can be different for older releases. The installation based on our binaries is quite simple, just choose the file matching your platform from the [downloads page](https://dl.gitea.io/gitea), copy the URL and replace the URL within the commands below: +All downloads come with SQLite, MySQL and PostgreSQL support, and are built with +embedded assets. This can be different for older releases. Choose the file matching +the destination platform from the [downloads page](https://dl.gitea.io/gitea), copy +the URL and replace the URL within the commands below: ``` wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64 @@ -24,7 +27,8 @@ chmod +x gitea ## Test -After following the steps above you will have a `gitea` binary within your working directory, first you can test it if it works like expected and afterwards you can copy it to the destination where you want to store it. When you launch Gitea manually from your CLI you can always kill it by hitting `Ctrl + C`. +After getting a binary, it can be tested with `./gitea web` or moved to a permanent +location. When launched manually, Gitea can be killed using `Ctrl+C`. ``` ./gitea web @@ -34,12 +38,16 @@ After following the steps above you will have a `gitea` binary within your worki ### Old glibc versions -Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to load the Gitea binary, usually resulting an error like ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./gitea)```. This is due to the integrated SQLite support in the binaries we provide. In the future, we will provide binaries without the requirement for glibc. As a workaround, you can upgrade your distribution or [install from source]({{< relref "from-source.en-us.md" >}}). +Older Linux distributions (such as Debian 7 and CentOS 6) may not be able to load the +Gitea binary, usually producing an error such as ```./gitea: /lib/x86_64-linux-gnu/libc.so.6: +version `GLIBC\_2.14' not found (required by ./gitea)```. This is due to the integrated +SQLite support in the binaries provided by dl.gitea.io. In this situation, it is usually +possible to [install from source]({{< relref "from-source.en-us.md" >}}) without sqlite +support. ### Running gitea on another port -If getting an error like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: bind: address already in use` gitea needs to be started on another free port. This is possible using `./gitea web -p $PORT`. - -## Anything missing? - -Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. +For errors like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:3000: +bind: address already in use` gitea needs to be started on another free port. This +is possible using `./gitea web -p $PORT`. It's possible another instance of gitea +is already running. diff --git a/doc/installation/from-binary.fr-fr.md b/doc/installation/from-binary.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/installation/from-package.en-us.md b/doc/installation/from-package.en-us.md index 94f0815d..9fdf30d7 100644 --- a/doc/installation/from-package.en-us.md +++ b/doc/installation/from-package.en-us.md @@ -15,17 +15,30 @@ menu: # Installation from package -## Linux +## Debian -We have not published any real package yet, we will update this page directly when we start to publish packages for any Linux distribution, in the meantime you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. +The only distribution that has any "official" package of Gitea is Debian. This is currently +in Debian's [contrib](https://wiki.debian.org/SourcesList). This is (currently) only available +in Debian testing and unstable (but should be installable/functional on stable). + +- Edit /etc/apt/sourced.list + - Add "contrib" to "deb http://deb.debian.org/debian unstable main contrib" +- apt-get update +- apt-get install gitea + +For other distributions, see the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide. ## Windows -We have not published any package for Windows yet, we will update this page directly when we start to publish packages in the form of `MSI` installers or via [Chocolatey](https://chocolatey.org/), in the meantime you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. +There are no published packages for Windows. This page will change when packages are published, +in the form of `MSI` installers or via [Chocolatey](https://chocolatey.org/). In the meantime +the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide. ## macOS -Currently we only support the installation via `brew` for macOS. If you are not using [Homebrew](http://brew.sh/) you should follow our [installation from binary]({{< relref "from-binary.en-us.md" >}}) guide. To install Gitea via `brew` you just need to execute the following commands: +Currently, the only supported method of installation on MacOS is [Homebrew](http://brew.sh/). +Following the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide may work, +but is not supported. To install Gitea via `brew`: ``` brew tap go-gitea/gitea @@ -34,13 +47,14 @@ brew install gitea ## FreeBSD -A FreeBSD port `www/gitea` is available. You can install a pre-built binary package: +A FreeBSD port `www/gitea` is available. To install the pre-built binary package: ``` pkg install gitea ``` -For the most up to date version, or to build the port with custom options, [install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html): +For the most up to date version, or to build the port with custom options, +[install it from the port](https://www.freebsd.org/doc/handbook/ports-using.html): ``` su - @@ -48,10 +62,8 @@ cd /usr/ports/www/gitea make install clean ``` -The port uses the standard FreeBSD file system layout: config files are in `/usr/local/etc/gitea`, bundled templates, options, plugins and themes are in `/usr/local/share/gitea`, and a start script is in `/usr/local/etc/rc.d/gitea`. +The port uses the standard FreeBSD file system layout: config files are in `/usr/local/etc/gitea`, +bundled templates, options, plugins and themes are in `/usr/local/share/gitea`, and a start script +is in `/usr/local/etc/rc.d/gitea`. -To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it with `service gitea start`. - -## Anything missing? - -Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. +To enable Gitea to run as a service, run `sysrc gitea_enable=YES` and start it with `service gitea start`. diff --git a/doc/installation/from-package.fr-fr.md b/doc/installation/from-package.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/installation/from-source.en-us.md b/doc/installation/from-source.en-us.md index a6686d8b..b4f804fd 100644 --- a/doc/installation/from-source.en-us.md +++ b/doc/installation/from-source.en-us.md @@ -15,52 +15,66 @@ menu: # Installation from source -We won't cover the basics of a Golang setup within this guide. If you don't know how to get the environment up and running you should follow the official [install instructions](https://golang.org/doc/install). +This section will not include basic [installation instructions](https://golang.org/doc/install). **Note**: Go version 1.7 or higher is required ## Download -First of all you have to retrieve the source code, the easiest way is to simply use directly Go for that. Just call the following commands to fetch the source and to switch into the working directory. +First retrieve the source code. The easiest way is to use the Go tool. Use the following +commands to fetch the source and switch into the source directory. ``` go get -d -u code.gitea.io/gitea cd $GOPATH/src/code.gitea.io/gitea ``` -Now it's time to decide which version of Gitea you want to build and install. Currently there are multiple options you can choose from. If you want to build our `master` branch you can directly go ahead to the [build section](#build), this branch represents our current development version and this is not intended for production use. - -If you want to build the latest stable version that acts as a development branch for the tagged releases you can see the available branches and how to checkout this branch with these commands: +Decide which version of Gitea to build and install. Currently, there are multiple options +to choose from. The `master` branch represents the current development version. To build +with master, skip to the [build section](#build). +To work with tagged releases, the following commands can be used: ``` git branch -a git checkout v1.0 ``` -If you would validate a Pull Request, first your must enable this new branch : (`xyz` is the PR id, for example `2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)) +To validate a Pull Request, first enable the new branch (`xyz` is the PR id; for example +`2663` for [#2663](https://github.com/go-gitea/gitea/pull/2663)): ``` git fetch origin pull/xyz/head:pr-xyz ``` -Last but not least you can also directly build our tagged versions like `v1.0.0`, if you want to build Gitea from the source this is the suggested way for that. To use the tags you need to list the available tags and checkout a specific tag with the following commands: +To build Gitea from source at a specific tagged release (like v1.0.0), list the available +tags and check out the specific tag. + +List available tags with the following. ``` git tag -l -git checkout v1.0.0 -git checkout pr-xyz +git checkout v1.0.0 # or git checkout pr-xyz ``` ## Build -Since we already bundle all required libraries to build Gitea you can continue with the build process itself. We provide various [make tasks](https://github.com/go-gitea/gitea/blob/master/Makefile) to keep the build process as simple as possible. See here how to get Make. Depending on your requirements you possibly want to add various build tags, you can choose between these tags: +Since all required libraries are already bundled in the Gitea source, it's +possible to build Gitea with no additional downloads. Various +[make tasks](https://github.com/go-gitea/gitea/blob/master/Makefile) are +provided to keep the build process as simple as possible. +See here how to get Make. +Depending on requirements, the following build tags can be included. -* `bindata`: With this tag you can embed all assets required to run an instance of Gitea, this makes a deployment quite easy because you don't need to care about any additional file. -* `sqlite`: With this tag you can enable support for a [SQLite3](https://sqlite.org/) database, this is only suggested for tiny Gitea installations. -* `tidb`: With this tag you can enable support for a [TiDB](https://github.com/pingcap/tidb) database, it's a quite simple file-based database comparable with SQLite. -* `pam`: With this tag you can enable support for PAM (Linux Pluggable Authentication Modules), this is useful if your users should be authenticated via your available system users. +* `bindata`: Build a single monolithic binary, with all assets included. +* `sqlite`: Enable support for a [SQLite3](https://sqlite.org/) database. Suggested only + for tiny installations. +* `tidb`: Enable support for a [TiDB](https://github.com/pingcap/tidb) database. +* `pam`: Enable support for PAM (Linux Pluggable Authentication Modules). Can be used to + authenticate local users or extend authentication to methods available to PAM. -Now it's time to build the binary, we suggest to embed the assets with the `bindata` build tag, to include the assets you also have to execute the `generate` make task, otherwise the assets are not prepared to get embedded: +Bundling assets into the binary using the `bindata` build tag can make development and +testing easier, but is not ideal for a production deployment. To include assets, they +must be built separately using the `generate` make task. ``` TAGS="bindata" make generate build @@ -68,12 +82,10 @@ TAGS="bindata" make generate build ## Test -After following the steps above you will have a `gitea` binary within your working directory, first you can test it if it works like expected and afterwards you can copy it to the destination where you want to store it. When you launch Gitea manually from your CLI you can always kill it by hitting `Ctrl + C`. +After following the steps above a `gitea` binary will be available in the working directory. +It can be tested from this directory or moved to a directory with test data. When Gitea is +launched manually from command line, it can be killed by pressing `Ctrl + C`. ``` ./gitea web ``` - -## Anything missing? - -Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. diff --git a/doc/installation/from-source.fr-fr.md b/doc/installation/from-source.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/installation/run-as-service-in-ubuntu.en-us.md b/doc/installation/run-as-service-in-ubuntu.en-us.md index 3d58167b..e004e3a0 100644 --- a/doc/installation/run-as-service-in-ubuntu.en-us.md +++ b/doc/installation/run-as-service-in-ubuntu.en-us.md @@ -13,56 +13,55 @@ menu: identifier: "linux-service" --- -### Run as service in Ubuntu 16.04 LTS - -#### Using systemd +### Run as service in Ubuntu 16.04 LTS -Run below command in terminal: +#### Using systemd + +Run the below command in a terminal: ``` sudo vim /etc/systemd/system/gitea.service -``` - -Add code to the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service). - -Uncomment any service need to be enabled like mysql in this case in Unit section. - -Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. - -Lastly start and enable gitea at boot: ``` -sudo systemctl start gitea -``` + +Copy the sample [gitea.service](https://github.com/go-gitea/gitea/blob/master/contrib/systemd/gitea.service). + +Uncomment any service that needs to be enabled on this host, such as MySQL. + +Change the user, home directory, and other required startup values. Change the +PORT or remove the -p flag if default port is used. + +Enable and start gitea at boot: ``` sudo systemctl enable gitea -``` +sudo systemctl start gitea +``` -#### Using supervisor +#### Using supervisor -Install supervisor by running below command in terminal: +Install supervisor by running below command in terminal: ``` sudo apt install supervisor -``` - -Create a log dir for the supervisor logs(assuming gitea is installed in /home/git/gitea/): ``` -mkdir /home/git/gitea/log/supervisor -``` -Open supervisor config file in vi/vim/nano etc. +Create a log dir for the supervisor logs: +``` +# assuming gitea is installed in /home/git/gitea/ +mkdir /home/git/gitea/log/supervisor +``` + +Open supervisor config file in a file editor: ``` sudo vim /etc/supervisor/supervisord.conf -``` - -And append the code at the end of the file from [here](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea). - -Change the user(git) accordingly to yours. And /home/git too if your username is different than git. Change the PORT or remove the -p flag if default port is used. - -Lastly start and enable supervisor at boot: ``` -sudo systemctl start supervisor -``` + +Append the configuration from the sample +[supervisord config](https://github.com/go-gitea/gitea/blob/master/contrib/supervisor/gitea). + +Change the user(git) and home(/home/git) settings to match the deployment +environment. Change the PORT or remove the -p flag if default port is used. + +Lastly enable and start supervisor at boot: ``` sudo systemctl enable supervisor -``` - +sudo systemctl start supervisor +``` diff --git a/doc/installation/windows-service.en-us.md b/doc/installation/windows-service.en-us.md index 0092c261..4955204d 100644 --- a/doc/installation/windows-service.en-us.md +++ b/doc/installation/windows-service.en-us.md @@ -15,19 +15,22 @@ menu: # Register as a Windows Service -To register Gitea as a Windows service, first run `cmd` as an Administrator, and then run the following command: +To register Gitea as a Windows service, open a command prompt (cmd) as an Administrator, +then run the following command: ``` sc create gitea start= auto binPath= ""C:\gitea\gitea.exe" web --config "C:\gitea\custom\conf\app.ini"" ``` -Do not forget to replace `C:\gitea` with your real Gitea folder. +Do not forget to replace `C:\gitea` with the correct Gitea directory. -After, open "Windows Services", search for the service named "gitea", right-click it and click on "Run". If everything is OK you should be able to reach Gitea on `http://localhost:3000` (or the port is was configured, if different than 3000). +Open "Windows Services", search for the service named "gitea", right-click it and click on +"Run". If everything is OK Gitea will be reachable on `http://localhost:3000` (or the port +that was configured). ## Unregister as a service -To unregister Gitea as a service, open `cmd` as an Administrator and run: +To unregister Gitea as a service, open a command prompt (cmd) as an Administrator and run: ``` sc delete gitea diff --git a/doc/installation/windows-service.fr-fr.md b/doc/installation/windows-service.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/installation/with-docker.en-us.md b/doc/installation/with-docker.en-us.md index c41c9328..c4763914 100644 --- a/doc/installation/with-docker.en-us.md +++ b/doc/installation/with-docker.en-us.md @@ -15,13 +15,19 @@ menu: # Installation with Docker -We provide automatically updated Docker images within our Docker Hub organization. It is up to you and your deployment to always use the latest stable tag or to use another service that updates the Docker image for you. +Gitea provides automatically updated Docker images within its Docker Hub organization. It is +possible to always use the latest stable tag or to use another service that handles updating +Docker images. -This reference setup guides you through the setup based on `docker-compose`, the installation of `docker-compose` is out of scope of this documentation. To install `docker-compose` follow the official [install instructions](https://docs.docker.com/compose/install/). +This reference setup guides users through the setup based on `docker-compose`, the installation +of `docker-compose` is out of scope of this documentation. To install `docker-compose` follow +the official [install instructions](https://docs.docker.com/compose/install/). ## Basics -The most simple setup just creates a volume and a network and starts the `gitea/gitea:latest` image as a service. Since there is no database available you can start it only with SQLite3. Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`. +The most simple setup just creates a volume and a network and starts the `gitea/gitea:latest` +image as a service. Since there is no database available one can be initialized using SQLite3. +Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`. ```yaml version: "2" @@ -45,7 +51,9 @@ services: ## Custom port -To bind the integrated openSSH daemon and the webserver on a different port, you just need to adjust the port section. It's common to just change the host port and keep the ports within the container like they are. +To bind the integrated openSSH daemon and the webserver on a different port, adjust +the port section. It's common to just change the host port and keep the ports within +the container like they are. ```diff version: "2" @@ -71,7 +79,8 @@ services: ## MySQL database -To start Gitea in combination with a MySQL database you should apply these changes to the `docker-compose.yml` file created above. +To start Gitea in combination with a MySQL database, apply these changes to the +`docker-compose.yml` file created above. ```diff version: "2" @@ -110,7 +119,8 @@ services: ## PostgreSQL database -To start Gitea in combination with a PostgreSQL database you should apply these changes to the `docker-compose.yml` file created above. +To start Gitea in combination with a PostgreSQL database, apply these changes to +the `docker-compose.yml` file created above. ```diff version: "2" @@ -148,7 +158,9 @@ services: ## Named volumes -To use named volumes instead of host volumes you just have to define and use the named volume within the `docker-compose.yml` configuration. This change will automatically create the required volume. +To use named volumes instead of host volumes, define and use the named volume +within the `docker-compose.yml` configuration. This change will automatically +create the required volume. ```diff version: "2" @@ -175,24 +187,31 @@ services: - "222:22" ``` -If you are using MySQL or PostgreSQL it's up to you to create named volumes for these containers as well. +MySQL or PostgreSQL containers will need to be created separately. ## Start -To start this setup based on `docker-compose` you just have to execute `docker-compose up -d` to launch Gitea in the background. You can see if it started properly via `docker-compose ps`, and you can tail the log output via `docker-compose logs`. +To start this setup based on `docker-compose`, execute `docker-compose up -d`, +to launch Gitea in the background. Using `docker-compose ps` will show if Gitea +started properly. Logs can be viewed with `docker-compose logs`. -If you want to shutdown the setup again just execute `docker-compose down`, this will stop and kill the containers, the volumes will still exist. +To shut down the setup, execute `docker-compose down`. This will stop +and kill the containers. The volumes will still exist. -Notice: if you use a non 3000 port on http, you need change app.ini `LOCAL_ROOT_URL = http://localhost:3000/`. +Notice: if using a non-3000 port on http, change app.ini to match +`LOCAL_ROOT_URL = http://localhost:3000/`. ## Install -After starting the Docker setup via `docker-compose` you should access Gitea with your favorite browser to finalize the installation. Please visit http://server-ip:3000 and follow the installation wizard. If you have started a database with the `docker-compose` setup as documented above please note that you have to use `db` as the database hostname. +After starting the Docker setup via `docker-compose` Gitea should be available using a +favorite browser to finalize the installation. Visit http://server-ip:3000 and follow the +installation wizard. If the database was started with the `docker-compose` setup as +documented above please note that `db` must be used as the database hostname. # Customization -Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should be placed in `/data/gitea` directory. If you are using host volumes it's quite easy to access these files, for named volumes you have to do it through another container or you should directly access `/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at `/data/gitea/conf/app.ini` after the installation. - -# Anything missing? - -Are we missing anything on this page? Then feel free to reach out to us on our [Discord server](https://discord.gg/NsatcWJ), there you will get answers to any question pretty fast. +Customization files described [here](https://docs.gitea.io/en-us/customizing-gitea/) should +be placed in `/data/gitea` directory. If using host volumes it's quite easy to access these +files; for named volumes this is done through another container or by direct access at +`/var/lib/docker/volumes/gitea_gitea/_data`. The configuration file will be saved at +`/data/gitea/conf/app.ini` after the installation. diff --git a/doc/installation/with-docker.fr-fr.md b/doc/installation/with-docker.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/upgrade.fr-fr.md b/doc/upgrade.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/upgrade/from-gogs.en-us.md b/doc/upgrade/from-gogs.en-us.md index 67bcc8d4..93f2e13a 100644 --- a/doc/upgrade/from-gogs.en-us.md +++ b/doc/upgrade/from-gogs.en-us.md @@ -15,25 +15,28 @@ menu: # Upgrade from Gogs -Gogs versions up to 0.9.146 (db schema version 15) can be smoothly upgraded to Gitea. +Gogs, version 0.9.146 and older, can be easily migrated to Gitea. -There are some steps to do so below. On Unix run as your Gogs user: +There are some basic steps to follow. On a Linux system run as the Gogs user: -* Create a Gogs backup with `gogs dump`. This creates `gogs-dump-[timestamp].zip` file containing all your Gogs data. -* Download the file matching your platform from the [downloads page](https://dl.gitea.io/gitea). +* Create a Gogs backup with `gogs dump`. This creates `gogs-dump-[timestamp].zip` file + containing all important Gogs data. +* Download the file matching the destination platform from the [downloads page](https://dl.gitea.io/gitea). * Put the binary at the desired install location. * Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini`. -* If you have custom `templates, public` in `gogs/custom/` copy them to `gitea/custom/`. -* If you have any other custom folders like `gitignore, label, license, locale, readme` in `gogs/custom/conf` copy them to `gitea/custom/options`. +* Copy custom `templates, public` from `gogs/custom/` to `gitea/custom/`. +* For any other custom folders, such as `gitignore, label, license, locale, readme` in + `gogs/custom/conf`, copy them to `gitea/custom/options`. * Copy `gogs/data/` to `gitea/data/`. It contains issue attachments and avatars. * Verify by starting Gitea with `gitea web`. -* Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file`, then run `Rewrite all update hook of repositories` (needed when custom config path is changed). +* Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file`. +* If custom or config path was changed, run `Rewrite all update hook of repositories`. ### Change gogs specific information: * Rename `gogs-repositories/` to `gitea-repositories/` * Rename `gogs-data/` to `gitea-data/` -* In your `gitea/custom/conf/app.ini` change: +* In `gitea/custom/conf/app.ini` change: FROM: ``` @@ -63,19 +66,22 @@ ROOT_PATH = /home/:USER/gitea/log ### Troubleshooting -* If you encounter errors relating to custom templates in the `gitea/custom/templates` folder, try moving the templates causing the errors away one by one. They may not be compatible with Gitea. +* If errors are encountered relating to custom templates in the `gitea/custom/templates` + folder, try moving the templates causing the errors away one by one. They may not be + compatible with Gitea or an update. ### Add Gitea to startup on Unix -Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib) with the right environment variables. +Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib) +with the right environment variables. -For distro's with systemd: +For distros with systemd: * Copy the updated script to `/etc/systemd/system/gitea.service` * Add the service to the startup with: `sudo systemctl enable gitea` * Disable old gogs startup script: `sudo systemctl disable gogs` -For distro's with SysVinit: +For distros with SysVinit: * Copy the updated script to `/etc/init.d/gitea` * Add the service to the startup with: `sudo rc-update add gitea` diff --git a/doc/upgrade/from-gogs.fr-fr.md b/doc/upgrade/from-gogs.fr-fr.md old mode 100755 new mode 100644 diff --git a/doc/usage/backup-and-restore.en-us.md b/doc/usage/backup-and-restore.en-us.md index 4346c6da..aa1e4805 100644 --- a/doc/usage/backup-and-restore.en-us.md +++ b/doc/usage/backup-and-restore.en-us.md @@ -15,11 +15,13 @@ menu: # Backup and Restore -Gitea currently has a `dump` command that will save your installation to a zip file. There will be a `restore` command implemented at some point in the future. You will be able to use this to back up your installation, as well as make migrating servers easier. +Gitea currently has a `dump` command that will save the installation to a zip file. This +file can be unpacked and used to restore an instance. ## Backup Command (`dump`) -First, switch to the user running gitea: `su git` (or whatever user you are using). Run `./gitea dump` in the gitea installation directory. You should see some output similar to this: +Switch to the user running gitea: `su git`. Run `./gitea dump` in the gitea installation +directory. There should be some output similar to the following: ``` 2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001 @@ -30,17 +32,31 @@ First, switch to the user running gitea: `su git` (or whatever user you are usin 2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip ``` -Inside the `gitea-dump-1482906742.zip` file, you will find the following: +Inside the `gitea-dump-1482906742.zip` file, will be the following: -* `custom/conf/app.ini` - This is your server config. -* `gitea-db.sql` - SQL dump of your database. -* `gitea-repo.zip` - This zip will be a complete copy of your repo folder. - See Config -> repository -> `ROOT` for the location. -* `log/` - this will contain various logs. You don't need these if you are doing - a migration. +* `custom/conf/app.ini` - Server config. +* `gitea-db.sql` - SQL dump of database +* `gitea-repo.zip` - Complete copy of the repository directory. +* `log/` - Various logs. They are not needed for a recovery or migration. -Intermediate backup files are created in a temporary directory specified either with the `--tempdir` command-line parameter or the `TMPDIR` environment variable. +Intermediate backup files are created in a temporary directory specified either with the +`--tempdir` command-line parameter or the `TMPDIR` environment variable. ## Restore Command (`restore`) -WIP: Does not exist yet. +There is currently no support for a recovery command. It is a manual process that mostly +involves moving files to their correct locations and restoring a database dump. + +Example: +``` +apt-get install gitea +unzip gitea-dump-1482906742.zip +cd gitea-dump-1482906742 +mv custom/conf/app.ini /etc/gitea/conf/app.ini +unzip gitea-repo.zip +mv gitea-repo/* /var/lib/gitea/repositories/ +chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/ +mysql -u$USER -p$PASS $DATABASE Date: Wed, 10 Jan 2018 07:19:50 +0100 Subject: [PATCH 0018/1282] Templates for extra links in top navbar and repo tool tabs. (#3308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These templates add content to the top navbar and to the repository page. This way we do not have to copy and modify the whole template, and re-modify it after upgrading Gitea if it changes. Signed-off-by: Alberto González Palomo --- doc/advanced/customizing-gitea.en-us.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/advanced/customizing-gitea.en-us.md index 5be30740..55e47d02 100644 --- a/doc/advanced/customizing-gitea.en-us.md +++ b/doc/advanced/customizing-gitea.en-us.md @@ -66,6 +66,8 @@ To add custom HTML to the header or the footer of the page, in the `templates/cu directory there is `header.tmpl` and `footer.tmpl` that can be modified. This can be a useful place to add custom CSS files or additional Javascript. +If all you want is to add extra links to the top navigation bar, or extra tabs to the repository view, you can put them in `extra_links.tmpl` and `extra_tabs.tmpl` inside your `custom/templates/custom/` directory. + ## Customizing gitignores, labels, licenses, locales, and readmes. Place custom files in corresponding sub-folder under `custom/options`. From 0a13e391e9d8f85c01fd061a4002684bc407bc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Gonz=C3=A1lez=20Palomo?= Date: Thu, 11 Jan 2018 20:56:40 +0100 Subject: [PATCH 0019/1282] Improve documentation about custom templates. (#3345) Now includes all the template hooks in the page, and a detailed example for the common case of adding an "about" page. --- doc/advanced/customizing-gitea.en-us.md | 26 ++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/doc/advanced/customizing-gitea.en-us.md b/doc/advanced/customizing-gitea.en-us.md index 55e47d02..9343b063 100644 --- a/doc/advanced/customizing-gitea.en-us.md +++ b/doc/advanced/customizing-gitea.en-us.md @@ -62,12 +62,32 @@ matching source. Any statement contained inside `{{` and `}}` are Gitea's templete syntax and shouldn't be touched without fully understanding these components. -To add custom HTML to the header or the footer of the page, in the `templates/custom` -directory there is `header.tmpl` and `footer.tmpl` that can be modified. This can be -a useful place to add custom CSS files or additional Javascript. +### Adding links and tabs If all you want is to add extra links to the top navigation bar, or extra tabs to the repository view, you can put them in `extra_links.tmpl` and `extra_tabs.tmpl` inside your `custom/templates/custom/` directory. +For instance, let's say you are in Germany and must add the famously legally-required "Impressum"/about page, listing who is responsible for the site's content: +just place it under your "custom/public/" directory (for instance `custom/public/impressum.html`) and put a link to it in `custom/templates/custom/extra_links.tmpl`. + +To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL: +`Impressum` + +You can add new tabs in the same way, putting them in `extra_tabs.tmpl`. +The exact HTML needed to match the style of other tabs is in the file +`templates/repo/header.tmpl` +([source in GitHub](https://github.com/go-gitea/gitea/blob/master/templates/repo/header.tmpl)) + +### Other additions to the page + +Apart from `extra_links.tmpl` and `extra_tabs.tmpl`, there are other useful templates you can put in your `custom/templates/custom/` directory: + +- `header.tmpl`, just before the end of the `` tag where you can add custom CSS files for instance. +- `body_outer_pre.tmpl`, right after the start of ``. +- `body_inner_pre.tmpl`, before the top navigation bar, but already inside the main container `
`. +- `body_inner_post.tmpl`, before the end of the main container. +- `body_outer_post.tmpl`, before the bottom `