feat: add portfolio_server config, service and scripts

This commit is contained in:
Julien Oculi 2024-06-04 15:39:43 +02:00
parent fab58379c1
commit 35612f8982
4 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# Configuration de `portfolio_server`
Server de portfolio (site static) de coh@bit avec sous domaine personnalisé.
## Port
`localhost:6363`
## Emplacements
- `https://git.cohabit.fr/cohabit/portfolio_server/*` -> `/srv/portfolio/*`
- `./systemd/*` -> `/etc/systemd/system/*`

View file

@ -0,0 +1,11 @@
# Pull portfolio server sources
cd /srv/portfolio
git pull origin main
# Setup portfolio server service
cp /srv/portfolio/portfolio.service /etc/systemd/system
# Start portfolio server
systemctl daemon-reload
systemctl enable portfolio
systemctl start portfolio

View file

@ -0,0 +1,23 @@
# Check if already installed
if [[ $(which deno) == "/usr/local/bin/deno" ]]; then
# Upgrade deno
deno upgrade
else
# Install deno
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh
# Create group and user
groupadd --system deno
useradd --system \
--gid deno \
--create-home \
--home-dir /var/lib/deno \
--shell /usr/sbin/nologin \
--comment "Deno js engine" \
deno
fi
# Clone website repo
mkdir -p /srv/portfolio
git clone -b main --depth 1 https://git.cohabit.fr/cohabit/portfolio_server.git /srv/portfolio

View file

@ -0,0 +1,15 @@
[Unit]
Description=Portofolio Server 1.1.1 service
Documentation=http://git.cohabit.fr/cohabit/portfolio_server
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=deno
WorkingDirectory=/srv/portfolio
ExecStart=PORT=6363 /usr/local/bin/deno task serve
Restart=on-failure
[Install]
WantedBy=multi-user.target