Compare commits

..

No commits in common. "09bc9c6b42d61ac9d29300ead081af955765c165" and "5405630490bdd56a6154550f0ed67951d9b3682b" have entirely different histories.

18 changed files with 69 additions and 84 deletions

View file

@ -1,13 +0,0 @@
FROM oven/bun:alpine
ENV HOSTNAME localhost
WORKDIR /startpage
COPY assets ./assets
COPY src ./src
COPY package.json ./
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD wget --spider -q http://0.0.0.0/healthcheck || exit 1
ENTRYPOINT [ "bun", "start" ]

View file

@ -1,27 +1,25 @@
<div align="center">
<img src="https://user-images.githubusercontent.com/76164598/170824479-5918fe82-18df-4549-8b20-c2b1595a27d0.png" alt="" align="center" />
<h1 align="center">Startpage</h1>
</div>
# startpage
My startpage, edited from github.com/kencx
# Getting Started
# How to use?
## Using bun.sh
1. git clone this repo
2. copy the path to the index.html file
3. set the path as your default startpage in your desired browser
```
bun start
```
# Customization
## Using docker-compose
### Image(s)
i have included a few vaporwave/retro styled gifs in this repo, you can edit it on the line <b>22</b> in the index.html the ```src="clouds.gif"``` to something like ```src="plane.gif"``` or your own image/gif
```
docker-compose up --build
```
### URLs
you can edit all of the URLs to your desired, starting on line **44** in ```index.html```
<br> **Example:** <br>
**line 45:** ```<li><a href="https://github.com/">github</a></li>``` <br >can be changed to <br> **line 45:** ```<li><a href="https://yoururl.com/">your url</a></li>```
# Customize
### Categories
Everything is static, just modify the content as you want in `src/` or `assets`.
i think you get it, starting on line **44** you can change the names of the categories etc. etc. i believe you're not dumb and understand
# Contributors
- [Siklos/Hydroxycarbamide](https://git.siklos-chaneru.dev/Siklos)
- [Woox](https://github.com/nwvh)
# Screenshot
![image](https://user-images.githubusercontent.com/76164598/170824479-5918fe82-18df-4549-8b20-c2b1595a27d0.png)

View file

Before

Width:  |  Height:  |  Size: 340 KiB

After

Width:  |  Height:  |  Size: 340 KiB

Before After
Before After

BIN
bun.lockb

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 562 KiB

After

Width:  |  Height:  |  Size: 562 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 2.4 MiB

Before After
Before After

View file

@ -1,7 +0,0 @@
services:
app:
image: startpage
build: .
restart: unless-stopped
ports:
- "8080:80"

48
index.ts Normal file
View file

@ -0,0 +1,48 @@
console.log("Hello World!");
const fetch = (req: Request) => {
const url = new URL(req.url);
const path = url.pathname;
if (path === "/") {
return new Response(Bun.file("./index.html"), {
headers: {
"Content-Type": "text/html"
}
});
} else if (path === "/style.css") {
return new Response(Bun.file("./style.css"), {
headers: {
"Content-Type": "text/css"
}
});
} else if (path === "/cat.gif") {
return new Response(Bun.file("./cat.gif"), {
headers: {
"Content-Type": "image/gif"
}
});
} else if (path === "/favicon.ico") {
return new Response(Bun.file("./favicon.ico"), {
headers: {
"Content-Type": "image/x-icon"
}
})
} else if (path.startsWith('/fonts/')) {
const fontPath = path.slice('/fonts/'.length);
return new Response(Bun.file(`./fonts/${fontPath}`), {
headers: {
"Content-Type": "application/octet-stream"
}
})
}
return new Response("404!");
}
Bun.serve({
port: Bun.env.PORT || 80,
hostname: Bun.env.HOSTNAME || "localhost",
fetch
});

View file

@ -1,14 +1,11 @@
{
"name": "startpage",
"module": "./src/index.ts",
"module": "index.ts",
"type": "module",
"scripts": {
"start": "bun run ./src/index.ts"
},
"devDependencies": {
"bun-types": "^1.1.31"
"bun-types": "latest"
},
"peerDependencies": {
"typescript": "^5.6.3"
"typescript": "^5.0.0"
}
}
}

View file

Before

Width:  |  Height:  |  Size: 3 MiB

After

Width:  |  Height:  |  Size: 3 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 169 KiB

Before After
Before After

View file

@ -1,38 +0,0 @@
const fetch = (req: Request) => {
const url = new URL(req.url);
const path = url.pathname;
if (path.startsWith('/fonts/')) {
const fontPath = path.slice('/fonts/'.length);
return new Response(Bun.file(`./assets/fonts/${fontPath}`), {
headers: {
"Content-Type": "application/octet-stream"
}
})
}
return new Response("404!");
};
Bun.serve({
port: Bun.env.PORT || 80,
static: {
"/healthcheck": new Response("All good!"),
"/": new Response(await Bun.file("./src/index.html").bytes(), {
headers: {
"Content-Type": "text/html",
},
}),
"/style.css": new Response(await Bun.file("./src/style.css").bytes(), {
headers: {
"Content-Type": "text/css"
},
}),
"/cat.gif": new Response(await Bun.file("./assets/img/cat.gif").bytes(), {
headers: {
"Content-Type": "image/gif",
},
}),
},
fetch,
});

View file

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.6 MiB

After

Width:  |  Height:  |  Size: 4.6 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1,005 KiB

After

Width:  |  Height:  |  Size: 1,005 KiB

Before After
Before After