Skip to content

Commit

Permalink
Rebrand to OpenShock
Browse files Browse the repository at this point in the history
  • Loading branch information
redmushie committed Oct 1, 2023
1 parent e3f6967 commit c03a02a
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: ci-develop
env:
BRANCH: develop
REGISTRY: ghcr.io
ARTIFACT_NAME: shocklink-webui.zip
ARTIFACT_NAME: openshock-webui.zip
IMAGE_NAME: ${{ github.repository_owner }}/webui
TARGET_ENV: container
NODE_ENV: development
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: ci-master
env:
BRANCH: master
REGISTRY: ghcr.io
ARTIFACT_NAME: shocklink-webui.zip
ARTIFACT_NAME: openshock-webui.zip
IMAGE_NAME: ${{ github.repository_owner }}/webui
TARGET_ENV: container
NODE_ENV: production
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: ci-tag
# TARGET_ENV is used by Webpack to determine the build target.
env:
REGISTRY: ghcr.io
ARTIFACT_NAME: shocklink-webui.zip
ARTIFACT_NAME: openshock-webui.zip
IMAGE_NAME: ${{ github.repository_owner }}/webui
TARGET_ENV: container
NODE_ENV: production
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM nginx:1-alpine

ENV SHOCKLINK_API_URL=https://api.shocklink.net
ENV SHOCKLINK_WEBUI_URL=https://shocklink.net/#/
ENV SHOCKLINK_SHARE_URL=https://shockl.ink/
# Default values.
ENV OPENSHOCK_NAME=LocalShock
ENV OPENSHOCK_URL=http://localhost:5001
ENV OPENSHOCK_API_URL=http://localhost:5002
ENV OPENSHOCK_SHARE_URL=https://shockl.ink

# Copy release artifacts (static JS and CSS bundles)
COPY dist /usr/share/nginx/html
Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ShockLink WebUI
# OpenShock WebUI

This is the ShockLink Web UI. It is a single-page application that communicates with the [ShockLink API](https://github.com/Shock-Link/API). It is written using JavaScript and SCSS using the Vue 3 framework.
This is the OpenShock Web UI. It is a single-page application that communicates with the [OpenShock API](https://github.com/OpenShock/API). It is written using JavaScript and SCSS using the Vue 3 framework.

## Contents

Expand All @@ -16,29 +16,31 @@ This is the ShockLink Web UI. It is a single-page application that communicates

# Configuring

The [webui](https://github.com/Shock-Link/WebUI/pkgs/container/webui) container supports configuration via environment variables.
The [webui](https://github.com/OpenShock/WebUI/pkgs/container/webui) container supports configuration via environment variables.

|Variable|Default|Description|
|-|-|-|
|`SHOCKLINK_API_URL`|`https://api.shocklink.net/`| URL of the API. |
|`SHOCKLINK_WEBUI_URL`|`https://shocklink.net/#/`| URL of the ShockLink WebUI. |
|`SHOCKLINK_SHARE_URL`|`https://shockl.ink/s/`| URL to prefix share links with. When visited, should redirect to `${SHOCKLINK_WEBUI_URL}/public/proxy/shares/links/{ID}`. |
|`OPENSHOCK_NAME`|`LocalShock`| Name of the OpenShock instance. |
|`OPENSHOCK_URL`|`http://webui:80`| URL of the OpenShock WebUI. (NO trailing slash!) |
|`OPENSHOCK_SHARE_URL`|`https://webui:80/s`| URL to prefix share links with. (NO trailing slash!) When visited, should redirect to `${OPENSHOCK_WEBUI_URL}/public/proxy/shares/links/{ID}`. |
|`OPENSHOCK_API_URL`|`http://api:80/`| URL of the API. (NO trailing slash!) |

# Deployment

This documentation describes how to self-host the WebUI container. This might not be of interest to you if you are content using [ShockLink.net](https://shocklink.net).
This documentation describes how to self-host the WebUI container. This might not be of interest to you if you are content using a public OpenShock instance such as [ShockLink.net](https://shocklink.net).

## Using Docker
Assuming you are running on `localhost`, with [the API](https://github.com/Shock-Link/API) running on port `5001`:
Assuming you are running on `localhost`, with [the API](https://github.com/OpenShock/API) running on port `5001`:

```bash
$ docker run \
-p 5002:80/tcp \
-e SHOCKLINK_API_URL=http://localhost:5001/ \
-e SHOCKLINK_WEBUI_URL=http://localhost:5002/#/ \
-e SHOCKLINK_SHARE_URL=http://localhost:5002/#/public/proxy/shares/links/ \
--name shocklink-webui \
ghcr.io/shocklink/webui:latest
-e OPENSHOCK_NAME=LocalShock \
-e OPENSHOCK_URL=http://localhost:5002 \
-e OPENSHOCK_API_URL=http://localhost:5001 \
-e OPENSHOCK_SHARE_URL=http://localhost:5002/#/public/proxy/shares/links/ \
--name openshoc-webui \
ghcr.io/OpenShock/webui:latest
```

## Using `docker-compose`
Expand Down
15 changes: 8 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ services:
redis:
image: redis/redis-stack-server:latest
volumes:
- /opt/docker/shocklink/redis/redis-stack.conf:/redis-stack.conf
- /opt/docker/openshock/redis/redis-stack.conf:/redis-stack.conf

# The API.
# Check https://github.com/Shock-Link/API for the latest configuration settings.
# Check https://github.com/OpenShock/API for the latest configuration settings.
api:
image: ghcr.io/shock-link/api:latest
image: ghcr.io/OpenShock/api:latest
depends_on:
- db
- redis
Expand All @@ -32,12 +32,13 @@ services:

# The Web UI (this repository).
webui:
image: ghcr.io/redmushie/webui:master
image: ghcr.io/OpenShock/webui:master
depends_on:
- api
ports:
- "5002:80/tcp"
environment:
- SHOCKLINK_API_URL=http://local:5001/
- SHOCKLINK_WEBUI_URL=http://local:5002/#/
- SHOCKLINK_SHARE_URL=http://local:5002/#/public/proxy/shares/links/
- OPENSHOCK_NAME=LocalShock
- OPENSHOCK_URL=http://local:5002
- OPENSHOCK_API_URL=http://api:80
- OPENSHOCK_SHARE_URL=http://local:5002/#/public/proxy/shares/links/
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "shocklink_web_ui",
"name": "openshock_web_ui",
"version": "1.3.0",
"description": "",
"main": "index.js",
Expand Down
10 changes: 5 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ShockLink</title>
<title>OPENSHOCK_NAME</title>

<meta property="og:title" content="ShockLink" />
<meta property="og:title" content="OPENSHOCK_NAME" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://shocklink.net" />
<meta property="og:image" content="https://shocklink.net/static/images/shocklink-logo-only.png" />
<meta property="og:description" content="ShockLink.net is a platform to control shockers (shock collars) for humans over the internet. Free and open source!" />
<meta property="og:url" content="OPENSHOCK_URL" />
<meta property="og:image" content="OPENSHOCK_URL/static/images/shocklink-logo-only.png" />
<meta property="og:description" content="OPENSHOCK_NAME is a platform to control shockers (shock collars) for humans over the internet. Free and open source!" />
</head>

<body data-color-scheme="dark">
Expand Down
6 changes: 3 additions & 3 deletions src/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<p class="version">ShockLink UI 1.4.0
<a target="_blank" :href="'https://github.com/Shock-Link/WebUI/commit/' + commitHash">{{ commitHash }}</a> | API <span
<p class="version">OpenShock UI 1.4.0
<a target="_blank" :href="'https://github.com/OpenShock/WebUI/commit/' + commitHash">{{ commitHash }}</a> | API <span
v-html="apiVersion"></span> <a target="_blank"
:href="'https://github.com/Shock-Link/API/commit/' + apiCommitHash">{{ apiCommitHash }}</a> | <span>{{ targetEnv }}</span>
:href="'https://github.com/OpenShock/API/commit/' + apiCommitHash">{{ apiCommitHash }}</a> | <span>{{ targetEnv }}</span>
</p>
<p class="cred"><a href="https://github.com/OpenShock">Made by OpenShock Team</a></p>
<p class="status" :style="'color: #' + connectionColor + ';'" v-html="$store.state.userHubState"></p>
Expand Down
7 changes: 4 additions & 3 deletions src/globals/config/config.container.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const config = {
apiUrl: "SHOCKLINK_API_URL",
webUiUrl: "SHOCKLINK_WEBUI_URL",
shortUrl: "SHOCKLINK_SHARE_URL"
name: "OPENSHOCK_NAME",
webUiUrl: "OPENSHOCK_URL/#/", // WebUI URL is formatted like "OPENSHOCK_URL/#/"
apiUrl: "OPENSHOCK_API_URL/",
shortUrl: "OPENSHOCK_SHARE_URL" // No trailing slash since this can be _anything_.
}

global.config = config;
1 change: 1 addition & 0 deletions src/globals/config/config.development.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const config = {
name: "ShockLink Dev",
apiUrl: "https://dev-api.shocklink.net/",
webUiUrl: "https://dev.shocklink.net/#/",
shortUrl: "https://shockl.ink/",
Expand Down
3 changes: 2 additions & 1 deletion src/globals/config/config.local.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const config = {
apiUrl: "https://localhost/",
name: "LocalShock",
webUiUrl: "https://localhost:8080/#/",
apiUrl: "https://localhost/",
shortUrl: "https://shockl.ink/"
}

Expand Down
1 change: 1 addition & 0 deletions src/globals/config/config.production.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const config = {
name: "ShockLink",
apiUrl: "https://api.shocklink.net/",
webUiUrl: "https://shocklink.net/#/",
shortUrl: "https://shockl.ink/"
Expand Down
2 changes: 1 addition & 1 deletion src/views/Login/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>
<div v-else>
<loading-view :loading="!requestDone" :error="!successful"
:successText="'<p><b>Successfully logged in!</b></p><p>Redirecting to <br><b><u>ShockLink Dashboard</u></b></p>'"
:successText="'<p><b>Successfully logged in!</b></p><p>Redirecting to <br><b><u>Dashboard</u></b></p>'"
:errorText="errorMessage"/>
<div class="sep-or">
<a class="txt2" @click="resetAll">Go Back</a>
Expand Down
2 changes: 1 addition & 1 deletion src/views/public/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<b-container>
<b-row>
<b-col align-self="center">
<h1>ShockLink Landing Page</h1>
<h1>OPENSHOCK_NAME Landing Page</h1>
</b-col>
</b-row>
<b-row>
Expand Down
6 changes: 3 additions & 3 deletions src/views/public/nav/PublicNavRoot.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<nav class="navbar first-level">
<a class="navbar-logo"><img src="@/assets/images/Logo.svg" alt="ShockLink Logo"/></a>
<a class="navbar-logo"><img src="@/assets/images/Logo.svg" alt="OpenShock Logo"/></a>
<theme-toggle/>
<button class="navbar-toggler" @click="mobileShow = !mobileShow" type="button"
aria-controls="navbarSupportedContent" aria-expanded="false"
Expand All @@ -14,8 +14,8 @@
<div class="right"/>
</div>
<item v-for="(item, index) in allElements" :item="item" :index="index" :key="index"/>
<item-link-external link="https://docs.shocklink.net"><i class="fa-solid fa-book-open-reader"></i>Wiki</item-link-external>
<item-link-external link="https://github.com/Shock-Link"><i class="fa-brands fa-github"></i>GitHub</item-link-external>
<item-link-external link="https://docs.openshock.net"><i class="fa-solid fa-book-open-reader"></i>Wiki</item-link-external>
<item-link-external link="https://github.com/OpenShock"><i class="fa-brands fa-github"></i>GitHub</item-link-external>
<item-link v-if="loggedIn" link="/dashboard"><i class="fa-solid fa-right-to-bracket"></i>Dashboard</item-link>
<item-link v-else link="/account/login"><i class="fa-solid fa-right-to-bracket"></i>Login</item-link>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/views/public/proxy/ShareLinksProxy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</b-form-group>
<div v-else>
<b-row style="margin-bottom: 10px;">
<b-button variant="outline-light" @click="login">Login with ShockLink Account</b-button>
<b-button variant="outline-light" @click="login">Login with OPENSHOCK_NAME Account</b-button>
</b-row>
<b-row>
<b-button variant="outline-light" @click="guest">Enter as Guest</b-button>
Expand Down
9 changes: 5 additions & 4 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Variables for startup script
SERVE_PATH=/usr/share/nginx/html
NAME=ShockLink
NAME=OpenShock

require() {
if [ -z "$1" ]; then
Expand All @@ -26,9 +26,10 @@ inject() {
}

# Inject our variables.
inject SHOCKLINK_API_URL $SHOCKLINK_API_URL
inject SHOCKLINK_WEBUI_URL $SHOCKLINK_WEBUI_URL
inject SHOCKLINK_SHARE_URL $SHOCKLINK_SHARE_URL
inject OPENSHOCK_NAME $OPENSHOCK_NAME
inject OPENSHOCK_API_URL $OPENSHOCK_API_URL
inject OPENSHOCK_WEBUI_URL $OPENSHOCK_WEBUI_URL
inject OPENSHOCK_SHARE_URL $OPENSHOCK_SHARE_URL

# Start nginx as normal.
# If something breaks, see: https://github.com/nginxinc/docker-nginx/blob/master/mainline/debian/Dockerfile
Expand Down

0 comments on commit c03a02a

Please sign in to comment.