https://github.com/aspyatkin/gogs-cookbook
Chef cookbook to install Gogs Git service
https://github.com/aspyatkin/gogs-cookbook
chef gogs
Last synced: 3 months ago
JSON representation
Chef cookbook to install Gogs Git service
- Host: GitHub
- URL: https://github.com/aspyatkin/gogs-cookbook
- Owner: aspyatkin
- License: mit
- Created: 2016-05-20T06:34:17.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-08-25T07:44:17.000Z (almost 5 years ago)
- Last Synced: 2025-03-04T12:43:26.018Z (over 1 year ago)
- Topics: chef, gogs
- Language: HTML
- Size: 64.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gogs-cookbook
Chef cookbook to install [Gogs](https://gogs.io) Git service.
## Usage
`gogs_app` resource should be used to install [Gogs](https://gogs.io) Git service.
```ruby
gogs_app 'default' do
postgres_host '127.0.0.1'
postgres_port 5432
postgres_database 'gogs'
postgres_user 'gogs'
postgres_password 'TOPSECRET'
redis_host '127.0.0.1'
redis_port 6379
secure true
conf(
'server' => {
'fqdn' => 'git.example'
},
'email' => {
'enabled' => true,
'host' => 'mx.example',
'port' => 587,
'user' => 'admin@git.example',
'password' => 'TOPSECRET',
'from' => 'Gogs '
}
)
action :install
end
```
It is expected that PostgreSQL and Redis are already set up on the node before utilizing this resource. One may use the corresponding Supermarket cookbooks (e.g. [postgresql](https://supermarket.chef.io/cookbooks/postgresql) and [redisio](https://supermarket.chef.io/cookbooks/redisio)) so as to install and configure them.
## Tips
Scripts are created in a directory specified by `service_script_dir` property (`/usr/local/bin` by default). Scripts are meant to be run by a user that can `su` as a Gogs service user (`git` by default). Paths to scripts are exposed in `node.run_state['gogs']['create_admin_script']` and `node.run_state['gogs']['backup_script']`.
### Creating an admin user
Run a simple interactive program to create a Gogs admin user.
```sh
$ gogs-create-admin
Username: git-admin
Password:
Repeat password:
Email: git-admin@example.com
New user 'git-admin' has been successfully created!
```
### Backing up
Creates a zip archive containing Gogs backup data in a current directory.
```sh
$ gogs-backup
```
## License
MIT © [Alexander Pyatkin](https://github.com/aspyatkin)