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