mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2025-12-14 02:34:53 +01:00
Compare commits
6 Commits
9be4051720
...
2d3ca53c08
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d3ca53c08 | |||
| 87a088bfb0 | |||
| 92b24e472e | |||
| 42f82ef69e | |||
| 506aa0a903 | |||
| 6c4222ac16 |
@@ -27,9 +27,9 @@ build-job: # This job runs in the build stage, which runs first.
|
|||||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
|
||||||
- chmod 600 ~/.ssh/id_rsa
|
- chmod 600 ~/.ssh/id_rsa
|
||||||
- pyinstaller --onefile portainer.py
|
- pyinstaller --onefile portainer.py
|
||||||
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.80.222:/myapps/bin/ || true
|
#- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.80.222:/myapps/bin/ || true
|
||||||
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@morefine.home.lan:/myapps/bin/ || true
|
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.77.12:/myapps/bin/ || true
|
||||||
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@m-server.home.lan:/myapps/bin/ || true
|
- scp -o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/portainer jd@192.168.77.101:/myapps/bin/ || true
|
||||||
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
|
|||||||
9
port.py
9
port.py
@@ -117,7 +117,6 @@ class Portainer:
|
|||||||
self.get_stacks()
|
self.get_stacks()
|
||||||
self.get_containers()
|
self.get_containers()
|
||||||
|
|
||||||
|
|
||||||
def set_defaults(self, config):
|
def set_defaults(self, config):
|
||||||
'''Set default configuration from provided config dictionary.'''
|
'''Set default configuration from provided config dictionary.'''
|
||||||
self.cur_config = config
|
self.cur_config = config
|
||||||
@@ -132,10 +131,12 @@ class Portainer:
|
|||||||
self.token = self.args.client.secrets.kv.v2.read_secret_version(path=token_path)['data']['data']['value']
|
self.token = self.args.client.secrets.kv.v2.read_secret_version(path=token_path)['data']['data']['value']
|
||||||
elif site == "port":
|
elif site == "port":
|
||||||
self.base_url = os.getenv("PORTAINER_URL", "https://port.sectorq.eu/api")
|
self.base_url = os.getenv("PORTAINER_URL", "https://port.sectorq.eu/api")
|
||||||
|
token_path = "port/token"
|
||||||
|
self.token = self.args.client.secrets.kv.v2.read_secret_version(path=token_path)['data']['data']['value']
|
||||||
else:
|
else:
|
||||||
self.base_url = os.getenv(
|
self.base_url = os.getenv(
|
||||||
"PORTAINER_URL", "https://portainer.sectorq.eu/api"
|
"PORTAINER_URL", "https://portainer.sectorq.eu/api"
|
||||||
)
|
)
|
||||||
self.token = "ptr_GCNUoFcTOaXm7k8ZxPdQGmrFIamxZPTydbserYofMHc="
|
self.token = "ptr_GCNUoFcTOaXm7k8ZxPdQGmrFIamxZPTydbserYofMHc="
|
||||||
self.get_endpoints()
|
self.get_endpoints()
|
||||||
self.get_stacks()
|
self.get_stacks()
|
||||||
@@ -801,9 +802,11 @@ class Portainer:
|
|||||||
service_ids = [s[0] for s in service_tuples if s[0] != "__ALL__" and s[0] != "__ONLY_CHECK__"]
|
service_ids = [s[0] for s in service_tuples if s[0] != "__ALL__" and s[0] != "__ONLY_CHECK__"]
|
||||||
else:
|
else:
|
||||||
service_ids = [self.args.service_id]
|
service_ids = [self.args.service_id]
|
||||||
if "__ONLY_CHECK__" in service_ids and self.args.update is False:
|
if "__ONLY_CHECK__" in service_ids or self.args.update is False:
|
||||||
pull = False
|
pull = False
|
||||||
|
print("Checking for updates only...")
|
||||||
else:
|
else:
|
||||||
|
print("Checking for updates and pulling updates...")
|
||||||
pull = True
|
pull = True
|
||||||
if "__ALL__" in service_ids:
|
if "__ALL__" in service_ids:
|
||||||
service_ids = [s[0] for s in service_tuples if s[0] != "__ALL__" and s[0] != "__ONLY_CHECK__"]
|
service_ids = [s[0] for s in service_tuples if s[0] != "__ALL__" and s[0] != "__ONLY_CHECK__"]
|
||||||
|
|||||||
@@ -28,9 +28,8 @@ try:
|
|||||||
if VAULT_TOKEN is None:
|
if VAULT_TOKEN is None:
|
||||||
raise KeyError
|
raise KeyError
|
||||||
except KeyError:
|
except KeyError:
|
||||||
VAULT_TOKEN = input("Valult root token : ")
|
VAULT_TOKEN = prompt("Valult root token : ", is_password=True)
|
||||||
os.environ["VAULT_TOKEN"] = VAULT_TOKEN
|
os.environ["VAULT_TOKEN"] = VAULT_TOKEN
|
||||||
input(VAULT_TOKEN)
|
|
||||||
|
|
||||||
client = hvac.Client(url=VAULT_ADDR, token=VAULT_TOKEN)
|
client = hvac.Client(url=VAULT_ADDR, token=VAULT_TOKEN)
|
||||||
# Check if connected
|
# Check if connected
|
||||||
@@ -40,7 +39,7 @@ else:
|
|||||||
raise Exception("Failed to authenticate with Vault")
|
raise Exception("Failed to authenticate with Vault")
|
||||||
# Specify the mount point of your KV engine
|
# Specify the mount point of your KV engine
|
||||||
|
|
||||||
VERSION = "0.1.13"
|
VERSION = "0.1.14"
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
"endpoint_id": "vm01",
|
"endpoint_id": "vm01",
|
||||||
@@ -406,7 +405,7 @@ if __name__ == "__main__":
|
|||||||
title="Select one service",
|
title="Select one service",
|
||||||
text="Choose a service:",
|
text="Choose a service:",
|
||||||
values=actions
|
values=actions
|
||||||
).run()
|
).run()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user