diff --git a/README.md b/README.md index d1cdee2..d6a1a08 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,9 @@ You can check [my own Maloja page](https://maloja.krateng.ch) to see what it loo ## Table of Contents * [Features](#features) * [How to install](#how-to-install) - * [Environment](#environment) - * [New Installation](#new-installation) - * [Update](#update) + * [LXC / VM / Bare Metal](#lxc--vm--bare-metal) * [Docker](#docker) + * [Extras](#extras) * [How to use](#how-to-use) * [Basic control](#basic-control) * [Data](#data) @@ -124,16 +123,26 @@ An example of a minimum run configuration when accessing maloja from an IPv4 add Start and stop the server with +```console maloja start maloja stop maloja restart +``` If something is not working, you can try +```console maloja debug +``` to run the server in the foreground. +```console + maloja info +``` + +will give you some basic information about your install. + ### Data diff --git a/maloja/globalconf.py b/maloja/globalconf.py index 1730448..2e773b5 100644 --- a/maloja/globalconf.py +++ b/maloja/globalconf.py @@ -2,6 +2,8 @@ import os from doreah.configuration import Configuration from doreah.configuration import types as tp +from .__pkginfo__ import versionstr + # if DATA_DIRECTORY is specified, this is the directory to use for EVERYTHING, no matter what @@ -270,6 +272,13 @@ data_dir = { +### write down the last ran version +with open(pthj(dir_settings['state'],".lastmalojaversion"),"w") as filed: + filed.write(versionstr) + filed.write("\n") + + + ### DOREAH CONFIGURATION diff --git a/maloja/proccontrol/control.py b/maloja/proccontrol/control.py index 14b059b..c27cd3a 100644 --- a/maloja/proccontrol/control.py +++ b/maloja/proccontrol/control.py @@ -95,13 +95,14 @@ def print_info(): print_header_info() print("Configuration Directory:",globalconf.dir_settings['config']) print("Data Directory: ",globalconf.dir_settings['state']) + print("Log Directory: ",globalconf.dir_settings['logs']) print("Network: ",f"IPv{ip_address(globalconf.malojaconfig['host']).version}, Port {globalconf.malojaconfig['port']}") print("Timezone: ",f"UTC{globalconf.malojaconfig['timezone']:+d}") print() print("#####") print() -@mainfunction({"l":"level"},shield=True) +@mainfunction({"l":"level","v":"version"},flags=['version'],shield=True) def main(*args,**kwargs): actions = { @@ -118,7 +119,10 @@ def main(*args,**kwargs): "info":print_info } - if len(args) > 0: + if "version" in kwargs: + print(info.versionstr) + + elif len(args) > 0: action = args[0] args = args[1:] if action in actions: actions[action](*args,**kwargs)