Skip to content

Commit

Permalink
Merge pull request #384 from IncognitoTGT/main
Browse files Browse the repository at this point in the history
Better password protect + update UV
  • Loading branch information
xbubbo authored Jan 19, 2024
2 parents e6c0a2e + 54cfe31 commit d73516f
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 32 deletions.
7 changes: 5 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const config = {
passwordProtect: false,
password: 'password',
challenge: false,
users: {
// username: 'password', you can add multiple users.
interstellar: 'password',
}
}
export default config
13 changes: 4 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ const server = http.createServer()
const app = express(server)
const bareServer = createBareServer('/v/')
const PORT = 8080
if (config.passwordProtect) {
console.log("Password protection is enabled. Username is 'interstellar'.")
console.log('Password is: ' + config.password)
app.use(
basicAuth({
users: { interstellar: password },
challenge: true,
})
)
if (config.challenge) {
console.log("Password protection is enabled. Usernames are: " + Object.keys(config.users))
console.log("Passwords are: " + Object.values(config.users))
app.use(basicAuth(config))
}
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
Expand Down
39 changes: 26 additions & 13 deletions static/m/bundle.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/m/client.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/m/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ self.__uv$config = {
encodeUrl: Ultraviolet.codec.xor.encode,
decodeUrl: Ultraviolet.codec.xor.decode,
handler: '/m/handler.js',
client: '/m/client.js',
bundle: '/m/bundle.js',
config: '/m/config.js',
sw: '/m/sw.js',
Expand Down
3 changes: 2 additions & 1 deletion static/m/handler.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion static/m/sw.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions static/sw.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
importScripts('/m/bundle.js')
importScripts('/m/config.js')
importScripts('/m/sw.js')
/*global UVServiceWorker,__uv$config*/
importScripts('/m/bundle.js');
importScripts('/m/config.js');
importScripts(__uv$config.sw || '/m/sw.js');

const sw = new UVServiceWorker()
let userKey = new URL(location).searchParams.get('userkey')
const sw = new UVServiceWorker();

self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)))
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));

19 comments on commit d73516f

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
st3llar ❌ Failed View Logs 2024-01-19T23:39:34.820Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
instell ✅ Deployed View Logs 2024-01-19T23:39:35.726Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:39:52.118Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
we-love-art ✅ Deployed View Logs 2024-01-19T23:40:00.858Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:01.903Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:06.380Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:08.308Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
mountpath ✅ Deployed View Logs 2024-01-19T23:40:12.166Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:13.324Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
talonnexus ✅ Deployed View Logs 2024-01-19T23:40:16.379Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
st3lla ❌ Failed View Logs 2024-01-19T23:40:19.110Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:28.307Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:28.419Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
classes ✅ Deployed View Logs 2024-01-19T23:40:29.281Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
gokudoespartyparty ❌ Failed View Logs 2024-01-19T23:40:39.116Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:54.872Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:40:57.057Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
learnmath ✅ Deployed View Logs 2024-01-19T23:41:01.685Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on d73516f Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-19T23:41:33.728Z

Please sign in to comment.