Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c7dd7e44d | |||
967390ddfa | |||
53ecb4302a |
@@ -4,7 +4,7 @@ _malias_ is a helper for mailcow instances. You can create, delete, search and l
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Download the latest release from https://gitlab.pm/rune/malias/releases. Unzip and move to a folder in you path (ease of use). I also recommend rename the file ```malias.py``` to just ```malias``` and make the file executable with ```chmod +x malias```. To install required python modules run ```pip3 install -r requirements.txt```
|
Download the latest release from [https://gitlab.pm/rune/malias/releases](https://iurl.no/release). Unzip and move to a folder in you path (ease of use). I also recommend rename the file ```malias.py``` to just ```malias``` and make the file executable with ```chmod +x malias```. To install required python modules run ```pip3 install -r requirements.txt```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ database = filepath.joinpath('malias.db')
|
|||||||
logfile = filepath.joinpath('malias.log')
|
logfile = filepath.joinpath('malias.log')
|
||||||
Path(filepath).mkdir(parents=True, exist_ok=True)
|
Path(filepath).mkdir(parents=True, exist_ok=True)
|
||||||
logging.basicConfig(filename=logfile,level=logging.INFO,format='%(message)s')
|
logging.basicConfig(filename=logfile,level=logging.INFO,format='%(message)s')
|
||||||
app_version = '0.3.1'
|
app_version = '0.3.2'
|
||||||
|
|
||||||
|
|
||||||
def get_latest_release():
|
def get_latest_release():
|
||||||
@@ -116,7 +116,6 @@ def get_settings(kind):
|
|||||||
|
|
||||||
|
|
||||||
def get_api():
|
def get_api():
|
||||||
latest_release = get_latest_release()
|
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
cursor.execute('SELECT api FROM apikey')
|
cursor.execute('SELECT api FROM apikey')
|
||||||
apikey = cursor.fetchone()[0]
|
apikey = cursor.fetchone()[0]
|
||||||
@@ -299,11 +298,11 @@ def checklist(alias):
|
|||||||
remoteData = json.loads(remote)
|
remoteData = json.loads(remote)
|
||||||
i = 0
|
i = 0
|
||||||
for search in remoteData:
|
for search in remoteData:
|
||||||
if alias in remoteData[i]['address'] or alias in remoteData[i]['goto']:
|
if alias == remoteData[i]['address'] or alias == remoteData[i]['goto']:
|
||||||
alias_exist = True
|
alias_exist = True
|
||||||
i=i+1
|
i=i+1
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
cursor.execute('SELECT count(*) FROM aliases where alias like ? or goto like ?', (alias,alias,))
|
cursor.execute('SELECT count(*) FROM aliases where alias == ? or goto == ?', (alias,alias,))
|
||||||
count = cursor.fetchone()[0]
|
count = cursor.fetchone()[0]
|
||||||
if count >= 1 :
|
if count >= 1 :
|
||||||
alias_exist = True
|
alias_exist = True
|
||||||
|
Reference in New Issue
Block a user