Skip to content

Commit ac7513b

Browse files
committed
feat: add index.html generator
0 parents  commit ac7513b

23 files changed

+3516
-0
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Build indexgen image'
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
permissions:
8+
contents: write
9+
packages: write
10+
11+
jobs:
12+
build:
13+
name: Build image
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
name: Checkout files
18+
19+
- name: Set up QEMU
20+
uses: docker/setup-qemu-action@v3
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v2
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@v5
34+
with:
35+
push: true
36+
platforms: linux/amd64,linux/arm64
37+
tags: ghcr.io/pmh-only/indexgen:latest
38+
cache-from: type=gha
39+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
.env

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"semi": false,
3+
"trailingComma": "none",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false
8+
}

Dockerfile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM public.ecr.aws/docker/library/alpine:3.20 as build
2+
3+
RUN apk add --no-cache nodejs
4+
RUN apk add --no-cache pnpm --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
5+
6+
WORKDIR /app
7+
8+
COPY package.json \
9+
pnpm-lock.yaml \
10+
./
11+
12+
RUN pnpm i
13+
14+
COPY tsconfig.json .
15+
COPY src src
16+
17+
RUN pnpm run build
18+
19+
FROM public.ecr.aws/docker/library/alpine:3.20 as resolve
20+
21+
RUN apk add --no-cache nodejs
22+
RUN apk add --no-cache pnpm --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
23+
24+
WORKDIR /app
25+
26+
COPY package.json \
27+
pnpm-lock.yaml \
28+
./
29+
30+
RUN pnpm i -P
31+
32+
FROM public.ecr.aws/docker/library/alpine:3.20 as runtime
33+
34+
RUN apk add --no-cache nodejs
35+
36+
ARG user=1000
37+
ARG group=1000
38+
39+
USER $user:$group
40+
WORKDIR /app
41+
42+
COPY --from=build /app/dist dist
43+
COPY --from=resolve /app/node_modules node_modules
44+
45+
COPY templates templates
46+
COPY configs configs
47+
COPY package.json package.json
48+
49+
ENTRYPOINT ["/usr/bin/node", "dist/main.js"]

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Minhyeok Park
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ✍️ indexgen
2+
**The static page generator generates index.html and viewer.html** for S3 and S3 compatible (e.g. minio) storage.
3+
4+
## Try it now!
5+
https://pub.pmh.codes
6+
7+
## Features
8+
* Scan bucket files with minimal API calls for faster speed and cost-effectiveness
9+
* [Easy and fully customizable HTML template powered by ejs](./templates/)
10+
* [Ignored file/directory list support](./configs/ignore)
11+
12+
## Screenshots for default template
13+
### index.html (desktop)
14+
![index.html screenshot](./docs/index_screenshot.png)
15+
16+
### index.html (mobile)
17+
![index.html mobile screenshot](./docs/index_screenshot_mobile.png)
18+
19+
### viewer.html (desktop)
20+
![viewer.html screenshot](./docs/viewer_screenshot.png)
21+
22+
### viewer.html (mobile)
23+
![viewer.html mobile screenshot](./docs/viewer_screenshot_mobile.png)
24+
25+
26+
## How to Run
27+
minimal example:
28+
```sh
29+
docker run -ite S3_BUCKET_NAME=mybucket \
30+
ghcr.io/pmh-only/indexgen:latest
31+
```
32+
33+
full example:
34+
```sh
35+
docker run -it \
36+
-e S3_ACCESS_TOKEN=kLn3QDurDd \
37+
-e S3_SECRET_TOKEN=gQf2iXlRRx2e7uh6ehMJtMc0QSZ41pJ6 \
38+
-e S3_ENDPOINT=https://s3.pmh.codes \
39+
-e S3_REGION=us-east-2 \
40+
-e S3_BUCKET_NAME=mybucket \
41+
ghcr.io/pmh-only/indexgen:latest
42+
```
43+
44+
## Copyright notice
45+
&copy; 2025. Minhyeok Park. <pmh_only@pmh.codes>. All rights reserved.\
46+
All source codes in this repository are MIT licensed.

configs/ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.pydio
2+
index.html
3+
_/*

docs/index_screenshot.png

148 KB
Loading

docs/index_screenshot_mobile.png

88.3 KB
Loading

docs/viewer_screenshot.png

244 KB
Loading

0 commit comments

Comments
 (0)