1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-09-19 18:31:16 +00:00

Fix running server_setup

This commit is contained in:
Mo 2022-05-17 11:58:19 +02:00
parent 68ac180e86
commit 76e8dbba46
5 changed files with 37 additions and 10 deletions

View file

@ -1,7 +1,12 @@
# No relative imports allowed in this file to be able to run server_setup.py without packages
import sys
from pathlib import Path
from ..terminal_utils import run, step
from .shared import LOCAL_BIN, LOGS_DIR, install_latest_pipx, poetry_update
from shared import LOCAL_BIN, LOGS_DIR, install_latest_pipx, poetry_update
sys.path.insert(0, "..")
from terminal_utils import run, step
def main():

View file

@ -1,5 +1,11 @@
from ..terminal_utils import run
from .shared import LOGS_DIR, REPO_DIR
# No relative imports allowed in this file to be able to run server_setup.py without packages
import sys
from shared import LOGS_DIR, REPO_DIR
sys.path.insert(0, "..")
from terminal_utils import run
def main():

View file

@ -1,6 +1,10 @@
# No relative imports allowed in this file to be able to run server_setup.py without packages
import sys
from pathlib import Path
from ..terminal_utils import run
sys.path.insert(0, "..")
from terminal_utils import run
LOCAL_BIN = Path("/home/admin/.local/bin/")
LOGS_DIR = Path("/var/log/advlabdb")

View file

@ -1,3 +1,5 @@
# No relative imports allowed in this file to be able to run server_setup.py without packages
import subprocess
from getpass import getpass

View file

@ -15,7 +15,7 @@ Run the following (as root):
----
# Install needed packages
apt update
apt install sudo python3 -y
apt install sudo python3 git -y
# Add a sudo user with the name 'admin'
sudo useradd admin
@ -29,8 +29,6 @@ sudo passwd admin
exit
----
Copy the repository to the server into `/home/admin/advlabdb`.
`ssh` again with the new user `admin` and password:
[source,bash]
@ -38,16 +36,28 @@ Copy the repository to the server into `/home/admin/advlabdb`.
ssh admin@SERVER_NAME
----
Clone the repository with `git clone` into `/home/admin/advlabdb`. Then `cd` into the new cloned repository:
[source,bash]
----
cd ~/advlabdb
----
Change server_name in `advlabdb/scripts/setup/advlabdb.conf` to your SERVER_NAME.
Run the following:
[source,bash]
----
# Run server setup script
cd ~/advlabdb
python3 -m advlabdb.scripts.setup.init_db
python3 advlabdb/scripts/setup/server_setup.py
----
Change server_name in advlabdb.conf
[source,bash]
----
python3 -m advlabdb.scripts.setup.init_database
----
== Stop ssh to root
// TODO: Add blocking password access