mirror of
https://github.com/lone-cloud/prism
synced 2026-06-04 12:13:28 -07:00
more dockerfile adjustments
This commit is contained in:
parent
8b746a0d2a
commit
4d515f91ea
7 changed files with 18 additions and 18 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
services:
|
services:
|
||||||
sup-server:
|
server:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: server/Dockerfile
|
dockerfile: server/Dockerfile
|
||||||
|
|
@ -21,7 +21,6 @@ services:
|
||||||
|
|
||||||
protonmail-bridge:
|
protonmail-bridge:
|
||||||
image: shenxn/protonmail-bridge:build
|
image: shenxn/protonmail-bridge:build
|
||||||
container_name: protonmail-bridge
|
|
||||||
profiles: ['protonmail']
|
profiles: ['protonmail']
|
||||||
volumes:
|
volumes:
|
||||||
- proton-bridge-data:/root
|
- proton-bridge-data:/root
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
services:
|
services:
|
||||||
sup-server:
|
server:
|
||||||
image: ghcr.io/lone-cloud/sup-server:latest
|
image: ghcr.io/lone-cloud/sup-server:latest
|
||||||
ports:
|
ports:
|
||||||
- '8080:8080'
|
- '8080:8080'
|
||||||
|
|
@ -19,7 +19,6 @@ services:
|
||||||
|
|
||||||
protonmail-bridge:
|
protonmail-bridge:
|
||||||
image: shenxn/protonmail-bridge:build
|
image: shenxn/protonmail-bridge:build
|
||||||
container_name: protonmail-bridge
|
|
||||||
profiles: ['protonmail']
|
profiles: ['protonmail']
|
||||||
volumes:
|
volumes:
|
||||||
- proton-bridge-data:/root
|
- proton-bridge-data:/root
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM oven/bun:1.1.42-alpine AS builder
|
FROM oven/bun:1.3.6-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
@ -9,7 +9,7 @@ COPY server .
|
||||||
|
|
||||||
RUN bun build --compile index.ts --outfile sup-server
|
RUN bun build --compile index.ts --outfile sup-server
|
||||||
|
|
||||||
FROM alpine:3.21
|
FROM alpine:3.23
|
||||||
|
|
||||||
ARG SIGNAL_CLI_VERSION=0.13.22
|
ARG SIGNAL_CLI_VERSION=0.13.22
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
const HOME = process.env.HOME || '/root';
|
const HOME = process.env.HOME || '/root';
|
||||||
|
|
||||||
export const SIGNAL_CLI_BIN = '../signal-cli/bin/signal-cli';
|
const SIGNAL_CLI_BIN = '../signal-cli/bin/signal-cli';
|
||||||
|
export const SIGNAL_CLI = (await Bun.file(SIGNAL_CLI_BIN).exists()) ? SIGNAL_CLI_BIN : 'signal-cli';
|
||||||
|
|
||||||
export const SIGNAL_CLI_SOCKET = '/tmp/signal-cli.sock';
|
export const SIGNAL_CLI_SOCKET = '/tmp/signal-cli.sock';
|
||||||
export const SIGNAL_CLI_DATA_DIR = `${HOME}/.local/share/signal-cli`;
|
export const SIGNAL_CLI_DATA_DIR = `${HOME}/.local/share/signal-cli`;
|
||||||
export const SIGNAL_CLI_DATA = `${HOME}/.local/share/signal-cli/data`;
|
export const SIGNAL_CLI_DATA = `${HOME}/.local/share/signal-cli/data`;
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,11 @@ import {
|
||||||
PROTON_BRIDGE_HOST,
|
PROTON_BRIDGE_HOST,
|
||||||
PROTON_BRIDGE_PORT,
|
PROTON_BRIDGE_PORT,
|
||||||
SUP_TOPIC,
|
SUP_TOPIC,
|
||||||
VERBOSE,
|
|
||||||
} from '../constants/config';
|
} from '../constants/config';
|
||||||
|
import { log } from '../utils/log';
|
||||||
import { createGroup, sendGroupMessage } from './signal';
|
import { createGroup, sendGroupMessage } from './signal';
|
||||||
import { getGroupId, register } from './store';
|
import { getGroupId, register } from './store';
|
||||||
|
|
||||||
const log = (...args: unknown[]) => VERBOSE && console.log(...args);
|
|
||||||
|
|
||||||
export async function startProtonMonitor() {
|
export async function startProtonMonitor() {
|
||||||
if (!BRIDGE_IMAP_USERNAME || !BRIDGE_IMAP_PASSWORD) {
|
if (!BRIDGE_IMAP_USERNAME || !BRIDGE_IMAP_PASSWORD) {
|
||||||
console.error(
|
console.error(
|
||||||
|
|
@ -25,10 +23,8 @@ export async function startProtonMonitor() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
log(chalk.blue(`🔗 Connecting to Proton Bridge at ${PROTON_BRIDGE_HOST}:${PROTON_BRIDGE_PORT}`));
|
||||||
chalk.blue(`🔗 Connecting to Proton Bridge at ${PROTON_BRIDGE_HOST}:${PROTON_BRIDGE_PORT}`),
|
log(chalk.blue(`📨 Monitoring mailbox: ${BRIDGE_IMAP_USERNAME}`));
|
||||||
);
|
|
||||||
console.log(chalk.blue(`📨 Monitoring mailbox: ${BRIDGE_IMAP_USERNAME}`));
|
|
||||||
|
|
||||||
const imap = new Imap({
|
const imap = new Imap({
|
||||||
user: BRIDGE_IMAP_USERNAME,
|
user: BRIDGE_IMAP_USERNAME,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import { rm } from 'node:fs/promises';
|
import { rm } from 'node:fs/promises';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { DAEMON_START_MAX_ATTEMPTS, DEVICE_NAME, VERBOSE } from '../constants/config';
|
import { DAEMON_START_MAX_ATTEMPTS, DEVICE_NAME, VERBOSE } from '../constants/config';
|
||||||
import { SIGNAL_CLI_BIN, SIGNAL_CLI_DATA, SIGNAL_CLI_SOCKET } from '../constants/paths';
|
import { SIGNAL_CLI, SIGNAL_CLI_DATA, SIGNAL_CLI_SOCKET } from '../constants/paths';
|
||||||
import type { ListAccountsResult, StartLinkResult, UpdateGroupResult } from '../types';
|
import type { ListAccountsResult, StartLinkResult, UpdateGroupResult } from '../types';
|
||||||
|
import { log } from '../utils/log';
|
||||||
|
|
||||||
|
log(`Running signal-cli from ${SIGNAL_CLI}`);
|
||||||
|
|
||||||
// Local development uses relative path, Docker uses PATH
|
|
||||||
const SIGNAL_CLI_PATH = (await Bun.file(SIGNAL_CLI_BIN).exists()) ? SIGNAL_CLI_BIN : 'signal-cli';
|
|
||||||
const MESSAGE_DELIMITER = '\n';
|
const MESSAGE_DELIMITER = '\n';
|
||||||
let account: string | null = null;
|
let account: string | null = null;
|
||||||
let currentLinkUri: string | null = null;
|
let currentLinkUri: string | null = null;
|
||||||
|
|
@ -152,7 +153,7 @@ export async function startDaemon() {
|
||||||
let authError = false;
|
let authError = false;
|
||||||
let cleaned = false;
|
let cleaned = false;
|
||||||
|
|
||||||
const proc = Bun.spawn([SIGNAL_CLI_PATH, 'daemon', '--socket', SIGNAL_CLI_SOCKET], {
|
const proc = Bun.spawn([SIGNAL_CLI, 'daemon', '--socket', SIGNAL_CLI_SOCKET], {
|
||||||
stdout: 'pipe',
|
stdout: 'pipe',
|
||||||
stderr: 'pipe',
|
stderr: 'pipe',
|
||||||
});
|
});
|
||||||
|
|
|
||||||
3
server/utils/log.ts
Normal file
3
server/utils/log.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
import { VERBOSE } from '../constants/config';
|
||||||
|
|
||||||
|
export const log = (...args: unknown[]) => VERBOSE && console.log(...args);
|
||||||
Loading…
Add table
Reference in a new issue