Skip to content

Commit 8ca6b5c

Browse files
committed
Added more config options, Formatted with Prettier, Added Gemini
1 parent a80b84f commit 8ca6b5c

File tree

11 files changed

+66
-52
lines changed

11 files changed

+66
-52
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ One of the most popular web proxies, used by over 5.7 million people in 2023.
66
### Consider joining our[ Discord Community](https://discord.gg/interstellar)
77

88
**If you find this project useful, consider giving it a star in the original repository.**
9+
910
<h2 align="center">Features</h2>
1011
<ul>
1112
<li>About:Blank Cloaking</li>

SECURITY.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
## Supported Versions
44

5-
Only current versions of the site are being updated, if you are using an older version of the site, consider upgrading to the latest version.
5+
Only current versions of the site are being updated, if you are using an older version of the site, consider upgrading to the latest version.
66

77
| Version | Supported |
88
| ------- | ------------------ |
99
| 5.1.x | :white_check_mark: |
1010
| 5.0.x | :x: |
11-
| 4.0.x | :x: |
11+
| 4.0.x | :x: |
1212
| < 4.0 | :x: |
1313

1414
## Reporting a Vulnerability
@@ -23,16 +23,14 @@ If you are using an older version of the site, we strongly recommend upgrading t
2323

2424
### How to Update
2525

26-
If you have a fork of the repository:
26+
If you have a fork of the repository:
2727
Then [sync your fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork).
2828

29-
If you have interstellar installed locally:
30-
Run ``git pull``, and ``npm i``.
31-
29+
If you have interstellar installed locally:
30+
Run `git pull`, and `npm i`.
3231

3332
By keeping your site up to date, you not only enjoy the latest features but also enhance the security of your experience.
3433

3534
If you encounter any challenges while updating, feel free to reach out to our [support team](https://discord.gg/interstellar) for assistance.
3635

3736
Thank you for prioritizing the security and performance of your experience with our site.
38-

config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const config = {
2+
routes: true, // Change this to false if you just want to host a bare server.
3+
local: true, // Change this to false to disable local assets.
24
challenge: false,
35
users: {
46
// username: 'password', you can add multiple users.

index.js

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,52 @@ import { createBareServer } from '@tomphttp/bare-server-node'
55
import path from 'node:path'
66
import cors from 'cors'
77
import config from './config.js'
8+
89
const __dirname = process.cwd()
910
const server = http.createServer()
1011
const app = express(server)
1112
const bareServer = createBareServer('/v/')
1213
const PORT = process.env.PORT || 8080
14+
15+
app.use(cors())
16+
app.use(express.json())
17+
app.use(express.urlencoded({ extended: true }))
18+
app.use(express.static(path.join(__dirname, 'static')))
19+
1320
if (config.challenge) {
1421
console.log('Password protection is enabled. Usernames are: ' + Object.keys(config.users))
1522
console.log('Passwords are: ' + Object.values(config.users))
16-
app.use(basicAuth(config))
23+
app.use(basicAuth(config.users))
24+
}
25+
26+
if (config.routes !== false) {
27+
const routes = [
28+
{ path: '/~', file: 'apps.html' },
29+
{ path: '/-', file: 'games.html' },
30+
{ path: '/!', file: 'settings.html' },
31+
{ path: '/0', file: 'tabs.html' },
32+
{ path: '/1', file: 'go.html' },
33+
{ path: '/', file: 'index.html' },
34+
]
35+
36+
routes.forEach((route) => {
37+
app.get(route.path, (req, res) => {
38+
res.sendFile(path.join(__dirname, 'static', route.file))
39+
})
40+
})
1741
}
18-
app.use(express.json())
19-
app.use(express.urlencoded({ extended: true }))
20-
app.use(cors())
21-
app.use(express.static(path.join(__dirname, 'static')))
2242

23-
const routes = [
24-
{ path: '/', file: 'index.html' },
25-
{ path: '/~', file: 'apps.html' },
26-
{ path: '/-', file: 'games.html' },
27-
{ path: '/!', file: 'settings.html' },
28-
{ path: '/0', file: 'tabs.html' },
29-
{ path: '/1', file: 'go.html' },
30-
]
43+
if (config.local !== false) {
44+
app.get('/y/*', cors({ origin: false }), (req, res, next) => {
45+
const baseUrl = 'https://raw.githubusercontent.com/ypxa/y/main'
46+
fetchData(req, res, next, baseUrl)
47+
})
48+
49+
app.get('/f/*', cors({ origin: false }), (req, res, next) => {
50+
const baseUrl = 'https://raw.githubusercontent.com/4x-a/x/fixy'
51+
fetchData(req, res, next, baseUrl)
52+
})
53+
}
3154

3255
const fetchData = async (req, res, next, baseUrl) => {
3356
try {
@@ -46,22 +69,6 @@ const fetchData = async (req, res, next, baseUrl) => {
4669
}
4770
}
4871

49-
app.get('/y/*', cors({ origin: false }), (req, res, next) => {
50-
const baseUrl = 'https://raw.githubusercontent.com/ypxa/y/main'
51-
fetchData(req, res, next, baseUrl)
52-
})
53-
54-
app.get('/f/*', cors({ origin: false }), (req, res, next) => {
55-
const baseUrl = 'https://raw.githubusercontent.com/4x-a/x/fixy'
56-
fetchData(req, res, next, baseUrl)
57-
})
58-
59-
routes.forEach((route) => {
60-
app.get(route.path, (req, res) => {
61-
res.sendFile(path.join(__dirname, 'static', route.file))
62-
})
63-
})
64-
6572
server.on('request', (req, res) => {
6673
if (bareServer.shouldRoute(req)) {
6774
bareServer.routeRequest(req, res)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "in",
3-
"version": "5.1.2",
3+
"version": "5.1.3",
44
"type": "module",
55
"engines": {
66
"npm": ">=7.0.0",

static/apps.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<link rel="stylesheet" href="/assets/styles/themes/default.css?v=2" />
1515
<script src="/assets/scripts/index.js?v=5"></script>
1616
<script src="https://kit.fontawesome.com/1237c86ba0.js" crossorigin="anonymous"></script>
17-
<script src="assets/scripts/apps.js?v=11"></script>
17+
<script src="assets/scripts/apps.js?v=12"></script>
1818
</head>
1919
<body>
2020
<div class="fixed-nav-bar">

static/assets/media/icons/gemini.png

6.93 KB
Loading

static/assets/scripts/apps.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ document.addEventListener('DOMContentLoaded', () => {
268268
categories: ['all', 'game', 'cloud'],
269269
blank: 'true',
270270
},
271+
{
272+
name: 'Google Gemini ',
273+
link: 'https://gemini.google.com',
274+
image: '/assets/media/icons/gemini.png',
275+
categories: ['all', 'ai'],
276+
},
271277
]
272278

273279
appsList.sort((a, b) => a.name.localeCompare(b.name))

static/assets/scripts/g.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,24 +1627,24 @@ document.addEventListener('DOMContentLoaded', () => {
16271627

16281628
function handleClick(app) {
16291629
if (typeof app.say !== 'undefined') {
1630-
alert(app.say);
1630+
alert(app.say)
16311631
}
1632-
1632+
16331633
if (app.local) {
1634-
saveToLocal(app.link);
1635-
window.location.href = '1';
1634+
saveToLocal(app.link)
1635+
window.location.href = '1'
16361636
} else if (app.local2) {
1637-
saveToLocal(app.link);
1638-
window.location.href = app.link;
1637+
saveToLocal(app.link)
1638+
window.location.href = app.link
16391639
} else if (app.blank) {
1640-
blank(app.link);
1640+
blank(app.link)
16411641
} else {
16421642
if (!app.local) {
1643-
go(app.link);
1643+
go(app.link)
16441644
}
16451645
}
1646-
1647-
return false;
1646+
1647+
return false
16481648
}
16491649

16501650
link.onclick = function () {

static/assets/styles/frame.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ iframe {
126126
box-shadow: none;
127127
border: none;
128128
outline: none;
129-
color: #fff
129+
color: #fff;
130130
}
131131

132132
.navpost {

0 commit comments

Comments
 (0)