2 Commits

Author SHA1 Message Date
Greg Karékinian
baa0739936 Add the backup recipe
Also move the Gitea data dir to an attribute
2020-05-26 15:21:26 +02:00
Greg Karékinian
3332a1b2e8 Write initial README 2020-05-26 15:21:07 +02:00
5 changed files with 24 additions and 2 deletions

View File

@@ -1,4 +1,18 @@
# kosmos_gitea
TODO: Enter the cookbook description here.
## Recipes
### default
Deploys the gitea binary, generates a config file and our custom Kosmos label
set. The service runs as a Systemd unit.
### backup
Back up the `/var/lib/gitea` directory using the
[backup](https://backup.github.io/backup/) tool and our backup cookbook
### pg_db
Should be executed on the primary PostgreSQL server (`postgresql_primary` role)
to create the user, database and access rules

View File

@@ -3,3 +3,4 @@ node.default["kosmos_gitea"]["version"] = gitea_version
node.default["kosmos_gitea"]["binary_url"] = "https://dl.gitea.io/gitea/#{gitea_version}/gitea-#{gitea_version}-linux-amd64"
node.default["kosmos_gitea"]["binary_checksum"] = "d8d43c13e71596c79b541e85e29defe065b4f70ac5155e6d0212bcfc669e1b9c"
node.default["kosmos_gitea"]["nginx"]["domain"] = "gitea.kosmos.org"
node.default["kosmos_gitea"]["working_directory"] = "/var/lib/gitea"

View File

@@ -21,3 +21,4 @@ chef_version '>= 14.0'
depends "kosmos-nginx"
depends "kosmos-postgresql"
depends "backup"

View File

@@ -23,3 +23,9 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
unless node.chef_environment == "development"
# backup the data dir and the config files
node.override["backup"]["archives"]["gitea"] = [node["kosmos_gitea"]["working_directory"]]
include_recipe "backup"
end

View File

@@ -28,7 +28,7 @@ include_recipe "kosmos-nginx"
domain = node["kosmos_gitea"]["nginx"]["domain"]
working_directory = "/var/lib/gitea"
working_directory = node["kosmos_gitea"]["working_directory"]
git_home_directory = "/home/git"
config_directory = "/etc/gitea"
gitea_binary_path = "/usr/local/bin/gitea"