Skip to content

Commit e2864ad

Browse files
committed
release: version bump to v0.5
Changelog: - Restructure project directory, moving main server entry point to cmd/server/main.go - Integrate high-performance layered cache system with BadgerDB (disk) and Ristretto (memory) - Add background BadgerDB value log GC routines and automatic size limit checks - Implement native transparent proxying for HLS video files (.m3u8, .ts, .cmfv) with custom playlist optimizations - Integrate gzhttp gzip compression middleware for embedded assets - Enhance HTML template layouts and responsive dark styling - Extend template functions with custom duration, host-stripping, HEIC checking, and count formatting helpers - Update Docker configuration with multi-stage Dockerfile and docker-compose configurations - Create GitHub Action workflows for CI build checks, release binaries compilation, and Docker registry push - Purge redundant scratch files, screen recordings, and test logs - Align environment configurations and clean deprecated comments
1 parent e8345f4 commit e2864ad

43 files changed

Lines changed: 5907 additions & 1375 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# Server address
2-
BINTERNET_HOST=0.0.0.0
2+
FLINTERNET_HOST=0.0.0.0
33

44
# Server port
5-
BINTERNET_PORT=8021
5+
FLINTERNET_PORT=8021
66

77
# Enables or disables disk caching
8-
#BINTERNET_DISK_CACHE=true
8+
#FLINTERNET_DISK_CACHE=true
99

1010
# Defines the amount of disk space (in megabytes) used for caching
11-
#BINTERNET_DISK_CACHE_LIMIT=1024
11+
#FLINTERNET_DISK_CACHE_LIMIT=1024
1212

1313
# Enables or disables RAM caching
14-
#BINTERNET_MEMORY_CACHE=true
14+
#FLINTERNET_MEMORY_CACHE=true
1515

1616
# Defines the amount of RAM (in megabytes) used for caching
17-
#BINTERNET_MEMORY_CACHE_LIMIT=256
17+
#FLINTERNET_MEMORY_CACHE_LIMIT=50
1818

19-
# Binternet will use this DNS in case the system fails to resolve it, useful for limited environments
20-
BINTERNET_FALLBACK_DNS=1.1.1.1
19+
# Flinternet will use this DNS in case the system fails to resolve it, useful for limited environments
20+
FLINTERNET_FALLBACK_DNS=1.1.1.1
2121

2222
# Preload next page
23-
#BINTERNET_PRELOAD=true
23+
#FLINTERNET_PRELOAD=true
2424

2525
# Preload images on the next page as well
26-
#BINTERNET_PRELOAD_IMAGES=true
26+
#FLINTERNET_PRELOAD_IMAGES=true
2727

2828
# Show internal errors on error pages to client
29-
#BINTERNET_SHOW_ERRORS_TO_CLIENT=true
29+
#FLINTERNET_SHOW_ERRORS_TO_CLIENT=true

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
name: Build & Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Source
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: '1.25.x'
21+
cache: true
22+
23+
- name: Verify Go Code
24+
run: |
25+
go build -v ./cmd/server
26+
go build -v ./cmd/inspect_ideas
27+
go build -v ./cmd/test_client
28+
29+
docker:
30+
name: Verify Docker Build
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout Source
34+
uses: actions/checkout@v4
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v3
38+
39+
- name: Set up Docker Buildx
40+
uses: docker/setup-buildx-action@v3
41+
42+
- name: Build Docker Image (Dry Run)
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: .
46+
push: false
47+
tags: ghcr.io/cat-ling/binternet-go:latest

.github/workflows/release.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
build-binaries:
14+
name: Build Binary
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
goos: [linux, windows, darwin]
19+
goarch: [amd64, arm64]
20+
exclude:
21+
- goos: windows
22+
goarch: arm64 # Optional: exclude if not needed, but keep standard targets
23+
steps:
24+
- name: Checkout Source
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version: '1.25.x'
31+
cache: true
32+
33+
- name: Build Binary
34+
env:
35+
GOOS: ${{ matrix.goos }}
36+
GOARCH: ${{ matrix.goarch }}
37+
run: |
38+
BINARY_NAME="flinternet-${{ matrix.goos }}-${{ matrix.goarch }}"
39+
if [ "${{ matrix.goos }}" = "windows" ]; then
40+
BINARY_NAME="${BINARY_NAME}.exe"
41+
fi
42+
go build -trimpath -ldflags="-s -w" -o "dist/${BINARY_NAME}" cmd/server/main.go
43+
44+
- name: Package Binary
45+
run: |
46+
cd dist
47+
BINARY_FILE=$(ls)
48+
PACKAGE_NAME="${BINARY_FILE%.*}"
49+
if [[ "${{ matrix.goos }}" == "windows" ]]; then
50+
zip "${PACKAGE_NAME}.zip" "${BINARY_FILE}"
51+
rm "${BINARY_FILE}"
52+
else
53+
tar -czvf "${PACKAGE_NAME}.tar.gz" "${BINARY_FILE}"
54+
rm "${BINARY_FILE}"
55+
fi
56+
57+
- name: Upload Artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: assets-${{ matrix.goos }}-${{ matrix.goarch }}
61+
path: dist/*
62+
retention-days: 1
63+
64+
github-release:
65+
name: Create GitHub Release
66+
needs: build-binaries
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Checkout Source
70+
uses: actions/checkout@v4
71+
72+
- name: Download Artifacts
73+
uses: actions/download-artifact@v4
74+
with:
75+
path: artifacts
76+
merge-multiple: true
77+
78+
- name: Release Assets
79+
uses: softprops/action-gh-release@v2
80+
with:
81+
files: artifacts/*
82+
draft: false
83+
prerelease: false
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
87+
docker-release:
88+
name: Build & Push Docker Image
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Checkout Source
92+
uses: actions/checkout@v4
93+
94+
- name: Set up QEMU
95+
uses: docker/setup-qemu-action@v3
96+
97+
- name: Set up Docker Buildx
98+
uses: docker/setup-buildx-action@v3
99+
100+
- name: Log in to GitHub Container Registry
101+
uses: docker/login-action@v3
102+
with:
103+
registry: ghcr.io
104+
username: ${{ github.actor }}
105+
password: ${{ secrets.GITHUB_TOKEN }}
106+
107+
- name: Extract Docker Metadata
108+
id: meta
109+
uses: docker/metadata-action@v5
110+
with:
111+
images: ghcr.io/cat-ling/binternet-go
112+
tags: |
113+
type=semver,pattern={{version}}
114+
type=semver,pattern={{major}}.{{minor}}
115+
type=raw,value=latest
116+
117+
- name: Build and Push Docker Image
118+
uses: docker/build-push-action@v6
119+
with:
120+
context: .
121+
platforms: linux/amd64,linux/arm64
122+
push: true
123+
tags: ${{ steps.meta.outputs.tags }}
124+
labels: ${{ steps.meta.outputs.labels }}
125+
cache-from: type=gha
126+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Binaries
2+
/build/
3+
/bin/
4+
*.exe
5+
*-linux-*
6+
*-darwin-*
7+
*-windows-*
8+
test/binternet-rs
9+
test/github.com/
10+
test/github.com/flinternet/flinternet-linux-amd64
11+
12+
# Environment configurations (secrets)
13+
.env
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
# Dependency directories
20+
/node_modules/
21+
/vendor/
22+
23+
# Local cache & data directories
24+
/cache/
25+
/test/cache/
26+
/data/
27+
28+
# Editor/OS specific files
29+
.DS_Store
30+
Thumbs.db
31+
*.local
32+
.idea/
33+
.vscode/
34+
*.suo
35+
*.ntvs*
36+
*.njsproj
37+
*.sln
38+
*.sw?
39+
40+
# Agent configuration / Instructions
41+
GEMINI.md
42+
.gemini/
43+

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ RUN go mod download
1414
COPY . .
1515

1616
# Build the binary
17-
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o binternet-go cmd/server/main.go
17+
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o flinternet cmd/server/main.go
1818

1919
# Final stage
2020
FROM gcr.io/distroless/static-debian11
2121

2222
WORKDIR /app
2323

2424
# Copy binary from builder
25-
COPY --from=builder /app/binternet-go .
25+
COPY --from=builder /app/flinternet .
2626

2727
# Expose port
2828
EXPOSE 8021
2929

3030
# Helper to run the executable
31-
ENTRYPOINT ["/app/binternet-go"]
31+
ENTRYPOINT ["/app/flinternet"]

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
# Demo
1+
# Flinternet
22

3-
<video src="https://github.com/Cat-Ling/binternet-go/raw/main/test-screen-record.mp4" width="250" controls></video>
3+
Flinternet is a fast, lightweight, privacy-focused, and JavaScript-free web proxy interface for Pinterest. It is written in Go and designed for public hosting or personal use, allowing users to browse Pinterest boards, pins, search feeds, and stream videos without client-side tracking, intrusive ads, popups, or aggressive app redirects.
4+
5+
## License
6+
7+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

assets/static/masonry.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
document.addEventListener("DOMContentLoaded", function() {
2+
// Initialize Masonry for standard pin grids
3+
const grids = document.querySelectorAll('.grid');
4+
grids.forEach(grid => {
5+
new Masonry(grid, {
6+
itemSelector: '.grid-item',
7+
columnWidth: 240,
8+
gutter: 16,
9+
fitWidth: true, // Centers the grid in its parent container
10+
transitionDuration: 0 // Avoid weird animations on load
11+
});
12+
});
13+
14+
// Initialize Masonry for boards and users
15+
const boardGrids = document.querySelectorAll('.boards-grid, .users-grid');
16+
boardGrids.forEach(grid => {
17+
new Masonry(grid, {
18+
itemSelector: '.masonry-item',
19+
columnWidth: 280,
20+
gutter: 24,
21+
fitWidth: true,
22+
transitionDuration: 0
23+
});
24+
});
25+
26+
window.recalculateMasonry = function() {
27+
grids.forEach(grid => Masonry.data(grid)?.layout());
28+
boardGrids.forEach(grid => Masonry.data(grid)?.layout());
29+
};
30+
31+
// Hide 'more' button if description is not overflowing
32+
function updateShowMoreLabels() {
33+
document.querySelectorAll('.post-description').forEach(function(desc) {
34+
var label = desc.nextElementSibling;
35+
if (label && label.classList.contains('show-more-label')) {
36+
// If scrollHeight is strictly greater than clientHeight, it's clamped
37+
if (desc.scrollHeight > desc.clientHeight) {
38+
label.style.display = 'inline-block';
39+
} else {
40+
label.style.display = 'none';
41+
}
42+
}
43+
});
44+
}
45+
46+
// Run this whenever we recalculate
47+
const originalRecalculate = window.recalculateMasonry;
48+
window.recalculateMasonry = function() {
49+
updateShowMoreLabels();
50+
originalRecalculate();
51+
};
52+
53+
// Listen for description toggles
54+
document.addEventListener('change', function(e) {
55+
if (e.target.classList.contains('desc-toggle')) {
56+
// Need a tiny delay for CSS max-height unset to take effect
57+
setTimeout(window.recalculateMasonry, 10);
58+
setTimeout(window.recalculateMasonry, 150); // safety catch for transitions
59+
}
60+
});
61+
62+
// Initial run for labels
63+
updateShowMoreLabels();
64+
});

assets/static/masonry.pkgd.min.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)