Closed rkhamis closed 4 years ago
@Pishoy please create a list of all the websites we need to package and keep this storycard updated with progress
below are a list of websites
[x] www.enertia.io
[x] www.freeflowtokens.com , www.freeflowtoken.com
[x] www.goldflow.io
[ ] www.freeflowpages.com
[x] www.capemusicacademy.com ( only one website no staging )
[ ] www.atwg.tech
[x] www.freeflowevent.com
[x] www.bettertoken.com
[x] www.faircoffee.trade
[x] www.3bot.org
[x] www.freeflownation.org
[ ] www.veda-masters.com
[ ] www.harvested.io
[ ] www.threefold.io
[ ] www.es.freeflownation.org
[x] www.openly.live
[x] www.support.grid.tf
[x] www.es.veda-egypt.com
[x] www.nbh-digital.com
[x] www.cultivo.earth
[x] www.veda-retreats.com
[x] www.veda-egypt.com
[x] www.threefold.love
[ ] www.staging.freeflowpages.com ( instead of www2)
[ ] www.threefold.tech
[x] www.euroflow.io
[x] www.inid.io
[x] www.incubaid.com
[ ] https://codescalers.com (only production)
[ ] https://zai.threefold.io (only )
[x] https://www2.mazraa.io/ (only staging, production outside our env )
[ ] www.grid.tf
[ ] erp.codescalers.com
[ ] all wikis are running on an openpublish as below list , also they should have ww2
wiki.freeflowevent.com
wiki.tokens.grid.tf
wiki.grid.tf
wiki.freeflownation.org
wiki.bettertoken.com
wiki.incubaid.com
wiki.tools.grid.tf
wiki.team.grid.tf
wiki.harvested.io
wiki.internal.grid.tf
wiki.ambassadors.grid.tf
wiki.threefold.tech
wiki.foundation.grid.tf
verified
1 - install jumpscaleX
2 - if website was already running
Kill ALL tmux running servers
clean bcdb kosmos 'j.data.bcdb.destroy_all()'
remove old servers config rm -rf /sandbox/cfg/nginx/default_openresty_threebot/servers/*
3 - git clone webiste repo in /var/www/threefold_tech
4 - create you package file packgae.py
in dir /sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/threefold_tech as below
from Jumpscale import j
class Package(j.baseclasses.threebot_package):
def _init(self, **kwargs):
if "branch" in kwargs.keys():
self.branch = kwargs["branch"]
else:
self.branch = "master"
def prepare(self):
"""
is called at install time
:return:
"""
server = self.openresty
server.install(reset=True)
server.configure()
website = server.websites.get("threefold_tech")
website.ssl = True
website.port = 443
locations = website.locations.get("main")
static_location = locations.locations_static.new()
static_location.name = "static"
static_location.path_url = "/"
static_location.path_location = f"/var/www/threefold_tech"
static_location.use_jumpscale_weblibs = True
website.domain = 'threefold_tech.grid.tf'
website.path = '/var/www/threefold_tech'
locations.configure()
website.configure()
def start(self):
"""
called when the 3bot starts
:return:
"""
self.prepare()
def stop(self):
"""
called when the 3bot stops
:return:
"""
pass
def uninstall(self):
"""
called when the package is no longer needed and will be removed from the threebot
:return:
"""
pass
5 - open new session and load ur package
kosmos -p
j.tools.threebot_packages.get('mythreefold_tech',path='/sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/threefold_tech')
j.servers.threebot.default.start(web=True, ssl=True)
@Pishoy this task is actually about creating the website packages, not just verifying that the packages work.
all websites are done, added package.py in their website repo and tested
1 - install jumpscaleX 2 - if website was already running
Kill ALL tmux running servers
clean bcdb
kosmos 'j.data.bcdb.destroy_all()'
or
bcdb delete --all
important dirs : /sandbox/cfg/nginx/default_openresty_threebot/servers/ has all websites conf file
3 - create your package file package.py and package.toml in website repo
package.py example of enertia website > change enertia to the name of your website
from Jumpscale import j
class Package(j.baseclasses.threebot_package):
def start(self):
server = self.openresty
server.configure()
for port in [80, 443]:
website = server.get_from_port(port)
website.domain = "UR_DOMAIN"
locations = website.locations.get(f"enertia_locations_{port}")
website_location = locations.locations_static.new()
website_location.name = "enertiawebsite"
website_location.path_url = "/"
fullpath = j.sal.fs.joinPaths(self.package_root, "html/")
website_location.path_location = fullpath
locations.configure()
website.configure()
website.save()
package.toml example file of enertai website
[source]
name = "enertiaio"
description = "enertiaio website"
threebot = "threefold"
version = "1.0.0"
then move all website files in directory html .
From Jumpscale machine do :
JSX> cl = j.servers.threebot.local_start_zerobot(background=False)
MARK THREEBOT IS STARTING
JSX> cl = j.clients.gedis.get("abc", port=8901, package_name="zerobot.packagemanager")
JSX> cl.actors.package_manager.package_add(git_url="https://github.com/PeterNashaat/www_enertia_io")
Websites need to have Package.py and package.toml files for now :
First create new branch 3bot and then add files in it and new html directory contains all website files
[x] www.3bot.org
[x] www.threefold.love
[x] www.threefold.tech
[x] www.incubaid.com
3bot.org and incubaid.com has been modified and tested, also threefold.love and threefold.tech tested
Follow docs here: https://github.com/threefoldtech/jumpscaleX_core/tree/development/JumpscaleCore/servers/threebot#packages
to create packages for all our websites