gogs 邮箱服务配置 设置管理员账号

第一步,登录邮箱配置开启smtp服务,并申请授权。以我的qq邮箱为例子。

gogs 邮箱服务配置 设置管理员账号_第1张图片

点击上图二维码旁边的“生成授权码”后,按要求发送短信。得到我的授权码类似如下。

找到app.ini文件

添加邮箱配置

[mailer]

ENABLED = true

HOST    = smtp.qq.com:25

FROM    = ***@qq.com

USER    = ***@qq.com

PASSWD  = *****

 

PASSWD填写申请的授权码。

配置好之后,重启网站服务,就好了。

 

设置管理员账号

登录mysql

zhangym@zhangym:~/catws/src/bluerov_ros_playground/launch$ mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3604
Server version: 5.7.27-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| gogs               |
| gogsdb             |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
6 rows in set (0.00 sec)

mysql> use gogs;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> update user set is_admin=1 where id=1;
Query OK, 1 row affected (0.50 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select id, is_admin from user;
+----+----------+
| id | is_admin |
+----+----------+
|  1 |        1 |
|  2 |        0 |
|  3 |        0 |
|  4 |        0 |
|  5 |        0 |
|  6 |        0 |
|  7 |        0 |
+----+----------+
7 rows in set (0.00 sec)
gogs 邮箱服务配置 设置管理员账号_第2张图片

可以访问管理员页面了,哈哈哈

gogs 邮箱服务配置 设置管理员账号_第3张图片

你可能感兴趣的:(ASP.NET,网站,gogs,邮箱服务配置,增加管理员账号)