Skip to content
Snippets Groups Projects
Commit 152cb0fb authored by tuhe's avatar tuhe
Browse files

CICD

parent 6ebeebc4
Branches
No related tags found
No related merge requests found
Pipeline #8672 failed
image: python:3.9-buster image: python:3.9-buster
before_script: before_script:
- apt install -y xvfb libssl-dev firefox-dev firefox-geckodriver openssl
- openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
- pip install -r requirements.txt - pip install -r requirements.txt
# - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )' # - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
## ##
## Run ssh-agent (inside the build environment) ## Run ssh-agent (inside the build environment)
...@@ -34,7 +37,8 @@ pages: ...@@ -34,7 +37,8 @@ pages:
script: script:
- pwd - pwd
- cd src - cd src
- python -m unlearn.tokenpage - xvfb-run -s "-screen 0 1400x900x24" python -m unlearn.tokenpage
# - python -m unlearn.tokenpage
- cd .. - cd ..
- ls - ls
- pwd - pwd
......
import uvicorn
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
File deleted
1665440787180 geckodriver INFO Listening on 127.0.0.1:60967
1665440787706 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "--remote-debugging-port" "39301" "--remote-allow-hosts" "localhost" "-no-remote" "-profile" "/tmp/rust_mozprofilek9MuTe"
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
1665440789077 Marionette INFO Marionette enabled
1665440789084 Marionette INFO Listening on port 43913
Read port: 43913
WebDriver BiDi listening on ws://127.0.0.1:39301
1665440789252 RemoteAgent WARN TLS certificate errors will be ignored for this session
console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofilek9MuTe/search.json.mozlz4", (void 0)))
Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
DevTools listening on ws://127.0.0.1:39301/devtools/browser/16d42f47-0161-4667-b0c7-f9b7f7ee9a13
Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\" nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\" location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2009\" data: no]"
1665441520882 Marionette INFO Stopped listening on port 43913
console.warn: TopSitesFeed: Failed to fetch data from Contile server: NetworkError when attempting to fetch resource.
import requests
from urllib.parse import urlparse from urllib.parse import urlparse
import json import json
import os import os
...@@ -7,6 +8,10 @@ from auth_code_flow import FlowManager ...@@ -7,6 +8,10 @@ from auth_code_flow import FlowManager
from diskcache import Cache from diskcache import Cache
from selenium import webdriver from selenium import webdriver
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
import socketserver
import ssl
import requests
from bs4 import BeautifulSoup
def whoami(lc): def whoami(lc):
...@@ -125,7 +130,7 @@ class LearnConfig: ...@@ -125,7 +130,7 @@ class LearnConfig:
print("All done!") print("All done!")
def __init__(self, refresh_token=None): def __init__(self, refresh_token=None, password=None):
cc = Cache(directory= os.path.join( os.path.dirname(__file__), "cache") ) cc = Cache(directory= os.path.join( os.path.dirname(__file__), "cache") )
# if "refresh_token" in cc: # if "refresh_token" in cc:
# del cc['refresh_token'] # del cc['refresh_token']
...@@ -152,7 +157,7 @@ class LearnConfig: ...@@ -152,7 +157,7 @@ class LearnConfig:
else: else:
if "refresh_token" in cc: if "refresh_token" in cc:
import requests
url = "https://auth.brightspace.com/core/connect/token" url = "https://auth.brightspace.com/core/connect/token"
print("Getting refresh token using", refresh_token) print("Getting refresh token using", refresh_token)
refresh_token = cc['refresh_token'] refresh_token = cc['refresh_token']
...@@ -171,7 +176,7 @@ class LearnConfig: ...@@ -171,7 +176,7 @@ class LearnConfig:
break break
else: else:
# Do oauth2 refreshing... # Do oauth2 refreshing...
self._oauth2_refresh() self._oauth2_refresh(password=password)
# s = input("Please give me a refresh token") # s = input("Please give me a refresh token")
# cc['refresh_token'] = s # cc['refresh_token'] = s
# print("Saved refresh token", s) # print("Saved refresh token", s)
...@@ -222,10 +227,7 @@ class LocalListen(Thread): ...@@ -222,10 +227,7 @@ class LocalListen(Thread):
def run(self): def run(self):
# while True: # while True:
print("hello world") print("hello world")
import http.server
# import ht
import socketserver
import ssl
PORT = 3434 PORT = 3434
# Handler = http.server.SimpleHTTPRequestHandler # Handler = http.server.SimpleHTTPRequestHandler
with socketserver.TCPServer(("localhost", PORT), S) as httpd: with socketserver.TCPServer(("localhost", PORT), S) as httpd:
...@@ -302,9 +304,7 @@ if __name__ == '__main__': ...@@ -302,9 +304,7 @@ if __name__ == '__main__':
# authorization_path="/oauth", # authorization_path="/oauth",
# ) # )
import requests
import urllib.parse
from bs4 import BeautifulSoup
user = 'tuhe' user = 'tuhe'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment