test2
This commit is contained in:
parent
5b0fe3cff1
commit
3e77e08b24
@ -1,7 +1,8 @@
|
||||
FROM oven/bun:latest
|
||||
WORKDIR /usr/src/app
|
||||
COPY . .
|
||||
COPY config.json /etc/netgateswitch/config.json
|
||||
VOLUME [ "/config"]
|
||||
COPY config.json /config/config.json
|
||||
RUN bun install --frozen-lockfile --production
|
||||
ENV NODE_ENV=production
|
||||
EXPOSE 7000/tcp
|
||||
|
@ -5,4 +5,4 @@ services:
|
||||
- '7000:7000'
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /home/ns:/etc/netgateswitch:ro
|
||||
- /home/ns:/config:ro
|
||||
|
6
index.ts
6
index.ts
@ -1,6 +1,6 @@
|
||||
import { serve } from 'bun';
|
||||
import { RouterOSAPI } from 'node-routeros';
|
||||
import cfg from '/etc/netgateswitch/config.json';
|
||||
import cfg from '/config/config.json';
|
||||
|
||||
let api = new RouterOSAPI({
|
||||
host: cfg.host,
|
||||
@ -184,7 +184,7 @@ async function writeConfig(
|
||||
cfg.proxycidr = pcidr;
|
||||
|
||||
haslogin = true;
|
||||
await Bun.write('/etc/netgateswitch/config.json', JSON.stringify(cfg));
|
||||
await Bun.write('/config/config.json', JSON.stringify(cfg));
|
||||
}
|
||||
|
||||
async function cleanConfig() {
|
||||
@ -195,5 +195,5 @@ async function cleanConfig() {
|
||||
cfg.password = '';
|
||||
cfg.maincidr = '';
|
||||
cfg.proxycidr = '';
|
||||
await Bun.write('/etc/netgateswitch/config.json', JSON.stringify(cfg));
|
||||
await Bun.write('/config/config.json', JSON.stringify(cfg));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user