mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 19:54:44 -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:
|
||||
sup-server:
|
||||
server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: server/Dockerfile
|
||||
|
|
@ -21,7 +21,6 @@ services:
|
|||
|
||||
protonmail-bridge:
|
||||
image: shenxn/protonmail-bridge:build
|
||||
container_name: protonmail-bridge
|
||||
profiles: ['protonmail']
|
||||
volumes:
|
||||
- proton-bridge-data:/root
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
services:
|
||||
sup-server:
|
||||
server:
|
||||
image: ghcr.io/lone-cloud/sup-server:latest
|
||||
ports:
|
||||
- '8080:8080'
|
||||
|
|
@ -19,7 +19,6 @@ services:
|
|||
|
||||
protonmail-bridge:
|
||||
image: shenxn/protonmail-bridge:build
|
||||
container_name: protonmail-bridge
|
||||
profiles: ['protonmail']
|
||||
volumes:
|
||||
- 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
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ COPY 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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
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_DATA_DIR = `${HOME}/.local/share/signal-cli`;
|
||||
export const SIGNAL_CLI_DATA = `${HOME}/.local/share/signal-cli/data`;
|
||||
|
|
|
|||
|
|
@ -8,13 +8,11 @@ import {
|
|||
PROTON_BRIDGE_HOST,
|
||||
PROTON_BRIDGE_PORT,
|
||||
SUP_TOPIC,
|
||||
VERBOSE,
|
||||
} from '../constants/config';
|
||||
import { log } from '../utils/log';
|
||||
import { createGroup, sendGroupMessage } from './signal';
|
||||
import { getGroupId, register } from './store';
|
||||
|
||||
const log = (...args: unknown[]) => VERBOSE && console.log(...args);
|
||||
|
||||
export async function startProtonMonitor() {
|
||||
if (!BRIDGE_IMAP_USERNAME || !BRIDGE_IMAP_PASSWORD) {
|
||||
console.error(
|
||||
|
|
@ -25,10 +23,8 @@ export async function startProtonMonitor() {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log(
|
||||
chalk.blue(`🔗 Connecting to Proton Bridge at ${PROTON_BRIDGE_HOST}:${PROTON_BRIDGE_PORT}`),
|
||||
);
|
||||
console.log(chalk.blue(`📨 Monitoring mailbox: ${BRIDGE_IMAP_USERNAME}`));
|
||||
log(chalk.blue(`🔗 Connecting to Proton Bridge at ${PROTON_BRIDGE_HOST}:${PROTON_BRIDGE_PORT}`));
|
||||
log(chalk.blue(`📨 Monitoring mailbox: ${BRIDGE_IMAP_USERNAME}`));
|
||||
|
||||
const imap = new Imap({
|
||||
user: BRIDGE_IMAP_USERNAME,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { rm } from 'node:fs/promises';
|
||||
import chalk from 'chalk';
|
||||
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 { 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';
|
||||
let account: string | null = null;
|
||||
let currentLinkUri: string | null = null;
|
||||
|
|
@ -152,7 +153,7 @@ export async function startDaemon() {
|
|||
let authError = 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',
|
||||
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