Starting migration from gogs to gitea

Gitea is a more trustable project.
This commit is contained in:
2018-10-30 14:50:33 +01:00
parent 40547fc477
commit 7ef72a70df
14 changed files with 303 additions and 167 deletions

41
tmpl/gitea-db.yml Normal file
View File

@ -0,0 +1,41 @@
---
%set dmode = %%getVar('gitea_db_mode','non')
%if %%dmode == "externe"
dbhost: %%gitea_dbserver
dbport: %%gitea_dbport
dbroot: %%gitea_dbuser
dbrootpwd: %%gitea_dbpass
%else if %%dmode == "local"
dbhost: 127.0.0.1
%end if
dbtype: mysql
dbname: gitea
dbuser: gitea
dbpass: "changeme"
%set allow_hosts = %%getVar('gitea_allow_hosts', '')
%if %%dmode == "local"
client_hosts: ["127.0.0.1", "localhost" %slurp
%else if %%dmode == "externe"
client_hosts: ["%%adresse_ip_eth0" %slurp
%end if
%if %%dmode != "default"
%if %%is_empty(%%allow_hosts)
]
%else
%for %%hst in %%allow_hosts
,"%%hst" %slurp
%end for
]
%end if
%end if
createscript: "/usr/share/eole/db/gitea/gen/00-create-gitea-db.sql"
#updatescripts: ["/usr/share/eole/db/gitea/updates/gitea-update-1.sql"]
%set cnt_prefix = %%getVar('container_path_reseau', '')
pwd_files:
- {file: '%%cnt_prefix/etc/gitea/conf/app.ini',
pattern: 'PASSWD="',
end_pattern: ';',
owner: 'root:www-data',
mod: '660' }

View File

@ -2,9 +2,9 @@
# PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE
; App name that shows on every page title
APP_NAME = %%gogs_name
APP_NAME = %%gitea_name
; Change it if you run locally
RUN_USER = gogs
RUN_USER = git
; Either "dev", "prod" or "test", default is "dev"
RUN_MODE = prod
@ -15,28 +15,28 @@ SCRIPT_TYPE = bash
[server]
PROTOCOL = https
%if %%getVar('activer_revprox','non') == 'oui'
DOMAIN = %%gogs_web_name
DOMAIN = %%gitea_web_name
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s/
%else
%if %%getVar('gogs_web_name', 'X-X-X-X') == 'X-X-X-X'
%if %%getVar('gitea_web_name', 'X-X-X-X') == 'X-X-X-X'
DOMAIN = %%adresse_ip_eth0
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
%else
DOMAIN = %%gogs_web_name
DOMAIN = %%gitea_web_name
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s/
%end if
%end if
HTTP_ADDR =
HTTP_PORT = %%git_http_port
HTTP_PORT = %%gitea_http_port
; Disable SSH feature when not available
DISABLE_SSH = false
SSH_PORT = %%git_ssh_port
SSH_PORT = %%gitea_ssh_port
; Disable CDN even in "prod" mode
OFFLINE_MODE = false
DISABLE_ROUTER_LOG = false
; Generate steps:
; $ cd path/to/gogs/custom/https
; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com
; $ cd path/to/gitea/custom/https
; $ ./gitea cert -ca=true -duration=8760h0m0s -host=myhost.example.com
;
; Or from a .pfx file exported from the Windows certificate store (do
; not forget to export the private key):
@ -55,14 +55,15 @@ LANDING_PAGE = explore
[database]
; Either "mysql", "postgres" or "sqlite3", it's your choice
DB_TYPE = mysql
HOST = %%container_ip_mysql:3306
NAME = gogs
USER = gogs
PASSWD=gogs1234
;FIXME FOR EOLEDB
HOST = %%getVar("container_ip_mysql","127.0.0.1"):3306
NAME = gitea
USER = gitea
PASSWD=gitea1234
; For "postgres" only, either "disable", "require" or "verify-full"
SSL_MODE = disable
; For "sqlite3" only
; PATH = %%gogs_db_file
; PATH = %%gitea_db_file
[admin]
@ -72,8 +73,8 @@ INSTALL_LOCK = true
SECRET_KEY = !#@FDEWREWR&*(
; Auto-login remember days
LOGIN_REMEMBER_DAYS = 7
COOKIE_USERNAME = gogs_awesome
COOKIE_REMEMBER_NAME = gogs_incredible
COOKIE_USERNAME = gitea_awesome
COOKIE_REMEMBER_NAME = gitea_incredible
; Reverse proxy authentication header name of user name
REVERSE_PROXY_AUTHENTICATION_USER = X-WEBAUTH-USER
@ -82,7 +83,7 @@ ACTIVE_CODE_LIVE_MINUTES = 180
RESET_PASSWD_CODE_LIVE_MINUTES = 180
; User need to confirm e-mail for registration
REGISTER_EMAIL_CONFIRM = false
%if %%getVar('gogs_registration','non') == 'oui'
%if %%getVar('gitea_registration','non') == 'oui'
; Does not allow register and admin create account only
DISABLE_REGISTRATION = false
%else
@ -94,12 +95,12 @@ REQUIRE_SIGNIN_VIEW = false
; Cache avatar as picture
ENABLE_CACHE_AVATAR = false
; Mail notification
%if %%getVar('gogs_mail','non') == 'non'
%if %%getVar('gitea_mail','non') == 'non'
ENABLE_NOTIFY_MAIL = false
%else
ENABLE_NOTIFY_MAIL = true
%end if
; More detail: https://github.com/gogits/gogs/issues/165
; More detail: https://github.com/gogits/gitea/issues/165
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
ENABLE_REVERSE_PROXY_AUTO_REGISTRATION = false
; Do not check minimum key size with corresponding type
@ -113,7 +114,7 @@ DELIVER_TIMEOUT = 5
; Allow insecure certification
SKIP_TLS_VERIFY = false
%if %%getVar('gogs_mail','non') == 'oui'
%if %%getVar('gitea_mail','non') == 'oui'
[mailer]
ENABLED = true
; Buffer length of channel, keep it as it is if you don't know what it is.
@ -136,15 +137,15 @@ USE_CERTIFICATE = false
CERT_FILE = custom/mailer/cert.pem
KEY_FILE = custom/mailer/key.pem
; Mail from address, RFC 5322. This can be just an email address, or the "Name" <email@example.com> format
%if %%getVar('gogs_mail_from','M-M-M-M') == 'M-M-M-M'
%if %%getVar('gitea_mail_from','M-M-M-M') == 'M-M-M-M'
FROM = %%system_mail_from
%else
FROM = %%gogs_mail_from
FROM = %%gitea_mail_from
%end if
%if %%getVar('gogs_mail_auth','non') == 'oui'
%if %%getVar('gitea_mail_auth','non') == 'oui'
; Mailer user name and password
USER = %%gogs_email_user
PASSWD = %%gogs_email_password
USER = %%gitea_email_user
PASSWD = %%gitea_email_password
%end if
%else
[mailer]
@ -303,7 +304,7 @@ RECEIVERS =
LEVEL =
; Either "mysql" or "postgres"
DRIVER =
; Based on xorm, e.g.: root:root@localhost/gogs?charset=utf8
; Based on xorm, e.g.: root:root@localhost/gitea?charset=utf8
CONN =
[git]

View File

@ -1,6 +1,6 @@
server {
listen 80;
server_name %%gogs_web_name;
server_name %%gitea_web_name;
return 301 https://$host$request_uri;
}
@ -11,13 +11,13 @@ server {
ssl_certificate_key %%server_key;
ssl_client_certificate /etc/ssl/certs/ca.crt;
access_log /var/log/nginx/revprox.revprox_http.access-ssl.log;
server_name %%gogs_web_name;
server_name %%gitea_web_name;
error_page 403 404 502 503 504 /nginx.html;
location = /nginx.html{
root /usr/share/nginx/www;
}
location / {
proxy_pass https://%%container_ip_forge:%%git_http_port;
proxy_pass https://%%container_ip_forge:%%gitea_http_port;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;