GithubHelp home page GithubHelp logo

openshift-gitea-image's Introduction

Gitea for OpenShift

Gitea is a Git service. Learn more about it at https://gitea.io.

Running containers on OpenShift comes with certain security and other requirements. This repository contains:

  • A Dockerfile for building an OpenShift-compatible Gitea image
  • A shell script to build the image using podman
  • The run scripts used in the Docker image

Prerequisites

  • An account in an OpenShift 4.10+ environment and a project

  • Gitea requires a database to store its information. Provisioning a database is out-of-scope for this repository. If you wish to run the database on OpenShift, it is suggested that you deploy PostgreSQL using persistent storage. More information on the OpenShift PostgreSQL deployment is here:

    https://docs.openshift.org/latest/using_images/db_images/postgresql.html

Deployment via Operator

A Gitea Operator can be found at https://github.com/rhpds/gitea-operator. Operators are the preferred way to deploy applications on Kubernetes.

Deployment via Helm Chart

A Helm Chart has been created at https://github.com/redhat-cop/helm-charts/charts/gitea.

Note that hostname is required during Gitea Helm chart installation in order to configure repository URLs correctly.

Deployment via OpenShift Template

Gitea can be easily deployed using the included templates in openshift folder.

Note that the template deploys PostgreSQL 12. If you are on an older OpenShift cluster that doesn't have that ImageStream available yet then modify the template first to use a PostgreSQL version that your clusters supports (9.6 or 10) in the ImageStream object.

If your have persistent volumes available in your cluster:

oc new-app -f https://raw.githubusercontent.com/rhpds/openshift-gitea-image/main/openshift/gitea-persistent-template.yaml --param=HOSTNAME=gitea-demo.yourdomain.com

Otherwise:

oc new-app -f https://raw.githubusercontent.com/rhpds/openshift-gitea-image/main/openshift/gitea-ephemeral-template.yaml --param=HOSTNAME=gitea-demo.yourdomain.com

Note that hostname is required during Gitea template deployment in order to configure repository URLs correctly.

Added automatic build

openshift-gitea-image's People

Contributors

bagnaram avatar gastaldi avatar infosec812 avatar jimmyjones2 avatar kenmoini avatar wkulhanek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

openshift-gitea-image's Issues

template uses docker.io but you have switched to quay.io

Hello,

Over on line 363 of the template you are using docker.io as the default image repo:

  value: "docker.io/wkulhanek/gitea" 

Yet that only has latest version 1.8.x as you are building 1.9.x and pushing to quay.io over here:

docker push quay.io/gpte-devops-automation/gitea:${VERSION}

This means that folks who are just running your original template are using an out of date version.

Note that the latest versions don't run from the template due to issue #4 which is fixed in pr #5

Thanks!

latest image (1.8.0) do not work

Log:

2019/05/04 19:39:28 �[1;31m[...s/setting/setting.go:729 NewContext()] [E] error saving generating JWT secret to custom config: open /home/gitea/conf/app.ini: read-only file system�[0m

Workaround:
Change image in gitea deployment config:
image: 'docker.io/wkulhanek/gitea:1.7.5'

/home/gitea/gitea: line 1: 404: command not found

First of all, thank you for this greate template! Sadly, in your latest release (1.5.0) the /home/gitea/gitea file is somehow broken, because it only contains 404 Not Found. I rebuild the image locally and everything works fine so I think all you need to do is rebuild and push it again. Maybe the release wasn't available on https://dl.gitea.io/gitea/ when you build it.

Clone via ssh fails with "kex_exchange_identification: Connection closed by remote host"

I've modified gitea-persistent-template.yaml to create gitea with SSH port opened:

    # Add 2022 port under Service -> spec -> ports
    - name: 2022-tcp
      port: 2022
      protocol: TCP
      targetPort: 2022

    # Add 2022 port under DeploymentConfig -> template -> spec -> ports
          - containerPort: 2022
            protocol: TCP
            name: ssh

HTTP cloning works fine but follow error shows when try to clone with SSH:

$ git clone ssh://gitea@myhostname:2022/user1/test-repo.git
Cloning into 'test-repo' ...
kex_exchange_identification: Connection closed by remote host

Logs when troubleshoot with ssh -vvvT gitea@myhostname -p 2022:

debug1: Connecting to myhostname [::1] port 2022.
debug1: Connection established.
...
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/user1/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/user1/.ssh/id_dsa
debug3: no such identity: /home/user1/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/user1/.ssh/id_ecdsa
debug3: no such identity: /home/user1/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/user1/.ssh/id_ed25519
debug3: no such identity: /home/user1/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).

According to this post, it seems to relate to folder permission issues. Which I checked to be true in the gitea pod:

sh-4.4$ ls -al /home
total 0
drwxr-xr-x. 1 root root 19 May 11 14:03 .
drwxr-xr-x. 1 root root 40 May 27 08:32 ..
drwxrwx---. 1 1000 root 47 May 27 08:32 gitea
sh-4.4$ id
uid=1001(gitea) gid=0(root) groups=0(root)
sh-4.4$ 

It seems that gitea has uid of 1001 but /home/gitea is owned by 1000. Is this a bug or am I missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.