Skip to content

Commit 834c6f7

Browse files
committed
Authentication
1 parent 637eed4 commit 834c6f7

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed

en-US/features/authentication.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@ name: Authentication
44

55
# Authentication
66

7-
## LDAP
7+
## Load authentication source from file
8+
9+
Starting from `0.11.45.0412`, you can define authentication source in local files to help better automate setup process.
10+
11+
Files with suffix `.conf` under `conf/auth.d` of custom directory will be recognized as authentication sources. For example, `custom/conf/auth.d/my_auth_source.conf`. As long as the file name ends with `.conf`, you can name it to something help you remember. You can find examples of all supported types [here](https://github.com/gogits/gogs/tree/f2ecfdc96a338815ffb2be898b3114031f0da48c/conf/auth.d).
12+
13+
Once files are loaded, they will appear in the **Admin Panel - Authentication Sources** page as before. They also work nicely with authentication sources defined in the database.
14+
15+
![](/docs/images/auth_sources.png)
16+
17+
However, do not try to edit file directly but edit via web interface because files are only read once when Gogs starts.
18+
19+
## Configuration
20+
21+
### LDAP
822

923
Both the LDAP via BindDN and the simple auth LDAP share the following fields:
1024

@@ -110,12 +124,12 @@ Both the LDAP via BindDN and the simple auth LDAP share the following fields:
110124
* Which group LDAP attribute contains an array above user attribute names.
111125
* Example: `memberUid`
112126

113-
## PAM
127+
### PAM
114128

115-
To configure this you just need to set the 'PAM Service Name' to a filename in `/etc/pam.d/`.
129+
To configure this you just need to set the **PAM Service Name** to a filename in `/etc/pam.d/`.
116130
If you want it to work with normal Linux passwords, the user running Gogs must have read access to `/etc/shadow`.
117131

118-
## SMTP
132+
### SMTP
119133

120134
This option allows Gogs to log in to your SMTP host as a Gogs user. To configure this, simply set the fields below:
121135

@@ -145,7 +159,7 @@ This option allows Gogs to log in to your SMTP host as a Gogs user. To configure
145159
- This authentication is activate
146160
- Enable or disable this auth.
147161

148-
## Freeipa
162+
### Freeipa
149163

150164
- In order to login to the Gogs using FreeIPA credentials, you need to create a bind account for Gogs to use:
151165

@@ -174,5 +188,5 @@ This option allows Gogs to log in to your SMTP host as a Gogs user. To configure
174188

175189
- Now login to the gogs as an Admin, click on “Authentication” under Admin Panel. Then click New LDAP Source and fill in the details, changing all where appropriate to your own domain as photo below:
176190

177-
![Freeipa-Gogs](https://raw.githubusercontent.com/Karen09/docs/master/images/Freeipa-Gogs.png)
191+
![](/docs/images/Freeipa-Gogs.png)
178192

images/auth_sources.png

35 KB
Loading

zh-CN/features/authentication.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@ name: 授权认证
44

55
# 授权认证
66

7-
## LDAP
7+
## 从本地文件加载认证源
8+
9+
`0.11.45.0412` 版本起,您可以通过在本地文件中定义认证源来简化自动化部署流程。
10+
11+
凡是在自定义路径的 `conf/auth.d` 目录下以 `.conf` 结尾的文件都将被识别为认证源。例如,`custom/conf/auth.d/my_auth_source.conf`。您可以随意命名这些文件帮助记忆,只要保证以 `.conf` 结尾即可。所有支持类型的示例文件可以在 [这里](https://github.com/gogits/gogs/tree/f2ecfdc96a338815ffb2be898b3114031f0da48c/conf/auth.d) 查看。
12+
13+
当文件加载完成之后,您就可以通过 **管理面板 - 认证源管理** 页面进行查看。通过本地文件加载和存储在数据库中的认证源相互兼容,并不冲突。
14+
15+
![](/docs/images/auth_sources.png)
16+
17+
不过需要注意的是,由于只有在 Gogs 启动时才会加载相关文件,请使用 Web 界面而不是直接编辑文件。
18+
19+
## 认证源配置
20+
21+
### LDAP
822

923
基于 BindDN 和 simple auth 的 LDAP 授权方式共享以下字段:
1024

@@ -110,12 +124,12 @@ name: 授权认证
110124
* Which user LDAP attribute is listed in the group.
111125
* Example: `uid`
112126

113-
## PAM
127+
### PAM
114128

115-
To configure this you just need to set the 'PAM Service Name' to a filename in `/etc/pam.d/`.
129+
To configure this you just need to set the **PAM Service Name** to a filename in `/etc/pam.d/`.
116130
If you want it to work with normal Linux passwords, the user running Gogs must have read access to `/etc/shadow`.
117131

118-
## SMTP
132+
### SMTP
119133

120134
Gogs 支持通过指定邮箱服务器来对用户进行创建和认证,可以通过配置以下选项启用该功能:
121135

@@ -145,7 +159,7 @@ Gogs 支持通过指定邮箱服务器来对用户进行创建和认证,可以
145159
- This authentication is activate
146160
- Enable or disable this auth.
147161

148-
## Freeipa
162+
### Freeipa
149163

150164
- In order to login to the Gogs using FreeIPA credentials, you need to create a bind account for Gogs to use:
151165

@@ -174,4 +188,4 @@ Gogs 支持通过指定邮箱服务器来对用户进行创建和认证,可以
174188

175189
- Now login to the gogs as an Admin, click on “Authentication” under Admin Panel. Then click New LDAP Source and fill in the details, changing all where appropriate to your own domain as photo below:
176190

177-
![Freeipa-Gogs](https://raw.githubusercontent.com/Karen09/docs/master/images/Freeipa-Gogs.png)
191+
![](/docs/images/Freeipa-Gogs.png)

0 commit comments

Comments
 (0)