sync notes(auto)
This commit is contained in:
parent
ba328dab92
commit
d8bbb1e4a8
1 changed files with 90 additions and 0 deletions
90
content/20240312115855 Raspi4 GiteaからForgejoに変更してみる.md
Normal file
90
content/20240312115855 Raspi4 GiteaからForgejoに変更してみる.md
Normal file
|
@ -0,0 +1,90 @@
|
|||
# 20240312115855 Raspi4 GiteaからForgejoに変更してみる
|
||||
#gitea #forgejo #raspi
|
||||
|
||||
## インストール
|
||||
[Forgejo](https://forgejo.org/download/) "Upgrade from Gitea" に、「バイナリを入れかえればOK」みたいなことが書いてあるので、そのようにしてみる。自分がインストールしていたバージョンは 1.21.5 なので、それに対応したバージョンをインストール
|
||||
|
||||
giteaが動いている前提。 cf. [[20240215215031 Raspi4にGiteaをインストール|Raspi4にGiteaをインストール]]
|
||||
|
||||
download:
|
||||
```
|
||||
$ cd tmp
|
||||
$ sudo systemctl stop gitea
|
||||
$ sudo mv /usr/local/bin/gitea /usr/local/bin/gitea.orig
|
||||
$ wget https://codeberg.org/forgejo/forgejo/releases/download/v1.21.5-0/forgejo-1.21.5-0-linux-arm64
|
||||
$ chmod a+x ./forgejo-1.21.5-0-linux-arm64
|
||||
```
|
||||
gpg
|
||||
```
|
||||
$ wget https://codeberg.org/forgejo/forgejo/releases/download/v1.21.5-0/forgejo-1.21.5-0-linux-arm64.asc
|
||||
$ gpg --verify forgejo-1.21.5-0-linux-arm64.asc forgejo-1.21.5-0-linux-arm64
|
||||
gpg: Signature made Thu 01 Feb 2024 04:43:24 JST
|
||||
gpg: using EDDSA key EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
|
||||
gpg: Good signature from "Forgejo <contact@forgejo.org>" [unknown]
|
||||
gpg: aka "Forgejo Releases <release@forgejo.org>" [unknown]
|
||||
gpg: WARNING: This key is not certified with a trusted signature!
|
||||
gpg: There is no indication that the signature belongs to the owner.
|
||||
Primary key fingerprint: EB11 4F5E 6C0D C2BC DD18 3550 A4B6 1A2D C592 3710
|
||||
```
|
||||
コピー
|
||||
```
|
||||
$ sudo cp forgejo-1.21.5-0-linux-arm64 /usr/local/bin/gitea
|
||||
```
|
||||
|
||||
再起動
|
||||
```
|
||||
$ sudo systemctl start gitea
|
||||
```
|
||||
|
||||
・・・で問題なく動いた。 バイナリ名やサービス名がgiteaだったりで不完全だけど、とりあえずOK。バージョンアップする時に困るかもしれない。
|
||||
一応 `/etc/gitea/app.ini` の [server] の `ROOT_URL`だけは `https://git.kinoshita-lab.org/`変更しておいた。
|
||||
|
||||
|
||||
外観的に落ちつかない、というか混乱しそうなので、トンネルとnginxは名前を変更した。
|
||||
```
|
||||
$ su cloudflare
|
||||
Password:
|
||||
cloudflare@saipi4:~ $ vim ~/.cloudflared/config.yaml
|
||||
# gitea と書いてあるところを gitに変更
|
||||
cloudflare@saipi4:~ $ cloudflared tunnel route dns c7e5dcd4-1cfe-4e6f-b8f0-d8d1d1c0c146 git.kinoshita-lab.org
|
||||
```
|
||||
cloudflaredコマンドでCNAMEを消す方法が不明だったので、 webインターフェースから gitea を消去。
|
||||
```
|
||||
$ sudo systemctl restart cloudflared
|
||||
```
|
||||
|
||||
nginxの設定を変更
|
||||
```
|
||||
$ sudo vim /etc/nginx/sites-available/default
|
||||
```
|
||||
中身はこんな感じ
|
||||
```
|
||||
# gitea -> forgejo
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name git.kinoshita-lab.org;
|
||||
|
||||
# https://docs.gitea.com/administration/reverse-proxies
|
||||
location / {
|
||||
client_max_body_size 512M;
|
||||
|
||||
# make wnginx use unescaped URI, keep "%2F" as is
|
||||
proxy_pass http://127.0.0.1:3000;
|
||||
proxy_set_header Connection $http_connection;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
$ sudo systemctl restart nginx
|
||||
```
|
||||
|
||||
## Ref.
|
||||
- [Forgejo](https://forgejo.org/download/)
|
||||
- [[20240215215031 Raspi4にGiteaをインストール|Raspi4にGiteaをインストール]]
|
Loading…
Reference in a new issue