sync notes(auto)

This commit is contained in:
Kaz Saita(raspi4) 2024-03-12 13:15:12 +09:00
parent 1196839831
commit 79b1984592

View file

@ -1,25 +1,26 @@
# 20240312115855 Raspi4 GiteaからForgejoに変更してみる # 20240312115855 Raspi4 GiteaからForgejoに変更してみる
#gitea #forgejo #raspi #gitea #forgejo #raspi
## インストール ## インストール
[Forgejo](https://forgejo.org/download/) "Upgrade from Gitea" に、「バイナリを入れかえればOK」みたいなことが書いてあるので、そのようにしてみる。自分がインストールしていたバージョンは 1.21.5 なので、それに対応したバージョンをインストール [Forgejo](https://forgejo.org/download/) "Upgrade from Gitea" に、「バイナリを入れかえればOK」みたいなことが書いてあるので、そのようにしてみる。自分がインストールしていたバージョンは 1.21.5 なので、それに対応したバージョンをインストール
giteaが動いている前提。 cf. [[20240215215031 Raspi4にGiteaをインストール|Raspi4にGiteaをインストール]] giteaが動いている前提。 cf. [[20240215215031 Raspi4にGiteaをインストール|Raspi4にGiteaをインストール]]
download: download:
``` ```
cd tmp $ cd tmp
sudo systemctl stop gitea $ sudo systemctl stop gitea
sudo mv /usr/local/bin/gitea /usr/local/bin/gitea.orig $ 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 $ 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 $ chmod a+x ./forgejo-1.21.5-0-linux-arm64
``` ```
gpg gpg
``` ```
$ wget https://codeberg.org/forgejo/forgejo/releases/download/v1.21.5-0/forgejo-1.21.5-0-linux-arm64.asc $ 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 --verify forgejo-1.21.5-0-linux-arm64.asc forgejo-1.21.5-0-linux-arm64
@ -31,24 +32,21 @@ gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner. 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 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 cp forgejo-1.21.5-0-linux-arm64 /usr/local/bin/gitea
``` ```
再起動 再起動
``` ```
sudo systemctl start gitea $ sudo systemctl start gitea
``` ```
・・・で問題なく動いた。 バイナリ名やサービス名がgiteaだったりで不完全だけど、とりあえずOK。バージョンアップする時に困るかもしれない。 ・・・で問題なく動いた。 バイナリ名やサービス名がgiteaだったりで不完全だけど、とりあえずOK。バージョンアップする時に困るかもしれない。
一応 `/etc/gitea/app.ini` の [server] の `ROOT_URL`だけは `https://git.kinoshita-lab.org/`変更しておいた。 一応 `/etc/gitea/app.ini` の [server] の `ROOT_URL`だけは `https://git.kinoshita-lab.org/`変更しておいた。
外観的に落ちつかない、というか混乱しそうなので、トンネルとnginxは名前を変更した。
外観的に落ちつかない、というか混乱しそうなので、トンネルとnginxは名前を変更した。
``` ```
$ su cloudflare $ su cloudflare
Password: Password:
@ -56,21 +54,16 @@ cloudflare@saipi4:~ $ vim ~/.cloudflared/config.yaml
# gitea と書いてあるところを gitに変更 # gitea と書いてあるところを gitに変更
cloudflare@saipi4:~ $ cloudflared tunnel route dns c7e5dcd4-1cfe-4e6f-b8f0-d8d1d1c0c146 git.kinoshita-lab.org cloudflare@saipi4:~ $ cloudflared tunnel route dns c7e5dcd4-1cfe-4e6f-b8f0-d8d1d1c0c146 git.kinoshita-lab.org
``` ```
cloudflaredコマンドでCNAMEを消す方法が不明だったので、 webインターフェースから gitea を消去。 cloudflaredコマンドでCNAMEを消す方法が不明だったので、 webインターフェースから gitea を消去。
``` ```
sudo systemctl restart cloudflared $ sudo systemctl restart cloudflared
``` ```
nginxの設定を変更 nginxの設定を変更
``` ```
sudo vim /etc/nginx/sites-available/default $ sudo vim /etc/nginx/sites-available/default
``` ```
中身はこんな感じ 中身はこんな感じ
``` ```
# gitea -> forgejo # gitea -> forgejo
server { server {
@ -94,12 +87,10 @@ server {
} }
} }
``` ```
``` ```
sudo systemctl restart nginx $ sudo systemctl restart nginx
``` ```
## Ref ## Ref.
- [Forgejo](https://forgejo.org/download/) - [Forgejo](https://forgejo.org/download/)
- [[20240215215031 Raspi4にGiteaをインストール|Raspi4にGiteaをインストール]] - [[20240215215031 Raspi4にGiteaをインストール|Raspi4にGiteaをインストール]]