GitHub Actions commited on
Commit
053deef
·
0 Parent(s):

Deploy WitNote with VNC and API support

Browse files
Files changed (5) hide show
  1. Dockerfile +80 -0
  2. README.md +330 -0
  3. api_server.py +22 -0
  4. nginx.conf +38 -0
  5. start.sh +57 -0
Dockerfile ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Ubuntu 22.04 as base
2
+ FROM ubuntu:22.04
3
+
4
+ # Prevent interactive prompts during installation
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Update and install basic dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ curl \
10
+ git \
11
+ xvfb \
12
+ x11vnc \
13
+ fluxbox \
14
+ websockify \
15
+ nginx \
16
+ python3-pip \
17
+ libnss3 \
18
+ libatk1.0-0 \
19
+ libatk-bridge2.0-0 \
20
+ libcups2 \
21
+ libdrm2 \
22
+ libgtk-3-0 \
23
+ libgbm1 \
24
+ libasound2 \
25
+ x11-xserver-utils \
26
+ wget \
27
+ ca-certificates \
28
+ gnupg \
29
+ build-essential \
30
+ && rm -rf /var/lib/apt/lists/*
31
+
32
+ # Install FastAPI and Uvicorn for health/info API
33
+ RUN pip3 install fastapi uvicorn
34
+
35
+ # Install Node.js 20
36
+ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
37
+ && apt-get install -y nodejs
38
+
39
+ # Setup noVNC
40
+ RUN mkdir -p /opt/noVNC && \
41
+ git clone https://github.com/novnc/noVNC.git /opt/noVNC && \
42
+ git clone https://github.com/novnc/websockify /opt/noVNC/utils/websockify && \
43
+ ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html
44
+
45
+ # Create a non-root user
46
+ RUN useradd -m -u 1000 user
47
+ ENV HOME=/home/user
48
+ WORKDIR /home/user
49
+
50
+ # Create vault directory
51
+ RUN mkdir -p /app/vault && chown user:user /app/vault && chmod 777 /app/vault
52
+ ENV VAULT_ROOT=/app/vault
53
+
54
+ # Clone and build the application from the official repository
55
+ # This avoids git storage and binary file issues in the Hugging Face Space repository
56
+ RUN git clone https://github.com/hooosberg/WitNote.git /home/user/app-source
57
+ WORKDIR /home/user/app-source
58
+ RUN npm install
59
+ # Build the Linux package
60
+ RUN npm run build:linux
61
+
62
+ # Install the built .deb package as root
63
+ USER root
64
+ # Find the .deb file and install it
65
+ RUN apt-get update && apt-get install -y ./release/*.deb || apt-get install -f -y
66
+
67
+ # Copy configuration and startup files from the build context
68
+ WORKDIR /home/user
69
+ COPY --chown=user:user api_server.py .
70
+ COPY --chown=user:user nginx.conf .
71
+ COPY --chown=user:user start.sh .
72
+ RUN chmod +x start.sh
73
+
74
+ # HF Spaces requirements
75
+ USER user
76
+ ENV DISPLAY=:99
77
+ EXPOSE 7860
78
+
79
+ # Launch using the startup script
80
+ CMD ["/home/user/start.sh"]
README.md ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: WitNote
3
+ emoji: 🧘
4
+ colorFrom: blue
5
+ colorTo: gray
6
+ sdk: docker
7
+ app_port: 7860
8
+ pinned: false
9
+ ---
10
+
11
+ <p align="center">
12
+ <img src="src/icon/智简icon 拷贝.png" alt="WitNote" width="128" height="128">
13
+ </p>
14
+
15
+ <h1 align="center">WitNote</h1>
16
+
17
+ <p align="center">
18
+ <strong>Smart Core, Simple Form</strong>
19
+ <br>
20
+ Everything is a file
21
+ <br>
22
+ <a href="https://hooosberg.github.io/WitNote/">🌐 Official Website</a>
23
+ </p>
24
+
25
+ <p align="center">
26
+ <a href="README.md">English</a> |
27
+ <a href="i18n/README_zh.md">简体中文</a> |
28
+ <a href="i18n/README_zh-TW.md">繁體中文</a> |
29
+ <a href="i18n/README_ja.md">日本語</a> |
30
+ <a href="i18n/README_ko.md">한국어</a> |
31
+ <a href="i18n/README_es.md">Español</a> |
32
+ <a href="i18n/README_fr.md">Français</a> |
33
+ <a href="i18n/README_de.md">Deutsch</a> |
34
+ <a href="i18n/README_it.md">Italiano</a> |
35
+ <a href="i18n/README_pt.md">Português</a> |
36
+ <a href="i18n/README_ru.md">Русский</a> |
37
+ <a href="i18n/README_ar.md">العربية</a> |
38
+ <a href="i18n/README_hi.md">हिन्दी</a> |
39
+ <a href="i18n/README_bn.md">বাংলা</a> |
40
+ <a href="i18n/README_tr.md">Türkçe</a> |
41
+ <a href="i18n/README_pl.md">Polski</a> |
42
+ <a href="i18n/README_nl.md">Nederlands</a> |
43
+ <a href="i18n/README_id.md">Bahasa Indonesia</a>
44
+ </p>
45
+
46
+ <p align="center">
47
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
48
+ <img src="https://img.shields.io/badge/platform-macOS%20|%20Windows%20|%20Linux-lightgrey.svg" alt="Platform">
49
+ <img src="https://img.shields.io/badge/Apple%20Silicon-M1%20|%20M2%20|%20M3%20|%20M4%20|%20M5-green.svg" alt="Apple Silicon">
50
+ <br>
51
+ <img src="https://img.shields.io/badge/Editable-md%20%7C%20txt-007AFF.svg" alt="Editable">
52
+ <img src="https://img.shields.io/badge/Preview-pdf%20%7C%20docx%20%7C%20images-FF9500.svg" alt="Preview">
53
+ </p>
54
+
55
+ <p align="center">
56
+ <a href="https://apps.apple.com/us/app/witnote-local-ai-writer/id6756833873?mt=12">
57
+ <img src="src/icon/Download_on_the_App_Store_Badge.svg" alt="Download on the Mac App Store" height="50">
58
+ </a>
59
+ </p>
60
+
61
+ > **🎉 Now Available on Mac App Store!**
62
+ >
63
+ > WitNote has officially landed on the Mac App Store. Thank you for your support! Your Star ⭐️ is our biggest motivation to keep moving forward!
64
+
65
+ **WitNote** is a local-first AI writing companion for macOS, Windows, and Linux.
66
+ Supports free switching between **Ollama / WebLLM / Cloud API** engines, paired with an ultra-minimalist **native card interface**, it works right out of the box. No continuous cloud dependency, no privacy concerns — intelligence made lightweight.
67
+
68
+ ![Local Offline AI Note](src/pic/witnote%20宣传截图/English/本地离线AI记事本.jpg)
69
+
70
+
71
+
72
+ ---
73
+
74
+ ## 🌟 Core Philosophy
75
+
76
+ - **Smart**: Three Engines in One, Freedom to Choose
77
+ - **WebLLM**: Lightweight model, requires download on first run, then works offline
78
+ - **Ollama**: Powerful local model, strong performance, completely offline
79
+ - **Cloud API**: Connect to cloud intelligence, infinite possibilities
80
+ - **Simple**: No complexity
81
+ - iOS-style card management, drag to organize
82
+ - Smart focus mode — window narrows, editor simplifies
83
+ - **Secure**: Data sovereignty
84
+ - [**Privacy Policy**](PRIVACY.md): 100% local storage. Your thoughts belong only to you.
85
+
86
+ ---
87
+
88
+ ## ✨ Features (v1.3.3)
89
+
90
+ ### 🆕 What's New in v1.3.3
91
+
92
+ - 🪟 **Frosted Glass UI** — Brand new visual design, modern frosted glass effect throughout
93
+ - 📐 **Flexible Three-Pane Layout** — Sidebar, Editor, and AI Panel can be resized and closed independently
94
+ - ✋ **Dual-Pane Drag & Edit** — In split view, drag the divider freely to adjust editor/preview ratio
95
+ - 📂 **Finder-Style File Tree** — Color tags, drag-to-move, hover-to-expand, fully upgraded context menu
96
+ - 📄 **Multi-Format Support** — Added PDF/Word preview, supports common image formats
97
+ - Editable: `.md` `.txt`
98
+ - Read-only Preview: `.pdf` `.docx`
99
+ - Image Viewer: `.jpg` `.png` `.gif` `.webp`
100
+ - 🚀 **Faster Startup** — Optimized splash screen, significantly reduced white screen wait time
101
+ - 🔒 **App Store Release** — Fully compliant with Apple Sandbox security standards, now on Mac App Store
102
+
103
+ ### 🔧 Core Features
104
+
105
+ - 📝 **Pure Local Notes** — Choose any folder as your notes vault, supports `.txt` and `.md`
106
+ - 🤖 **Three-in-One Engine** — Switch freely between **WebLLM** (Light), **Ollama** (Local Power), or **Cloud API** (Custom Connection)
107
+ - ✨ **Smart Autocomplete** — 3 presets (Lite/Standard/Full), Press Tab to accept suggestions sentence by sentence
108
+ - 🎭 **Rich Role Library** — Built-in 10+ selected role prompts (Writer, Translator, Polisher, etc.), one-click switch & custom support
109
+ - 🌍 **Global Communication** — **Supports 8 Languages**:
110
+ - English, 简体中文, 繁體中文, 日本語, 한국어, Français, Deutsch, Español
111
+ - Interface and AI responses automatically adapt to your language
112
+ - 🔒 **Privacy First** — All AI inference is local (when using local engines), no data upload, Apple Notarized
113
+ - 💬 **Highly Customizable** — Freely edit system prompts to craft your exclusive AI assistant
114
+ - 🎨 **Multiple Themes** — Light / Dark / Zen Tea, fully optimized dark mode
115
+ - 🗂️ **Card Grid View** — iOS-style with drag-and-drop sorting, polished context menus
116
+ - 🔍 **Context Aware** — AI can directly read your current article or folder contents
117
+ - 🎯 **Focus Mode** — Auto-switches to distraction-free editing when window narrows
118
+
119
+ ---
120
+
121
+ ## 🚀 Quick Start
122
+
123
+ ### Download
124
+
125
+ #### 🍎 Mac App Store (Recommended)
126
+
127
+ <a href="https://apps.apple.com/us/app/witnote-local-ai-writer/id6756833873?mt=12">
128
+ <img src="src/icon/Download_on_the_App_Store_Badge.svg" alt="Download on the Mac App Store" height="50">
129
+ </a>
130
+
131
+ #### 📦 GitHub Releases
132
+
133
+ Download the latest installer from [Releases](https://github.com/hooosberg/WitNote/releases):
134
+
135
+ | Platform | File | Note |
136
+ |----------|------|------|
137
+ | 🍎 macOS | `WitNote-1.3.3.dmg` | Apple Silicon (M1/M2/M3/M4/M5) Only |
138
+ | 🪟 Windows (x64) | `WitNote-1.3.3-setup-x64.exe` | Standard PC (Intel/AMD) |
139
+ | 🪟 Windows (ARM64) | `WitNote-1.3.3-setup-arm64.exe` | Snapdragon PCs (e.g. Surface Pro X) |
140
+ | 🐧 Linux (AppImage) | `WitNote-1.3.3-x86_64.AppImage` | x64 Universal (ARM64 available) |
141
+ | 📦 Linux (Deb) | `WitNote-1.3.3-amd64.deb` | Ubuntu/Debian x64 (ARM64 available) |
142
+
143
+ ---
144
+
145
+ ## 💻 System Requirements
146
+
147
+ ### 🍎 macOS
148
+
149
+ | Item | Minimum | Recommended |
150
+ |------|---------|-------------|
151
+ | OS Version | macOS 12.0+ | macOS 13.0+ |
152
+ | Chip | **Not Supported (Intel Chips)** | **Apple Silicon (M1/M2/M3/M4/M5)** |
153
+ | RAM | - | 16GB+ |
154
+ | Storage | - | SSD, 4GB+ free space |
155
+
156
+ > ❌ **Important Note for Intel Macs**:
157
+ >
158
+ > This application **does not support** Mac computers with Intel chips. Even if forced to run, the experience will be extremely poor due to the following reasons:
159
+ > 1. **Architectural Incompatibility**: The built-in local inference engines (WebLLM/Ollama) deeply rely on the ARM64 architecture and NPU/Metal hardware acceleration of Apple Silicon.
160
+ > 2. **Lack of Hardware Acceleration**: Intel Macs lack Unified Memory Architecture. Running quantized models is extremely slow (generating a single token may take seconds) and causes severe device heating.
161
+ > 3. **Architectural Trade-off**: To ensure the best experience and minimal package size, we have removed support for the x86_64 architecture.
162
+ >
163
+ > We strongly recommend using Mac devices equipped with Apple Silicon (M-series) chips.
164
+
165
+ ### 🪟 Windows
166
+
167
+ | Item | Minimum | Recommended |
168
+ |------|---------|-------------|
169
+ | OS Version | Windows 10 (64-bit) | Windows 11 |
170
+ | Processor | Intel Core i5 / AMD Ryzen 5 | Intel Core i7 / AMD Ryzen 7 |
171
+ | RAM | 8GB | 16GB+ |
172
+ | Storage | 2GB free space | SSD, 4GB+ free space |
173
+ | GPU | Integrated graphics | Discrete GPU with Vulkan support |
174
+
175
+ > ⚠️ **Note**: Windows ARM64 devices (e.g. Surface Pro X) are now natively supported!
176
+
177
+ ### 🐧 Linux
178
+
179
+ | Item | Minimum | Recommended |
180
+ |------|---------|-------------|
181
+ | OS Version | Ubuntu 20.04+ / Debian 11+ | Latest Mainstream Distro |
182
+ | Arch | x64 / ARM64 | x64 / ARM64 |
183
+ | RAM | 8GB | 16GB+ |
184
+
185
+ ---
186
+
187
+ ## 📦 Installation
188
+
189
+ ### 🍎 macOS Installation
190
+
191
+ **Method 1: Mac App Store (Recommended)**
192
+
193
+ Search for "WitNote" in the App Store or [Click Here](https://apps.apple.com/us/app/witnote-local-ai-writer/id6756833873?mt=12) to download and install, enjoying automatic updates.
194
+
195
+ **Method 2: DMG Installer**
196
+
197
+ 1. Download the `.dmg` file
198
+ 2. Double-click to open the DMG
199
+ 3. Drag the app to Applications folder
200
+ 4. Launch from Applications
201
+
202
+ > 🎉 **Great News!**
203
+ >
204
+ > This app is now **Apple Notarized**! No more "unverified developer" warnings!
205
+ >
206
+ > 😅 *~~The developer bravely took out a loan to afford the $99 Apple Developer account...~~*
207
+ > *(Yes, this actually happened. Thanks to all users for your support!)*
208
+
209
+ ### 🪟 Windows Installation
210
+
211
+ 1. Download the `.exe` installer
212
+ 2. Run the setup wizard
213
+ 3. Choose installation path (customizable)
214
+ 4. Complete installation, launch from Desktop or Start Menu
215
+
216
+ ### 🐧 Linux Installation
217
+
218
+ **AppImage (Universal):**
219
+ 1. Download `.AppImage` file
220
+ 2. Right-click Properties -> Allow executing file as program (or `chmod +x WitNote*.AppImage`)
221
+ 3. Double-click to run
222
+
223
+ **Deb (Ubuntu/Debian):**
224
+ 1. Download `.deb` file (e.g., `WitNote-1.3.3-amd64.deb`)
225
+ 2. Run installation via terminal (automatically handles dependencies):
226
+ ```bash
227
+ sudo apt install ./WitNote-1.3.3-amd64.deb
228
+ ```
229
+
230
+ > 📝 **Important Notes for Windows Users**:
231
+ >
232
+ > As an individual developer without an expensive EV Code Signing Certificate, you might encounter the following:
233
+ > 1. **SmartScreen**: If you see "Windows protected your PC" (Unknown Publisher), please click **"More info"** -> **"Run anyway"**.
234
+ > 2. **Antivirus Warning**: Windows Defender or other AV software might flag the installer. The project is open-source and safe. If blocked, please try disabling AV temporarily.
235
+
236
+ ---
237
+
238
+ ## 🔧 AI Engine Info
239
+
240
+ ### 1. WebLLM (Light)
241
+ The app includes a built-in WebLLM engine with `qwen2.5:0.5b` model (macOS only, Windows users are recommended to use Ollama).
242
+ - **Pros**: No extra software installation needed, works completely offline after initial model download.
243
+ - **Best for**: Quick Q&A, simple text polishing, low-end devices.
244
+
245
+ ### 2. Ollama (Local Power)
246
+ Supports connecting to locally running Ollama service.
247
+ - **Pros**: Runs 7B, 14B or even larger models, powerful performance, completely offline.
248
+ - **Usage**: Install [Ollama](https://ollama.com) first, then download more models in Settings (e.g., qwen2.5:7b, llama3, etc).
249
+
250
+ ### 3. Cloud API (Limitless Cloud)
251
+ Supports connecting to OpenAI-compatible Cloud APIs.
252
+ - **Pros**: Access the most powerful models on Earth with just an API Key.
253
+ - **Best for**: Top-tier logical reasoning, or when local hardware cannot support large models.
254
+ - **Config**: Enter API URL and Key in Settings (Supports OpenAI, Gemini, DeepSeek, Moonshot, etc).
255
+
256
+ ---
257
+
258
+ ## 📸 Screenshots
259
+
260
+
261
+ ### 📐 Dual-Pane Editor
262
+ ![Dual-Pane Editor](src/pic/witnote%20宣传截图/English/双栏预览编辑.jpg)
263
+
264
+ ### 🤖 Three AI Engines
265
+ ![Three AI Engines](src/pic/witnote%20宣传截图/English/三种AI引擎.jpg)
266
+
267
+ ### ✨ Smart Autocomplete
268
+ ![Smart Autocomplete](src/pic/witnote%20宣传截图/English/智能续写.jpg)
269
+
270
+ ### 🎭 Personalized Persona
271
+ ![Personalized Persona](src/pic/witnote%20宣传截图/English/个性化角色.jpg)
272
+
273
+ ### 📄 Multi-Format Support
274
+ ![Multi-Format Support](src/pic/witnote%20宣传截图/English/word%20pdf%20jpg%20多种格式支持.jpg)
275
+
276
+ ### 🎯 Focus Mode
277
+ ![Focus Mode](src/pic/witnote%20宣传截图/English/专注模式.jpg)
278
+
279
+ ### 🎨 Multiple Themes
280
+ ![Multiple Themes](src/pic/witnote%20宣传截图/English/多种主题外观.jpg)
281
+
282
+ ### 🗂️ Card File Management
283
+ ![Card File Management](src/pic/witnote%20宣传截图/English/卡片管理文件.jpg)
284
+
285
+
286
+ ---
287
+
288
+ ## 🛠️ Development
289
+
290
+ ```bash
291
+ # Clone the repository
292
+ git clone https://github.com/hooosberg/WitNote.git
293
+ cd WitNote
294
+
295
+ # Install dependencies
296
+ npm install
297
+
298
+ # Start development server
299
+ npm run dev
300
+
301
+ # Build macOS version
302
+ npm run build
303
+
304
+ # Build Windows version
305
+ npm run build -- --win
306
+ ```
307
+
308
+ ---
309
+
310
+ ## 📄 License
311
+
312
+ MIT License
313
+
314
+ ---
315
+
316
+ ## 👨‍💻 Developer
317
+
318
+ **hooosberg**
319
+
320
+ 📧 [zikedece@proton.me](mailto:zikedece@proton.me)
321
+
322
+ 🔗 [https://github.com/hooosberg/WitNote](https://github.com/hooosberg/WitNote)
323
+
324
+ 📖 [Development Diary](public/dev-diaries/dev-diary_en.md)
325
+
326
+ ---
327
+
328
+ <p align="center">
329
+ <i>Smart Core, Simple Form<br>Everything is a file</i>
330
+ </p>
api_server.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ import time
3
+ import os
4
+
5
+ app = FastAPI()
6
+
7
+ @app.get("/health")
8
+ def health():
9
+ return {"status": "ok", "timestamp": time.time()}
10
+
11
+ @app.get("/api/info")
12
+ def get_info():
13
+ return {
14
+ "app": "WitNote",
15
+ "version": "1.3.3",
16
+ "platform": "Linux (VNC)",
17
+ "vault_path": os.environ.get("VAULT_ROOT", "/home/user/vault")
18
+ }
19
+
20
+ if __name__ == "__main__":
21
+ import uvicorn
22
+ uvicorn.run(app, host="127.0.0.1", port=7861)
nginx.conf ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ daemon off;
2
+ error_log /tmp/nginx_error.log;
3
+ pid /tmp/nginx.pid;
4
+
5
+ events {
6
+ worker_connections 1024;
7
+ }
8
+
9
+ http {
10
+ access_log /tmp/nginx_access.log;
11
+ client_body_temp_path /tmp/nginx/client_body;
12
+ proxy_temp_path /tmp/nginx/proxy_temp;
13
+ fastcgi_temp_path /tmp/nginx/fastcgi_temp;
14
+ uwsgi_temp_path /tmp/nginx/uwsgi_temp;
15
+ scgi_temp_path /tmp/nginx/scgi_temp;
16
+
17
+ server {
18
+ listen 7860;
19
+
20
+ location /health {
21
+ proxy_pass http://127.0.0.1:7861/health;
22
+ }
23
+
24
+ location /api/ {
25
+ proxy_pass http://127.0.0.1:7861/api/;
26
+ }
27
+
28
+ location / {
29
+ proxy_pass http://127.0.0.1:6080/;
30
+ proxy_http_version 1.1;
31
+ proxy_set_header Upgrade $http_upgrade;
32
+ proxy_set_header Connection "Upgrade";
33
+ proxy_set_header Host $host;
34
+ proxy_read_timeout 61s;
35
+ proxy_buffering off;
36
+ }
37
+ }
38
+ }
start.sh ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Fail on error
4
+ set -e
5
+
6
+ # Setup Display
7
+ export DISPLAY=:99
8
+ export XDG_RUNTIME_DIR=/tmp/runtime-user
9
+ mkdir -p $XDG_RUNTIME_DIR
10
+ chmod 700 $XDG_RUNTIME_DIR
11
+
12
+ # Nginx temp dirs
13
+ mkdir -p /tmp/nginx/client_body
14
+ mkdir -p /tmp/nginx/proxy_temp
15
+ mkdir -p /tmp/nginx/fastcgi_temp
16
+ mkdir -p /tmp/nginx/uwsgi_temp
17
+ mkdir -p /tmp/nginx/scgi_temp
18
+
19
+ # Start Xvfb
20
+ echo "Starting Xvfb..."
21
+ Xvfb :99 -screen 0 1400x900x24 &
22
+
23
+ # Wait for Xvfb to be ready
24
+ until xset -q -display :99 > /dev/null 2>&1
25
+ do
26
+ echo "Waiting for Xvfb..."
27
+ sleep 1
28
+ done
29
+
30
+ # Start Fluxbox (Window Manager)
31
+ echo "Starting Fluxbox..."
32
+ fluxbox &
33
+
34
+ # Start x11vnc
35
+ echo "Starting x11vnc..."
36
+ x11vnc -display :99 -forever -nopw -listen localhost -xkb &
37
+
38
+ # Start noVNC proxy on 6080
39
+ echo "Starting noVNC..."
40
+ /opt/noVNC/utils/novnc_proxy --vnc localhost:5900 --listen 6080 &
41
+
42
+ # Start API server on 7861
43
+ echo "Starting API server..."
44
+ python3 api_server.py &
45
+
46
+ # Start Nginx on 7860
47
+ echo "Starting Nginx..."
48
+ nginx -c $(pwd)/nginx.conf &
49
+
50
+ # Start WitNote
51
+ # Use --no-sandbox because we are running in a container
52
+ echo "Starting WitNote..."
53
+ witnote --no-sandbox &
54
+
55
+ # Keep the script running
56
+ echo "Environment is ready."
57
+ wait