chore: add back BrowserOp, make changes to CI env (#1088)

* chore: add back BrowserOp

* chore: make CI env and not DEV env generate refresh tokens every time

* chore: make 'CI' env var captilization uniform across the app

* chore: change NODE_ENV for playwright to
This commit is contained in:
Danny Avila 2023-10-22 13:50:25 -04:00 committed by GitHub
parent 4073b7d05d
commit 70590251d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 26 additions and 8 deletions

View file

@ -21,7 +21,7 @@ jobs:
BAN_VIOLATIONS: ${{ secrets.BAN_VIOLATIONS }}
BAN_DURATION: ${{ secrets.BAN_DURATION }}
BAN_INTERVAL: ${{ secrets.BAN_INTERVAL }}
NODE_ENV: ci
NODE_ENV: CI
steps:
- uses: actions/checkout@v2
- name: Use Node.js 20.x

View file

@ -17,7 +17,7 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
NODE_ENV: ci
NODE_ENV: CI
CI: true
SEARCH: false
BINGAI_TOKEN: user_provided

View file

@ -0,0 +1,17 @@
{
"schema_version": "v1",
"name_for_human": "BrowserOp",
"name_for_model": "BrowserOp",
"description_for_human": "Browse dozens of webpages in one query. Fetch information more efficiently.",
"description_for_model": "This tool offers the feature for users to input a URL or multiple URLs and interact with them as needed. It's designed to comprehend the user's intent and proffer tailored suggestions in line with the content and functionality of the webpage at hand. Services like text rewrites, translations and more can be requested. When users need specific information to finish a task or if they intend to perform a search, this tool becomes a bridge to the search engine and generates responses based on the results. Whether the user is seeking information about restaurants, rentals, weather, or shopping, this tool connects to the internet and delivers the most recent results.",
"auth": {
"type": "none"
},
"api": {
"type": "openapi",
"url": "https://testplugin.feednews.com/.well-known/openapi.yaml"
},
"logo_url": "https://openapi-af.op-mobile.opera.com/openapi/testplugin/.well-known/logo.png",
"contact_email": "aiplugins-contact-list@opera.com",
"legal_info_url": "https://legal.apexnews.com/terms/"
}

View file

@ -90,7 +90,7 @@ const refreshController = async (req, res) => {
return res.status(401).redirect('/login');
}
if (process.env.NODE_ENV === 'development') {
if (process.env.NODE_ENV === 'CI') {
const token = await setAuthTokens(userId, res);
const userObj = user.toJSON();
return res.status(200).send({ token, user: userObj });

View file

@ -12,7 +12,7 @@ if (!process.stdin.isTTY) {
}
// If we are in CI env, lets exit
if (process.env.NODE_ENV === 'ci') {
if (process.env.NODE_ENV === 'CI') {
console.log('Note: we are in a CI environment, skipping install script.');
exit(0);
}

View file

@ -241,7 +241,7 @@ class Env {
* @returns {Boolean}
*/
isCI() {
return this.currentEnvironment() === 'ci';
return this.currentEnvironment() === 'CI';
}
}

View file

@ -16,7 +16,8 @@ const config: PlaywrightTestConfig = {
env: {
...process.env,
SEARCH: 'false',
NODE_ENV: 'development',
NODE_ENV: 'CI',
TITLE_CONVO: 'false',
SESSION_EXPIRY: '60000',
REFRESH_TOKEN_EXPIRY: '300000',
},

View file

@ -62,8 +62,8 @@ export default defineConfig({
reuseExistingServer: true,
env: {
...process.env,
NODE_ENV: 'CI',
SEARCH: 'false',
NODE_ENV: 'development',
SESSION_EXPIRY: '60000',
ALLOW_REGISTRATION: 'true',
REFRESH_TOKEN_EXPIRY: '300000',

View file

@ -26,7 +26,7 @@
"upgrade": "node config/upgrade.js",
"create-user": "node config/create-user.js",
"backend": "cross-env NODE_ENV=production node api/server/index.js",
"backend:dev": "cross-env NODE_ENV=production npx nodemon api/server/index.js",
"backend:dev": "cross-env NODE_ENV=development npx nodemon api/server/index.js",
"backend:stop": "node config/stop-backend.js",
"build:data-provider": "cd packages/data-provider && npm run build",
"frontend": "npm run build:data-provider && cd client && npm run build",