Skip to content

Commit 36ed959

Browse files
committed
release: version bump to v1.0.0
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 36ed959

43 files changed

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

.github/workflows/release.yml

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