update
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
GITEA_ACCESS_TOKEN=528ed6363ba47884c05235cff9ba47e38b4201d5
|
||||
GITEA_USERNAME=hoangvv
|
||||
GITEA_PASSWORD=smartyourlife
|
||||
GITEA_HOST = https://git.nextzenos.com/api/v1
|
||||
@@ -21,3 +21,5 @@
|
||||
# Go workspace file
|
||||
go.work
|
||||
|
||||
venv/
|
||||
*.zip
|
||||
|
||||
+28
-18
@@ -1,4 +1,13 @@
|
||||
{
|
||||
"id": "bifrost",
|
||||
"name": "Bifrost",
|
||||
"description": "Bifrost is a platform for building and deploying applications.",
|
||||
"deployment": {
|
||||
"type": "native"
|
||||
},
|
||||
"installation": {
|
||||
"host_type": "local"
|
||||
},
|
||||
"apps": [
|
||||
{
|
||||
"key": "nextzenos",
|
||||
@@ -38,45 +47,46 @@
|
||||
],
|
||||
"tags": [
|
||||
{
|
||||
"key": "Website",
|
||||
"name": "Website",
|
||||
"key": "server-panel",
|
||||
"name": "Server Panel",
|
||||
"sort": 1
|
||||
},
|
||||
{
|
||||
"key": "Database",
|
||||
"key": "database",
|
||||
"name": "Database",
|
||||
"sort": 2
|
||||
},
|
||||
{
|
||||
"key": "Server",
|
||||
"name": "Web Server",
|
||||
"key": "firewall",
|
||||
"name": "FireWall",
|
||||
"sort": 3
|
||||
},
|
||||
{
|
||||
"key": "Runtime",
|
||||
"name": "Runtime",
|
||||
"key": "tool",
|
||||
"name": "Utility",
|
||||
"sort": 4
|
||||
},
|
||||
{
|
||||
"key": "Tool",
|
||||
"name": "Utility",
|
||||
"key": "vpn",
|
||||
"name": "VPN",
|
||||
"sort": 5
|
||||
},
|
||||
{
|
||||
"key": "DevTool",
|
||||
"name": "Development tool",
|
||||
"sort": 10
|
||||
"key": "nas",
|
||||
"name": "NAS",
|
||||
"sort": 5
|
||||
},
|
||||
{
|
||||
"key": "Middleware",
|
||||
"name": "Middleware",
|
||||
"sort": 12
|
||||
"key": "cli",
|
||||
"name": "CLI",
|
||||
"sort": 6
|
||||
},
|
||||
{
|
||||
"key": "Local",
|
||||
"name": "Local",
|
||||
"sort": 99
|
||||
"key": "api",
|
||||
"name": "API",
|
||||
"sort": 6
|
||||
}
|
||||
],
|
||||
"version": "1.0.0",
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
"deployment": {
|
||||
"type": "docker"
|
||||
},
|
||||
"location": {
|
||||
"host_type": "local",
|
||||
"installation_path": "/opt/bifrost/apps/nextcloud"
|
||||
"installation": {
|
||||
"host_type": "local"
|
||||
},
|
||||
"tags": [],
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+2
-1
@@ -6,9 +6,10 @@
|
||||
"deployment": {
|
||||
"type": "native"
|
||||
},
|
||||
"location": {
|
||||
"installation": {
|
||||
"host_type": "remote",
|
||||
"host": "10.0.0.1"
|
||||
},
|
||||
"tags": [],
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+2
-1
@@ -6,9 +6,10 @@
|
||||
"deployment": {
|
||||
"type": "native"
|
||||
},
|
||||
"location": {
|
||||
"installation": {
|
||||
"host_type": "remote",
|
||||
"host": "10.0.0.1"
|
||||
},
|
||||
"tags": [],
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+2
-1
@@ -6,8 +6,9 @@
|
||||
"deployment": {
|
||||
"type": "native"
|
||||
},
|
||||
"location": {
|
||||
"locinstallationation": {
|
||||
"host_type": "local"
|
||||
},
|
||||
"tags": [],
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
"deployment": {
|
||||
"type": "docker"
|
||||
},
|
||||
"location": {
|
||||
"host_type": "local",
|
||||
"installation_path": "/opt/bifrost/apps/nextvpn"
|
||||
"installation": {
|
||||
"host_type": "local"
|
||||
},
|
||||
"tags": [],
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+3
-3
@@ -6,10 +6,10 @@
|
||||
"deployment": {
|
||||
"type": "docker"
|
||||
},
|
||||
"location": {
|
||||
"host_type": "local",
|
||||
"installation_path": "/opt/bifrost/apps/nextweb"
|
||||
"installation": {
|
||||
"host_type": "local"
|
||||
},
|
||||
"apps": [],
|
||||
"tags": [],
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+3
-2
@@ -1,14 +1,15 @@
|
||||
{
|
||||
"id": "nextzenos",
|
||||
"name": "NextZenOS",
|
||||
"name": "NextzenOS",
|
||||
"version": "1.4",
|
||||
"description": "",
|
||||
"deployment": {
|
||||
"type": "native"
|
||||
},
|
||||
"location": {
|
||||
"installation": {
|
||||
"host_type": "local"
|
||||
},
|
||||
"apps": [],
|
||||
"tags": [],
|
||||
"lastModified": 1746671214
|
||||
}
|
||||
+6
-1
@@ -1,6 +1,8 @@
|
||||
REGISTRY_PATH = $(shell pwd)/registry
|
||||
REGISTRY_REPO = git.nextzenos.com/CDN/bifrost-registry.git
|
||||
update_registry:
|
||||
RELEASE_UID = 8845
|
||||
PYTHON = $(REGISTRY_PATH)/venv/bin/python
|
||||
update_registry: package_registry upload_registry
|
||||
( cd $(REGISTRY_PATH) && \
|
||||
@read -p "Enter your commit message: " commit_msg; \
|
||||
git pull https://$(GIT_USER):$(GIT_PASS)@$(REGISTRY_REPO) || true; \
|
||||
@@ -11,3 +13,6 @@ update_registry:
|
||||
package_registry:
|
||||
(cd $(REGISTRY_PATH) && \
|
||||
zip -r registry.zip *.json -x .gitignore .git .mk)
|
||||
|
||||
upload_registry:
|
||||
$(PYTHON) $(REGISTRY_PATH)/scripts/main.py
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
python-dotenv ; python_version > '3.10'
|
||||
git+https://github.com/dblueai/giteapy.git ; python_version > '3.10'
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
from .config import GiteaConfig
|
||||
from .api import GiteaApi
|
||||
|
||||
__all__ = ["GiteaConfig", "GiteaApi"]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
import giteapy
|
||||
from .config import GiteaConfig
|
||||
|
||||
|
||||
class GiteaApi:
|
||||
|
||||
def __init__(self):
|
||||
self.config = GiteaConfig().configuration
|
||||
|
||||
def admin_gitea_instance(self):
|
||||
return giteapy.AdminApi(giteapy.ApiClient(self.config))
|
||||
|
||||
def repo_gitea_instance(self):
|
||||
return giteapy.RepositoryApi(giteapy.ApiClient(self.config))
|
||||
|
||||
def user_gitea_instance(self):
|
||||
return giteapy.UserApi(giteapy.ApiClient(self.config))
|
||||
|
||||
def org_gitea_instance(self):
|
||||
return giteapy.OrganizationApi(giteapy.ApiClient(self.config))
|
||||
|
||||
def misc_gitea_instance(self):
|
||||
return giteapy.MiscellaneousApi(giteapy.ApiClient(self.config))
|
||||
|
||||
def issue_gitea_instance(self):
|
||||
return giteapy.IssueApi(giteapy.ApiClient(self.config))
|
||||
@@ -0,0 +1,14 @@
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
import giteapy
|
||||
|
||||
# Automatically look for .env in the project root
|
||||
load_dotenv()
|
||||
|
||||
|
||||
class GiteaConfig:
|
||||
def __init__(self):
|
||||
self.configuration = giteapy.Configuration()
|
||||
self.configuration.host = os.getenv("GITEA_HOST")
|
||||
self.configuration.api_key["Authorization"] = os.getenv("GITEA_ACCESS_TOKEN")
|
||||
self.configuration.api_key_prefix["Authorization"] = "Bearer"
|
||||
@@ -0,0 +1,47 @@
|
||||
from gitea.api import GiteaApi
|
||||
from gitea.config import GiteaConfig
|
||||
import giteapy
|
||||
import os
|
||||
import json
|
||||
|
||||
|
||||
def main():
|
||||
gitea_instance = GiteaApi()
|
||||
admin_instance = gitea_instance.admin_gitea_instance()
|
||||
repo_instance = gitea_instance.repo_gitea_instance()
|
||||
|
||||
# Parameters
|
||||
owner = "CDN" # Owner of the repository
|
||||
repo = "bifrost-registry" # Repository name
|
||||
release_id = 8845 # The ID of the release to attach to
|
||||
attachment_path = (
|
||||
"/root/dev/Bifrost/registry/registry.zip" # Path to the file you want to upload
|
||||
)
|
||||
get_release_response = repo_instance.repo_get_release(
|
||||
owner=owner,
|
||||
repo=repo,
|
||||
id=release_id, # Release ID
|
||||
)
|
||||
assets = get_release_response.assets
|
||||
attachment_id = None
|
||||
for asset in assets:
|
||||
if asset.name == "registry.zip":
|
||||
attachment_id = asset.id
|
||||
repo_instance.repo_delete_release_attachment(
|
||||
owner=owner,
|
||||
repo=repo,
|
||||
id=release_id, # Release ID
|
||||
attachment_id=attachment_id,
|
||||
)
|
||||
create_response = repo_instance.repo_create_release_attachment(
|
||||
owner=owner,
|
||||
repo=repo,
|
||||
id=release_id, # Release ID
|
||||
attachment=attachment_path,
|
||||
name=os.path.basename(attachment_path), # Filename for the attachment
|
||||
)
|
||||
print(create_response)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user