Compare commits

...

33 commits
0.0.8 ... main

Author SHA1 Message Date
Sangelo f35ade0784 [d] remove comment in dockerfile
All checks were successful
Build and push docker image / publish (push) Successful in 43s
2024-05-16 09:37:59 +02:00
Sangelo 27ab7903cf [c+a] fix #3 and make external caddyfile 2024-05-16 09:36:48 +02:00
Sangelo 7b8e6424d9 Merge branch 'main' of gitpot.org:sangelo/website 2024-05-16 09:12:44 +02:00
Sangelo 1b98e4130f [a] add mastodon link to header for verification
All checks were successful
Build and push docker image / publish (push) Successful in 44s
2024-05-16 06:50:31 +00:00
Sangelo 1804dc9704 Update src/lib/components/Socials.svelte
All checks were successful
Build and push docker image / publish (push) Successful in 44s
2024-05-16 06:48:15 +00:00
Sangelo 0745dc8d81 [c] update steam link
All checks were successful
Build and push docker image / publish (push) Successful in 42s
2024-05-16 06:46:07 +00:00
Sangelo f8e5846fa5 [c] change from mas.to to chaos.social
All checks were successful
Build and push docker image / publish (push) Successful in 41s
2024-05-14 20:22:22 +02:00
Sangelo 9f2dbdf27c [c] hardening of Dockerfile (#4)
All checks were successful
Build and push docker image / publish (push) Successful in 49s
Reviewed-on: #4
2024-05-10 13:50:07 +00:00
Sangelo b627cf1d4a [d] remove healthcheck script 2024-05-10 15:48:42 +02:00
Sangelo 30dbe25051 [a] add healthcheck endpoint to caddyfile config 2024-04-26 11:08:30 +02:00
Sangelo 3b7af7907d Initial work on hardening 2024-04-24 17:02:40 +02:00
Sangelo e5abb037c9 [c] update dependencies 2024-04-19 08:16:06 +02:00
Sangelo 1a734dbe6d [c] update .forgejo/workflows/build.yml 2024-04-16 12:15:44 +00:00
Sangelo bb66957eb8 [c] fix broken links & add comment to justfile
All checks were successful
Build and push docker image / deploy (push) Successful in 40s
2024-04-16 14:12:24 +02:00
Sangelo 24e0e9f29b [c] Dockerfile refactoring
All checks were successful
Build and push docker image / deploy (push) Successful in 44s
2024-04-12 09:35:09 +02:00
Sangelo bcca482355 [c] fix background color of images being black and not transparent
All checks were successful
Build and push docker image / deploy (push) Successful in 39s
2024-04-08 17:22:21 +02:00
Sangelo 97f82f6265 [c] update readme logo 2024-04-08 17:18:20 +02:00
Sangelo dd08df29df [c] add project logo to readme 2024-04-08 17:15:39 +02:00
Sangelo a00a1df43d [c] Migrate to gitpot.org
All checks were successful
Build and push docker image / deploy (push) Successful in 1m11s
2024-04-08 13:52:10 +02:00
Sangelo e682a4ca4f [a] Add rel=me to social links 2024-04-07 19:57:07 +02:00
Sangelo 6e83b55b0a [c] upgrade dependencies, add upgrade-interactive to Justfile
All checks were successful
Build and push docker image / deploy (push) Successful in 38s
2024-04-03 17:02:46 +02:00
Sangelo d07163376a [a+d] Initial docker-compose + delete old build scripts 2024-04-03 16:49:15 +02:00
Sangelo f5d7e719fb [c] clarify contribution requirements in README.md 2024-04-03 13:19:01 +00:00
Sangelo 4325badbf9 [c] Fix docker container labels
All checks were successful
Build and push docker image / deploy (push) Successful in 41s
2024-04-03 15:13:05 +02:00
Sangelo fab7b8153b [c] Update README.md with link to the just project
All checks were successful
Build and push docker image / deploy (push) Successful in 40s
2024-04-03 13:07:18 +00:00
Sangelo 3f637dbab3 Automated building and deployment process with Docker (#2)
Reviewed-on: https://gitpot.dev/sangelo/website/pulls/2
2024-04-03 12:10:51 +00:00
Sangelo e0112466ce Merge branch 'main' into docker 2024-04-03 12:10:00 +00:00
Sangelo 7e19be55b1 [c] Update README with up-to-date just commands 2024-04-03 13:08:42 +02:00
Sangelo ef5bc8a670 [c] add description label to dockerfile 2024-04-03 12:59:24 +02:00
Sangelo 4ecf1f1de6 [c] modify workflow if-statement to work in SH
All checks were successful
Build and push docker image / deploy (push) Successful in 42s
2024-04-03 12:46:25 +02:00
Sangelo 88950724c9 [c] re-create tag var in publish container task
All checks were successful
Build and push docker image / deploy (push) Successful in 42s
2024-04-03 12:43:07 +02:00
Sangelo e845705829 [c] fix css for tooltip again 2024-03-22 22:35:46 +01:00
Sangelo d213c2f178 [c] tooltip css fixes 2024-03-22 22:26:44 +01:00
24 changed files with 730 additions and 525 deletions

View file

@ -7,7 +7,7 @@ on:
- '*'
jobs:
deploy:
publish:
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
@ -34,16 +34,15 @@ jobs:
export TAG=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///')
# build the container
just -f /workspace/sangelo/website/Justfile build "${TAG}"
echo "$TAG"
- name: 🐳 Publish Container
run: |
echo "$TAG"
echo "${{ secrets.PUBLISH_TOKEN }}" | docker login gitpot.dev -u sangelo --password-stdin
docker push "gitpot.dev/sangelo/website:${TAG}"
export TAG=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///')
echo "${{ secrets.PUBLISH_TOKEN }}" | docker login gitpot.org -u sangelo --password-stdin
docker push "gitpot.org/sangelo/website:${TAG}"
# publish tag latest as well
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
docker tag "gitpot.dev/sangelo/website:${TAG}" "gitpot.dev/sangelo/website:latest"
docker push "gitpot.dev/sangelo/website:latest"
if echo "${{ github.ref }}" | grep -q "refs/tags/"; then
docker tag "gitpot.org/sangelo/website:${TAG}" "gitpot.org/sangelo/website:latest"
docker push "gitpot.org/sangelo/website:latest"
fi

26
Caddyfile Normal file
View file

@ -0,0 +1,26 @@
:80 {
root * /app
try_files {path}.html {path}
file_server
handle_errors {
# handle 4xx errors
@4xx expression `{err.status_code} >= 400 && {err.status_code} < 500`
handle @4xx {
rewrite * /internal/error/400.html
templates
file_server
}
# handle 5xx errors
@5xx expression `{err.status_code} >= 500 && {err.status_code} < 600`
handle @5xx {
rewrite * /internal/error/500.html
templates
file_server
}
}
}
:8080 {
respond /health "OK" 200
}

View file

@ -2,31 +2,46 @@
FROM node:20-alpine AS builder
# Set the working directory in the container
WORKDIR /app
WORKDIR /git
# Copy the repository contents into the container
COPY . .
# Install dependencies and build the site. Output directory will be /app/build
# Install dependencies and build the site. Output directory will be /git/build
RUN yarn install && yarn run build
# Final stage
FROM caddy:2-alpine
# Set the working directory in the container
WORKDIR /web
WORKDIR /app
# Copy the build directory from the builder stage to /web
COPY --from=builder /app/build /web
# Copy the build directory from the builder stage to /app
COPY --from=builder /git/build /app
# Caddyfile configuration to serve files from /web
RUN echo -e ":80 {\n root * /web\n file_server\n}" > /etc/caddy/Caddyfile
# Create a dedicated user 'web' and change ownership of /app to 'web'
RUN addgroup -S web && adduser -S web -G web && chown -R web:web /app
# Caddyfile configuration to serve files from /app
COPY --from=builder /git/Caddyfile /etc/caddy/Caddyfile
# Expose port 80
EXPOSE 80
# Start Caddy with the specified Caddyfile
# Switch to the 'web' user
USER web
# Start Caddy with the specified Caddyfile as the 'web' user
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
# Docker Container Labels
LABEL org.opencontainers.image.title="Sangelo's Space"
LABEL org.opencontainers.image.description="Sangelo's Space website, packaged as a docker container, with the Caddy webserver."
LABEL org.opencontainers.image.url="https://sangelo.space"
LABEL org.opencontainers.image.documentation="https://gitpot.org/sangelo/website"
LABEL org.opencontainers.image.vendor="Sangelo"
LABEL org.opencontainers.image.licenses="GPL-v3"
LABEL org.opencontainers.image.source="https://gitpot.org/sangelo/website"
# Remove intermediate images after build
ONBUILD RUN rm -rf /app
ONBUILD RUN rm -rf /git

View file

@ -4,7 +4,7 @@ set dotenv-load
# defaults
default_runner := 'docker'
default_tag := 'latest'
default_image := 'gitpot.dev/sangelo/website:latest'
default_image := 'gitpot.org/sangelo/website:latest'
# run development server by default
default: dev
@ -37,7 +37,7 @@ clean runner=default_runner tag=default_tag:
_clean_images runner=default_runner:
#!/usr/bin/env bash
set -o pipefail
image_ids=$({{runner}} image ls | grep gitpot.dev/sangelo/website | awk '{print $3}')
image_ids=$({{runner}} image ls | grep gitpot.org/sangelo/website | awk '{print $3}')
if [ -n "$image_ids" ]; then
for image_id in $image_ids; do
{{runner}} image rm $image_id
@ -61,7 +61,7 @@ run tag=default_tag runner=default_runner:
publish image=default_image runner=default_runner:
@echo "Publishing with '{{runner}}'..."
@# log into gitpot
echo "$GITPOT_TOKEN" | {{runner}} login gitpot.dev -u $GITPOT_USERNAME --password-stdin
echo "$GITPOT_TOKEN" | {{runner}} login gitpot.org -u $GITPOT_USERNAME --password-stdin
@# push the specified image to the container registry
{{runner}} push {{image}}
@echo "Published {{image}} successfuly! Use '{{runner}} pull {{image}}' to pull the container."
@ -82,3 +82,8 @@ preview: _install
@echo "Running vite preview server..."
yarn run build
yarn run preview --open
# upgrade dependencies for the project interactively with yarn
upgrade-interactive: _install
@echo "Interactively upgrading packages..."
yarn upgrade-interactive --latest

View file

@ -1,3 +1,5 @@
<div align="center"> <img src="https://gitpot.org/sangelo/website/raw/branch/main/static/assets/img/sangelos-space-readme.png"/ width=11%> </div>
# Sangelo's Space
This is the source-code for my website, written in Svelte & SCSS.<br>
@ -5,10 +7,10 @@ Feel free to explore!
## Contributing
You're welcome to contribute to this website if you have a Lunivity account (see homepage for details if registrations aren't open).<br>
You're welcome to contribute to this website if you have a Lunivity account (see Gitpot's homepage for details if registrations aren't open).<br>
Once you fork and clone the repository, follow the next steps.
If you have `just` installed, setting up is pretty easy:
If you have [`just`](https://github.com/casey/just/) installed, setting up is pretty easy:
```bash
# setup dependencies and run dev server
@ -16,9 +18,6 @@ just
# you can also run `just dev`
just dev
# to build and preview a webpage, run `just preview`
just preview
```
View a list of all possible `just` recipes with `just -l`.
@ -40,27 +39,40 @@ Once you've made your changes, you can create a Pull Request and I'll make sure
## Building
### Build locally
To create a production version of this website without docker:
```bash
# automatically build & preview
just preview
# or, manually build
yarn run build
```
You can then preview the production build locally with `yarn run preview --open`.
The files will be available in the repo, in the `build/` directory.
### Build with Docker
To build a docker container image with `just`:
```bash
# build and run container image with docker
# build and run container image with docker, tag: latest
just build
# build with podman
just build podman
just build <tag> podman
# clean, build, and run container image with docker or podman
# clean, build, and run container image with docker, tag: latest
just all
just all podman
# clean, build, and run container image with podman, tag: dev
just all dev podman
```
You can preview the production build with `yarn run preview`.
You can preview the produced docker build with `just run [tag] [runner]`.
## License

View file

@ -1,5 +0,0 @@
podman compose -f docker-compose.build.yml down && \
#podman compose -f docker-compose.build.yml rm --all && \
podman compose -f docker-compose.build.yml build --no-cache && \
podman compose -f docker-compose.build.yml up -d --force-recreate && \
watch -n 1 podman compose -f docker-compose.build.yml ps

View file

@ -1,5 +0,0 @@
sudo docker compose -f docker-compose.build.yml down && \
#sudo docker compose -f docker-compose.build.yml rm --all && \
sudo docker compose -f docker-compose.build.yml build --no-cache && \
sudo docker compose -f docker-compose.build.yml up -d --force-recreate && \
watch -n 1 sudo docker compose -f docker-compose.build.yml ps

View file

@ -1,9 +1,11 @@
services:
web:
image: gitpot.dev/sangelo/website:${TAG}
image: gitpot.org/sangelo/website:${TAG}
build:
context: .
dockerfile: Dockerfile
no_cache: true
ports:
- "3000:80"
- "3080:8080"

View file

@ -0,0 +1,14 @@
services:
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
website:
image: gitpot.org/sangelo/website:latest
container_name: website
restart: unless-stopped
ports:
- "3000:80"

View file

@ -12,22 +12,23 @@
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte": "^2.30.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.10.1",
"sass": "^1.63.6",
"svelte": "^4.0.5",
"svelte-check": "^3.4.3",
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.5",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.37.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"sass": "^1.75.0",
"svelte": "^4.2.13",
"svelte-check": "^3.6.9",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.4.2"
"typescript": "^5.4.5",
"vite": "^5.2.8"
},
"type": "module",
"dependencies": {

View file

@ -17,6 +17,7 @@
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link href="https://chaos.social/@sangelo" rel="me" />
<script
type="module"
src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@2/dist/zero-md.min.js"

View file

@ -45,7 +45,7 @@
<a
href="https://discord.com/users/373525255102136341"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button discord"
aria-label="Discord"
@ -58,7 +58,7 @@
<a
href="https://youtube.com/@Sangeloo"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button youtube"
aria-label="YouTube"
@ -71,7 +71,7 @@
<a
href="https://github.com/SangeloDev"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button github"
aria-label="GitHub"
@ -84,7 +84,7 @@
<a
href="mailto:contact@sangelo.space"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button email"
aria-label="Email"
@ -99,22 +99,22 @@
<div class="button-container below" transition:slide>
<div class="tooltip">
<a
href="https://steamcommunity.com/id/sangeloo"
href="https://steamcommunity.com/id/Sangelo"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button steam"
aria-label="Steam"
>
<IconSteam class="icon" size="2.5em" />
</a>
<span class="tooltiptext">@sangeloo</span>
<span class="tooltiptext">@Sangelo</span>
</div>
<div class="tooltip">
<a
href="https://matrix.to/#/@sangelo:stardust.foo"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button matrix"
aria-label="Matrix"
@ -125,9 +125,9 @@
</div>
<div class="tooltip">
<a
href="https://gitpot.dev/Sangelo"
href="https://gitpot.org/sangelo"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button gitpot"
aria-label="Gitpot"
@ -195,16 +195,16 @@
</div>
<div class="tooltip">
<a
href="https://mas.to/@sangelo"
href="https://chaos.social/@sangelo"
target="_blank"
rel="noopener noreferrer"
rel="noopener noreferrer me"
tabindex="0"
class="round-button button mastodon"
aria-label="Mastodon"
>
<IconMastodon class="icon" size="2.5em" />
</a>
<span class="tooltiptext">@sangelo@mas.to</span>
<span class="tooltiptext">@sangelo@chaos.social</span>
</div>
</div>
{/if}

View file

@ -1,8 +1,8 @@
<script>
import IconOpenInNew from 'svelte-material-icons/OpenInNew.svelte';
let projectLogo = "assets/logos/dashinit.svg";
let projectReadme = "https://gitpot.dev/dashinit/cli/raw/branch/main/README.md";
let projectSite = "https://gitpot.dev/dashinit/cli";
let projectReadme = "https://gitpot.org/dashinit/cli/raw/branch/main/README.md";
let projectSite = "https://gitpot.org/dashinit/cli";
</script>
<content>

View file

@ -1,7 +1,7 @@
<script>
import IconOpenInNew from 'svelte-material-icons/OpenInNew.svelte';
let projectLogo = "assets/logos/explorecraft.svg";
let projectReadme = "https://gitpot.dev/ExploreCraft/website/raw/branch/main/README.md";
let projectReadme = "https://gitpot.org/ExploreCraft/website/raw/branch/main/README.md";
let projectSite = "https://explorecraft.net";
</script>

View file

@ -1,8 +1,8 @@
<script>
import IconOpenInNew from 'svelte-material-icons/OpenInNew.svelte';
let projectLogo = "assets/logos/gitpot-color.svg";
let projectReadme = "https://gitpot.dev/gitpot/.profile/raw/branch/main/README.md";
let projectSite = "https://gitpot.dev"
let projectReadme = "https://gitpot.org/gitpot/.profile/raw/branch/main/README.md";
let projectSite = "https://gitpot.org"
</script>
<content>

View file

@ -1,7 +1,7 @@
<script>
import IconOpenInNew from 'svelte-material-icons/OpenInNew.svelte';
let projectLogo = "assets/logos/lunivity.svg";
let projectReadme = "https://gitpot.dev/lunivity/.profile/raw/branch/main/README.md";
let projectReadme = "https://gitpot.org/lunivity/.profile/raw/branch/main/README.md";
let projectSite = "https://lunivity.com"
</script>

View file

@ -17,7 +17,7 @@
<h1 class="modal-title no-select">All Projects</h1>
<p class="modal-title">These are all of my projects, including the ones that didn't fit in the homepage. Take a look!</p>
<ul class="item-list">
<a class="item" href="https://gitpot.dev/sangelo/website" rel="noopener noreferrer" target="_blank" tabindex="0">
<a class="item" href="https://gitpot.org/sangelo/website" rel="noopener noreferrer" target="_blank" tabindex="0">
<div class="thumbnail"><img src="assets/logos/sangelos-space-website.svg" alt="Sangelo's Logo" /></div>
<div class="item-details">
<h2>Sangelo's Space</h2>
@ -31,14 +31,14 @@
<p class="item-description">Open-source by nature, self-hosted by choice. Self-hosted cloud services.</p>
</div>
</a>
<a class="item" href="https://gitpot.dev" rel="noopener noreferrer" target="_blank" tabindex="0">
<a class="item" href="https://gitpot.org" rel="noopener noreferrer" target="_blank" tabindex="0">
<div class="thumbnail"><img src="assets/logos/gitpot-color.svg" alt="Gitpot Logo" /></div>
<div class="item-details">
<h2>Gitpot</h2>
<p class="item-description">Code so sweet, bugs can't compete! A Forgejo-powered git forge which is part of the Lunivity Circle.</p>
</div>
</a>
<a class="item" href="https://gitpot.dev/dashinit/cli" rel="noopener noreferrer" target="_blank" tabindex="0">
<a class="item" href="https://gitpot.org/dashinit/cli" rel="noopener noreferrer" target="_blank" tabindex="0">
<div class="thumbnail"><img src="assets/logos/dashinit.svg" alt="dashinit Logo" /></div>
<div class="item-details">
<h2>dashinit</h2>

View file

@ -1,7 +1,7 @@
<script>
import IconOpenInNew from 'svelte-material-icons/OpenInNew.svelte';
let projectLogo = "assets/logos/sangefault.svg";
let projectReadme = "https://gitpot.dev/sangelo/SangeFault/raw/branch/1.8.9/README.md";
let projectReadme = "https://gitpot.org/sangelo/SangeFault/raw/branch/1.8.9/README.md";
let projectSite = "https://github.com/SangeloDev/SangeFault";
</script>

View file

@ -1,8 +1,8 @@
<script>
import IconOpenInNew from 'svelte-material-icons/OpenInNew.svelte';
let projectLogo = "assets/logos/sangelos-space-website.svg";
let projectReadme = "https://gitpot.dev/sangelo/website/raw/branch/main/README.md";
let projectSite = "https://gitpot.dev/sangelo/website";
let projectReadme = "https://gitpot.org/sangelo/website/raw/branch/main/README.md";
let projectSite = "https://gitpot.org/sangelo/website";
</script>
<content>

View file

@ -139,11 +139,12 @@
opacity: 0;
transition: opacity ease-in-out 0.1s;
}
.tooltiptext {
z-index: 1001;
user-select: none;
cursor: default;
width: max-content;
}
.tooltip:hover .tooltiptext {

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

File diff suppressed because one or more lines are too long

View file

@ -1,5 +1,5 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */

1021
yarn.lock

File diff suppressed because it is too large Load diff