Compare commits
4 Commits
spacecruft
...
production
Author | SHA1 | Date |
---|---|---|
Cameron Clough | deccb39c44 | |
Cameron Clough | 128f8b4c91 | |
Cameron Clough | 0b629806fc | |
Adam Black | f8f82df082 |
|
@ -9,6 +9,10 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
|
logging:
|
||||||
|
options:
|
||||||
|
max-size: "200k"
|
||||||
|
max-file: "10"
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
# See traefik/traefik.toml for static config
|
# See traefik/traefik.toml for static config
|
||||||
|
@ -28,9 +32,11 @@ services:
|
||||||
# Use the retropilot-server image from the GitHub Container Registry
|
# Use the retropilot-server image from the GitHub Container Registry
|
||||||
image: ghcr.io/retropilot/retropilot-server:production
|
image: ghcr.io/retropilot/retropilot-server:production
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
logging:
|
||||||
|
driver: none
|
||||||
volumes:
|
volumes:
|
||||||
# Mount realdata dir to /realdata in the container
|
# Mount dir to /realdata in the container
|
||||||
- ./realdata:/realdata
|
- /home/retro-data/prod:/realdata
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
labels:
|
labels:
|
||||||
|
@ -54,8 +60,10 @@ services:
|
||||||
# But run the worker script instead
|
# But run the worker script instead
|
||||||
command: npm run worker
|
command: npm run worker
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
logging:
|
||||||
|
driver: none
|
||||||
volumes:
|
volumes:
|
||||||
- ./realdata:/realdata
|
- /home/retro-data/prod:/realdata
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
labels:
|
labels:
|
||||||
|
@ -65,6 +73,10 @@ services:
|
||||||
watchtower:
|
watchtower:
|
||||||
# automatically update containers when new images are released
|
# automatically update containers when new images are released
|
||||||
image: containrrr/watchtower
|
image: containrrr/watchtower
|
||||||
|
logging:
|
||||||
|
options:
|
||||||
|
max-size: "200k"
|
||||||
|
max-file: "10"
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
command: --interval 30 --label-enable
|
command: --interval 30 --label-enable
|
||||||
|
|
|
@ -41,6 +41,8 @@ services:
|
||||||
# Use the retropilot-server image from the GitHub Container Registry
|
# Use the retropilot-server image from the GitHub Container Registry
|
||||||
image: ghcr.io/retropilot/retropilot-server:main
|
image: ghcr.io/retropilot/retropilot-server:main
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
logging:
|
||||||
|
driver: none
|
||||||
volumes:
|
volumes:
|
||||||
# Mount realdata dir to /realdata in the container
|
# Mount realdata dir to /realdata in the container
|
||||||
- ./realdata:/realdata
|
- ./realdata:/realdata
|
||||||
|
@ -67,6 +69,8 @@ services:
|
||||||
# But run the worker script instead
|
# But run the worker script instead
|
||||||
command: npm run worker
|
command: npm run worker
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
logging:
|
||||||
|
driver: none
|
||||||
volumes:
|
volumes:
|
||||||
- ./realdata:/realdata
|
- ./realdata:/realdata
|
||||||
env_file:
|
env_file:
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import authentication from './authentication';
|
import authentication from './authentication';
|
||||||
import { Accounts } from '../../models';
|
import { Accounts } from '../../models';
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,7 @@ export async function SetResearchStatus(userId, status) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function GetResearchStatus(userId) {
|
export async function GetResearchStatus(userId) {
|
||||||
return Accounts.findOne({where: {id: userId}, attributes: ['research_enabled']})
|
return Accounts.findOne({ where: { id: userId }, attributes: ['research_enabled'] });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default null;
|
export default null;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import log4js from 'log4js';
|
|
||||||
|
|
||||||
import admin from './admin';
|
import admin from './admin';
|
||||||
import auth from './auth';
|
import auth from './auth';
|
||||||
|
|
|
@ -1,34 +1,25 @@
|
||||||
import bodyParser from 'body-parser';
|
|
||||||
import crypto from 'crypto';
|
|
||||||
import dirTree from 'directory-tree';
|
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import log4js from 'log4js';
|
|
||||||
|
|
||||||
import { requireAuthenticated } from '../../../middlewares/authentication';
|
import { requireAuthenticated } from '../../../middlewares/authentication';
|
||||||
import { SetResearchStatus, GetResearchStatus } from '../../../controllers/user/settings';
|
import { SetResearchStatus, GetResearchStatus } from '../../../controllers/user/settings';
|
||||||
|
|
||||||
const logger = log4js.getLogger();
|
|
||||||
|
|
||||||
// /api/devices
|
// /api/devices
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
router.patch('/research/:enabled', requireAuthenticated, async (req, res) => {
|
router.patch('/research/:enabled', requireAuthenticated, async (req, res) => {
|
||||||
const { enabled } = req.params;
|
const { enabled } = req.params;
|
||||||
if (!enabled) { res.json({ bad: true }); }
|
if (!enabled) { res.json({ bad: true }); }
|
||||||
const doEnable = enabled === 'true';
|
const doEnable = enabled === 'true';
|
||||||
const accountId = req.account.id;
|
|
||||||
|
|
||||||
const update = await SetResearchStatus(req.account.id, doEnable);
|
|
||||||
|
|
||||||
return res.json({ success: true, data: req.account });
|
|
||||||
});
|
|
||||||
|
|
||||||
router.get('/research/', requireAuthenticated, async (req, res) => {
|
await SetResearchStatus(req.account.id, doEnable);
|
||||||
const accountId = req.account.id;
|
|
||||||
|
return res.json({ success: true, data: req.account });
|
||||||
const update = await GetResearchStatus(req.account.id);
|
});
|
||||||
|
|
||||||
return res.json({ success: true, data: update });
|
router.get('/research/', requireAuthenticated, async (req, res) => {
|
||||||
});
|
const update = await GetResearchStatus(req.account.id);
|
||||||
|
|
||||||
|
return res.json({ success: true, data: update });
|
||||||
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|
Loading…
Reference in New Issue