From d4426f1dff2decad9b5e3cd25eb88ff0e0b74efb Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Thu, 19 Nov 2020 08:48:33 -0800 Subject: [PATCH] Make default config file simpler. Closes #364 (#375) --- .github/workflows/buildmaster.yaml | 2 +- build/release/Dockerfile-build | 2 +- build/release/build.sh | 3 +- config-default.yaml | 31 +++++++++++++++++++ config/config.go | 2 +- .../config-example.yaml | 0 6 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 config-default.yaml rename config-example.yaml => examples/config-example.yaml (100%) diff --git a/.github/workflows/buildmaster.yaml b/.github/workflows/buildmaster.yaml index 6b96b0590..7465030d8 100644 --- a/.github/workflows/buildmaster.yaml +++ b/.github/workflows/buildmaster.yaml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v2 - name: Copy default config file - run: cp config-example.yaml config.yaml + run: cp config-default.yaml config.yaml - name: Build Docker image run: docker build -t owncast . diff --git a/build/release/Dockerfile-build b/build/release/Dockerfile-build index 97e976cac..70f56de2a 100644 --- a/build/release/Dockerfile-build +++ b/build/release/Dockerfile-build @@ -22,7 +22,7 @@ RUN apk update && apk add --no-cache ffmpeg ffmpeg-libs ca-certificates && updat # Copy owncast assets WORKDIR /app COPY --from=build /build/owncast /app/owncast -COPY --from=build /build/config-example.yaml /app/config.yaml +COPY --from=build /build/config-default.yaml /app/config.yaml COPY --from=build /build/webroot /app/webroot COPY --from=build /build/static /app/static diff --git a/build/release/build.sh b/build/release/build.sh index d67c31dbf..80fae412f 100755 --- a/build/release/build.sh +++ b/build/release/build.sh @@ -52,10 +52,11 @@ build() { mkdir -p dist/${NAME}/data # Default files - cp config-example.yaml dist/${NAME}/config.yaml + cp config-default.yaml dist/${NAME}/config.yaml cp data/content-example.md dist/${NAME}/data/content.md cp -R webroot/ dist/${NAME}/webroot/ + # Copy the production pruned+minified css to the build's directory. cp "${TMPDIR}tailwind.min.css" ./dist/${NAME}/webroot/js/web_modules/tailwindcss/dist/tailwind.min.css cp -R static/ dist/${NAME}/static diff --git a/config-default.yaml b/config-default.yaml new file mode 100644 index 000000000..78e3cb03f --- /dev/null +++ b/config-default.yaml @@ -0,0 +1,31 @@ +# See https://owncast.online/docs/configuration/ for more details + +instanceDetails: + name: Owncast + title: Owncast + summary: "This is brief summary of whom you are or what your stream is. You can edit this description in your config file." + + logo: /img/logo.svg + + tags: + - music + - software + - streaming + + # https://owncast.online/docs/configuration/#external-links + # for full list of supported social links. All optional. + socialHandles: + - platform: github + url: http://github.com/owncast/owncast + +videoSettings: + # Change this value and keep it secure. Treat it like a password to your live stream. + streamingKey: abc123 + + streamQualities: + - medium: + videoBitrate: 1200 + encoderPreset: veryfast + +# Set to true if you don't want the service checking for future releases. +disableUpgradeChecks: false diff --git a/config/config.go b/config/config.go index e0cbfa2e9..60b430ff6 100644 --- a/config/config.go +++ b/config/config.go @@ -106,7 +106,7 @@ type S3 struct { func (c *config) load(filePath string) error { if !utils.DoesFileExists(filePath) { - log.Fatal("ERROR: valid config.yaml is required. Copy config-example.yaml to config.yaml and edit") + log.Fatal("ERROR: valid config.yaml is required. Copy config-default.yaml to config.yaml and edit") } yamlFile, err := ioutil.ReadFile(filePath) diff --git a/config-example.yaml b/examples/config-example.yaml similarity index 100% rename from config-example.yaml rename to examples/config-example.yaml