mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
tweak(git): Move proxy url definition into config files
We'll likely want to host our own proxy. Self-hosters likewise may have their own, but it's convenient to use isomorphic-git's for development.
This commit is contained in:
parent
a68194090e
commit
c436460b8c
@ -18,4 +18,5 @@
|
||||
*/
|
||||
globalThis.__CONFIG__ = {
|
||||
sdk_url: 'http://puter.localhost:4100/sdk/puter.js',
|
||||
proxy_url: 'https://cors.isomorphic-git.org',
|
||||
};
|
||||
|
@ -18,4 +18,6 @@
|
||||
*/
|
||||
globalThis.__CONFIG__ = {
|
||||
sdk_url: 'https://puter.com/puter.js/v2',
|
||||
// TODO: Host a proxy ourselves, so we're not relying on (and maybe overloading) theirs.
|
||||
proxy_url: 'https://cors.isomorphic-git.org',
|
||||
};
|
||||
|
@ -18,8 +18,6 @@
|
||||
*/
|
||||
import path from 'path-browserify';
|
||||
|
||||
export const PROXY_URL = 'https://cors.isomorphic-git.org';
|
||||
|
||||
/**
|
||||
* Attempt to locate the git repository directory.
|
||||
* @throws Error If no git repository could be found, or another error occurred.
|
||||
|
@ -18,7 +18,6 @@
|
||||
*/
|
||||
import git from 'isomorphic-git';
|
||||
import http from 'isomorphic-git/http/web';
|
||||
import { PROXY_URL } from '../git-helpers.js';
|
||||
import { SHOW_USAGE } from '../help.js';
|
||||
import path from 'path-browserify';
|
||||
|
||||
@ -107,7 +106,7 @@ export default {
|
||||
await git.clone({
|
||||
fs,
|
||||
http,
|
||||
corsProxy: PROXY_URL,
|
||||
corsProxy: globalThis.__CONFIG__.proxy_url,
|
||||
dir: repo_path,
|
||||
url: repository,
|
||||
depth: options.depth,
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
import git from 'isomorphic-git';
|
||||
import http from 'isomorphic-git/http/web';
|
||||
import { determine_fetch_remote, find_repo_root, PROXY_URL } from '../git-helpers.js';
|
||||
import { determine_fetch_remote, find_repo_root } from '../git-helpers.js';
|
||||
import { SHOW_USAGE } from '../help.js';
|
||||
|
||||
export default {
|
||||
@ -61,7 +61,7 @@ export default {
|
||||
fs,
|
||||
http,
|
||||
cache,
|
||||
corsProxy: PROXY_URL,
|
||||
corsProxy: globalThis.__CONFIG__.proxy_url,
|
||||
dir,
|
||||
gitdir,
|
||||
remote,
|
||||
@ -78,7 +78,7 @@ export default {
|
||||
fs,
|
||||
http,
|
||||
cache,
|
||||
corsProxy: PROXY_URL,
|
||||
corsProxy: globalThis.__CONFIG__.proxy_url,
|
||||
dir,
|
||||
gitdir,
|
||||
...remote_data,
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
import git from 'isomorphic-git';
|
||||
import http from 'isomorphic-git/http/web';
|
||||
import { determine_fetch_remote, find_repo_root, PROXY_URL } from '../git-helpers.js';
|
||||
import { determine_fetch_remote, find_repo_root } from '../git-helpers.js';
|
||||
import { SHOW_USAGE } from '../help.js';
|
||||
|
||||
export default {
|
||||
@ -78,7 +78,7 @@ export default {
|
||||
await git.pull({
|
||||
fs,
|
||||
http,
|
||||
corsProxy: PROXY_URL,
|
||||
corsProxy: globalThis.__CONFIG__.proxy_url,
|
||||
dir,
|
||||
gitdir,
|
||||
cache,
|
||||
|
Loading…
Reference in New Issue
Block a user