SSD
It's a bit moldy this week. First, it hangs up on the machine for daily use, and it can't be recognized at all.
Two days later, on the small machine used to write articles, 500G
the mechanical hard disk also hung up, and I re-formatted it, and hung it 玩客云
up as a download disk.
Fortunately, there are backups, but the restoration Docker
of is a bit troublesome, such as:
HomeAssistant
, using the previously exportedsyno.txz
and re- imported, the configuration file has not been moved, but there are still various problems;messense/aliyundrive-webdav
Iflatest
the version ,Hyper Backup
it will be displayed in the log when backing upHTTP status client error (400 Bad Request) for url (https://openapi.aliyundrive.com/adrive/v1.0/openFile/get_by_path)
;vaultwarden/server
If you uselatest
the version , you will always report an error when you log inUsername or Password is incorrect. Try again.
, and it will be displayed in the log(login) POST /identity/connect/token => 400 Bad Request
;
vps
This week, Tencent’s cloudflare tunnel
.
The software in this article
不长到一百四誓不改名
is recommended ; but Lao Su does not know how to use it, and his level willgit clone
only use it;
What is Gitea?
Gitea
The primary goal of the service is to create a self-builtGit
service . We useGo
as the back-end language, which allows us to only generate an executable program. And he also supports cross-platform, supportsLinux
,macOS
andWindows
and various architectures, in additionx86
toamd64
, also includesARM
andPowerPC
.
If you don't want to build it yourself, you can go online demo
: https://try.gitea.io
Install
build database
Lao Su used MariaDB 10
the database .
phpMyAdmin
Create an empty database named in gitea
.
For illustration purposes, assume the database password is
123456
Therefore, according to the above settings, the final database-related parameters are as follows:
- Database host:
192.168.0.197
,IP
consistent ; - Database port:
3307
, if you useMariaDB 5
it3306
, but Lao Su didn’t test it; - Database user:
gitea
- Database password:
123456
- Database name:
gitea
, because the same name as the user is selected;
install mirror
Install it in Docker mode on Synology.
If you are familiar with the command line, it may be docker cli
faster
When Lao Su is tossing,
latest
the corresponding version is1.19.3
# 新建文件夹 gitea 和 子目录
mkdir -p /volume2/docker/gitea/data
# 进入 gitea 目录
cd /volume2/docker/gitea
# 运行容器
docker run -d \
--restart always \
--name gitea \
-p 3231:3000 \
-p 222:22 \
-v $(pwd)/data:/data \
-v /etc/TZ:/etc/TZ:ro \
-v /etc/localtime:/etc/localtime:ro \
-e USER_UID=1000 \
-e USER_GID=1000 \
-e GITEA__database__DB_TYPE=mysql \
-e GITEA__database__HOST=192.168.0.197:3307 \
-e GITEA__database__NAME=gitea \
-e GITEA__database__USER=gitea \
-e GITEA__database__PASSWD=123456 \
gitea/gitea:latest
variable | value |
---|---|
USER_UID |
Gitea of the user running inside the container UID , defaults to1000 |
USER_GID |
Gitea of the user running inside the container GID , defaults to1000 |
GITEA__database__DB_TYPE |
database type |
GITEA__database__HOST |
database host |
GITEA__database__NAME |
database name |
GITEA__database__USER |
database user |
GITEA__database__PASSWD |
database password |
For more environment variables, please see the official documentation: https://docs.gitea.cn/installation/install-with-docker#environment variables
You can also use docker-compose
the installation , save the following content as docker-compose.yml
a file
version: "3"
services:
server:
image: gitea/gitea:latest
container_name: gitea
restart: always
volumes:
- ./data:/data
- /etc/TZ:/etc/TZ:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3231:3000"
- "222:22"
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=192.168.0.197:3307
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=123456
Then execute the following command
# 新建文件夹 gitea 和 子目录
mkdir -p /volume2/docker/gitea/data
# 进入 gitea 目录
cd /volume2/docker/gitea
# 将 docker-compose.yml 放入当前目录
# 一键启动
docker-compose up -d
run
Enter in the browser http://群晖IP:3231
, the first time you need to configure
Lao Su didn’t change anything, including mail settings and administrators, I’ll talk about it later
There is a short loading process
Followed by the login interface
Because there is no administrator set at the beginning, the first registered user is the administrator
The main interface after successful creation
set up
Management background
Supports migration from other repositories
configuration file
Gitea
The configuration file is saved in /data/gitea/conf/app.ini
, FileStation
in , the corresponding path is/docker/gitea/data/gitea/conf/app.ini
Before app.ini
making any changes to , you need to add Everyone
read and write permissions for
Otherwise the modification will be invalid
After modifying the settings, you need to restart the container for the settings to take effect
disable registration
If you want to disable registration, then only administrators can create accounts for users. Although troublesome, it may be safer
One way is through environment variables DISABLE_REGISTRATION=true
, the other is in ,app.ini
change fromDISABLE_REGISTRATION
false
true
After restarting the container, it can no longer be registered
E-Mail settings
Because we didn't set the email when we initialized at the beginning, so now app.ini
it looks like this
[mailer]
ENABLED = false
If you want to configure the mail service, you must first ENABLED
change to true
, and add the following content at the same time. Of course, the settings are different for different mailboxes, which is why Lao Su did not set it at the beginning
[mailer]
ENABLED = true
FROM = [email protected]
MAILER_TYPE = smtp
HOST = smtp.88.com:465
IS_TLS_ENABLED = true
USER = [email protected]
PASSWD = <第三方邮件客户端>
When creating a user, if email notification is checked
will receive the mail soon
client
Gitea
The server uses SSH
the protocol , and SSH
the port is not the default. 22
Instead 222
, Lao Su searched, and there are two methods:
The following content has not been verified by Lao Su, please check it yourself;
-
The first way
Git
is to specify the port number in the remote repository address of the , for example:git remote add origin ssh://user@host:port/path/to/repo
-
The second is to modify the local configuration file. You
Windows
can configureC:\Users\<YourUserName>\.ssh\config
the port number in the file under , for example:SSH
Host gitserver
HostName gitserver.com
Port 222
User git
You can then use git remote add origin git@gitserver:path/to/repo
to add remote repositories.
reference documents
Gitea
address: https://gitea.io/en-us/
gitea/README_ZH.md at main go-gitea/gitea GitHub
address: https://github.com/go-gitea/gitea/blob/main/README_ZH.md
Documentation | Gitea Official Documentation
Address: https://docs.gitea.cn/
Install with Docker - Docs
address: https://docs.gitea.io/en-us/install-with-docker/