Compare commits

..

19 Commits

Author SHA1 Message Date
orangecoding
e6ca3a78f0 next release version 2025-12-09 13:55:32 +01:00
orangecoding
89c93efa17 adding features 2025-12-09 13:40:13 +01:00
orangecoding
9a6ae5c30a merged master 2025-12-09 12:54:45 +01:00
orangecoding
f6bfc0f3ae upgrade version 2025-11-27 16:08:20 +01:00
orangecoding
e7ea0369ed upgrade version 2025-11-27 16:04:55 +01:00
orangecoding
b74268a234 merged master 2025-11-27 15:58:12 +01:00
orangecoding
3d40d9a548 storing settings in db 2025-11-17 12:06:26 +01:00
orangecoding
656a615b4a Merge branch 'master' into listing-management 2025-11-17 10:28:16 +01:00
orangecoding
f9e08015f1 preparing new settings page 2025-11-02 15:04:19 +01:00
orangecoding
f0ecfb12c7 preparing new settings page 2025-11-02 15:01:19 +01:00
orangecoding
96cd9098f0 improve filtering for listings 2025-11-01 16:29:05 +01:00
orangecoding
60525d4cca merged master 2025-11-01 10:50:58 +01:00
orangecoding
77a7c5493c preparing listing management 2025-11-01 10:45:19 +01:00
orangecoding
99a23fff06 improving footer 2025-11-01 10:36:58 +01:00
orangecoding
712fa84a02 smaller security and memory improvements 2025-11-01 10:30:08 +01:00
orangecoding
2d31608fc6 renaming settings -> general settings 2025-11-01 10:20:27 +01:00
orangecoding
946160345d aligning run now button 2025-11-01 10:09:40 +01:00
orangecoding
9bd05e1e73 improving processing times label and hide when screen width is too low 2025-11-01 10:08:13 +01:00
orangecoding
1104f200ac upgrading dependencies, fixing image placeholder 2025-11-01 09:42:01 +01:00
8 changed files with 33 additions and 110 deletions

View File

@@ -1,47 +1,7 @@
# Dependencies (will be installed fresh in container)
node_modules/
# Database and config (mounted as volumes)
npm-debug.log
test/
db/
conf/
# Git
.git/
.github/
.gitignore
# IDE and editor
.idea/
.vscode/
*.swp
*.swo
.DS_Store
# Testing
test/
# Documentation
doc/
*.md
!README.md
# Development config files
.babelrc
.husky/
.nvmrc
.prettierrc
.prettierignore
eslint.config.js
# Docker files (not needed inside container)
Dockerfile
docker-compose.yml
docker-test.sh
.dockerignore
# Logs
*.log
npm-debug.log
# Build artifacts (built fresh in container)
dist/

View File

@@ -1,58 +1,27 @@
# ================================
# Stage 1: Build stage
# ================================
FROM node:22-alpine AS builder
WORKDIR /build
# Install build dependencies needed for native modules (better-sqlite3)
RUN apk add --no-cache python3 make g++
# Copy package files first for better layer caching
COPY package.json yarn.lock ./
# Install all dependencies (including devDependencies for building)
RUN yarn config set network-timeout 600000 \
&& yarn --frozen-lockfile
# Copy source files needed for build
COPY index.html vite.config.js ./
COPY ui ./ui
COPY lib ./lib
# Build frontend assets
RUN yarn build:frontend
# ================================
# Stage 2: Production stage
# ================================
FROM node:22-alpine
FROM node:22-slim
WORKDIR /fredy
# Install Chromium and curl (for healthcheck)
# Using Alpine's chromium package which is much smaller
RUN apk add --no-cache chromium curl
# Install Chromium and curl without extra recommended packages and clean apt cache
# curl is needed for the health check
RUN apt-get update \
&& apt-get install -y --no-install-recommends chromium curl \
&& rm -rf /var/lib/apt/lists/*
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Install build dependencies for native modules, then remove them after yarn install
COPY package.json yarn.lock ./
# Copy lockfiles first to leverage cache for dependencies
COPY package.json yarn.lock .
RUN apk add --no-cache --virtual .build-deps python3 make g++ \
&& yarn config set network-timeout 600000 \
&& yarn --frozen-lockfile --production \
&& yarn cache clean \
&& apk del .build-deps
# Set Yarn timeout, install dependencies and PM2 globally
RUN yarn config set network-timeout 600000 \
&& yarn --frozen-lockfile \
&& yarn global add pm2
# Copy built frontend from builder stage
COPY --from=builder /build/ui/public ./ui/public
# Copy application source (only what's needed at runtime)
COPY index.js ./
COPY index.html ./
COPY lib ./lib
# Copy application source and build production assets
COPY . .
RUN yarn build:frontend
# Prepare runtime directories and symlinks for data and config
RUN mkdir -p /db /conf \
@@ -65,4 +34,5 @@ EXPOSE 9998
VOLUME /db
VOLUME /conf
CMD ["node", "index.js"]
# Start application using PM2 runtime
CMD ["pm2-runtime", "index.js"]

View File

@@ -107,10 +107,6 @@ yarn run start:frontend # in another terminal
👉 Open <http://localhost:9998>
### With Unraid
Should you use [Unraid](https://unraid.net/), you can now install Fredy from the community store :)
**Default Login:**
- Username: `admin`
- Password: `admin`

View File

@@ -1,24 +1,22 @@
services:
fredy:
container_name: fredy
# build from empty build folder to reduce size of image
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/orangecoding/fredy
# map existing config and database
volumes:
- ./conf:/conf
- ./db:/db
ports:
- "9998:9998"
restart: unless-stopped
# Resource limits to prevent runaway memory usage from Chromium
deploy:
resources:
limits:
memory: 1G
healthcheck:
test: ["CMD", "curl", "--fail", "--silent", "--show-error", "--max-time", "5", "http://localhost:9998/"]
# The container will immediately stop when health check fails after retries
test: ["CMD-SHELL", "curl --fail --silent --show-error --max-time 5 http://localhost:9998/ || exit 1"]
interval: 120s
timeout: 10s
retries: 3
start_period: 30s
retries: 1
start_period: 10s

View File

@@ -1,4 +1,9 @@
export const DEFAULT_CONFIG = {
interval: '60',
port: 9998,
workingHours: { from: '', to: '' },
demoMode: false,
analyticsEnabled: null,
// Default path for sqlite storage directory. Interpreted relative to project root.
sqlitepath: '/db',
};

View File

@@ -3,8 +3,6 @@ import fs from 'fs';
import path from 'path';
import { nanoid } from 'nanoid';
import logger from '../../../logger.js';
import { DEFAULT_CONFIG } from '../../../../defaultConfig.js';
import { getDirName } from '../../../../utils.js';
export function up(db) {
db.exec(`
@@ -69,10 +67,6 @@ export function up(db) {
'analyticsEnabled',
config.analyticsEnabled != null ? config.analyticsEnabled : defaults.analyticsEnabled,
);
//now making sure only sqlite path remains in the config
const sqlitepath = config.sqlitepath || DEFAULT_CONFIG.sqlitepath;
fs.writeFileSync(`${getDirName()}/../conf/config.json`, JSON.stringify({ sqlitepath }));
} catch (e) {
logger.error(e);
}

View File

@@ -22,8 +22,8 @@ function compileSettings(rows, configValues) {
config[r.name] = parsed && typeof parsed === 'object' && 'value' in parsed ? parsed.value : parsed;
}
return {
...configValues,
...config,
...configValues,
};
}

View File

@@ -1,6 +1,6 @@
{
"name": "fredy",
"version": "15.1.1",
"version": "15.0.0",
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
"scripts": {
"prepare": "husky",