fmt: Added pre-commit, fixed a few lint errors, npn updated webui

This commit is contained in:
jamesread 2023-08-24 12:17:55 +01:00
parent 4b3485145f
commit 11dad79794
30 changed files with 124 additions and 127 deletions

View File

@ -39,7 +39,7 @@ If possible, please copy and paste your OliveTin logs from when the error happen
**Screenshot of WebDeveloper console logs** **Screenshot of WebDeveloper console logs**
If you know how, and if you think it's relevant, a screenshot of the If you know how, and if you think it's relevant, a screenshot of the
WebDeveloper console from when you clicked a button is often really helpful. WebDeveloper console from when you clicked a button is often really helpful.
**Anything else?** **Anything else?**

View File

@ -4,7 +4,7 @@ First of all, thank you for considering to raise a pull request!
Don’t be afraid to ask for advice before working on a contribution. If you’re thinking about a bigger change, especially that might affect the core working or architecture, it’s almost essential to talk and ask about what you’re planning might affect things. Some of the larger future plans may not be documented well so it’s difficult to understand how your change might affect the general direction and roadmap of this project without asking. Don’t be afraid to ask for advice before working on a contribution. If you’re thinking about a bigger change, especially that might affect the core working or architecture, it’s almost essential to talk and ask about what you’re planning might affect things. Some of the larger future plans may not be documented well so it’s difficult to understand how your change might affect the general direction and roadmap of this project without asking.
The preferred way to communicate is probably via Discord or GitHub issues. The preferred way to communicate is probably via Discord or GitHub issues.
Helpful information to understand the project can be found here: [CONTRIBUTING](https://github.com/OliveTin/OliveTin/blob/main/CONTRIBUTING.adoc) Helpful information to understand the project can be found here: [CONTRIBUTING](https://github.com/OliveTin/OliveTin/blob/main/CONTRIBUTING.adoc)
@ -13,10 +13,10 @@ Helpful information to understand the project can be found here: [CONTRIBUTING](
# Checklist # Checklist
Please put a X in the boxes as evidence of reading through the checklist. Please put a X in the boxes as evidence of reading through the checklist.
- [ ] I have forked the project, and raised this PR on a feature branch. - [ ] I have forked the project, and raised this PR on a feature branch.
- [ ] `make githooks` has been run, and my git commit message was accepted by the git hook. - [ ] `make githooks` has been run, and my git commit message was accepted by the git hook.
- [ ] `make daemon-compile` runs without any issues. - [ ] `make daemon-compile` runs without any issues.
- [ ] `make daemon-codestyle` runs without any issues. - [ ] `make daemon-codestyle` runs without any issues.
- [ ] `make daemon-unittests` runs without any issues. - [ ] `make daemon-unittests` runs without any issues.
- [ ] `make webui-codestyle` runs without any issues. - [ ] `make webui-codestyle` runs without any issues.
- [ ] I understand and accept the [AGPL-3.0 license](LICENSE) and [code of conduct](CODE_OF_CONDUCT.md), and my contributions fall under these. - [ ] I understand and accept the [AGPL-3.0 license](LICENSE) and [code of conduct](CODE_OF_CONDUCT.md), and my contributions fall under these.

View File

@ -18,7 +18,7 @@ builds:
goarm: goarm:
- 5 # For old RPIs - 5 # For old RPIs
- 6 - 6
- 7 - 7
main: cmd/OliveTin/main.go main: cmd/OliveTin/main.go
@ -62,10 +62,10 @@ changelog:
- '^refactor:' - '^refactor:'
archives: archives:
- -
format: tar.gz format: tar.gz
files: files:
- config.yaml - config.yaml
- LICENSE - LICENSE
- README.md - README.md
@ -225,15 +225,14 @@ release:
## Container images ([on Docker Hub](https://hub.docker.com/r/jamesread/olivetin/tags?page=1&ordering=last_updated)) ## Container images ([on Docker Hub](https://hub.docker.com/r/jamesread/olivetin/tags?page=1&ordering=last_updated))
- `docker pull docker.io/jamesread/olivetin:{{ .Version }}` - `docker pull docker.io/jamesread/olivetin:{{ .Version }}`
## Upgrade warnings, or breaking changes ## Upgrade warnings, or breaking changes
- No such issues between the last release and this version. - No such issues between the last release and this version.
## Useful links ## Useful links
- [Which download do I need?](https://docs.olivetin.app/choose-package.html) - [Which download do I need?](https://docs.olivetin.app/choose-package.html)
- [Ask for help and chat with others users in the Discord community](https://discord.gg/jhYWWpNJ3v) - [Ask for help and chat with others users in the Discord community](https://discord.gg/jhYWWpNJ3v)
Thanks for your interest in OliveTin! Thanks for your interest in OliveTin!

10
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

View File

@ -7,9 +7,9 @@ of multiple projects, your time and interest in contributing is most welcome.
If you're not sure where to get started, raise an issue in the project. If you're not sure where to get started, raise an issue in the project.
Ideas may be discussed, purely on their merits and issues. Our Code of Conduct Ideas may be discussed, purely on their merits and issues. Our Code of Conduct
(CoC) is straightforward - it's important that contributors feel comfortable in (CoC) is straightforward - it's important that contributors feel comfortable in
discussion throughout the whole process. This project respects the discussion throughout the whole process. This project respects the
link:https://www.kernel.org/doc/html/latest/process/code-of-conduct.html[Linux Kernel code of conduct]. link:https://www.kernel.org/doc/html/latest/process/code-of-conduct.html[Linux Kernel code of conduct].
== If you're not sure, ask! == If you're not sure, ask!
@ -18,19 +18,19 @@ contribution. If you're thinking about a bigger change, especially that might
affect the core working or architecture, it's almost essential to talk and ask affect the core working or architecture, it's almost essential to talk and ask
about what you're planning might affect things. Some of the larger future plans may not be about what you're planning might affect things. Some of the larger future plans may not be
documented well so it's difficult to understand how your change might affect documented well so it's difficult to understand how your change might affect
the general direction and roadmap of this project without asking. the general direction and roadmap of this project without asking.
The preferred way to communicate is probably via Discord or GitHub issues. The preferred way to communicate is probably via Discord or GitHub issues.
=== Dev environment setup and clean build - Fedora === Dev environment setup and clean build - Fedora
``` ```
dnf install git go protobuf-compiler make -y dnf install git go protobuf-compiler make -y
git clone https://github.com/OliveTin/OliveTin.git git clone https://github.com/OliveTin/OliveTin.git
cd OliveTin cd OliveTin
# `make grpc` will also run `make go-tools`, which installs "buf". This binary # `make grpc` will also run `make go-tools`, which installs "buf". This binary
# will be put in your GOPATH/bin/, which should be on your path. buf is used to # will be put in your GOPATH/bin/, which should be on your path. buf is used to
# generate the protobuf / grpc stubs. # generate the protobuf / grpc stubs.
make grpc make grpc
make make
@ -39,10 +39,10 @@ make
=== Getting started to contribute; === Getting started to contribute;
The project layout is reasonably straightforward; The project layout is reasonably straightforward;
* See the `Makefile` for common targets. This project was originally created on top of Fedora, but it should be usable on Debian/your faveourite distro with minor changes (if any). * See the `Makefile` for common targets. This project was originally created on top of Fedora, but it should be usable on Debian/your faveourite distro with minor changes (if any).
* The API is defined in protobuf+grpc - you will need to `make grpc`. * The API is defined in protobuf+grpc - you will need to `make grpc`.
* The Go daemon is built from the `cmd` and `internal` directories mostly. * The Go daemon is built from the `cmd` and `internal` directories mostly.
* The webui is just a single page application with a bit of Javascript in the `webui` directory. This can happily be hosted on another webserver. * The webui is just a single page application with a bit of Javascript in the `webui` directory. This can happily be hosted on another webserver.

View File

@ -4,16 +4,16 @@ LABEL org.opencontainers.image.source https://github.com/OliveTin/OliveTin
LABEL org.opencontainers.image.title=OliveTin LABEL org.opencontainers.image.title=OliveTin
RUN mkdir -p /config /var/www/olivetin \ RUN mkdir -p /config /var/www/olivetin \
&& microdnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \ && microdnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \
iputils \ iputils \
openssh-clients \ openssh-clients \
shadow-utils \ shadow-utils \
docker \ docker \
&& microdnf clean all && microdnf clean all
RUN useradd --system --create-home olivetin -u 1000 RUN useradd --system --create-home olivetin -u 1000
EXPOSE 1337/tcp EXPOSE 1337/tcp
VOLUME /config VOLUME /config

View File

@ -5,14 +5,14 @@ LABEL org.opencontainers.image.title=OliveTin
RUN mkdir -p /config /var/www/olivetin \ RUN mkdir -p /config /var/www/olivetin \
&& \ && \
microdnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \ microdnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \
iputils \ iputils \
shadow-utils \ shadow-utils \
openssh-clients openssh-clients
RUN useradd --system --create-home olivetin -u 1000 RUN useradd --system --create-home olivetin -u 1000
EXPOSE 1337/tcp EXPOSE 1337/tcp
VOLUME /config VOLUME /config

View File

@ -5,14 +5,14 @@ LABEL org.opencontainers.image.title=OliveTin
RUN mkdir -p /config /var/www/olivetin \ RUN mkdir -p /config /var/www/olivetin \
&& \ && \
microdnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \ microdnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \
iputils \ iputils \
shadow-utils \ shadow-utils \
openssh-clients openssh-clients
RUN useradd --system --create-home olivetin -u 1000 RUN useradd --system --create-home olivetin -u 1000
EXPOSE 1337/tcp EXPOSE 1337/tcp
VOLUME /config VOLUME /config

8
Jenkinsfile vendored
View File

@ -14,7 +14,7 @@ pipeline {
sh 'make go-tools' sh 'make go-tools'
} }
} }
stage('Compile') { stage('Compile') {
steps { steps {
withEnv(["PATH+GO=/root/go/bin/"]) { withEnv(["PATH+GO=/root/go/bin/"]) {
@ -25,9 +25,9 @@ pipeline {
} }
} }
} }
stage ('Post-Compile') { stage ('Post-Compile') {
parallel { parallel {
stage('Codestyle') { stage('Codestyle') {
steps { steps {
withEnv(["PATH+GO=/root/go/bin/"]) { withEnv(["PATH+GO=/root/go/bin/"]) {
@ -45,6 +45,6 @@ pipeline {
} }
} }
} }
} }
} }

View File

@ -1,9 +1,9 @@
compile: daemon-compile-x64-lin compile: daemon-compile-x64-lin
daemon-compile-armhf: daemon-compile-armhf:
GOARCH=arm GOARM=6 go build -o OliveTin.armhf github.com/OliveTin/OliveTin/cmd/OliveTin GOARCH=arm GOARM=6 go build -o OliveTin.armhf github.com/OliveTin/OliveTin/cmd/OliveTin
daemon-compile-x64-lin: daemon-compile-x64-lin:
GOOS=linux go build -o OliveTin github.com/OliveTin/OliveTin/cmd/OliveTin GOOS=linux go build -o OliveTin github.com/OliveTin/OliveTin/cmd/OliveTin
daemon-compile-x64-win: daemon-compile-x64-win:
@ -14,7 +14,7 @@ daemon-compile: daemon-compile-armhf daemon-compile-x64-lin daemon-compile-x64-w
daemon-codestyle: daemon-codestyle:
go fmt ./... go fmt ./...
go vet ./... go vet ./...
gocyclo -over 4 cmd internal gocyclo -over 4 cmd internal
gocritic check ./... gocritic check ./...
daemon-unittests: daemon-unittests:
@ -24,7 +24,7 @@ daemon-unittests:
githooks: githooks:
cp -v .githooks/* .git/hooks/ cp -v .githooks/* .git/hooks/
go-tools: go-tools:
go install "github.com/bufbuild/buf/cmd/buf" go install "github.com/bufbuild/buf/cmd/buf"
go install "github.com/fzipp/gocyclo/cmd/gocyclo" go install "github.com/fzipp/gocyclo/cmd/gocyclo"
@ -37,7 +37,7 @@ go-tools:
grpc: go-tools grpc: go-tools
buf generate buf generate
dist: protoc dist: protoc
protoc: protoc:
protoc --go_out=. --go-grpc_out=. --grpc-gateway_out=. -I .:/usr/include/ OliveTin.proto protoc --go_out=. --go-grpc_out=. --grpc-gateway_out=. -I .:/usr/include/ OliveTin.proto
@ -54,7 +54,7 @@ podman-container:
integration-tests-docker-image: integration-tests-docker-image:
docker rm -f olivetin && docker rmi -f olivetin docker rm -f olivetin && docker rmi -f olivetin
docker build -t olivetin:latest . docker build -t olivetin:latest .
docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin docker create --name olivetin -p 1337:1337 -v `pwd`/integration-tests/configs/:/config/ olivetin
devrun: compile devrun: compile
killall OliveTin || true killall OliveTin || true
@ -70,4 +70,4 @@ webui-codestyle:
clean: clean:
rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen rm -rf dist OliveTin OliveTin.armhf OliveTin.exe reports gen
.PHONY: grpc .PHONY: grpc

View File

@ -2,7 +2,7 @@
<img alt = "project logo" src = "https://github.com/OliveTin/OliveTin/blob/main/webui/OliveTinLogo.png" align = "right" width = "160px" /> <img alt = "project logo" src = "https://github.com/OliveTin/OliveTin/blob/main/webui/OliveTinLogo.png" align = "right" width = "160px" />
OliveTin gives **safe** and **simple** access to predefined shell commands from a web interface. OliveTin gives **safe** and **simple** access to predefined shell commands from a web interface.
[![Discord](https://img.shields.io/discord/846737624960860180?label=Discord%20Server)](https://discord.gg/jhYWWpNJ3v) [![Discord](https://img.shields.io/discord/846737624960860180?label=Discord%20Server)](https://discord.gg/jhYWWpNJ3v)
[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/awesome-selfhosted/awesome-selfhosted#automation) [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/awesome-selfhosted/awesome-selfhosted#automation)
@ -11,7 +11,7 @@ OliveTin gives **safe** and **simple** access to predefined shell commands from
[![Go Report Card](https://goreportcard.com/badge/github.com/Olivetin/OliveTin)](https://goreportcard.com/report/github.com/OliveTin/OliveTin) [![Go Report Card](https://goreportcard.com/badge/github.com/Olivetin/OliveTin)](https://goreportcard.com/report/github.com/OliveTin/OliveTin)
[![Build Snapshot](https://github.com/OliveTin/OliveTin/actions/workflows/build-snapshot.yml/badge.svg)](https://github.com/OliveTin/OliveTin/actions/workflows/build-snapshot.yml) [![Build Snapshot](https://github.com/OliveTin/OliveTin/actions/workflows/build-snapshot.yml/badge.svg)](https://github.com/OliveTin/OliveTin/actions/workflows/build-snapshot.yml)
## Use cases ## Use cases
**Safely** give access to commands, for less technical people; **Safely** give access to commands, for less technical people;
@ -34,10 +34,10 @@ OliveTin gives **safe** and **simple** access to predefined shell commands from
## Features ## Features
* **Responsive, touch-friendly UI** - great for tablets and mobile * **Responsive, touch-friendly UI** - great for tablets and mobile
* **Super simple config in YAML** - because if it's not YAML now-a-days, it's not "cloud native" :-) * **Super simple config in YAML** - because if it's not YAML now-a-days, it's not "cloud native" :-)
* **Dark mode** - for those of you that roll that way. * **Dark mode** - for those of you that roll that way.
* **Accessible** - passes all the accessibility checks in Firefox, and issues with accessibility are taken seriously. * **Accessible** - passes all the accessibility checks in Firefox, and issues with accessibility are taken seriously.
* **Container** - available for quickly testing and getting it up and running, great for the selfhosted community. * **Container** - available for quickly testing and getting it up and running, great for the selfhosted community.
* **Integrate with anything** - OliveTin just runs Linux shell commands, so theoretially you could integrate with a bunch of stuff just by using curl, ping, etc. However, writing your own shell scripts is a great way to extend OliveTin. * **Integrate with anything** - OliveTin just runs Linux shell commands, so theoretially you could integrate with a bunch of stuff just by using curl, ping, etc. However, writing your own shell scripts is a great way to extend OliveTin.
* **Lightweight on resources** - uses only a few MB of RAM and barely any CPU. Written in Go, with a web interface written as a modern, responsive, Single Page App that uses the REST/gRPC API. * **Lightweight on resources** - uses only a few MB of RAM and barely any CPU. Written in Go, with a web interface written as a modern, responsive, Single Page App that uses the REST/gRPC API.
* **Good amount of unit tests and style checks** - helps potential contributors be consistent, and helps with maintainability. * **Good amount of unit tests and style checks** - helps potential contributors be consistent, and helps with maintainability.
@ -48,17 +48,17 @@ Desktop web browser;
![Desktop screenshot](media/screenshotDesktop.png) ![Desktop screenshot](media/screenshotDesktop.png)
Desktop web browser (dark mode); Desktop web browser (dark mode);
![Desktop screenshot](media/screenshotDesktopDark.png) ![Desktop screenshot](media/screenshotDesktopDark.png)
Mobile screen size (responsive layout); Mobile screen size (responsive layout);
![Mobile screenshot](media/screenshotMobile.png) ![Mobile screenshot](media/screenshotMobile.png)
## Documentation ## Documentation
All documentation can be found at http://docs.olivetin.app . This includes installation and usage guide, etc. All documentation can be found at http://docs.olivetin.app . This includes installation and usage guide, etc.
### Quickstart reference for `config.yaml` ### Quickstart reference for `config.yaml`
@ -75,19 +75,19 @@ Put this `config.yaml` in `/etc/OliveTin/` if you're running a standard service,
```yaml ```yaml
# 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"
# Actions (buttons) to show up on the WebUI: # Actions (buttons) to show up on the WebUI:
actions: actions:
# Docs: https://docs.olivetin.app/action-container-control.html # Docs: https://docs.olivetin.app/action-container-control.html
- title: Restart Plex - title: Restart Plex
icon: restart icon: restart
shell: docker restart plex shell: docker restart plex
# This will send 1 ping # This will send 1 ping
# Docs: https://docs.olivetin.app/action-ping.html # Docs: https://docs.olivetin.app/action-ping.html
- title: Ping host - title: Ping host
shell: ping {{ host }} -c {{ count }} shell: ping {{ host }} -c {{ count }}
@ -102,7 +102,7 @@ actions:
title: Count title: Count
type: int type: int
default: 1 default: 1
# Restart http on host "webserver1" # Restart http on host "webserver1"
# Docs: https://docs.olivetin.app/action-ssh.html # Docs: https://docs.olivetin.app/action-ssh.html
- title: restart httpd - title: restart httpd
@ -111,4 +111,3 @@ actions:
``` ```
A full example config can be found at in this repository - [config.yaml](https://github.com/OliveTin/OliveTin/blob/main/config.yaml). A full example config can be found at in this repository - [config.yaml](https://github.com/OliveTin/OliveTin/blob/main/config.yaml).

View File

@ -2,7 +2,7 @@
## Supported Versions ## Supported Versions
Currently, only the `main` branch is "supported". Currently, only the `main` branch is "supported".
| Version | Supported | | Version | Supported |
| ------- | ------------------ | | ------- | ------------------ |
@ -10,4 +10,4 @@ Currently, only the `main` branch is "supported".
## Reporting a Vulnerability ## Reporting a Vulnerability
Please email `contact@jread.com` for responsible disclosure. Accepted issues will be made public once patched, and you will be given credit. Please email `contact@jread.com` for responsible disclosure. Accepted issues will be made public once patched, and you will be given credit.

View File

@ -17,4 +17,3 @@ plugins:
# - name: openapiv2 # - name: openapiv2
# out: reports/openapiv2 # out: reports/openapiv2

View File

@ -1,5 +1,5 @@
version: v1 version: v1
deps: deps:
- buf.build/googleapis/googleapis - buf.build/googleapis/googleapis
lint: lint:
use: use:

View File

@ -1,15 +1,15 @@
# There is a built-in micro proxy that will host the webui and REST API all on # There is a built-in micro proxy that will host the webui and REST API all on
# one port (this is called the "Single HTTP Frontend") and means you just need # one port (this is called the "Single HTTP Frontend") and means you just need
# one open port in the container/firewalls/etc. # one open port in the container/firewalls/etc.
# #
# 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"
# Actions (buttons) to show up on the WebUI: # Actions (buttons) to show up on the WebUI:
actions: actions:
# This will run a simple script that you create. # This will run a simple script that you create.
- title: Run backup script - title: Run backup script
shell: /opt/backupScript.sh shell: /opt/backupScript.sh
@ -32,15 +32,15 @@ actions:
type: int type: int
default: 1 default: 1
description: How many times to do you want to ping? description: How many times to do you want to ping?
# Restart lightdm on host "server1" # Restart lightdm on host "server1"
# Docs: https://docs.olivetin.app/action-ping.html # Docs: https://docs.olivetin.app/action-ping.html
- title: restart httpd - title: restart httpd
icon: restart icon: restart
shell: ssh root@server1 'service httpd restart' shell: ssh root@server1 'service httpd restart'
# OliveTin can run long-running jobs like Ansible playbooks. # OliveTin can run long-running jobs like Ansible playbooks.
# #
# For such jobs, you will need to install ansible-playbook on the host where # For such jobs, you will need to install ansible-playbook on the host where
# you are running OliveTin, or in the container. # you are running OliveTin, or in the container.
# #
@ -51,7 +51,7 @@ actions:
timeout: 120 timeout: 120
# OliveTin can control containers - docker is just a command line app. # OliveTin can control containers - docker is just a command line app.
# #
# However, if you are running in a container you will need to do some setup, # However, if you are running in a container you will need to do some setup,
# see the docs below. # see the docs below.
# #
@ -76,4 +76,3 @@ actions:
shell: sleep 5 shell: sleep 5
timeout: 5 timeout: 5
icon: "&#x1F62A" icon: "&#x1F62A"

View File

@ -1,6 +1,6 @@
cypress: cypress:
npm install npm install
./cypressRun.sh "general" ./cypressRun.sh "general"
./cypressRun.sh "hiddenNav" ./cypressRun.sh "hiddenNav"
.PHONY: cypress container .PHONY: cypress container

View File

@ -1 +1 @@
# OliveTin-integration-tests # OliveTin-integration-tests

View File

@ -2,7 +2,7 @@
# (eg, snapshot builds on GitHub) # (eg, snapshot builds on GitHub)
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
config.vm.box = "generic/centos8" config.vm.box = "generic/centos8"
config.vm.provision "shell", inline: "mkdir /etc/OliveTin && chmod o+w /etc/OliveTin/", privileged: true config.vm.provision "shell", inline: "mkdir /etc/OliveTin && chmod o+w /etc/OliveTin/", privileged: true
config.vm.provision "file", source: "configs/config.general.yaml/.", destination: "/etc/OliveTin/config.yaml" config.vm.provision "file", source: "configs/config.general.yaml/.", destination: "/etc/OliveTin/config.yaml"

View File

@ -1,17 +1,17 @@
# #
# Integration Test Config: General # Integration Test Config: General
# #
listenAddressSingleHTTPFrontend: 0.0.0.0:1337 listenAddressSingleHTTPFrontend: 0.0.0.0:1337
logLevel: "DEBUG" logLevel: "DEBUG"
checkForUpdates: false checkForUpdates: false
actions: actions:
- title: Ping Google.com - title: Ping Google.com
shell: ping google.com -c 1 shell: ping google.com -c 1
icon: ping icon: ping
- title: restart lightdm - title: restart lightdm
icon: poop icon: poop
shell: ssh root@overseer 'service lightdm restart' shell: ssh root@overseer 'service lightdm restart'
@ -32,4 +32,3 @@ actions:
- title: Restart Plex - title: Restart Plex
icon: smile icon: smile
shell: docker restart plex shell: docker restart plex

View File

@ -1,12 +1,12 @@
# #
# Integration Test Config: General # Integration Test Config: General
# #
showFooter: false showFooter: false
checkForUpdates: false checkForUpdates: false
# Actions (buttons) to show up on the WebUI: # Actions (buttons) to show up on the WebUI:
actions: actions:
- title: Ping example.com - title: Ping example.com
shell: ping example.com -c 1 shell: ping example.com -c 1
icon: ping icon: ping

View File

@ -1,14 +1,14 @@
# #
# Integration Test Config: General # Integration Test Config: General
# #
listenAddressSingleHTTPFrontend: 0.0.0.0:1337 listenAddressSingleHTTPFrontend: 0.0.0.0:1337
showNavigation: false showNavigation: false
checkForUpdates: false checkForUpdates: false
# Actions (buttons) to show up on the WebUI: # Actions (buttons) to show up on the WebUI:
actions: actions:
- title: Ping example.com - title: Ping example.com
shell: ping example.com -c 1 shell: ping example.com -c 1
icon: ping icon: ping

View File

@ -17,5 +17,3 @@ describe('Homepage rendering', () => {
}) })
}) })
}); });

View File

@ -10,5 +10,3 @@ describe('Hidden Footer', () => {
}) })
}) })
}); });

View File

@ -14,5 +14,3 @@ describe('Hidden Nav', () => {
}) })
}) })
}); });

View File

@ -23,4 +23,3 @@
// //
// -- This will overwrite an existing command -- // -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

View File

@ -8,4 +8,3 @@ cp -f ./configs/config.$1.yaml ./configs/config.yaml
docker start olivetin docker start olivetin
NO_COLOR=1 ./node_modules/.bin/cypress run --headless -s cypress/integration/$1/* || true NO_COLOR=1 ./node_modules/.bin/cypress run --headless -s cypress/integration/$1/* || true
docker kill olivetin docker kill olivetin

View File

@ -48,7 +48,7 @@ stop()
status() { status() {
PID=$(pidof OliveTin) PID=$(pidof OliveTin)
RETVAL=$? RETVAL=$?
if [ $RETVAL -eq 1 ] ; then if [ $RETVAL -eq 1 ] ; then
echo "OliveTin is stopped" echo "OliveTin is stopped"

View File

@ -4,4 +4,4 @@ name=$RC_SVCNAME
description="OliveTin" description="OliveTin"
command="/usr/local/bin/OliveTin" command="/usr/local/bin/OliveTin"
pidfile="/run/${RC_SVCNAME}.pid" pidfile="/run/${RC_SVCNAME}.pid"
command_background=true command_background=true

View File

@ -63,10 +63,10 @@
<footer title = "footer"> <footer title = "footer">
<p><img title = "application icon" src = "OliveTinLogo.png" height = "1em" class = "logo" /> OliveTin</p> <p><img title = "application icon" src = "OliveTinLogo.png" height = "1em" class = "logo" /> OliveTin</p>
<p> <p>
<a href = "https://docs.olivetin.app" target = "_new">Documentation</a> | <a href = "https://docs.olivetin.app" target = "_new">Documentation</a> |
<a href = "https://github.com/OliveTin/OliveTin/issues/new/choose" target = "_new">Raise an issue on GitHub</a> | <a href = "https://github.com/OliveTin/OliveTin/issues/new/choose" target = "_new">Raise an issue on GitHub</a> |
<span id = "currentVersion">Version: ?</p> <span id = "currentVersion">Version: ?</p>
<a id = "available-version" href = "http://olivetin.app" target = "_blank" hidden>?</a> <a id = "available-version" href = "http://olivetin.app" target = "_blank" hidden>?</a>
</p> </p>
</footer> </footer>
@ -98,11 +98,11 @@
<template id = "tplLogRow"> <template id = "tplLogRow">
<tr class = "log-row"> <tr class = "log-row">
<td class = "timestamp">?</td> <td class = "timestamp">?</td>
<td> <td>
<span class = "icon" role = "icon"></span> <span class = "icon" role = "icon"></span>
<span class = "content">?</span> <span class = "content">?</span>
<details> <details>
<summary>stdout</summary> <summary>stdout</summary>
<pre class = "stdout"> <pre class = "stdout">
@ -124,7 +124,7 @@
</template> </template>
<script type = "text/javascript"> <script type = "text/javascript">
/** /**
This is the bootstrap code, which relies on very simple, old javascript This is the bootstrap code, which relies on very simple, old javascript
to at least display a helpful error message if we can't use OliveTin. to at least display a helpful error message if we can't use OliveTin.
*/ */

View File

@ -1053,9 +1053,9 @@
} }
}, },
"node_modules/eslint-plugin-node/node_modules/semver": { "node_modules/eslint-plugin-node/node_modules/semver": {
"version": "6.3.0", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true, "dev": true,
"bin": { "bin": {
"semver": "bin/semver.js" "semver": "bin/semver.js"
@ -2639,9 +2639,9 @@
} }
}, },
"node_modules/read-pkg/node_modules/semver": { "node_modules/read-pkg/node_modules/semver": {
"version": "5.7.1", "version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"dev": true, "dev": true,
"bin": { "bin": {
"semver": "bin/semver" "semver": "bin/semver"
@ -2796,9 +2796,9 @@
} }
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@ -4155,9 +4155,9 @@
"dev": true "dev": true
}, },
"semver": { "semver": {
"version": "6.3.0", "version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"dev": true "dev": true
} }
} }
@ -5281,9 +5281,9 @@
} }
}, },
"semver": { "semver": {
"version": "5.7.1", "version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"dev": true "dev": true
}, },
"type-fest": { "type-fest": {
@ -5399,9 +5399,9 @@
} }
}, },
"semver": { "semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"