Code Monkey home page Code Monkey logo

docker-compose-nginx-gogs's Introduction

Private GOGS ( github-clone ) served through HTTPS via NGINX

Requirement

Build

After installing the requirements, run inside this directory:

docker-compose up

First run

Self-signed certificates using gogs

During the first run, the nginx container webserver will complain that no certificates are available and will quit. (But gitserver will keep running.)

To solve that, open a terminal and execute (replace (gitserver) with the name of the container as printed by docker-compose up call):

docker exec -it (gitserver) bash

This will connect you to the running gitserver container and will launch an instance of bash inside it. Then enter (replace again (hostname) here with your domain name):

cd /data/gogs/conf/
/app/gogs/gogs cert -ca=true -duration=8760h0m0s -host=(hostname)
exit

That's it. You now have self-signed certificates by gogs. You can now restart the failed container:

docker-compose up

Autorithy signed certificates

If you already have signed certificates, just copy them into: /var/gogs/gogs/conf in your local system. They will automatically mounted during when docker-compose is launched.

Remember to rename the certificate: cert.pem, and the server key: key.pem.

Usage

You can now acces you self-hosted gogs service through HTTPS using any browser. You'll get a warning however as the certificate are self-signed.

git through self-signed HTTPS

To use git with a self-signed, you need to disable SSL verification temporarly:

export GIT_SSL_NO_VERIFY=true

or permanently (:warning: DANGEROUS ๐Ÿšท):

git config --global http.sslverify false

git through ssh on a different port (10022)

To use git with ssh on a different port than the default port 22:

git clone ssh://git@hostname:10022/user/repo.git

Remember to add your ssh keys first!

References

docker-compose-nginx-gogs's People

Contributors

msis avatar

Watchers

 avatar

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.