--
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Nercone Web Server Updator
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
User=root
|
|
||||||
Group=root
|
|
||||||
WorkingDirectory=/srv/nercone-webserver
|
|
||||||
ExecStart=/usr/bin/bash /srv/nercone-webserver/update.sh
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Nercone Web Server
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=root
|
|
||||||
Group=root
|
|
||||||
WorkingDirectory=/srv/nercone-webserver
|
|
||||||
ExecStart=/usr/bin/bash /srv/nercone-webserver/start.sh
|
|
||||||
Restart=always
|
|
||||||
RestartSec=3
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
9
nercone-website-autoupdater.service
Normal file
9
nercone-website-autoupdater.service
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Nercone Website Updater
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
WorkingDirectory=/srv/website
|
||||||
|
ExecStart=/usr/bin/bash /srv/website/update.sh
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Nercone Web Server Updator
|
Description=Nercone Website Updater
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar=*-*-* 00:00:00 UTC
|
OnCalendar=*-*-* 00:00:00 UTC
|
||||||
14
nercone-website.service
Normal file
14
nercone-website.service
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Nercone Website
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
WorkingDirectory=/srv/website
|
||||||
|
ExecStart=/usr/bin/bash /srv/website/start.sh
|
||||||
|
Restart=always
|
||||||
|
RestartSec=3
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -3,7 +3,7 @@ requires = ["uv_build>=0.9.5,<0.10.0"]
|
|||||||
build-backend = "uv_build"
|
build-backend = "uv_build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "nercone-webserver"
|
name = "nercone-website"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
@@ -16,4 +16,4 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
nercone-webserver = "nercone_webserver.__main__:main"
|
nercone-website = "nercone_website.__main__:main"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ def main():
|
|||||||
"uvicorn.access": {"handlers": ["file", "console"], "level": "INFO", "propagate": False}
|
"uvicorn.access": {"handlers": ["file", "console"], "level": "INFO", "propagate": False}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uvicorn.run("nercone_webserver.server:app", host="0.0.0.0", port=8080, workers=1, server_header=False, log_config=log_config)
|
uvicorn.run("nercone_website.server:app", host="0.0.0.0", port=8080, workers=1, server_header=False, log_config=log_config)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
2
start.sh
2
start.sh
@@ -1 +1 @@
|
|||||||
/root/.local/bin/nercone-webserver
|
/root/.local/bin/nercone-website
|
||||||
|
|||||||
10
update.sh
10
update.sh
@@ -1,7 +1,7 @@
|
|||||||
sudo /usr/bin/systemctl disable nercone-webserver
|
sudo /usr/bin/systemctl disable nercone-website
|
||||||
sudo /usr/bin/systemctl kill nercone-webserver
|
sudo /usr/bin/systemctl kill nercone-website
|
||||||
/usr/bin/git pull
|
/usr/bin/git pull
|
||||||
/root/.local/bin/uv tool uninstall nercone-webserver --no-cache || true
|
/root/.local/bin/uv tool uninstall nercone-website --no-cache || true
|
||||||
/root/.local/bin/uv tool install . --upgrade --no-cache
|
/root/.local/bin/uv tool install . --upgrade --no-cache
|
||||||
sudo /usr/bin/systemctl enable nercone-webserver
|
sudo /usr/bin/systemctl enable nercone-website
|
||||||
sudo /usr/bin/systemctl start nercone-webserver
|
sudo /usr/bin/systemctl start nercone-website
|
||||||
|
|||||||
Reference in New Issue
Block a user