[Support] Gitea


Recommended Posts

Application Name: Gitea: Git with a cup of tea

Application Site: http://gitea.io 

Docker Hub: https://hub.docker.com/r/gitea/gitea/

Github: https://github.com/go-gitea/gitea

Template-Repository: https://github.com/fanningert/unraid-docker-templates

 

EDIT: Current master of gitea is not working. I am working on a version with the current stable 1.1.4 release.

Edited by fanningert
  • Like 1
Link to comment
8 hours ago, Ezro said:

Hey,

 

I'm really digging Gitea (especially how fast the UI is).

 

Do you know how I can set up your container with the LetsEncrypt + DuckDns linuxserver.io docker containers?

 

I'm ultimately trying to get gitea to be accessible from https://mydomain.com/gitea but can't seem to figure out the configuration for it.

 

I feel like I'm getting close.

 

I'm able to get a 404, but with some Gitea information listed on the page (version, page load time, template, languages, etc.)

 

image.thumb.png.c716817fe4373c2de995f2641e156555.png

Link to comment

@Ezro go to the app directory of gitea (/appdata/gitea/gitea/conf) and open the app.ini.

 

Change following values to your domain URL.
 

[server]
SSH_DOMAIN       = sub.example.com
DOMAIN           = sub.example.com
ROOT_URL         = https://sub.example.com/

I would like to prefer to make a sub domain for GITEA, but when you like to run GITEA as sub directory, here the changes in the app.ini. (not tested)

 

[server]
SSH_DOMAIN       = sub.example.com
DOMAIN           = sub.example.com
ROOT_URL         = https://sub.example.com/gitea/

Regards Thomas

Edited by fanningert
Link to comment
7 minutes ago, fanningert said:

@Ezro go to the app directory of gitea (/appdata/gitea/gitea/conf) and open the app.ini.

 

Change following values to your domain URL.
 


[server]
SSH_DOMAIN       = sub.example.com
DOMAIN           = sub.example.com
ROOT_URL         = https://sub.example.com/

I would like to prefer to make a only sub domain for GITEA, but when you like to run GITEA as sub directory, here the changes in the app.ini. (not tested)

 


[server]
SSH_DOMAIN       = sub.example.com
DOMAIN           = sub.example.com
ROOT_URL         = https://sub.example.com/gitea/

Regards Thomas

 

I'm still getting 404.

 

Here's what my configs currently look like:

 

/appdata/gitea/gitea/conf/app.ini

[server]
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = mydomain.duckdns.org
DOMAIN           = mydomain.duckdns.org
HTTP_PORT        = 3000
ROOT_URL         = https://mydomain.duckdns.org/gitea
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = false
OFFLINE_MODE     = false
PROTOCOL         = http

 

/appdata/letsencrypt/nginx/site-confs

location /gitea {

  include /config/nginx/proxy.conf;

  proxy_pass http://192.168.1.207:3000;

}

 

Link to comment

@Ezro 

I think the problem is the reverse proxy settings. (I personaly use caddy a reverse proxy and lets encrypt webserver).

 

Change your reverse proxy setting to...

location /gitea {
  include /config/nginx/proxy.conf;
  proxy_pass http://192.168.1.207:3000
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
}

Regards Thomas

Link to comment
7 minutes ago, fanningert said:

@Ezro 

I think the problem is the reverse proxy settings. (I personaly use caddy a reverse proxy and lets encrypt webserver).

 

Change your reverse proxy setting to...


location /gitea {
  include /config/nginx/proxy.conf;
  proxy_pass http://192.168.1.207:3000
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
}

Regards Thomas

 

@fanningert

 

I tried changing the reverse proxy settings but am now getting a 400 error:

400 Bad Request: too many Host headers

Would configuration be easier if I used caddy? I'm not too familiar with any of this configuration (especially with multiple docker containers).

 

Ideally, I'd like to not have to SSH into my server in order to get the routing working properly.

 

 

Link to comment
On 9/24/2017 at 2:36 AM, fanningert said:

I don' know what you have in your /config/nginx/proxy.conf. But the easy way is to remove this line.

Caddy is much easier and I like it. I will create a docker for proxy feature.

@fanningert

 

Here's my /config/nginx/proxy.config:

 

client_max_body_size 10m;
client_body_buffer_size 128k;

#Timeout if the real server is dead
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503;

# Advanced Proxy Config
send_timeout 5m;
proxy_read_timeout 240;
proxy_send_timeout 240;
proxy_connect_timeout 240;

# Basic Proxy Config
proxy_set_header Host $host:$server_port;
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 https;
proxy_redirect  http://  $scheme://;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_cache_bypass $cookie_session;
proxy_no_cache $cookie_session;
proxy_buffers 32 4k;

Link to comment
  • 1 month later...
  • 2 months later...

Hello,

 

Thanks for this Docker. I am having issues changing the port. I assigned this to grab an IP from my network (so I can assign a domain to it), however I cannot get it to change ports. Everything works fine if I leave it on port 3000, but if I modify app.ini and restart, it doesn't work. If I change it back to 3000, it works. I've even modified this in the Docker template in unRAID. Any idea what could be going on, or what I am missing?

Link to comment

@CrunchyToast I made a fresh docker container installation of Gitea an it is working with different ports.

I only changed the input values of the fields SSH-Port (changed from 22 to 8022) and HTTP-Port (changed from 3000 to 8300).

image.png.9ebade6555d14ff34fc1b85e3c39d67e.png

Could it be, that you want to change to a port number, what is allready used by a other docker container?

Or, did you changed the network type? I am using "Bridge".

 

Here a detail screenshot of the http port setting.

image.png.75557373c92843b3fbf40576cdf1f8fb.png

 

The only problem on the install process of gitea with different http port, is the hard link to "http://localhost:3000/user/login" after the installation.

image.png.ff2dff9c91b8dff572e5098266d74be2.png

Edited by fanningert
Link to comment
  • 3 months later...
  • 3 weeks later...

I got this up and running last night, and it's great - but I cant seem to change the config file at all.  Any save throws a permission error when editing across the network.  Looking at the permissions for the file everyone has read access - but for some reason my wife's account has write access as well (note: my wife is not technically inclined and I would never explicitly give her permission to do much of anything on the server aside from saving her photos to a share)?!?

Edited by hkyCoach
Link to comment

@hkyCoach This week I am not at home. I will check it, next week.

 

Update: I think the problem is the original gitea docker container. In this container the git user has the id 1000 and the group id also 1000. Is it possible that your have is in a group with the ID 1000 or the user ID is 1000?

Edited by fanningert
Link to comment
  • 4 weeks later...

Hi,

I had an issue running this in network=HOST mode. Since port 22 is already taken (by the unRAID server), when the container's sshd tries to bind to port 22, it fails. Then because of supervisor, it constantly tries the same command and ends up spamming the logs. I had to edit the sshd_config file and change the port in order to get it to stop.

Link to comment
  • 2 months later...

Hi guys!

I really need some help, because i am new to reverse proxy/letsencrypt thing.

Basically, i followed Spaceinvader One video about Nextcloud and letsencrypt:

 

 

No problems for nextcloud, but i can't configure gitea.

I created the file: user/appdata/letsencrypt/nginx/proxy-confs/gitea.subdomain.conf

server {
	listen 443 ssl;
    server_name gitea.*;
    include /config/nginx/ssl.conf;
    client_max_body_size 0;
    location / {
    	include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_gitea gitea;
        proxy_pass https://$upstream_gitea:3000;
    }
}

Then edited the gitea config file:

[server]
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = gitea.mypersonaldomain.com
HTTP_PORT        = 8300
ROOT_URL         = https://gitea.mypersonaldomain.com:8300
DISABLE_SSH      = false
SSH_PORT         = 8022
LFS_CONTENT_PATH = /data/git/lfs
DOMAIN           = gitea.mypersonaldomain.com
LFS_START_SERVER = true
LFS_JWT_SECRET   = ***********************************
OFFLINE_MODE     = false

The container uses port 8300 and 8022 for ssh.

The best i get is a 502 error when visiting gitea.mypersonaldomain.com:8300.

With these settings, the gitea web interface is unreachable even if i point to my localhost ip ( 192.168.1.200:8300 )

Any tips ?

Edited by Raz
code snippet
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.