Skip to content

Commit

Permalink
Merge pull request #7 from webhippie/fix-api-endpoint
Browse files Browse the repository at this point in the history
feat: use viper and cobra, switch to new api endpoint
  • Loading branch information
tboerger authored May 20, 2022
2 parents fd52c29 + fb187df commit 681a5c0
Show file tree
Hide file tree
Showing 22 changed files with 872 additions and 227 deletions.
3 changes: 2 additions & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ branches:
restrictions:
apps:
- renovate
users: []
users:
- bothippie
teams: []

...
2 changes: 1 addition & 1 deletion .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
id: golang
uses: actions/setup-go@v2
with:
go-version: 1.17.8
go-version: 1.18.1

- name: Run generate
id: generate
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- name: Checkout source
id: source
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_ACCESS_TOKEN }}

- name: Setup golang
id: golang
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:
target: webhippie/cursecli
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
description: HetznerCloud Exporter
description: Cursecli
readme: README.md

- name: Quay readme
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# Changelog for 1.1.0

The following sections list the changes for 1.1.0.

## Summary

* Fix #6: Switch API as it is secured now

## Details

* Bugfix #6: Switch API as it is secured now

We switched to the official Curseforge API as the previously used API is not usable anymore.
Part of that is also introducing a flag for the API key as we don't have any anonymous API
available anymore.

https://github.com/webhippie/cursecli/issues/6


# Changelog for 1.0.0

The following sections list the changes for 1.0.0.
Expand Down
7 changes: 7 additions & 0 deletions changelog/1.1.0_2022-05-20/new-endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: Switch API as it is secured now

We switched to the official Curseforge API as the previously used API is not
usable anymore. Part of that is also introducing a flag for the API key as we
don't have any anonymous API available anymore.

https://github.com/webhippie/cursecli/issues/6
16 changes: 16 additions & 0 deletions config/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"log": {
"level": "info",
"pretty": true,
"color": true
},
"api": {
"key": ""
},
"manifest": {
"path": "manifest.json"
},
"mods": {
"path": "mods/"
}
}
16 changes: 16 additions & 0 deletions config/example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
log:
level: info
pretty: true
color: true

api:
key:

manifest:
path: manifest.json

mods:
path: mods/

...
10 changes: 10 additions & 0 deletions docs/content/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "About"
date: 2022-05-04T00:00:00+00:00
anchor: "about"
weight: 10
---

This command-line tool provides commands to interact with the Curseforge API. At
the time of writing this you are able to download all mods part of a manifest
which have been defined within the Curseforge client, focused on Minecraft.
2 changes: 1 addition & 1 deletion docs/content/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Building"
date: 2022-05-03T00:00:00+00:00
anchor: "building"
weight: 20
weight: 30
---

As this project is built with Go you need to install Go first. The installation
Expand Down
93 changes: 89 additions & 4 deletions docs/content/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,99 @@
---
title: "Getting Started"
date: 2022-05-03T00:00:00+00:00
date: 2022-05-20T00:00:00+00:00
anchor: "getting-started"
weight: 10
weight: 20
---

## Installation

TBD
So far we are offering only a few different variants for the installation. You
can choose between [Docker][docker] or pre-built binaries which are stored on
our download mirror and GitHub releases. Maybe we will also provide system
packages for the major distributions later if we see the need for it.

### Docker

Generally we are offering the images through
[quay.io/webhippie/cursecli][quay] and [webhippie/cursecli][dockerhub], so
feel free to choose one of the providers. Maybe we will come up with Kustomize
manifests or some Helm chart.

### Binaries

Simply download a binary matching your operating system and your architecture
from our [downloads][downloads] or the GitHub releases and place it within your
path like `/usr/local/bin` if you are using macOS or Linux.

## Configuration

TBD
We provide overall three different variants of configuration. The variant based
on environment variables and commandline flags are split up into global values
and command-specific values.

### Envrionment variables

If you prefer to configure the service with environment variables you can see
the available variables below.

#### Global

CURSECLI_CONFIG_FILE
: Path to optional config file

CURSECLI_LOG_LEVEL
: Set logging level, defaults to `info`

CURSECLI_LOG_COLOR
: Enable colored logging, defaults to `true`

CURSECLI_LOG_PRETTY
: Enable pretty logging, defaults to `true`

CURSECLI_API_KEY
: API key to access Curseforge

### Commandline flags

If you prefer to configure the service with commandline flags you can see the
available variables below.

#### Global

--config-file
: Path to optional config file

--log-level
: Set logging level, defaults to `info`

--log-color
: Enable colored logging, defaults to `true`

--log-pretty
: Enable pretty logging, defaults to `true`

--api-key
: API key to access Curseforge

### Configuration file

So far we support multiple file formats like `json` or `yaml`, if you want to
get a full example configuration just take a look at [our repository][repo],
there you can always see the latest configuration format. These example configs
include all available options and the default values. The configuration file
will be automatically loaded if it's placed at
`/etc/cursecli/config.yml`, `${HOME}/.cursecli/config.yml` or
`$(pwd)/cursecli/config.yml`.

## Usage

The program provides a few sub-commands on execution. The available config
methods have already been mentioned above. Generally you can always see a
formated help output if you execute the binary similar to something like
`cursecli --help`.

[docker]: https://www.docker.com/
[quay]: https://quay.io/repository/webhippie/cursecli
[dockerhub]: https://hub.docker.com/r/webhippie/cursecli
[downloads]: https://dl.webhippie.de/#cursecli/
[repo]: https://github.com/webhippie/cursecli/tree/master/config
2 changes: 1 addition & 1 deletion docs/content/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "License"
date: 2022-05-03T00:00:00+00:00
anchor: "license"
weight: 30
weight: 40
---

This project is licensed under the [Apache 2.0][license] license. For the
Expand Down
23 changes: 19 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@ go 1.17
require (
github.com/joho/godotenv v1.4.0
github.com/rs/zerolog v1.26.1
github.com/urfave/cli/v2 v2.7.1
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.11.0
)

require (
github.com/antzucaro/matchr v0.0.0-20210222213004-b04723ef80f0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
Loading

0 comments on commit 681a5c0

Please sign in to comment.