Skip to content

Commit

Permalink
Do not manually migrate gitea; instead use INSTALL_LOCK
Browse files Browse the repository at this point in the history
  • Loading branch information
myitcv committed Aug 21, 2020
1 parent 10c05e7 commit 47218cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 57 deletions.
63 changes: 17 additions & 46 deletions app.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
APP_NAME = Gitea: Git with a cup of tea
RUN_MODE = prod
RUN_USER = git
RUN_MODE = dev

[repository]
ROOT = /data/git/repositories
Expand All @@ -13,77 +12,49 @@ TEMP_PATH = /data/gitea/uploads

[server]
APP_DATA_PATH = /data/gitea
LFS_JWT_SECRET = O5uN7PIi7SQMtX1it3aIOr8IPkdLE8o-oN72hyu2yNY
SSH_PORT = 22
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
OFFLINE_MODE = false
DISABLE_SSH = false

; localhost
DOMAIN = play-with-go.dev
SSH_DOMAIN = play-with-go.dev
HTTP_PORT = 3000
ROOT_URL = https://play-with-go.dev
DISABLE_SSH = false
SSH_PORT = 22
SSH_LISTEN_PORT = 22
LFS_START_SERVER = false
LFS_CONTENT_PATH = /data/git/lfs

[database]
PATH = /data/gitea/gitea.db
DB_TYPE = sqlite3
HOST = localhost:3306
NAME = gitea
USER = root
PASSWD =
SCHEMA =
SSL_MODE = disable
CHARSET = utf8
PATH = /data/gitea/gitea.db
DB_TYPE = sqlite3
HOST = localhost:3306
NAME = gitea
USER = root
PASSWD =

[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 = true
ENABLE_FEDERATED_AVATAR = false

[attachment]
PATH = /data/gitea/attachments

[log]
ROOT_PATH = /data/gitea/log
MODE = file
LEVEL = info

[security]
INSTALL_LOCK = true
SECRET_KEY = wKWHwTMXLQMm2uiDX4mLygLlP91DjXulos3jZWKgm8fiMOqCTsaJylpoCZCo5w86
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1ODk0NTE3MjZ9.tGRtl3YftujQbQmgh4rIinivTflfzUwYDtJ-aODBUD8
PASSWORD_COMPLEXITY = off
SECRET_KEY =
INTERNAL_TOKEN = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

[service]
DISABLE_REGISTRATION = true
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 = false
DEFAULT_ENABLE_TIMETRACKING = false
NO_REPLY_ADDRESS = noreply.localhost
DISABLE_REGISTRATION = false
REQUIRE_SIGNIN_VIEW = false

[oauth2]
JWT_SECRET = 35thZ40_78zAHUN5xdk1Bg3WpU7LtmsBkHvuwMJ9POY

[mailer]
ENABLED = false

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
JWT_SECRET = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

12 changes: 1 addition & 11 deletions cmd/gitea/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,14 @@ import (
)

func (r *runner) runSetup(args []string) error {
if err := r.setupCmd.fs.Parse(args); err != nil {
return r.setupCmd.usageErr("failed to parse flags: %v", err)
}
migrate := exec.Command("docker-compose", "exec", "-T", "-u", "git", "gitea", "gitea", "migrate")
migrate.Stdout = os.Stdout
migrate.Stderr = os.Stderr
migrate.Stdin = os.Stdin
err := migrate.Run()
check(err, "failed to run [%v]: %v", migrate, err)

adminUser := exec.Command("docker-compose", "exec", "-T", "-u", "git", "gitea", "gitea", "admin", "create-user",
"--admin", "--username", os.Getenv("PLAYWITHGODEV_ROOT_USER"),
"--password", os.Getenv("PLAYWITHGODEV_ROOT_PASSWORD"), "--email", "blah@blah.com",
)
adminUser.Stdout = os.Stdout
adminUser.Stderr = os.Stderr
adminUser.Stdin = os.Stdin
err = adminUser.Run()
err := adminUser.Run()
check(err, "failed to run [%v]: %v", adminUser, err)

// Now run self in Docker
Expand Down

0 comments on commit 47218cf

Please sign in to comment.