This commit is contained in:
Björn Ellensohn 2024-01-11 16:07:52 +01:00
parent d315aa06ba
commit 18db82318d
13 changed files with 150 additions and 44 deletions

Binary file not shown.

View File

@ -1,11 +0,0 @@
actions:
- title: "Start Navigation Stack"
shell: docker compose -f /repo/docker-compose.yaml up -d navigation
- title: "Stop Navigation Stack"
shell: docker compose -f /repo/docker-compose.yaml down navigation
- title: "Start Mapping"
shell: docker compose -f /repo/docker-compose.yaml up -d mapping
- title: "Stop Mapping"
shell: docker compose -f /repo/docker-compose.yaml down mapping
- title: "Restart Teleop"
shell: docker compose -f /repo/docker-compose.yaml restart teleop

View File

@ -0,0 +1,36 @@
showNavigation: false
logLevel: "INFO"
showNewVersions: false
showFooter: false
actions:
- title: "Start Navigation Stack"
shell: podman-compose -f /repo/docker-compose.yaml up -d navigation
icon: '<img src = "customIcons/nav2_start.png" width = "48px"/>'
- title: "Stop Navigation Stack"
shell: docker compose -f /repo/docker-compose.yaml down navigation
icon: '<img src = "customIcons/nav2_stop.png" width = "48px"/>'
- title: "Start Mapping"
shell: docker compose -f /repo/docker-compose.yaml up -d mapping
icon: '<img src = "customIcons/mapping_start.gif" width = "48px"/>'
- title: "Stop Mapping"
shell: docker compose -f /repo/docker-compose.yaml down mapping
icon: '<img src = "customIcons/mapping_stop.gif" width = "48px"/>'
- title: "Restart Teleop"
icon: '<img src = "customIcons/gamepad.png" width = "48px"/>'
shell: docker restart cps_loki-teleop-1
- title: Restart or Shutdown System
icon: restart
shell: systemctl {{ choice }}
arguments:
- name: choice
title: Pick one
choices:
- value: reboot
- value: shutdown
- value: grafana
# This will SSH into a server an run the command 'service httpd restart'
- title: Restart httpd on Server 1
shell: ssh bjorn@loki.local 'echo "it works"'
icon: ping
timeout: 5

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1 @@
ba1fa920-2863-4600-994f-23559acfcab2

View File

@ -157,13 +157,59 @@ services:
# privileged: true # privileged: true
# volumes: # volumes:
# - ./config/olivetin.yaml:/config/config.yaml # replace host path or volume as needed # - ./config/olivetin.yaml:/config/config.yaml # replace host path or volume as needed
# - .:/repo # # - .:/repo
# - /var/run/docker.sock:/var/run/docker.sock # - /var/run/docker.sock:/var/run/docker.sock
# - /var/lib/docker:/var/lib/docker # # - /var/lib/docker:/var/lib/docker
# ports: # ports:
# - "88:1337" # - "80:1337"
# restart: unless-stopped # restart: unless-stopped
config:
container_name: olivetin
image: jamesread/olivetin
#image: ghcr.io/bjoernellens1/cps_bot_mini_ws/olivetin
build:
context: .
dockerfile: docker/Dockerfile
tags:
- ghcr.io/bjoernellens1/cps_bot_mini_ws/olivetin
target: olivetin
x-bake:
platforms:
#- linux/arm64
- linux/amd64
user: root
privileged: true
volumes:
- ./config/olivetin/:/config/ # here is config.yaml and icons located
- ./config/olivetin/icons:/var/www/olivetin/customIcons
- .:/repo
- /var/run/docker.sock:/var/run/docker.sock
# - /var/lib/docker:/var/lib/docker
- ~/.ssh/id_rsa:/root/.ssh/id_rsa
ports:
- "80:1337"
restart: unless-stopped
portainer:
container_name: portainer
#image: jamesread/olivetin
image: portainer/portainer-ce:latest
volumes:
- ./config/olivetin/:/config/ # here is config.yaml and icons located
- ./config/olivetin/icons:/var/www/olivetin/customIcons
- .:/repo
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
# - /var/lib/docker:/var/lib/docker
- ~/.ssh/id_rsa:/root/.ssh/id_rsa
ports:
- "8000:8000"
- "9443:9443"
restart: unless-stopped
################################################################################################################################ ################################################################################################################################
# This section is mostly for supervision from PC # # This section is mostly for supervision from PC #
################################################################################################################################ ################################################################################################################################
@ -201,3 +247,5 @@ services:
# Needed to display graphical applications # Needed to display graphical applications
privileged: true privileged: true
networks: {} networks: {}
volumes:
portainer_data:

View File

@ -93,45 +93,45 @@ LABEL org.opencontainers.image.source=https://github.com/bjoernellens1/cps_loki
############################################# #############################################
# OliveTin Build # # OliveTin Build #
############################################# #############################################
# FROM registry.fedoraproject.org/fedora:39 AS olivetin FROM registry.fedoraproject.org/fedora:39 AS olivetin
# LABEL org.opencontainers.image.source https://ghcr.io/bjoernellens1/cps_bot_mini_ws/olivetin LABEL org.opencontainers.image.source https://ghcr.io/bjoernellens1/cps_bot_mini_ws/olivetin
# LABEL org.opencontainers.image.title=OliveTin LABEL org.opencontainers.image.title=OliveTin
# # Making sure there is newest docker version installed # Making sure there is newest docker version installed
# RUN dnf -y install dnf-plugins-core \ RUN dnf -y install dnf-plugins-core \
# && dnf -y install 'dnf-command(config-manager)' \ && dnf -y install 'dnf-command(config-manager)' \
# && dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo \ && dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo \
# && dnf -y install docker-ce-cli docker-compose-plugin --setopt=install_weak_deps=False && dnf -y install docker-ce-cli docker-compose-plugin --setopt=install_weak_deps=False
# # Install OliveTin and dependencies # Install OliveTin and dependencies
# RUN mkdir -p /config /var/www/olivetin \ RUN mkdir -p /config /var/www/olivetin \
# && dnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \ && dnf install -y --nodocs --noplugins --setopt=keepcache=0 --setopt=install_weak_deps=0 \
# iputils \ iputils \
# openssh-clients \ openssh-clients \
# shadow-utils \ shadow-utils \
# OliveTin \ OliveTin \
# && dnf clean all && dnf 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
# USER olivetin USER olivetin
# ENTRYPOINT [ "/usr/bin/OliveTin" ] ENTRYPOINT [ "/usr/bin/OliveTin" ]
# FROM alpine AS olivetin FROM docker AS olivetin
RUN wget https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.apk
RUN apk add --allow-untrusted OliveTin_linux_amd64.apk
# RUN wget https://github.com/OliveTin/OliveTin/releases/download/2023.12.21/OliveTin_linux_amd64.deb
# RUN apt install ./OliveTin_linux_amd64.deb
# Expose the default OliveTin port
EXPOSE 1337
# RUN wget https://github.com/OliveTin/OliveTin/releases/latest/download/OliveTin_linux_amd64.apk # Set the default command to run OliveTin
# RUN apk add --allow-untrusted OliveTin_linux_amd64.apk docker-cli-compose CMD ["OliveTin"]
# # Expose the default OliveTin port
# EXPOSE 1337
# # Set the default command to run OliveTin
# CMD ["OliveTin"]

32
webapi.py Normal file
View File

@ -0,0 +1,32 @@
import requests
import json
url = "https://loki.local:9443/api/auth"
# Set your admin username and password
username = "cpsadmin"
password = "pac99CPS"
# Define the payload for the POST request
payload = {
"Username": username,
"Password": password
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, data=json.dumps(payload), headers=headers, verify=False)
# Check the response status code
if response.status_code == 200:
print("Authentication successful!")
# You can access the response content using response.text or response.json() if the content is in JSON format
print("Response content:", response.text)
else:
print("Authentication failed. Status code:", response.status_code)
print("Response content:", response.text)
token = response