diff --git a/.dockerignore b/.dockerignore index c77a412f..5fcee18d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ node_modules -github \ No newline at end of file +github +public \ No newline at end of file diff --git a/.gitignore b/.gitignore index ff227fe9..29550455 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -node_modules/ -data/ \ No newline at end of file +node_modules +data +public \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index cd99f47e..95ddea40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM node:14-alpine +RUN apk update && apk add --no-cache nano + WORKDIR /app COPY package*.json ./ @@ -10,6 +12,7 @@ COPY . . RUN mkdir -p ./public ./data \ && cd ./client \ + && npm install --production \ && npm run build \ && cd .. \ && mv ./client/build/* ./public \ diff --git a/Dockerfile.multiarch b/Dockerfile.multiarch index 0cb17885..808b8157 100644 --- a/Dockerfile.multiarch +++ b/Dockerfile.multiarch @@ -1,5 +1,7 @@ FROM node:14-alpine +RUN apk update && apk add --no-cache nano + WORKDIR /app COPY package*.json ./ @@ -11,6 +13,7 @@ COPY . . RUN mkdir -p ./public ./data \ && cd ./client \ + && npm install --production \ && npm run build \ && cd .. \ && mv ./client/build/* ./public \ diff --git a/README.md b/README.md index 6f4927c4..cca0f49a 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,23 @@ Follow instructions from wiki: [Installation without Docker](https://github.com/  ## Usage +### Search bar +> While opening links, module will follow `Open all links in the same tab` setting +#### Supported search engines +| Name | Prefix | Search URL | +|------------|--------|-------------------------------------| +| Disroot | /ds | http://search.disroot.org/search?q= | +| DuckDuckGo | /d | https://duckduckgo.com/?q= | +| Google | /g | https://www.google.com/search?q= | + +#### Supported services +| Name | Prefix | Search URL | +|--------------------|--------|-----------------------------------------------| +| IMDb | /im | https://www.imdb.com/find?q= | +| Reddit | /r | -https://www.reddit.com/search?q= | +| The Movie Database | /mv | https://www.themoviedb.org/search?query= | +| Youtube | /yt | https://www.youtube.com/results?search_query= | + ### Setting up weather module 1. Obtain API Key from [Weather API](https://www.weatherapi.com/pricing.aspx). > Free plan allows for 1M calls per month. Flame is making less then 3K API calls per month. @@ -99,6 +116,11 @@ Follow instructions from wiki: [Installation without Docker](https://github.com/ - Format: `www.domain.com`, `domain.com`, `sub.domain.com`, `local`, `ip`, `ip:port` - Redirect: `http://{dest}` +### Custom CSS +> This is an experimental feature. Its behaviour might change in the future. +> +Follow instructions from wiki: [Custom CSS](https://github.com/pawelmalak/flame/wiki/Custom-CSS) + ## Support If you want to support development of Flame and my upcoming self-hosted and open source projects you can use the following link: diff --git a/Socket.js b/Socket.js index 0ae1f563..a6a58c64 100644 --- a/Socket.js +++ b/Socket.js @@ -1,11 +1,13 @@ const WebSocket = require('ws'); +const Logger = require('./utils/Logger'); +const logger = new Logger(); class Socket { constructor(server) { this.webSocketServer = new WebSocket.Server({ server }) this.webSocketServer.on('listening', () => { - console.log('Socket: listen'); + logger.log('Socket: listen'); }) this.webSocketServer.on('connection', (webSocketClient) => { diff --git a/api.js b/api.js index 6ea1ab17..a720fe24 100644 --- a/api.js +++ b/api.js @@ -1,15 +1,17 @@ -const path = require('path'); +const { join } = require('path'); const express = require('express'); const errorHandler = require('./middleware/errorHandler'); const api = express(); // Static files -api.use(express.static(path.join(__dirname, 'public'))); +api.use(express.static(join(__dirname, 'public'))); +api.use('/uploads', express.static(join(__dirname, 'data/uploads'))); api.get(/^\/(?!api)/, (req, res) => { - res.sendFile(path.join(__dirname, 'public/index.html')); + res.sendFile(join(__dirname, 'public/index.html')); }) + // Body parser api.use(express.json()); diff --git a/client/.env b/client/.env index 5a3822fd..70acd433 100644 --- a/client/.env +++ b/client/.env @@ -1 +1 @@ -REACT_APP_VERSION=1.4.0 \ No newline at end of file +REACT_APP_VERSION=1.5.0 \ No newline at end of file diff --git a/client/public/flame.css b/client/public/flame.css new file mode 100644 index 00000000..e69de29b diff --git a/client/public/index.html b/client/public/index.html index 2ede77fe..3f43c404 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -4,15 +4,10 @@ - - - - + +