Hello Friends,
I have been working to understand what is wrong with my configurations to make the Gitea
works for me on my server.
I could not figure it out and I am sure that i must be doing something wrong since I had to make a change that will make my ssh clone to work and not HTTP
while it was the opposite before I made the change.
This is ONLY because Gitea
and Grafana
Shares the same port (as well as the first letter) - Port 3000
I have built a docker compose to create my docker as follows:
version: "3.7"
services:
gitea:
image: gitea/gitea:latest
container_name: gitea
hostname: gitea
networks:
- net
ports:
- "3333:3000"
- "2222:22"
environment:
- APP_NAME="Gitea OnlyMe"
- PUID=1000
- PGID=1000
- TZ=Asia/Jerusalem
volumes:
- ./data:/data:rw
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- ../scripts/gitea:/scripts
restart: always
networks:
net:
external: false
As shown above I have changed my HTTP port and my SSH to 3333 and 2222 respectively.
Before I have made the change - the HTTP works and the SSH did NOT work on private repos.
while using
git clone -v http://$SERVERIP:3333/$USER/hello-world.git
I managed to clone the git repo but I needed to put my credentials all the time, that is why I wanted to use the ssh git clone - Already added my public key under SSH using the web UI.
So… In order to make my life easier (so I though I was going to…) I wanted to clone using the followings:
git clone -v ssh://git@$SERVERIP:2222/$USER/hello-world.git
And I got Error not connecting - Connection refused… Then I realized that I am not sure if it is hard-coded but, I used verbose to monitor what is going on and I saw that there was an inside connection with the http://localhost:3000 and that is not the port I configured at all.
What I did was - Reinstalling everything from scratch and while I was on the installation page I wrote on the HTTP 3000 and the BASE URL to be with :3333 - that will probably make the HTTP works on the side of the UI (that what I want) and Not sure what it will do to the HTTP clone (of which was my second choice of cloning, since it asks for credentials all the time)
I have restarted the Server and I tried to clone using SSH again:
git clone -v ssh://git@$SERVERIP:2222/$USER/hello-world.git
And it worked…
I am not even sure what I have done to it to work but I DID NOT changed the port on the UI for HTTP listening - since I am sure that I don’t need to touch it (But I truly don’t understand why it is there for configuration if IT will use 3000 no mater what port I chose)
This is my app.ini
config:
APP_NAME = Gitea OnlyMe
RUN_MODE = prod
RUN_USER = git
[repository]
ROOT = /data/git/repositories
[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo
[repository.upload]
TEMP_PATH = /data/gitea/uploads
[server]
APP_DATA_PATH = /data/gitea
SSH_DOMAIN = 12.34.56.78
########### CHANGE HERE ############
HTTP_PORT = 3000
ROOT_URL = http://12.34.56.78:3333/
#####################################
DISABLE_SSH = false
SSH_PORT = 2222
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
DOMAIN = 12.34.56.78
LFS_JWT_SECRET = L**********************MVyyptU_O90N-TnS5u78pR
OFFLINE_MODE = false
[database]
PATH = /data/gitea/gitea.db
DB_TYPE = sqlite3
HOST = localhost:3306
NAME = gitea
USER = root
PASSWD =
SCHEMA =
SSL_MODE = disable
CHARSET = utf8
[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER = file
[picture]
AVATAR_UPLOAD_PATH = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = true
[attachment]
PATH = /data/gitea/attachments
[log]
ROOT_PATH = /data/gitea/log
MODE = file
LEVEL = info
[security]
INSTALL_LOCK = true
SECRET_KEY = 367477567878564552453455434343232324235445454656567767675654554343423 /* FAKE
INTERNAL_TOKEN = jklcvsjkvne;fkjvhefjklvnerjjleflgjnefovbjekbbfjklbnrjklberoberkoberkob /* FAKE
[service]
DISABLE_REGISTRATION = false
REQUIRE_SIGNIN_VIEW = false
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost
[oauth2]
JWT_SECRET = fkjvhefjklvnerjjleflgjnefovbjekbbfjklbnrjkl /* FAKE
[mailer]
ENABLED = false
[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true
Just not sure how to overcome this installation with both to work and the link for the HTTP clone from the Gitea
is NOT with the Correct Port.
I would be happy to start using it and make my practice with Gitea
as soon as possible.
I am not sure that if this is a BUG or that the port 3000 is hard-coded. I just want to know how to change the port from 3000 to 3333 and make EVEYTHING works under the hood of Gitea
.
Thank you!