Skip to content

Commit

Permalink
Merge pull request #73 from SQLJames/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
SQLJames authored Nov 10, 2024
2 parents 473b334 + c8b7ddc commit ccdc353
Show file tree
Hide file tree
Showing 13 changed files with 1,383 additions and 308 deletions.
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/chart_workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Lint, Test and Deploy Charts
on:
push:
pull_request:

jobs:
lint-test:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/verify_readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Verify Chart Documentation
on:
push:

jobs:
verify-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Golang
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: install chart-doc-gen
run: go install kubepack.dev/chart-doc-gen@latest
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y make
# Install chart-doc-gen or add additional commands as needed
- name: Generate Documentation
run: make gen

- name: Verify Documentation
run: make verify
32 changes: 32 additions & 0 deletions .github/workflows/verify_values_schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Verify Chart Schema
on:
push:

jobs:
verify-schema:
name: "Verify Chart Schema"
runs-on: ubuntu-22.04
steps:
- name: "Checkout"
uses: actions/[email protected]
with:
fetch-depth: 0

- name: "Set Up Helm"
uses: azure/[email protected]
if: github.ref != 'refs/heads/main'
with:
version: v3.4.1
- name: install helm-schema-gen
run: helm plugin install https://github.com/karuppiah7890/helm-schema-gen.git
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y make
# Install chart-doc-gen or add additional commands as needed
- name: Generate Documentation
run: make gen-schema

- name: Verify Documentation
run: make verify
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## Changelog

### V2.5.1

#### Non-Breaking Changes
- Updating values.schema.json
- Updating Readme documentation
- Adding new github workflow to verify readme documentation is up to date going forward
- Removed unneeded files from the repository
- Removed changelog entries from the main readme
- Added values.schema.json workflow to make sure schema json is up to date going forward

### V2.5.0

#### Breaking Changes
Expand Down
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,4 @@ chart's [README.md](https://github.com/SQLJames/factorio-server-charts/blob/main
## Examples Of Large mods

Values.yaml configuration of large [mods](./examples/):
* [Space-Exploration](https://mods.factorio.com/mod/space-exploration)

## Changelog

### V1.1.0

#### Breaking Changes

- Moved account data from `server_settings.` to `account.` in values.yaml
- Moved server password from `server_settings.` to `serverPassword.` in values.yaml

#### Non-Breaking Changes

- Added `account.accountSecret` field to values.yaml
- Added `rcon.passwordSecret` field to values.yaml
- Added `serverPassword.passwordSecret` field to values.yaml
- Changed default `rcon.password` to `CHANGEMECHANGEME`, which should be changed anyway
- Changed default `map_gen_settings.autoplace_controls` from the standard values to `{}`, since by default map
generation follows standard parameters if not overriden
- Changed default `admin_list`, `white_list` and `ban_list` to `[]` instead of `nil`
* [Space-Exploration](https://mods.factorio.com/mod/space-exploration)
2 changes: 1 addition & 1 deletion charts/factorio-server-charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.5.0
version: 2.5.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
492 changes: 261 additions & 231 deletions charts/factorio-server-charts/README.md

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions charts/factorio-server-charts/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ project:
description: A Helm chart for running factorio in kubernetes
app: Factorio
repository:
url: https://github.com/SQLJames/factorio-server-charts
name: github
url: https://sqljames.github.io/factorio-server-charts
name: factorio
chart:
name: factorio-server-charts
version: 1.2.4
values: "-- generate from values file --"
valuesExample: "-- generate from values file --"
release:
Expand Down
169 changes: 169 additions & 0 deletions charts/factorio-server-charts/readme.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/factorio-server-charts)](https://artifacthub.io/packages/search?repo=factorio-server-charts)
[![Factorio](https://img.shields.io/static/v1?label=Factorio&message=v2.0.10&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACPtJREFUeJzVVglQVFcWbZYGBJHNBruhaWjo5f/f3XQD3c2ibMKggoJBowKyNluDLBJXBI2OCyEqronjBokCyqKiuIABjWabKSuJM6k4i5OqmFgxiZPJJMRlxDMXo0nLSKbKyaRqXtWpX//V//ec99699zwe7/9xvLtuildXWUhhU1FQQd1sNtnD2T6ApscRrH4RAR83xNRc22DEx+v1eG+V8U6Qv8dOml5EKCHMIcQRxv4cXNZPmvzkhei+C8v1eLsmBANLDDAGiDppepUF6gjSp2a9uikh4fUVEa1y4bgaejUR5hKSQyXjpvQuCMn57Yrom50FHHpKOHTkKhGvlFwYIWAY6qciv7k9Nu+rjcZvvtwahVdKDdcnc17NVXHebQPl7OU/1QZ/9YelxqH24nAcTFehZR6LprkcTLHq2zNjZO9qZYJ9VlbfC+DbWGUumiovSw9XLKT3WEIwQU6wG5X8ytYUwScNEYOfE/nvVkeix6zGvvmau5cW64cuL9bjwqJIdJaFoTk/GE05QfjNHAaNqQqsT+XQatLhVFXwnZ1ZqveyjcKWzkLu0uGi0Durk7WDkTJR68NdWUl4hmD7RAE7ixOtNqUb9g0sj8TJYiXaslh0Lk7E6XVp6KiMwLEFOhw1q9BVzOII4VSpCseKVHg1R4296Rz2Z6jQUxaKixWhQ69V6NBhYvFiqhpLpwUPermO3WxxP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xG6u56gONW872/W40cl/09DJ/FwSJS6HN6bRW06m3yCnjF+Lt85O9ifoETbzvuxVecxXo4pQf4TzonHuw37BUNwfGpiy5GuEy6pI2NZlRKIlTMCofJyGmmztbyfuvH8t6NqKjvTwEjBSiVg/MUQOI8ZvmgMd7YcQgzBjzfalfvnGKkRnItW7j9HIfGuZPzE1S6ODhE07f4/I/wlxr8AAkgaqTYaX18AAAAASUVORK5CYII=&labelColor=4c2c2c&color=8c6c6c)](https://www.factorio.com/)
[![Chart Version](https://img.shields.io/static/v1?logo=Helm&logoColor=0f1689&message=v1.1.0&label=Helm%20Chart&labelColor=eeeeee&color=fefefe)](https://sqljames.github.io/factorio-server-charts/index.yaml)
[![Image Version](https://img.shields.io/static/v1?logo=Docker&message=v1.1.70&label=Docker%20Image&labelColor=eeeeee&color=fefefe)](https://sqljames.github.io/factorio-server-charts/index.yaml)

# {{ .Project.ShortName }}

[{{ .Project.Name }}]({{ .Project.URL }}) - {{ .Project.Description }}

## TL;DR;

```bash
$ helm repo add {{ .Repository.Name }} {{ .Repository.URL }}
$ helm repo update
$ helm search repo {{ .Repository.Name }}/{{ .Chart.Name }}
$ helm upgrade -i {{ .Release.Name }} {{ .Repository.Name }}/{{ .Chart.Name }} -n {{ .Release.Namespace }} --create-namespace
```

## Introduction

This chart deploys {{ .Project.App }} on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites
{{ range .Prerequisites }}
- {{ . }}
{{- end }}

## Installing the Chart

To install/upgrade the chart with the release name `{{ .Release.Name }}`:

```bash
$ helm upgrade -i {{ .Release.Name }} {{ .Repository.Name }}/{{ .Chart.Name }} -n {{ .Release.Namespace }} --create-namespace
```

The command deploys {{ .Project.App }} on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.

> **Tip**: List all releases using `helm list`

## Uninstalling the Chart

To uninstall the `{{ .Release.Name }}`:

```bash
$ helm uninstall {{ .Release.Name }} -n {{ .Release.Namespace }}
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Importing a save file

> :warning: Importing a save file will **OVERWRITE THE SERVER SAVEFILE** with the name specified in `factorioServer.save_name`. Import with caution!

### Importing by URL

To import your save file from a URL, set `import_save.source_url` to a direct-download link for your savegame. By default, the file will be downloaded and imported only once.

If, on pod intialization, you wish to re-import the file every time the contents of the savegame change, set `import_save.reimport_on_change` to `true`.
:warning: If the savegame at the source url changes, this will overwrite the server save with that file. Use with caution!

If you wish to reimport the save file every time the pod reinitializes, regardless of changes, set `import_save.reimport_every_time` to `true`. This could be useful for demos or testing.
:warning: This will overwrite the server savegame **every time the pod reinitializes**. Use with caution!

### Manual Import

To import an existing save file, start/restart the pod at least once. This will create the import folder structure.

Now, copy the savegame you wish to import to the `/factorio/save-importer/import/<existing_savegame_name>.zip` on the running pod using whatever mechanism you prefer. To do this with kubectl:

```bash
kubectl cp ./my_existing_savegame.zip <namespace>/<pod_name>:/factorio/save-importer/import
```

Restart the pod again to import your save file.


## Installing mods

To Install mods, change `mods.enabled` to `true`, add any offical mods by their URL name under the `mods.portal`
section, and any unofficial mods in the `mods.unofficial`section.


```yaml
mods:
image:
repository: "ghcr.io/sqljames/factorio-mod-downloader"
## Container image pull policy
pullPolicy: Always
## Overrides the image tag whose default is the chart appVersion.
tag: "1.0.1"
## You should set an fix version, i.e.:
# tag: "1.1.37"
enabled: false
# in order to use the mods portal you will need to specify the username and token in the server_settings.
portal: []
# - name: factorissimo-2-notnotmelon
# version: 3.5.11
# unofficial section is meant to just allow you to download and place folders into the mods folder.
# we will not check version compatibility automatically with these downloads.
# you can encounter an error if the file names dont match what the mod is expecting for example
# Error Util.cpp:83: Failed to load mod "Squeak-Through": Filename of mod
# /factorio/mods/Squeak-Through.zip doesn't match the expected Squeak Through_1.8.2.zip (case sensitive!)
unofficial: []
# - url: "https://github.com/Suprcheese/Squeak-Through/archive/refs/tags/1.8.2.zip"
# name: "Squeak Through_1.8.2.zip"
```
If the Factorio server doesn't start, check that the logs don't have an error with the mods. They are pretty verbose.

### Overhaul mods
It is possible that your mod may extend the default settings. As a result, your server might not start properly and instead throw an error.

While we expose all the default settings, we would not be able to determine what is needed if it is absent. To add new settings you would need to convert the desired json file into a yaml struct as we are mounting all configurations as a config map into the container.

For example prior to the official release of 2.0, there was an issue with Space Exploration. The `autoplace_controls` by default is an empty array, and thus we were not able to start the instance as there were no settings for them to evaluate. Additionally, they are also modifying some of the other settings. These changes implement the default recommended settings, available in the UI and were stored in a file at `...Factorio\mods\space-exploration\shared.lua`. In the lua file, it has 2 sections, basic_settings and advanced_settings which correspond to settings in `map-gen-settings.json` and `map-settings.json` respecively.

At the time of writing, to make these changes you would need to add this to your values.yaml file to override their default values in the chart.

> **_NOTE:_** These settings may change and it is important to check with the mod maintainer/community to check the recommended settings.
```
map_settings:
pollution:
enemy_attack_pollution_consumption_modifier: 0.5
enemy_evolution:
time_factor: 0.0000005
destroy_factor: 0.0005
pollution_factor: 0.00000025

map_gen_settings:
water: 1.5
starting_area: 2
autoplace_controls:
hot:
size: 0.5
cold:
size: 0.5
property_expression_names:
control-setting:moisture:bias: '0.05'
control-setting:aux:bias: '-0.35'
```
More information about the debugging process for the space exploration mod can be read on [Issue 24](https://github.com/SQLJames/factorio-server-charts/issues/24).

If you do run into any issues with mods, I will try to work with you on finding the right settings and document them as well.

{{ if .Chart.Values -}}

## Configuration

The following table lists the configurable parameters of the `{{ .Chart.Name }}` chart and their default values.

{{ .Chart.Values }}

Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

```bash
$ helm upgrade -i {{ .Release.Name }} {{ .Repository.Name }}/{{ .Chart.Name }} -n {{ .Release.Namespace }} --create-namespace --set {{ .Chart.ValuesExample }}
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while
installing the chart. For example:

```bash
$ helm upgrade -i {{ .Release.Name }} {{ .Repository.Name }}/{{ .Chart.Name }} -n {{ .Release.Namespace }} --create-namespace --values values.yaml
```
{{- end }}

## Releases

Releases are published using the official helm release action in github.
https://github.com/helm/chart-releaser-action
Loading

0 comments on commit ccdc353

Please sign in to comment.