diff --git a/forgejo/cli.py b/forgejo/cli.py index f3334e0..7b58963 100644 --- a/forgejo/cli.py +++ b/forgejo/cli.py @@ -24,7 +24,6 @@ class Forgejo: self.c = c self.parser = parser self.subparser = self.parser.add_subparsers() - self.install() self.register() self.login() self.create_repository() @@ -39,17 +38,6 @@ class Forgejo: group.add_argument("email", type=str, help="Forgejo user's email") group.add_argument("host", type=str, help="URI at which Forgejo is running") - def install(self): - def run(args, c: Session): - forgejo = forgejo_from_args(args, c=c) - forgejo.install() - - self.install_parser = self.subparser.add_parser( - name="install", description="Install Forgejo", help="Install Forgejo" - ) - self.__add_credentials_parser(self.install_parser) - self.install_parser.set_defaults(func=run) - def register(self): def run(args, c: Session): forgejo = forgejo_from_args(args, c=c) diff --git a/forgejo/forgejo.py b/forgejo/forgejo.py index 20ae3d1..7d36d63 100755 --- a/forgejo/forgejo.py +++ b/forgejo/forgejo.py @@ -71,54 +71,6 @@ class Forgejo: count += 1 continue - def install(self): - """ - Install Forgejo, first form that a user sees when a new instance is - deployed - """ - - parsed = urlparse(self.host) - # cwd = os.environ.get("PWD") - # user = os.environ.get("USER") - payload = { - "db_type": "sqlite3", - "db_host": "localhost:3306", - "db_user": "root", - "db_passwd": "", - "db_name": "forgejo", - "ssl_mode": "disable", - "db_schema": "", - "charset": "utf8", - "db_path": "/data/gitea/gitea.db", - "app_name": "Forgejo:+Beyond+Coding+We+Forge", - "repo_root_path": "/data/git/repositories", - "lfs_root_path": "/data/git/lfs", - "run_user": "git", - "domain": parsed.netloc, - "ssh_port": "22", - "http_port": "3000", - "app_url": self.get_uri(""), - "log_root_path": "/data/gitea/log", - "smtp_host": "", - "smtp_from": "", - "smtp_user": "", - "smtp_passwd": "", - "enable_federated_avatar": "on", - "enable_open_id_sign_in": "on", - "enable_open_id_sign_up": "on", - "default_allow_create_organization": "on", - "default_enable_timetracking": "on", - "no_reply_address": "noreply.localhost", - "password_algorithm": "pbkdf2", - "admin_name": self.username, - "admin_passwd": self.password, - "admin_confirm_passwd": self.password, - "admin_email": self.email, - } - - resp = self.c.post(self.get_uri(""), data=payload, allow_redirects=False) - sleep(10) - def get_csrf_token(self, url: str) -> str: """ Get CSRF token at a URI diff --git a/lib.sh b/lib.sh index d6add58..6e3a7b2 100755 --- a/lib.sh +++ b/lib.sh @@ -42,11 +42,6 @@ wait_for_env() { # register root user on Forgejo to simulate Hoste admin and integrate SSO forgejo_root(){ -# python -m forgejo \ -# forgejo install \ -# $FORGEJO_ROOT_USERNAME $FORGEJO_ROOT_PASSOWRD \ -# $FORGEJO_ROOT_EMAIL \ -# $FORGEJO_URL python -m forgejo \ forgejo register \ $FORGEJO_ROOT_USERNAME $FORGEJO_ROOT_PASSOWRD \