前提・実現したいこと
ソースの管理をするのにBitbucketのプライベートリポジトリを作って作業していたのですが、会社から外部サービスの使用を禁止されたため社内にサーバーを建てようとしています。
今までリモートリポジトリの操作はBitbucketの画面、ローカルの操作はSourcetreeを使って行っていたので、次も似た環境にしようとしています。
そこでCentOS7サーバーにgiteaをdocker-composeを使って起動させたのですが、pushをするとエラーになってしまいます。
ログにlocalhostと出ているのでdockerかgitの設定が間違っているのだと思うのですが、さっぱりわかりません。
何かご存知の方がいらっしゃいましたら助けてください!
発生している問題・エラーメッセージ
giteaにpushできない。
ローカル(sourcetree)からpushした時のエラー
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v origin master:master POST git-receive-pack (466 bytes) remote: * Checking 1 branches remote: Gitea: Internal Server Error remote: Unable to contact gitea: Post http://localhost:80/api/internal/hook/pre-receive/system/test: dial tcp 127.0.0.1:80: connect: connection refused Pushing to http://(サーバーIP)/system/test.git To http://(サーバーIP)/system/test.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'http://(サーバーIP)/system/test.git'
Gitea画面から直接ファイル追加した時のエラー
(※一行で出て見づらかったので、それっぽい所で改行しています)
ファイル 'sample.txt' を作成または変更できませんでした: Unable to push back to repo from temporary repo: system/test (/data/gitea/tmp/local-repo/upload.git621725553) Error: exit status 1 - remote: * Checking 1 branches remote: Gitea: Internal Server Error remote: Unable to contact gitea: Post http://localhost:80/api/internal/hook/pre-receive/system/test: dial tcp 127.0.0.1:80: connect: connection refused To /data/git/repositories/system/test.git ! [remote rejected] 7ba47ff3dda2fda4fcf4df4b9510255f3777ea95 -> master (pre-receive hook declined) error: failed to push some refs to '/data/git/repositories/system/test.git'
該当のソースコード
docker-compose.yml
yml
1version: "2" 2networks: 3 gitea: 4 external: false 5services: 6 server: 7 image: gitea/gitea:latest 8 environment: 9 - TZ=Japan 10 - USER_UID=1000 11 - USER_GID=1000 12 - DB_TYPE=mysql 13 - DB_HOST=db:3306 14 restart: always 15 networks: 16 - gitea 17 volumes: 18 - /opt/gitea/data:/data 19 ports: 20 - "80:3000" 21 - "2222:2222" 22 depends_on: 23 - db 24 db: 25 image: mysql:5.7 26 restart: always 27 environment: 28 - TZ=Japan 29 - MYSQL_ROOT_PASSWORD=(パスワード) 30 - MYSQL_USER=gitea 31 - MYSQL_PASSWORD=(パスワード) 32 - MYSQL_DATABASE=gitea 33 networks: 34 - gitea 35 volumes: 36 - /opt/gitea/mysql:/var/lib/mysql 37 command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
試したこと
1. 空っぽのリポジトリを作ってローカルリポジトリをコミット
上記のエラーが出ました
2. ローカルでクローンできるか?
Gitea側でリポジトリ作成時にREADME.md等を作る設定にするできるmasterブランチやファイルがcloneできるか実験しました。
・httpでクローン
クローンすることができましたが、pushすると上記のエラーになります。
・SSHでクローン
PuTTYでSSHのキーを発行後、公開鍵をGiteaに登録、プライベート鍵をPageantに登録、
Sourcetreeのオプション→全般でSSHクライアントの設定でプライベート鍵を登録しましたが、
リポジトリタイプが「ソースパス/ソースURLとして正しくありません」と出てCloneできませんでした。
**3.Bitbucketから移行できるか **
試しにリポジトリを1つ移行しましたが、ブランチを含めて全て移行できました。
httpであればクローンもできますが、pushすると上記エラーになります。。。
4.Giteaの画面上からファイルを追加できるか
上記のようなエラーになりできませんでした。
補足情報(FW/ツールのバージョンなど)
[サーバー]
OS : CentOS7
Gitea : 1.11.0
docker : 19.03.5
docker-compose : 1.25.0
[クライアント]
OS : Windows10
Sourcetree: 3.1.2
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/04/10 02:14
2020/04/23 14:59