Skip to content

Commit

Permalink
Update Bare server, Ultraviolet and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoryammilwalrus committed Feb 13, 2023
1 parent 5467ea2 commit e41cdef
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 83 deletions.
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:18-alpine

WORKDIR /app

COPY package*.json .

RUN npm install

COPY static static/
COPY src/index.js src/

EXPOSE 8080

CMD ["npm", "start"]
131 changes: 102 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,29 @@
"install-webretro-linux": "chmod u+x ./src/webretro.sh && ./src/webretro.sh",
"install-webretro-win": "echo \"Error: not finshed\" && exit 1"
},
"files": ["static", "src", "ssl", ".gitignore", "app.json"],
"files": [
"static",
"src",
"ssl",
".gitignore",
"app.json"
],
"repository": {
"type": "git",
"url": "git+https://github.com/amethystnetwork-dev/Incognito"
},
"keywords": ["unoffical", "ultraviolet", "unblock", "titaniumnetwork", "bypass-filter", "amethystnetwork-dev"],
"keywords": [
"unoffical",
"ultraviolet",
"unblock",
"titaniumnetwork",
"bypass-filter",
"amethystnetwork-dev"
],
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
"@tomphttp/bare-server-node": "^1.2.2",
"@tomphttp/bare-server-node": "^1.2.3",
"serve-static": "^1.15.0"
},
"engines": {
Expand Down
8 changes: 7 additions & 1 deletion static/gs.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
},
{
"img": "./img/gs/fnf.jpg",
"location": "./source/fnf/",
"location": "./source/fridaynightfunkin/",
"category": "web",
"title": "Friday Night Funkin"
},
Expand Down Expand Up @@ -229,6 +229,12 @@
"title": "Vex 5",
"category": "web"
},
{
"img": "./img/gs/vex6.jpg",
"location": "./source/vex6/",
"title": "Vex 6",
"category": "web"
},
{
"img": "./img/gs/warfare1917.png",
"location": "./source/swfs/#warfare1917",
Expand Down
6 changes: 3 additions & 3 deletions static/load.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@
let url = atob(decodeURIComponent(window.location.hash.slice(1)));
let search;
switch (localStorage.getItem('incog||search')) {
case 'google':
search = 'https://google.com/search?q='
break;
case 'ddg':
search = 'https://duckduckgo.com/?q='
break;
Expand All @@ -104,7 +101,10 @@
break;
default:
localStorage.setItem('incog||search', 'google')
// fall through to next option
case 'google':
search = 'https://google.com/search?q='
break;
};
if (url) {
if (!isUrl(url)) url = search + url;
Expand Down
19 changes: 4 additions & 15 deletions static/script/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,35 +79,24 @@ function access(app) {

clearTimeout(app.timeout);
app.timeout = setTimeout(async () => {
const { bare } = app;
var mode = localStorage.getItem('incog||suggestions') || 'ddg';
var path;
var host;
var prefix;
var array;
if(mode == 'none') {} else {
switch(mode) {
case 'ddg':
host = 'duckduckgo.com'
path = '/ac/?q='
host = 'https://duckduckgo.com/ac/?q='
prefix = 'phrase'
array = false
break;
case 'brave':
host = 'search.brave.com'
path = '/api/suggest?q='
host = 'https://search.brave.com/api/suggest?q='
array = true
break;
}
const res = await fetch(__uv$config.bare + 'v1/', {
headers: {
'x-bare-host': host,
'x-bare-protocol': 'https:',
'x-bare-path': path + encodeURIComponent(event.target.value),
'x-bare-port': '443',
'x-bare-headers': JSON.stringify({ Host: host }),
'x-bare-forward-headers': '[]'
}
})
const res = await bare.fetch(host + encodeURIComponent(event.target.value))
const json = await res.json();
var suggestions = [];

Expand Down
Loading

0 comments on commit e41cdef

Please sign in to comment.