Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-installation support #209

Closed
6 tasks done
lunny opened this issue Nov 22, 2016 · 24 comments
Closed
6 tasks done

Pre-installation support #209

lunny opened this issue Nov 22, 2016 · 24 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@lunny
Copy link
Member

lunny commented Nov 22, 2016

This feature is very useful for rapidly creating an OEM Gitea instance. All the pre-installation will only need give a specific ini file. This file is not the same as the config.ini.

  • set a default database
  • set run user
  • set a default admin user and password
  • add users or organizations
  • add auth source
  • migrate some git repos. For example, migrate all the repos of mine in github.
@lunny lunny added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Nov 22, 2016
@lunny lunny added this to the 1.x.x milestone Nov 22, 2016
@stevenroose
Copy link

stevenroose commented Nov 22, 2016

Why would it not be the same as config.ini? All the things you mention seem to be configuration variables..

@lunny
Copy link
Member Author

lunny commented Nov 22, 2016

The first three could, but the last three cannot

@stevenroose
Copy link

Hmm. "add auth source" could, see #183. The other two indeed should not. But that are post-installation steps, imo.

@bkcsoft
Copy link
Member

bkcsoft commented Nov 29, 2016

IMO just create a gitea admin load <FILE>-command.

config.yml (Yes, I like yaml. And very much hand-written, non-linted, pseudo-yaml)

install:
  database:
    type: sqlite
    path: data/gitea.db
    secret: FOOBAR42
  run_user: git
  admin_user:
  - name: admin
    password: foobaz
users:
- name: bkc
  password: foobar42
  admin: false
- name: lunny
  password: badf00d1337
  admin: true
organizations:
- name: octokit
migrate:
- source: https://github.com/octokit/hello-world.git
  namespace: octokit
  name: hello-world
  mirror: false

@lunny
Copy link
Member Author

lunny commented Nov 29, 2016

lack of auth sources.

@stevenroose
Copy link

stevenroose commented Nov 30, 2016

Run user, admin user, database and auth sources are not install vars but global config vars that should be kept in a config file that is loaded on every run, not black-box inserted on install.

There is no need for pre-installation stuff, I setup a whole lot self-hosted applications and none have them. What they have is a config file that contains all you need.

Post-installation actions might make sense, though. F.e. adding users and organisations. However shouldn't the API allow for this when you provide an admin user in app.ini?

@lunny
Copy link
Member Author

lunny commented Nov 30, 2016

@stevenroose, I don't think so. Installation and Configuration are not the same things. Installation should have something you can not easily change. i.e. database, run user, data root dir. If you changed these, you have to restart your system. Adding users/organizations, adding auth source, config sendmail and etc. are configurations and could be changed when system is running.

@tboerger
Copy link
Member

I would prefer a single file as well. And if authentication sources are defined via config I would even disable editing via ui

@stevenroose
Copy link

@lunny Almost all of them you could in theory change at runtime except maybe run user. But almost all of them you probably don't want to do that at runtime. Things like database, datadirs, auth source, sendmail are core configurations and will almost never change once your system is deployed. They shouldn't too.

@bkcsoft
Copy link
Member

bkcsoft commented Dec 2, 2016

@stevenroose Gitea currently makes no effort at separating global/install var so currently it's sort-of a moot argument. Being able to bootstrap an instance is really helpful :)

@stevenroose
Copy link

@bkcsoft Yeah but there currently is a global config file and no install config file, so instead of making the latter, I think it makes more sense to just put it into the already existing config file :)

Makes installation much more intuitive for new users too, just fill in the app.ini file and run and you're done.

@bkcsoft
Copy link
Member

bkcsoft commented Dec 6, 2016

with #354 that will be easier since the default app.ini is now included in the binary :)

@couling
Copy link
Contributor

couling commented Jan 19, 2017

To add my two cents worth. I think we ought to continue to be careful to keep the use of app.ini coherent. There is a danger that it will become confusing. I think the auth provider is sitting on the wrong side of the fence. I know it threw me when I was first setting up gogs. We ought to look at moving it, even if it needs its own config file. INI files are flexible enough that we could have an "auth.ini" where each section refers to a different auth provider.

However the items "add users", "add or organizations" "migrate git repos" are once off admin activities and should not happen every time the server starts. Therefore they belong nowhere near a settings file. I believe the best idea would be a command line API.

Rather than a gitea admin load <FILE> to load a monolithic file. A set of functions:

  • gitea admin add user
  • gitea admin list users
  • gitea admin delete user

This lets user create shell scripts or batch scripts which are as complex or simple as their needs. It also provides some simple solutions to lost admin passwords etc.

@lunny
Copy link
Member Author

lunny commented Jan 20, 2017

reset someuser's password.

gitea admin passwd <user>

@bkcsoft
Copy link
Member

bkcsoft commented Jan 20, 2017

@lunny with an optional password for those of us that don't have an email server setup 😉

gitea admin passwd <user> [password]

@lunny
Copy link
Member Author

lunny commented Jan 20, 2017

@bkcsoft This only for who forget admin password. If you have admin password, you can change user's password in Admin Panel.

@bkcsoft
Copy link
Member

bkcsoft commented Jan 21, 2017

@lunny unless you want a cron-job that changes their password every 3 months ;)

@ptman
Copy link
Contributor

ptman commented Mar 13, 2017

Instead of storing "dynamic configuration variables" in the database, one could keep them in the same config file and support reload instead of restart of gitea. (think apache/nginx reload vs restart)

@rajdavies
Copy link

We would like to to use gitea for out of the box git support in the fabric8.io project - which uses KeyCloak as an identity provider (Oauth). Being able to configure the OAuth provider in a configuration file seems to be the only way forward for us.

ethantkoenig added a commit to ethantkoenig/gitea that referenced this issue Jul 10, 2017
@hankerepo
Copy link

What about a config directory that would always start with a default app.ini.whatever. app.ini.whatever would be the starting point with the other files being merged and overriding any settings app.ini.whatever? Similar to /etc/whatever.d style directories

@randyesq
Copy link

randyesq commented Feb 6, 2019

Was any support for this ever added? I have the same use case as @rajdavies . I already have Keycloak up and running and in my environment, there is no real way to open a web UI and make changes. Being able to put everything in a config file for Ansible or some other CM tool to bootstrap the installation and configuration is key.

@lunny lunny removed the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Feb 6, 2019
@lunny
Copy link
Member Author

lunny commented Feb 6, 2019

I think now every thing listed could be done via app.ini or gitea command lines.

@lunny lunny removed this from the 1.x.x milestone Feb 6, 2019
@randyesq
Copy link

randyesq commented Feb 6, 2019

Where can I find the related docs?

@jolheiser
Copy link
Member

https://docs.gitea.io/en-us/command-line/

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests