Compare commits

..

6 Commits

Author SHA1 Message Date
2d3ca53c08 build 2025-12-13 13:38:22 +01:00
87a088bfb0 build 2025-12-13 13:36:15 +01:00
92b24e472e Update .gitlab-ci.yml file 2025-12-13 13:35:22 +01:00
42f82ef69e build 2025-12-13 13:33:02 +01:00
506aa0a903 Update .gitlab-ci.yml file 2025-12-13 13:32:42 +01:00
6c4222ac16 build 2025-12-13 13:30:30 +01:00
3 changed files with 12 additions and 10 deletions

View File

@@ -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
- chmod 600 ~/.ssh/id_rsa
- 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@morefine.home.lan:/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.80.222:/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@192.168.77.101:/myapps/bin/ || true
- rm -rf /home/gitlab-runner/builds/1fLwHSKm2/0/jaydee/portainer.tmp
artifacts:
paths:

View File

@@ -117,7 +117,6 @@ class Portainer:
self.get_stacks()
self.get_containers()
def set_defaults(self, config):
'''Set default configuration from provided config dictionary.'''
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']
elif site == "port":
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:
self.base_url = os.getenv(
"PORTAINER_URL", "https://portainer.sectorq.eu/api"
)
)
self.token = "ptr_GCNUoFcTOaXm7k8ZxPdQGmrFIamxZPTydbserYofMHc="
self.get_endpoints()
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__"]
else:
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
print("Checking for updates only...")
else:
print("Checking for updates and pulling updates...")
pull = True
if "__ALL__" in service_ids:
service_ids = [s[0] for s in service_tuples if s[0] != "__ALL__" and s[0] != "__ONLY_CHECK__"]

View File

@@ -28,9 +28,8 @@ try:
if VAULT_TOKEN is None:
raise KeyError
except KeyError:
VAULT_TOKEN = input("Valult root token : ")
VAULT_TOKEN = prompt("Valult root token : ", is_password=True)
os.environ["VAULT_TOKEN"] = VAULT_TOKEN
input(VAULT_TOKEN)
client = hvac.Client(url=VAULT_ADDR, token=VAULT_TOKEN)
# Check if connected
@@ -40,7 +39,7 @@ else:
raise Exception("Failed to authenticate with Vault")
# Specify the mount point of your KV engine
VERSION = "0.1.13"
VERSION = "0.1.14"
defaults = {
"endpoint_id": "vm01",
@@ -406,7 +405,7 @@ if __name__ == "__main__":
title="Select one service",
text="Choose a service:",
values=actions
).run()
).run()