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
3 changes: 1 addition & 2 deletions .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ ROOT=https://your-produciton-server.com
KEY=
USER_JOHNDOE=
USER_TEST=
LOCALHOST=127.0.0.1
LOCALHOSTv6=::1
MAPBOX=
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
NODE_ENV: ${{ vars.NODE_ENV }}
KEY: ${{ secrets.KEY }}
USER_TEST: ${{ secrets.USER_TEST }}
MAPBOX: ${{ secrets.MAPBOX }}

steps:
- uses: actions/checkout@v3
Expand All @@ -27,7 +28,7 @@ jobs:
- run: npm run build --if-present
- name: Start server
run: |
sudo NODE_ENV=$NODE_ENV KEY=$KEY USER_TEST=$USER_TEST npm start &
sudo NODE_ENV=$NODE_ENV KEY=$KEY USER_TEST=$USER_TEST MAPBOX=$MAPBOX npm start &
sleep 16 # Give server some time to start
- name: Check if server is running
run: |
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ This application is designed to be used with the [OSMAND+ mobile app]([url](http
Due to a plugin called [Triprecording]([url](https://osmand.net/docs/user/plugins/trip-recording/))
Using the above link or by [clicking here](https://osmand.net/docs/user/plugins/trip-recording#recording-settings) more information can be found to setup webtracking or "online tracking"

## Mapbox
Mapbox requires an access token.
These can be created for free [register required]([url](https://tiles.mapbox.com/signup))
Once available, add it to the envrionment variables.

## DEMO
At this point, there is no demo, but here is a screenshot:
![Demo LOREX, markers on a map in berlin, information about speed and distance on the right](https://raw.githubusercontent.com/Type-Style/LOREX/dev/demo.png)
Binary file modified demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
160 changes: 1 addition & 159 deletions httpdocs/color-table.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified httpdocs/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions httpdocs/images/marker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions init/generatePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ const rl = readline.createInterface({
output: process.stdout
});


if (!process.env.KEY) {
console.error("KEY is missing! Please provide Environment Variable KEY. \nExample: KEY=your-key node ./init/generatePassword.js");
return;
}


// Prompt user for input
rl.question('Enter Password to be generated: ', async (input) => {
const cryptedPassword = await crypt(input);
Expand Down
26 changes: 13 additions & 13 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
Expand Up @@ -92,7 +92,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-leaflet": "^4.2.1",
"react-router-dom": "^6.26.0",
"react-router-dom": "^6.26.1",
"toobusy-js": "^0.5.1"
},
"_moduleAliases": {
Expand Down
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ app.use((req, res, next) => { // clean up IPv6 Addresses
})

if (process.env.NODE_ENV != "development") {
app.use(helmet({ contentSecurityPolicy: { directives: { "default-src": "'self'", "img-src": "*" } } }));
app.use(helmet({ contentSecurityPolicy: { directives: { "default-src": "'self'", "img-src": "*" } }, referrerPolicy: { policy: "strict-origin-when-cross-origin" } }));
}
app.use(cache);
app.use(compression())
Expand All @@ -58,7 +58,7 @@ app.set('trust proxy',true);
// routes
app.get(['/', '/login'], (req, res) => {
logger.log(req.ip + " - " + res.locals.ip, true);
res.render("index");
res.render("index", {"mapbox": process.env.MAPBOX, "root": process.env.ROOT});
});

app.use('/write', writeRouter);
Expand Down
Loading