feature: Helper scripts for ssh, themes, etc (#349)
* feature: Helper scripts for ssh, themes, etc * cicd: Update goreleaser to support v2 .goreleaser.yml files
This commit is contained in:
parent
e0678fc0a9
commit
482ef0e5e8
|
|
@ -52,7 +52,7 @@ jobs:
|
||||||
run: cd integration-tests && make -w
|
run: cd integration-tests && make -w
|
||||||
|
|
||||||
- name: goreleaser
|
- name: goreleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
version: latest
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ jobs:
|
||||||
run: make -w webui-dist
|
run: make -w webui-dist
|
||||||
|
|
||||||
- name: goreleaser
|
- name: goreleaser
|
||||||
uses: goreleaser/goreleaser-action@v5
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
version: latest
|
||||||
|
|
|
||||||
|
|
@ -12,3 +12,4 @@ tmp/
|
||||||
webui/
|
webui/
|
||||||
webui.dev/node_modules
|
webui.dev/node_modules
|
||||||
webui.dev/.parcel-cache
|
webui.dev/.parcel-cache
|
||||||
|
custom-webui
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
project_name: OliveTin
|
project_name: OliveTin
|
||||||
|
version: 2
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go mod download
|
- go mod download
|
||||||
|
|
@ -98,7 +99,7 @@ dockers:
|
||||||
- webui
|
- webui
|
||||||
- var/entities/
|
- var/entities/
|
||||||
- config.yaml
|
- config.yaml
|
||||||
- var/helper-actions/olivetin-setup-easy-ssh
|
- var/helper-actions/
|
||||||
|
|
||||||
- image_templates:
|
- image_templates:
|
||||||
- "docker.io/jamesread/olivetin:{{ .Tag }}-arm64"
|
- "docker.io/jamesread/olivetin:{{ .Tag }}-arm64"
|
||||||
|
|
@ -115,7 +116,7 @@ dockers:
|
||||||
- webui
|
- webui
|
||||||
- var/entities/
|
- var/entities/
|
||||||
- config.yaml
|
- config.yaml
|
||||||
- var/helper-actions/olivetin-setup-easy-ssh
|
- var/helper-actions/
|
||||||
|
|
||||||
docker_manifests:
|
docker_manifests:
|
||||||
- name_template: docker.io/jamesread/olivetin:{{ .Version }}
|
- name_template: docker.io/jamesread/olivetin:{{ .Version }}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ RUN mkdir -p /config /config/entities/ /var/www/olivetin \
|
||||||
shadow-utils \
|
shadow-utils \
|
||||||
apprise \
|
apprise \
|
||||||
jq \
|
jq \
|
||||||
|
git \
|
||||||
docker \
|
docker \
|
||||||
&& microdnf clean all
|
&& microdnf clean all
|
||||||
|
|
||||||
|
|
@ -24,7 +25,7 @@ VOLUME /config
|
||||||
|
|
||||||
COPY OliveTin /usr/bin/OliveTin
|
COPY OliveTin /usr/bin/OliveTin
|
||||||
COPY webui /var/www/olivetin/
|
COPY webui /var/www/olivetin/
|
||||||
COPY var/helper-actions/olivetin-setup-easy-ssh /usr/bin/olivetin-setup-easy-ssh
|
COPY var/helper-actions/* /usr/bin/
|
||||||
|
|
||||||
USER olivetin
|
USER olivetin
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ RUN mkdir -p /config /config/entities/ /var/www/olivetin \
|
||||||
shadow-utils \
|
shadow-utils \
|
||||||
apprise \
|
apprise \
|
||||||
jq \
|
jq \
|
||||||
|
git \
|
||||||
docker \
|
docker \
|
||||||
&& microdnf clean all
|
&& microdnf clean all
|
||||||
|
|
||||||
|
|
@ -24,7 +25,7 @@ VOLUME /config
|
||||||
|
|
||||||
COPY OliveTin /usr/bin/OliveTin
|
COPY OliveTin /usr/bin/OliveTin
|
||||||
COPY webui /var/www/olivetin/
|
COPY webui /var/www/olivetin/
|
||||||
COPY var/helper-actions/olivetin-setup-easy-ssh /usr/bin/olivetin-setup-easy-ssh
|
COPY var/helper-actions/* /usr/bin/
|
||||||
|
|
||||||
USER olivetin
|
USER olivetin
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ VOLUME /config
|
||||||
|
|
||||||
COPY OliveTin /usr/bin/OliveTin
|
COPY OliveTin /usr/bin/OliveTin
|
||||||
COPY webui /var/www/olivetin/
|
COPY webui /var/www/olivetin/
|
||||||
COPY var/helper-actions/olivetin-setup-easy-ssh /usr/bin/olivetin-setup-easy-ssh
|
COPY var/helper-actions/* /usr/bin/
|
||||||
|
|
||||||
USER olivetin
|
USER olivetin
|
||||||
|
|
||||||
|
|
|
||||||
33
config.yaml
33
config.yaml
|
|
@ -5,7 +5,6 @@
|
||||||
# Listen on all addresses available, port 1337
|
# Listen on all addresses available, port 1337
|
||||||
listenAddressSingleHTTPFrontend: 0.0.0.0:1337
|
listenAddressSingleHTTPFrontend: 0.0.0.0:1337
|
||||||
|
|
||||||
|
|
||||||
# Choose from INFO (default), WARN and DEBUG
|
# Choose from INFO (default), WARN and DEBUG
|
||||||
logLevel: "INFO"
|
logLevel: "INFO"
|
||||||
|
|
||||||
|
|
@ -111,17 +110,44 @@ actions:
|
||||||
- type: confirmation
|
- type: confirmation
|
||||||
title: Are you sure?!
|
title: Are you sure?!
|
||||||
|
|
||||||
|
# This is an action that runs a script included with OliveTin, that will
|
||||||
|
# download themes. You will still need to set theme "themeName" in your config.
|
||||||
|
#
|
||||||
|
# Docs: https://docs.olivetin.app/themes.html
|
||||||
|
- title: Get OliveTin Theme
|
||||||
|
shell: olivetin-get-theme {{ themeGitRepo }} {{ themeFolderName }}
|
||||||
|
icon: theme
|
||||||
|
arguments:
|
||||||
|
- name: themeGitRepo
|
||||||
|
title: Theme's Git Repository
|
||||||
|
description: Find new themes at https://olivetin.app/themes
|
||||||
|
type: url
|
||||||
|
|
||||||
|
- name: themeFolderName
|
||||||
|
title: Theme's Folder Name
|
||||||
|
type: ascii_identifier
|
||||||
|
|
||||||
# Sometimes you want to run actions on other servers - don't overcomplicate
|
# Sometimes you want to run actions on other servers - don't overcomplicate
|
||||||
# it, just use SSH!
|
# it, just use SSH! OliveTin includes a helper to make this easier, which is
|
||||||
|
# entirely optional. You can also setup SSH manually.
|
||||||
#
|
#
|
||||||
|
# Docs: https://docs.olivetin.app/action-ssh-easy.html
|
||||||
# Docs: https://docs.olivetin.app/action-ssh.html
|
# Docs: https://docs.olivetin.app/action-ssh.html
|
||||||
|
- title: "Setup easy SSH"
|
||||||
|
icon: ssh
|
||||||
|
shell: olivetin-setup-easy-ssh
|
||||||
|
popupOnStart: execution-dialog
|
||||||
|
|
||||||
|
# Here's how to use SSH with the "easy" config, to restart a service on
|
||||||
|
# another server.
|
||||||
|
#
|
||||||
|
# Docs: https://docs.olivetin.app/action-ssh-easy.html
|
||||||
# Docs: https://docs.olivetin.app/action-service.html
|
# Docs: https://docs.olivetin.app/action-service.html
|
||||||
- title: Restart httpd on server1
|
- title: Restart httpd on server1
|
||||||
id: restart_httpd
|
id: restart_httpd
|
||||||
icon: restart
|
icon: restart
|
||||||
timeout: 1
|
timeout: 1
|
||||||
shell: ssh root@server1 'service httpd restart'
|
shell: ssh -F /config/ssh/easy.cg root@server1 'service httpd restart'
|
||||||
|
|
||||||
# Lots of people use OliveTin to build web interfaces for their electronics
|
# Lots of people use OliveTin to build web interfaces for their electronics
|
||||||
# projects. It's best to install OliveTin as a native package (eg, .deb), and
|
# projects. It's best to install OliveTin as a native package (eg, .deb), and
|
||||||
|
|
@ -272,3 +298,4 @@ dashboards:
|
||||||
|
|
||||||
- title: 'Start {{ container.Names }}'
|
- title: 'Start {{ container.Names }}'
|
||||||
- title: 'Stop {{ container.Names }}'
|
- title: 'Stop {{ container.Names }}'
|
||||||
|
themeName: buttonbox
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ var emojis = map[string]string{
|
||||||
"logs": "🔍",
|
"logs": "🔍",
|
||||||
"light": "💡",
|
"light": "💡",
|
||||||
"robot": "🤖",
|
"robot": "🤖",
|
||||||
|
"ssh": "🔐",
|
||||||
|
"theme": "🎨",
|
||||||
}
|
}
|
||||||
|
|
||||||
func lookupHTMLIcon(keyToLookup string, defaultIcon string) string {
|
func lookupHTMLIcon(keyToLookup string, defaultIcon string) string {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
olivetin-get-git-repo "https://github.com/walkxcode/dashboard-icons.git" /config/custom-webui/dashboard-icons/
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
REPO=$1
|
||||||
|
DEST=$2
|
||||||
|
|
||||||
|
git -C "$DEST" pull || git clone "$REPO" "$DEST"
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
olivetin-get-git-repo "$1" "/config/custom-webui/themes/$2"
|
||||||
|
|
||||||
|
if grep -E -q "^themeName" /config/config.yaml; then
|
||||||
|
echo "Updating theme in config file"
|
||||||
|
sed -i "s/^themeName:.*/themeName: $2/g" /config/config.yaml
|
||||||
|
else
|
||||||
|
echo "themeName: $2" >> /config/config.yaml
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "You must restart OliveTin for theme changes to take effect."
|
||||||
|
|
@ -18,13 +18,16 @@ echo "To use this SSH key with OliveTin, format your action line like this:"
|
||||||
echo ""
|
echo ""
|
||||||
echo "actions:"
|
echo "actions:"
|
||||||
echo " - name: My SSH Action"
|
echo " - name: My SSH Action"
|
||||||
echo " shell: ssh -F /config/ssh/config user@host \"echo 'Hello, world!'\""
|
echo " shell: ssh -F /config/ssh/easy.cfg user@host \"echo 'Hello, world!'\""
|
||||||
echo ""
|
echo ""
|
||||||
echo "Note: This config has ssh key checking turned off for convenience."
|
echo "Note: This config has ssh key checking turned off so you don't have to "
|
||||||
echo "If validating SSH keys is important to you, you should not use this config."
|
echo "keep approving host keys inside the OliveTin container. This should only"
|
||||||
|
echo "be used in environments where checking SSH host keys is not important."
|
||||||
|
echo ""
|
||||||
|
echo "If validating SSH host keys is important, you should not use this config."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
cat <<EOF > /config/ssh/config
|
cat <<EOF > /config/ssh/easy.cfg
|
||||||
Host *
|
Host *
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
UserKnownHostsFile=/dev/null
|
UserKnownHostsFile=/dev/null
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue