RIP NWS
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Failing after 1h5m57s

This commit is contained in:
Nicholas Orlowsky 2025-04-04 16:49:33 -04:00
parent 52afac5028
commit 6bd69f6c5b
No known key found for this signature in database
GPG key ID: A9F3BA4C0AA7A70B
11 changed files with 2298 additions and 19 deletions

19
.direnv/bin/nix-direnv-reload Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/home/nickorlow/programming/personal/nws-site" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/home/nickorlow/programming/personal/nws-site")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi
# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/home/nickorlow/programming/personal/nws-site" true
# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/home/nickorlow/programming/personal/nws-site/.envrc"
# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/home/nickorlow/programming/personal/nws-site/.envrc" "/home/nickorlow/programming/personal/nws-site/.direnv"/*.rc

View file

@ -0,0 +1 @@
/nix/store/gr8ifjf51b4w3v62vvinq4s8w97pn3ag-nix-shell-env

File diff suppressed because it is too large Load diff

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

View file

@ -1,14 +1,23 @@
FROM rust:1.82 as build
FROM rust:alpine AS builder
ENV PKG_CONFIG_ALLOW_CROSS=1
WORKDIR /app/src
RUN USER=root
WORKDIR .
COPY . .
RUN apk add pkgconfig openssl-dev libc-dev openssl-libs-static
COPY ./ ./
RUN cargo build --release
RUN cargo install --path .
FROM alpine:latest
WORKDIR /app
RUN apk update \
&& apk add openssl ca-certificates
EXPOSE 80
COPY --from=builder /app/src/target/release/website /app/website
COPY assets /app/assets
ENV RUST_LOG=info
ENV EXPOSE_PORT=80
EXPOSE 80
ENTRYPOINT ["website"]
ENTRYPOINT ["/app/website"]

11
shell.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = [ pkgs.pkg-config pkgs.openssl pkgs.libgcc pkgs.boost pkgs.cmake pkgs.python312 pkgs.cmake pkgs.gnumake ];
shellHook = ''
export OPENSSL_DIR="${pkgs.openssl.dev}"
export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig"
export OPENSSL_NO_VENDOR=1
export OPENSSL_LIB_DIR="${pkgs.lib.getLib pkgs.openssl}/lib"
'';
}

View file

@ -1,5 +1,9 @@
{%- import "shutdown_warn.html" as warn -%}
<h1>Blog</h1>
{% call warn::shutdown_warn() %}
{% for blog in blogs %}
<div style="margin-top: 10px; margin-bottom: 10px;">
<h3 style="margin-bottom: 0px;">

View file

@ -1,2 +1,6 @@
{%- import "shutdown_warn.html" as warn -%}
{% call warn::shutdown_warn() %}
<h1>Under Construction</h1>
<p>The new dashboard isn't ready yet! Nobody but me used it anyways!</p>

View file

@ -1,17 +1,11 @@
{%- import "uptime_table.html" as scope -%}
{%- import "shutdown_warn.html" as warn -%}
<div>
<script>
var url = new URL(window.location.href);
var af = url.searchParams.get("af");
if (af == null || af == "true") {
window.location.href = "./assets/april_fools.html";
}
</script>
<h1 style="margin-bottom: 0px;margin-top: 0px;">Nick Web Services</h1>
<p style="margin-top: 0px;">Pottsville, PA - Philadelphia, PA - Austin, TX</p>
{% call warn::shutdown_warn() %}
<p>
Nick Web Services is a hosting service based out of the Commonwealth of Pennsylvania
@ -34,6 +28,6 @@ We operate four datacenters located across three cities in two states. This infr
have reduced uptime. This is expected to be resolved around August 2024.
</p>
<h2>Compare us to our competitors!</h2>
{% call scope::uptime_table(uptime_infos) %}
<!--<h2>Compare us to our competitors!</h2>
{% call scope::uptime_table(uptime_infos) %}-->
</div>

View file

@ -0,0 +1,14 @@
{% macro shutdown_warn() %}
<div style="border-color:#ff0000; border-width: 2px; padding: 10px;border-style: double;">
<h2>NOTICE: NWS has been shut down</h2>
<p>For various reasons, NWS had to shut down all datacenters except the Pottsville, PA location. Due to only having one point of presence, NWS has been unable to deliver reliable uptime. Furthermore, the maintenance required to run NWS has become a bit too much for me, especially since it now no longer provides any benefits over just having a server running all of my services with docker compose. </p>
<p>Due to the above complications, NWS shut down on April 4th, 2025 at 4:48 PM EDT. During the time NWS was operating from 2021 - 2025, it was able to deliver consistently high uptime, including for having 100% uptime for <b>over a year</b> between the dates of 11/8/2023 and 11/28/2024.</p>
<p>In August, NWS may be able to open another datacenter, at which point it may resume operations.</p>
<p>This website (and my other websites) are just being run on my homelab as docker containers under docker compose.</p>
</div>
{% endmacro %}

View file

@ -1,8 +1,11 @@
{%- import "uptime_table.html" as scope -%}
{%- import "shutdown_warn.html" as warn -%}
<h1>System Status</h1>
<h2>Datacenter Status</h2>
{% call warn::shutdown_warn() %}
<!--<h2>Datacenter Status</h2>
<p>
The status of each of Nick Web Services's 4
datacenters.
@ -23,4 +26,4 @@ Nick Web Services may be affected by factors not controlled by us such as
bad optimization or buggy software.
</p>
{% call scope::uptime_table(svc_uptime_infos) %}
{% call scope::uptime_table(svc_uptime_infos) %}-->