feat: init woodpecker #1

Open
realaravinth wants to merge 9 commits from init-woodpecker into master
Showing only changes of commit 77dda509ca - Show all commits

View file

@ -30,46 +30,6 @@ def check_online():
count += 1 count += 1
continue continue
def install():
INSTALL_PAYLOAD = {
"db_type": "sqlite3",
"db_host": "localhost:3306",
"db_user": "root",
"db_passwd": "",
"db_name": "gitea",
"ssl_mode": "disable",
"db_schema": "",
"charset": "utf8",
"db_path": "/data/gitea/gitea.db",
"app_name": "Gitea:+Git+with+a+cup+of+tea",
"repo_root_path": "/data/git/repositories",
"lfs_root_path": "/data/git/lfs",
"run_user": "git",
"domain": "localhost",
"ssh_port": "2221",
"http_port": "3000",
"app_url": "http://localhost:3000/",
"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": "",
"admin_passwd": "",
"admin_confirm_passwd": "",
"admin_email": "",
}
requests.post(f"http://localhost:3000", data=INSTALL_PAYLOAD)
class ParseCSRFGiteaForm(HTMLParser): class ParseCSRFGiteaForm(HTMLParser):
token: str = None token: str = None
@ -141,7 +101,7 @@ def login(client: HTMLClient):
} }
resp = client.session.post(url, data=payload, allow_redirects=False) resp = client.session.post(url, data=payload, allow_redirects=False)
print(f"login {client.session.cookies}") print(f"login {client.session.cookies}")
if resp.status_code == 302: if resp.status_code == 303:
print("User logged in") print("User logged in")
return return
@ -196,8 +156,6 @@ if __name__ == "__main__":
REPOS.append(f"repository_{i}") REPOS.append(f"repository_{i}")
check_online() check_online()
print("Instance online") print("Instance online")
install()
print("Instance configured and installed")
client = HTMLClient() client = HTMLClient()
count = 0 count = 0
while True: while True: