6 Commits

Author SHA1 Message Date
Eilles 46711f99ec add the function of specifing date format, formatted the code 2026-01-18 07:39:21 +08:00
Eilles c000a953c4 adding the Chinese translation 2026-01-18 07:38:07 +08:00
Sweetbread 2c0f65e59f fix: handle trailing slashes
Docker Build and Push / build-and-push (push) Successful in 2m2s
2025-12-31 23:05:41 +03:00
Burer 03cbd2f60b cleanup: delete leftover files
Docker Build and Push / build-and-push (push) Successful in 1m17s
2025-12-30 07:57:21 +02:00
Burer 72bb6c2e79 tweak: enable JS minification for non-debug mode
Docker Build and Push / build-and-push (push) Successful in 1m14s
2025-12-29 21:20:56 +02:00
Sweetbread 002cf1ad07 ci: add docker image creation
Docker Build and Push / build-and-push (push) Successful in 1m22s
2025-12-29 21:49:08 +03:00
19 changed files with 266 additions and 21 deletions
+31
View File
@@ -0,0 +1,31 @@
name: Docker Build and Push
on:
push:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Registry
uses: docker/login-action@v2
with:
registry: git.kolibrios.org
username: kolibrios
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name == 'push' }}
tags: git.kolibrios.org/kolibrios/kolibrios.org:latest
cache-from: type=gha
cache-to: type=gha,mode=max
-1
View File
@@ -17,7 +17,6 @@ htmlcov/
docs/_build/
# Our's
Dockerfile
.env
static/*.css
static/*.css.map
+23
View File
@@ -0,0 +1,23 @@
FROM node:18-alpine as sass
RUN npm install -g sass
WORKDIR /build
COPY ./static ./static
RUN sass ./static:./static \
--no-source-map \
--style=compressed
FROM python:3.11-slim
WORKDIR /app
COPY . .
COPY --from=sass /build/static/ ./static/
RUN pip install --no-cache-dir -r requirements.txt
ENV FLASK_ENV=production
ENV PYTHONUNBUFFERED=1
CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--workers", "4"]
+23 -16
View File
@@ -14,20 +14,20 @@ app = Flask(__name__)
locales.ensure_loaded()
# CSS Compilation and minification
if app.debug:
# CSS Compilation and minification
css = compile_sass(filename="static/style.scss", output_style="compressed")
with open("static/style.css", "w", encoding="utf-8") as f:
f.write(css)
# JS minification
with open("static/script.js", encoding="utf-8") as f:
js = f.read()
js = re.sub(r"/\*.*?\*/", "", js, flags=re.S)
js = re.sub(r"//.*", "", js)
js = re.sub(r"\s+", " ", js).strip()
with open("static/script.min.js", "w", encoding="utf-8") as f:
f.write(js)
# JS minification
with open("static/script.js", encoding="utf-8") as f:
js = f.read()
js = re.sub(r"/\*.*?\*/", "", js, flags=re.S)
js = re.sub(r"//.*", "", js)
js = re.sub(r"\s+", " ", js).strip()
with open("static/script.min.js", "w", encoding="utf-8") as f:
f.write(js)
@app.before_request
@@ -45,12 +45,16 @@ def before_request():
@app.context_processor
def _inject_autobuild_vers():
return {'autobuild_vers': autobuild.autobuild_vers}
return {"autobuild_vers": autobuild.autobuild_vers}
@app.context_processor
def _inject_autobuild_date():
return {'autobuild_date': autobuild.autobuild_date}
return {
"autobuild_date": g.translations.get("downloads", {})
.get("date-format", "{DD}.{MM}.{YYYY}")
.format(**autobuild.autobuild_date)
}
@app.context_processor
@@ -58,16 +62,19 @@ def inject_translations():
def translate(text, **kwargs):
section, key = text.split(":", 1)
template = g.translations \
.get(section, {}) \
template = (
g.translations.get(section, {})
.get(key, f"${section}: {key}$")
.replace("\\n", " \\n")
.replace("\n", "")
)
try:
return template.format(**kwargs)
except Exception:
return template
return {'_': translate}
return {"_": translate}
# ---------- ROUTES -------------------------------------------------------
@@ -78,12 +85,12 @@ def home():
return redirect(url_for("index", lang=helpers.get_best_lang()))
@app.route("/<lang>")
@app.route("/<lang>", strict_slashes=False)
def index(lang):
return helpers.render_localized_template(lang, "index.html")
@app.route("/<lang>/download")
@app.route("/<lang>/download", strict_slashes=False)
def download(lang):
return helpers.render_localized_template(lang, "download.html")
+1
View File
@@ -51,6 +51,7 @@ header = Herunterladen
version = Version:
date = Build-Datum:
date-format = {DD}.{MM}.{YYYY}
img-descr = Disketten-Image
iso-descr = LiveCD-Abbild
+1
View File
@@ -49,6 +49,7 @@ header = Downloads
version = Version:
date = Build date:
date-format = {DD}/{MM}/{YYYY}
img-descr = Floppy disk image
iso-descr = LiveCD image
+1
View File
@@ -51,6 +51,7 @@ header = Descargas
version = Versión:
date = Fecha de compilación:
date-format = {DD}.{MM}.{YYYY}
img-descr = Imagen de disquete
iso-descr = Imagen LiveCD
+1
View File
@@ -51,6 +51,7 @@ header = Téléchargements
version = Version :
date = Date de compilation :
date-format = {DD}/{MM}/{YYYY}
img-descr = Image de la disquette
iso-descr = Image du LiveCD
+1
View File
@@ -50,6 +50,7 @@ header = Scaricamento
version = Versione:
date = Data di compilazione:
date-format = {DD}/{MM}/{YYYY}
img-descr = Immagine su dischetto
iso-descr = Immagine LiveCD
+1
View File
@@ -51,6 +51,7 @@ header = Downloads
version = Versie:
date = Builddatum:
date-format = {DD}.{MM}.{YYYY}
img-descr = Afbeelding op diskette
iso-descr = LiveCD-afbeelding
+1
View File
@@ -51,6 +51,7 @@ header = Скачать
version = Версия:
date = Дата сборки:
date-format = {DD}.{MM}.{YYYY}
img-descr = Образ дискеты
iso-descr = Образ LiveCD
+85
View File
@@ -0,0 +1,85 @@
[title]
language = 简体中文
index = KolibriOS
download = KolibriOS - 下载
[header]
index = KolibriOS 官方网站
download = KolibriOS 下载页
[menu]
kolibrios = KolibriOS
download = 下载
forum = 论坛
wiki = 百科
git = Git
[git]
header = KolibriOS 现已拥抱 Git
text = 来看看我们全新又对开发者友好的代码仓库吧:
[article]
p1 = {kolibrios} 是一个体积微小、功能强大、响应迅速的,面向 x86 兼容机的操作系统。
只需要寥寥数兆字节的磁盘空间、一个 i586 处理器和 12 兆字节内存,
你就能体验到一个丰富的应用生态:
文字处理、图像查看、图形编辑、网页浏览等基本应用一应俱全,甚至还有三十多个有意思的游戏。
在文件系统方面,{kolibrios} 完全支持 FAT12/16/32
同时也支持读取 NTFS、exFAT、ISO9660 和 Ext2/3/4 文件系统。
它还提供了一套丰富的{drivers},囊括众多主流声卡、网卡、显卡。
drivers = 驱动程序
p2 = 试想一款能在短短几秒内启动到图形化界面的操作系统!
不再囿于转着小圈圈的鼠标指针,所有的应用软件都在鼠标点击后极速开启!
得益于 {kolibrios} 的核心部分(内核、驱动)完全采用 {fasm} 汇编语言来编写,这样的高速已经不再是幻想!
快来试试我们的 {kolibrios},将其与现代臃肿的 Windows 和 Linux 系统比比看,你就会发现它们之间的速度差距。
p3 = {kolibrios} 是一个 MenuetOS 的派生分支,从 2004 开始脱离其独立开发。
如果你有需要{feedback}的问题,我们会非常欢迎~!
当然,如果能为我们提供{help},我们也感激不尽!
feedback = 反馈
help = 帮助
p_subscription = 希望你能尽情享用我们的作品!
[downloads]
header = 下载链接
version = 当前版本:
date = 构建日期:
date-format = {YYYY}年{MM}月{DD}日
img-descr = 软盘镜像
iso-descr = Live 光盘镜像
distr-descr = 优盘或多系统启动通用包
raw-descr = UEFI/BIOS 混合包
prev_rev = 先前版本
all_rev = 所有即时构建包
download_choice = 该怎么选?
download_help = 对新手而言,Live 光盘就是最优解。\n\
\n\
而与之不同的是,通用包允许用户把在系统运行过程中对 KolibriOS 的更改保存下来,例如系统设置之类就可以保存。\n\
\n\
混合启动镜像包含了对 UEFI 技术的支持,可以让你在现代的电脑上更好地启动之。
download_description = 在此页面中,你可以下载我们的即时构建版本,也就是包含了最新的更新。
需要知道的是:这些特性往往会致使系统不稳定,使用时请牢记此项。
这些文件都经过 {zip} 压缩打包。{kolibrios} 以 {gpl} 协议发布,其源码可见于{git}。
git-server = 此仓库站
download_warn = 有些时候,一些防病毒软件会错误地将 {kolibrios} 的镜像标记为威胁项目,这应当是误判。{kolibrios} 完全开源,如果担心存在问题,无论何时何地,你都可以自行构建一份来确保安全。
[screenshots]
header = 内容截屏
1 = KolibriOS 桌面
2 = 演示程序
3 = 不同的文件管理器
4 = 网络相关的程序
5 = 游戏
6 = 开发调试工具
[footer]
team = KolibriOS 开发团队
+87
View File
@@ -0,0 +1,87 @@
[title]
language = 繁體中文
index = KolibriOS
download = KolibriOS - 下載
[header]
index = KolibriOS 官方站
download = KolibriOS 下載頁
[menu]
kolibrios = KolibriOS
download = 下載
forum = 論壇
wiki = 百科
git = Git
[git]
header = KolibriOS 現已移入 Git
text = 來看看我們又新又友好的代碼倉庫吧:
[article]
p1 = {kolibrios} 是一個空間小、功能強、回應快的,面向 x86 兼容機的作業系統。
只需要寥寥數 MB 磁碟空間、一個 i586 處理器和 12 MB RAM
即可體驗到一個豐富的應用生態:
文字處理、圖像查看、圖形編輯、網頁流覽等基本應用一應俱全,甚至還有三十多個有意思的小遊戲。
在檔案系統方面,{kolibrios} 完全支援 FAT12/16/32
同時也能夠讀取 NTFS、exFAT、ISO9660 和 Ext2/3/4 檔案系統。
它還提供了一套豐富的{drivers},囊括眾多主流音效卡、網卡、顯卡。
drivers = 驅動程式
p2 = 試想一款能在短短幾秒內啟動到圖形化介面的作業系統!
不再囿於轉著小圈圈的滑鼠指標,所有的應用軟體都在點擊後極速開啟!
得益於 {kolibrios} 的核心部分(內核、驅動)完全採用 {fasm} 組合語言來編寫,這樣的高速已不再是幻想!
快來試試我們的 {kolibrios},將其與現代臃腫的 Windows 和 Linux 系統比比看,你就會發現它們之間的速度差距。
p3 = {kolibrios} 是 2004 年自 MenuetOS Fork 而來,也從那一刻起開始脫離它進行自主開發。
歡飲您{feedback}您遇到的任何問題。
如果能為我們提供{help},我們也會感激不盡!
feedback = 回饋
help = 幫助
p_subscription = 希望你能盡情享用我們的作品!
[downloads]
header = 下載連結
version = 當前版本:
date = 構建日期:
date-format = {YYYY}年{MM}月{DD}日
img-descr = 軟碟鏡像
iso-descr = LiveCD 鏡像
distr-descr = 閃存盤或多系統啟用的動通用包
raw-descr = UEFI/BIOS 混合包
prev_rev = 早期版本
all_rev = 所有 Nightly 構建包
download_choice = 如何選擇我要的包?
download_help = 對新手而言,LiveCD 就是最優解。\n\
\n\
而與之不同的是,通用包允許使用者把在系統運行過程中對 KolibriOS 作出的更改保存下來,例如系統設置之類就可以保留。\n\
\n\
混合啟動鏡像包含了對 UEFI 技術的支援,可以讓你在現代的電腦上更好地啟動之。
download_description = 在此頁面裏,你可以下載我們的 Nightly 構建包,也即包含了當下最新的更新。
需要知道的是:因爲是即時更新並構建的,這些包往往包含一些導致系統不穩定的特性,請在使用時牢記此項。
這些檔案都是經過 {zip} 壓縮打包的,使用前需解壓。{kolibrios} 以 {gpl} 許可證發佈,其源碼可見於{git}。
git-server = 此倉庫站
download_warn = 有些時候,一些防毒軟體會錯誤地將 {kolibrios} 的鏡像標記為威脅項,這應當是一種誤判。我們的 {kolibrios} 完全開源,如果擔心存在安全問題,無論何時何地,你都可以自行構建一份來確保運行的内容是安全的。
[screenshots]
header = 內容截屏
1 = KolibriOS 桌面
2 = 演示程式
3 = 不同的檔案管理員
4 = 網路相關的程式
5 = 遊戲
6 = 開發調試工具
[footer]
team = KolibriOS 開發團隊
+9 -4
View File
@@ -6,7 +6,7 @@ import time
STATUS_URL = "https://builds.kolibrios.org/status.html"
STATUS_SEC = 300 # refetch each 5 minutes
autobuild_date = "DD.MM.YYYY"
autobuild_date = {"YYYY": "YYYY", "MM": "MM", "DD": "DD"}
autobuild_vers = "0.0.0.0+0000-0000000"
_started = False
@@ -56,12 +56,17 @@ def _refresh_build_date_once():
if not mts:
mds = re.search(r"\b(\d{2})\.(\d{2})\.(\d{4})\b", text)
if mds:
autobuild_date = f"{mds.group(1)}.{mds.group(2)}.{mds.group(3)}"
autobuild_date["YYYY"] = mds.group(1)
autobuild_date["MM"] = mds.group(2)
autobuild_date["DD"] = mds.group(3)
else:
return
else:
y, mo, d = mts.groups()
autobuild_date = f"{d}.{mo}.{y}"
(
autobuild_date["YYYY"],
autobuild_date["MM"],
autobuild_date["DD"],
) = mts.groups()
if last_commit_ver:
autobuild_vers = last_commit_ver
+1
View File
@@ -8,3 +8,4 @@ Jinja2==3.1.6
libsass==0.23.0
MarkupSafe==3.0.2
Werkzeug==3.1.3
gunicorn
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B