Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/nodejsdeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:

- run: npm install
- run: npm run build --if-present
env:
VUE_APP_CESIUM_TOKEN: ${{ secrets.CESIUM_TOKEN }}

- name: deploy to server
uses: AEnterprise/rsync-deploy@v1.0.2
Expand Down
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ WORKDIR /usr/src/app
# Install git (needed for submodules)
RUN apt-get update && apt-get install -y git

# Create a non-root user
RUN useradd -m -u 2000 nodeuser

# Copy package files first for better caching
COPY package*.json ./

Expand All @@ -23,5 +26,14 @@ RUN git submodule update
# Run the update-browserslist-db as suggested in the warning
RUN npx update-browserslist-db@latest

# Change ownership of the app directory to the non-root user
RUN chown -R nodeuser:nodeuser /usr/src/app

# Switch to non-root user
USER nodeuser

# Configure git to trust the mounted directory
RUN git config --global --add safe.directory /usr/src/app

EXPOSE 8080
CMD [ "npm", "run", "dev" ]
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@ or build the docker file locally:
docker build -t <your username>/uavlogviewer .

# Run Docker Image
docker run -p 8080:8080 -d <your username>/uavlogviewer

# View Running Containers
docker ps

# View Container Log
docker logs <container id>
docker run -e VUE_APP_CESIUM_TOKEN=<Your cesium ion token> -it -p 8080:8080 -v ${PWD}:/usr/src/app <your username>/uavlogviewer

# Navigate to localhost:8080 in your web browser

# changes should automatically be applied to the viewer

```
3 changes: 2 additions & 1 deletion config/dev.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ const { merge } = require('webpack-merge')
const prodEnv = require('./prod.env')

module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
NODE_ENV: '"development"',
VUE_APP_CESIUM_TOKEN: JSON.stringify(process.env.VUE_APP_CESIUM_TOKEN || '')
})
3 changes: 2 additions & 1 deletion config/prod.env.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict'
module.exports = {
NODE_ENV: '"production"'
NODE_ENV: '"production"',
VUE_APP_CESIUM_TOKEN: JSON.stringify(process.env.VUE_APP_CESIUM_TOKEN || '')
}
5 changes: 2 additions & 3 deletions src/components/CesiumViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ import {
isPointInPolygon
} from './cesiumExtra/boundingPolygon.js'

Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwMTIzNmJhM' +
'y1jNDE3LTQ0MzAtODVkMS1mZmUzODdjMTg0MGIiLCJpZCI6MzAzNjYzLCJpYXQiOjE3NDc2MjEzOTR9.Eu' +
'W7FIgBv2OzYDyy0xfCWiExKyLIK9S4qJoT4D5-qrM'
// Set Cesium token from environment variable
Ion.defaultAccessToken = process.env.VUE_APP_CESIUM_TOKEN || ''

const colorCoderMode = new ColorCoderMode(store)
const colorCoderRange = new ColorCoderRange(store)
Expand Down