Skip to content

Commit 4544537

Browse files
authored
new year update (#6)
* update packages * enable gzip compression * update build script so the image can be used locally
1 parent 1ff1d33 commit 4544537

5 files changed

Lines changed: 54 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 0.1.3
2+
3+
## What's new
4+
5+
* Enable gzip compression for static resources
6+
7+
## Fixes
8+
9+
## Changes
10+
11+
* Update tui-app to 0.1.3
12+
* Update tui-server to 0.1.1
13+
114
# 0.1.2
215

316
## What's new

Makefile

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ EXTERNAL_CONFIG_NAME=tiny-webui-$(TARGET_PLATFORM)_defconfig
44
OUTPUT_DIR=output
55
IMAGE_OUTPUT_DIR=$(OUTPUT_DIR)/$(TARGET_PLATFORM)
66

7+
REGISTRY_HOST?=127.0.0.1
8+
REGISTRY_PORT?=5000
9+
REGISTRY_NAME?=registry
10+
REGISTRY_IMAGE?=registry:2
11+
IMAGE_NAME?=tiny-webui
12+
IMAGE_TAG?=latest
13+
REGISTRY_REF=$(REGISTRY_HOST):$(REGISTRY_PORT)/$(IMAGE_NAME):$(IMAGE_TAG)
14+
15+
BUILDX_BUILDER?=tui-builder
16+
717
all:docker-image
818

919
.PHONY:config
@@ -34,12 +44,19 @@ docker-image:
3444
$(MAKE) image TARGET_PLATFORM=arm64
3545
rm -rf $(OUTPUT_DIR)/amd64
3646
ln -sf x64 $(OUTPUT_DIR)/amd64
37-
docker buildx create || true
47+
@if docker ps -a --format '{{.Names}}' | grep -qx '$(REGISTRY_NAME)'; then \
48+
docker inspect -f '{{.State.Running}}' '$(REGISTRY_NAME)' 2>/dev/null | grep -qx true || docker start '$(REGISTRY_NAME)' >/dev/null; \
49+
else \
50+
docker run -d -p '$(REGISTRY_PORT):5000' --name '$(REGISTRY_NAME)' '$(REGISTRY_IMAGE)' >/dev/null; \
51+
fi
52+
@docker buildx inspect '$(BUILDX_BUILDER)' >/dev/null 2>&1 || \
53+
docker buildx create --name '$(BUILDX_BUILDER)' --driver docker-container --driver-opt network=host --use >/dev/null
54+
@docker buildx use '$(BUILDX_BUILDER)' >/dev/null
3855
docker buildx build \
3956
--platform linux/amd64,linux/arm64 \
4057
-f docker/Dockerfile \
41-
-t tiny-webui:latest \
42-
--output type=oci,dest=$(OUTPUT_DIR)/tiny-webui.tar \
58+
-t $(REGISTRY_REF) \
59+
--push \
4360
.
4461

4562
.PHONY:dl_cache

external/overlay/etc/nginx/nginx.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ http {
1515
default_type application/octet-stream;
1616
sendfile on;
1717

18+
# gzip compression
19+
gzip on;
20+
gzip_disable "msie6";
21+
gzip_vary on;
22+
gzip_proxied any;
23+
gzip_comp_level 6;
24+
gzip_min_length 1024;
25+
gzip_http_version 1.1;
26+
gzip_types
27+
text/plain
28+
text/css
29+
text/xml
30+
application/json
31+
application/javascript
32+
application/xml
33+
application/xml+rss
34+
image/svg+xml;
35+
1836
map $http_upgrade $connection_upgrade {
1937
default upgrade;
2038
'' close;

external/package/tui-app/tui-app.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
################################################################################
66

7-
TUI_APP_VERSION = 0.1.1
7+
TUI_APP_VERSION = 0.1.3
88
TUI_APP_SITE = https://github.com/tiny-webui/webapp.git
99
TUI_APP_SITE_METHOD = git
1010
TUI_APP_GIT_SUBMODULES = YES
@@ -13,7 +13,7 @@ TUI_APP_INSTALL_TARGET = YES
1313

1414
define TUI_APP_BUILD_CMDS
1515
npm i --prefix $(@D)
16-
npm run build:static --prefix $(@D)
16+
npm run build --prefix $(@D)
1717
endef
1818

1919
# TODO: pre gzip the appropriate files

external/package/tui-server/tui-server.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
################################################################################
66

77

8-
TUI_SERVER_VERSION = 0.1.0
8+
TUI_SERVER_VERSION = 0.1.1
99
TUI_SERVER_SITE = https://github.com/tiny-webui/server.git
1010
TUI_SERVER_SITE_METHOD = git
1111
TUI_SERVER_INSTALL_STAGING = NO

0 commit comments

Comments
 (0)