forked from Pavel_Durov/python_bot
make pipisa secure
This commit is contained in:
parent
55e5303ab2
commit
d41eeb3232
@ -24,6 +24,11 @@ steps:
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
environment:
|
||||
ARANGO_PASSWORD:
|
||||
from_secret: arango-pwd
|
||||
ARANGO_USERNAME:
|
||||
from_secret: arango-usr
|
||||
- name: restart systemd unit
|
||||
commands:
|
||||
- systemctl restart jack_bot
|
||||
|
@ -1,8 +1,8 @@
|
||||
---
|
||||
databaso:
|
||||
host: 'https://arango.guaranteedstruggle.host'
|
||||
user: root
|
||||
pass: stolendick527
|
||||
#user: root
|
||||
#pass: stolendick527
|
||||
base: pipisa
|
||||
collection: dicks
|
||||
posts_removal_collection: posts_removal
|
||||
|
@ -5,7 +5,7 @@ from global_conf import CONFIG
|
||||
from arango import ArangoClient
|
||||
|
||||
import logging
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def get_dicks_collection():
|
||||
@ -13,8 +13,10 @@ def get_dicks_collection():
|
||||
arango_client = ArangoClient(hosts=CONFIG['databaso']['host'] )
|
||||
pipisa_db = arango_client.db(
|
||||
CONFIG['databaso']['base'],
|
||||
username=CONFIG['databaso']['user'],
|
||||
password=CONFIG['databaso']['pass']
|
||||
username=os.environ['ARANGO_USR'],
|
||||
password=os.environ['ARANGO_PWD'],
|
||||
#username=CONFIG['databaso']['user'],
|
||||
#password=CONFIG['databaso']['pass']
|
||||
)
|
||||
dicks_collection = pipisa_db.collection(CONFIG['databaso']['collection'])
|
||||
|
||||
@ -28,9 +30,11 @@ def get_posts_removal_collection():
|
||||
try:
|
||||
arango_client = ArangoClient(hosts=CONFIG['databaso']['host'] )
|
||||
pipisa_db = arango_client.db(
|
||||
CONFIG['databaso']['base'],
|
||||
username=CONFIG['databaso']['user'],
|
||||
password=CONFIG['databaso']['pass']
|
||||
CONFIG['databaso']['base'],
|
||||
username=os.environ['ARANGO_USR'],
|
||||
password=os.environ['ARANGO_PWD'],
|
||||
#username=CONFIG['databaso']['user'],
|
||||
#password=CONFIG['databaso']['pass']
|
||||
)
|
||||
posts_removal_collection = pipisa_db.collection(CONFIG['databaso']['posts_removal_collection'])
|
||||
|
||||
|
15
jack_bot.service
Normal file
15
jack_bot.service
Normal file
@ -0,0 +1,15 @@
|
||||
# пример того что лежит на хосте
|
||||
[Unit]
|
||||
Description=pipisa-bot
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=jack
|
||||
Type=simple
|
||||
Restart=always
|
||||
WorkingDirectory=/usr/share/python_bot
|
||||
ExecStart=/usr/bin/python3 /usr/share/python_bot/bot.py
|
||||
ExecStart=/usr/bin/python3 /usr/share/python_bot/bot.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target#
|
Loading…
Reference in New Issue
Block a user