diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index b22edfe..ab31ba8 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -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 diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index ad8b8b8..93dc508 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -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 diff --git a/.github/workflows/ci-tag.yml b/.github/workflows/ci-tag.yml index 55901ab..e44aa85 100644 --- a/.github/workflows/ci-tag.yml +++ b/.github/workflows/ci-tag.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 36e64b9..78d7f81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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://webui.localhost:5002 +ENV OPENSHOCK_API_URL=http://api.localhost:5001 +ENV OPENSHOCK_SHARE_URL= # Copy release artifacts (static JS and CSS bundles) COPY dist /usr/share/nginx/html diff --git a/README.md b/README.md index 0e2cba6..a60cba9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 openshock-webui \ + ghcr.io/openshock/webui:latest ``` ## Using `docker-compose` diff --git a/docker-compose.yml b/docker-compose.yml index 0a52706..bc048b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,12 +14,13 @@ 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 + container_name: api depends_on: - db - redis @@ -32,12 +33,16 @@ services: # The Web UI (this repository). webui: - image: ghcr.io/redmushie/webui:master + # Make sure to fresh build if you make changes: + # docker-compose up --build + build: . + container_name: webui 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://webui.localhost:5002 + - OPENSHOCK_API_URL=http://api.localhost:5001 + - OPENSHOCK_SHARE_URL=http://webui.localhost:5002/#/public/proxy/shares/links/ diff --git a/package-lock.json b/package-lock.json index 9b51b2e..118b330 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "shocklink_web_ui", + "name": "openshock_web_ui", "version": "1.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "shocklink_web_ui", + "name": "openshock_web_ui", "version": "1.3.0", "license": "AGPL", "dependencies": { diff --git a/package.json b/package.json index fa1802f..2df1571 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { - "name": "shocklink_web_ui", + "name": "openshock_web_ui", "version": "1.3.0", "description": "", "main": "index.js", "scripts": { "build": "webpack", + "build-ci": "webpack --mode production --env TARGET_ENV=container", "local": "webpack-dev-server --mode development --env TARGET_ENV=local --https", "dev": "webpack-dev-server --mode development --env TARGET_ENV=development --https" }, diff --git a/public/index.container.html b/public/index.container.html new file mode 100644 index 0000000..cbad2f9 --- /dev/null +++ b/public/index.container.html @@ -0,0 +1,21 @@ + + + + + + + OPENSHOCK_NAME + + + + + + + + + +
+ + + + \ No newline at end of file diff --git a/public/index.html b/public/index.shocklink.html similarity index 78% rename from public/index.html rename to public/index.shocklink.html index a924907..55f1c51 100644 --- a/public/index.html +++ b/public/index.shocklink.html @@ -10,7 +10,7 @@ - + diff --git a/src/Footer.vue b/src/Footer.vue index 640a2b5..7ced790 100644 --- a/src/Footer.vue +++ b/src/Footer.vue @@ -1,8 +1,8 @@