File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22The config of the object storage plugin.
33"""
44
5+ import os
6+ import re
57import shutil
68
79ENV_ACCESS_KEY_NAME = "LINODE_CLI_OBJ_ACCESS_KEY"
810ENV_SECRET_KEY_NAME = "LINODE_CLI_OBJ_SECRET_KEY"
9- # replace {} with the cluster name
10- BASE_URL_TEMPLATE = "https://{}.linodeobjects.com"
11- BASE_WEBSITE_TEMPLATE = "{bucket}.website-{cluster}.linodeobjects.com"
11+
12+ API_HOST = os .getenv ("LINODE_CLI_API_HOST" , "" )
13+
14+ OBJ_DOMAIN = "linodeobjects.com"
15+
16+ if API_HOST :
17+ match = re .match (r"api\.([^.]+)\.linode\.com" , API_HOST )
18+ if match :
19+ OBJ_DOMAIN = f"{ match .group (1 )} .linodeobjects.com"
20+
21+ BASE_URL_TEMPLATE = f"https://{{}}.{ OBJ_DOMAIN } "
22+ BASE_WEBSITE_TEMPLATE = f"{{bucket}}.website-{{cluster}}.{ OBJ_DOMAIN } "
1223
1324# for all date output
1425DATE_FORMAT = "%Y-%m-%d %H:%M"
You can’t perform that action at this time.
0 commit comments