Update start_server.sh
Browse files- start_server.sh +118 -12
start_server.sh
CHANGED
|
@@ -2,13 +2,13 @@
|
|
| 2 |
|
| 3 |
NGX_NAME="${NGX_NAME:-admin}"
|
| 4 |
NGX_PASS="${NGX_PASS:-admin}"
|
| 5 |
-
CRYPTPASS=
|
| 6 |
PORT="${PORT:-8080}"
|
| 7 |
|
| 8 |
echo "USERNAME:" $NGX_NAME
|
| 9 |
echo "PASSWORD:" $NGX_PASS
|
| 10 |
|
| 11 |
-
echo "${NGX_NAME}:${CRYPTPASS}" >
|
| 12 |
|
| 13 |
COMMIT=$(cat /app/openvscode-server/product.json | awk '/commit/{print $4;exit}' FS='[""]')
|
| 14 |
sed -i "s/#COMMIT#/$COMMIT/" nginx.conf
|
|
@@ -17,16 +17,16 @@ nginx -c $PWD/nginx.conf
|
|
| 17 |
|
| 18 |
set +e
|
| 19 |
if [[ ! -z "$REPO" ]]; then
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
else
|
| 28 |
-
|
| 29 |
-
|
| 30 |
fi
|
| 31 |
|
| 32 |
git config --global http.postBuffer 524288000
|
|
@@ -49,9 +49,115 @@ $vscode --install-extension HuggingFace.huggingface-vscode
|
|
| 49 |
$vscode --install-extension naumovs.color-highlight
|
| 50 |
$vscode --install-extension Codeium.codeium
|
| 51 |
$vscode --install-extension antfu.browse-lite
|
|
|
|
| 52 |
# $vscode --install-extension BriteSnow.vscode-toggle-quotes
|
| 53 |
|
| 54 |
-
|
| 55 |
ln -s $vscode_cli $(dirname $vscode_cli)/code
|
| 56 |
set -e
|
| 57 |
exec $vscode --host 0.0.0.0 --port 5050 --without-connection-token \"${@}\" --
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
NGX_NAME="${NGX_NAME:-admin}"
|
| 4 |
NGX_PASS="${NGX_PASS:-admin}"
|
| 5 |
+
CRYPTPASS=$(openssl passwd -apr1 ${NGX_PASS})
|
| 6 |
PORT="${PORT:-8080}"
|
| 7 |
|
| 8 |
echo "USERNAME:" $NGX_NAME
|
| 9 |
echo "PASSWORD:" $NGX_PASS
|
| 10 |
|
| 11 |
+
echo "${NGX_NAME}:${CRYPTPASS}" >ngpasswd
|
| 12 |
|
| 13 |
COMMIT=$(cat /app/openvscode-server/product.json | awk '/commit/{print $4;exit}' FS='[""]')
|
| 14 |
sed -i "s/#COMMIT#/$COMMIT/" nginx.conf
|
|
|
|
| 17 |
|
| 18 |
set +e
|
| 19 |
if [[ ! -z "$REPO" ]]; then
|
| 20 |
+
dir=$(basename "$REPO" .git)
|
| 21 |
+
echo start to clone initial repo $REPO into $dir
|
| 22 |
+
git clone --progress $REPO $dir
|
| 23 |
+
cd $dir
|
| 24 |
+
git config --global user.name "$(git log -1 --pretty=format:'%an')"
|
| 25 |
+
git config --global user.email "$(git log -1 --pretty=format:'%ae')"
|
| 26 |
+
cd ..
|
| 27 |
else
|
| 28 |
+
git config --global user.name "$SPACE_AUTHOR_NAME"
|
| 29 |
+
git config --global user.email "$SPACE_AUTHOR_NAME@hf.co"
|
| 30 |
fi
|
| 31 |
|
| 32 |
git config --global http.postBuffer 524288000
|
|
|
|
| 49 |
$vscode --install-extension naumovs.color-highlight
|
| 50 |
$vscode --install-extension Codeium.codeium
|
| 51 |
$vscode --install-extension antfu.browse-lite
|
| 52 |
+
$vscode --install-extension foxundermoon.shell-format
|
| 53 |
# $vscode --install-extension BriteSnow.vscode-toggle-quotes
|
| 54 |
|
|
|
|
| 55 |
ln -s $vscode_cli $(dirname $vscode_cli)/code
|
| 56 |
set -e
|
| 57 |
exec $vscode --host 0.0.0.0 --port 5050 --without-connection-token \"${@}\" --
|
| 58 |
+
|
| 59 |
+
# settings.json
|
| 60 |
+
# {
|
| 61 |
+
# "workbench.colorTheme": "Rainbow Contrast (rainglow)",
|
| 62 |
+
# "workbench.iconTheme": "material-icon-theme",
|
| 63 |
+
# "workbench.productIconTheme": "material-product-icons",
|
| 64 |
+
# "workbench.startupEditor": "none",
|
| 65 |
+
# "terminal.integrated.defaultProfile.windows": "Command Prompt",
|
| 66 |
+
# "prettier.tabWidth": 4,
|
| 67 |
+
# "prettier.proseWrap": "never",
|
| 68 |
+
# "prettier.printWidth": 400,
|
| 69 |
+
# "editor.tabSize": 4,
|
| 70 |
+
# "editor.indentSize": 4,
|
| 71 |
+
# "editor.fontFamily": "'Fira Code Light'",
|
| 72 |
+
# "terminal.integrated.fontFamily": "monospace",
|
| 73 |
+
# "editor.fontSize": 17,
|
| 74 |
+
# "editor.lineHeight": 1.5,
|
| 75 |
+
# "editor.defaultFormatter": "esbenp.prettier-vscode",
|
| 76 |
+
# "editor.formatOnSave": true,
|
| 77 |
+
# "editor.wordWrap": "on",
|
| 78 |
+
# "black-formatter.args": ["--line-length", "490"],
|
| 79 |
+
# "[shellscript]": {
|
| 80 |
+
# "editor.defaultFormatter": "foxundermoon.shell-format",
|
| 81 |
+
# "editor.formatOnSave": true
|
| 82 |
+
# },
|
| 83 |
+
# "[css]": {
|
| 84 |
+
# "editor.defaultFormatter": "vscode.css-language-features",
|
| 85 |
+
# "editor.formatOnSave": true
|
| 86 |
+
# },
|
| 87 |
+
# "[scss]": {
|
| 88 |
+
# "editor.defaultFormatter": "vscode.css-language-features",
|
| 89 |
+
# "editor.formatOnSave": true
|
| 90 |
+
# },
|
| 91 |
+
# "[python]": {
|
| 92 |
+
# "editor.defaultFormatter": "ms-python.black-formatter",
|
| 93 |
+
# "editor.formatOnSave": true
|
| 94 |
+
# },
|
| 95 |
+
# "editor.detectIndentation": false,
|
| 96 |
+
# "editor.wordWrapColumn": 300,
|
| 97 |
+
# "html.format.wrapLineLength": 0,
|
| 98 |
+
# "indentRainbow.indicatorStyle": "light",
|
| 99 |
+
# "indentRainbow.lightIndicatorStyleLineWidth": 1,
|
| 100 |
+
# "indentRainbow.colors": ["rgba(255,255,64,0.3)", "rgba(127,255,127,0.3)", "rgba(255,127,255,0.3)", "rgba(79,236,236,0.3)"],
|
| 101 |
+
# "codeium.enableCodeLens": false,
|
| 102 |
+
# "explorer.confirmDragAndDrop": false,
|
| 103 |
+
# "explorer.confirmDelete": false,
|
| 104 |
+
# "editor.fontWeight": "normal",
|
| 105 |
+
# "editor.fontLigatures": true,
|
| 106 |
+
# "editor.fontVariations": true,
|
| 107 |
+
# "codeium.enableConfig": {
|
| 108 |
+
# "*": true,
|
| 109 |
+
# "jinja-js": true
|
| 110 |
+
# },
|
| 111 |
+
# "prettier.useTabs": true,
|
| 112 |
+
# "editor.autoIndent": "advanced",
|
| 113 |
+
# "notebook.formatOnSave.enabled": true,
|
| 114 |
+
# "notebook.formatOnCellExecution": true,
|
| 115 |
+
# "workbench.editor.enablePreview": false,
|
| 116 |
+
# "jupyter.askForKernelRestart": false,
|
| 117 |
+
# "editor.minimap.renderCharacters": false
|
| 118 |
+
# }
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
# keybindings.json
|
| 122 |
+
# // Geben Sie Ihre Tastenzuordnungen in dieser Datei ein, um die Standardwerte außer Kraft zu setzen.auto[]
|
| 123 |
+
# [
|
| 124 |
+
# {
|
| 125 |
+
# "key": "ctrl+d",
|
| 126 |
+
# "command": "editor.action.duplicateSelection"
|
| 127 |
+
# },
|
| 128 |
+
# {
|
| 129 |
+
# "key": "alt+c alt+a",
|
| 130 |
+
# "command": "editor.action.addCommentLine",
|
| 131 |
+
# "when": "editorTextFocus && !editorReadonly"
|
| 132 |
+
# },
|
| 133 |
+
# {
|
| 134 |
+
# "key": "ctrl+k ctrl+c",
|
| 135 |
+
# "command": "-editor.action.addCommentLine",
|
| 136 |
+
# "when": "editorTextFocus && !editorReadonly"
|
| 137 |
+
# },
|
| 138 |
+
# {
|
| 139 |
+
# "key": "alt+c alt+x",
|
| 140 |
+
# "command": "editor.action.removeCommentLine",
|
| 141 |
+
# "when": "editorTextFocus && !editorReadonly"
|
| 142 |
+
# },
|
| 143 |
+
# {
|
| 144 |
+
# "key": "ctrl+k ctrl+u",
|
| 145 |
+
# "command": "-editor.action.removeCommentLine",
|
| 146 |
+
# "when": "editorTextFocus && !editorReadonly"
|
| 147 |
+
# },
|
| 148 |
+
# {
|
| 149 |
+
# "key": "f2",
|
| 150 |
+
# "command": "document.open",
|
| 151 |
+
# "when": "editorLangId == 'ahk'"
|
| 152 |
+
# },
|
| 153 |
+
# {
|
| 154 |
+
# "key": "f1",
|
| 155 |
+
# "command": "-document.open",
|
| 156 |
+
# "when": "editorLangId == 'ahk'"
|
| 157 |
+
# },
|
| 158 |
+
# {
|
| 159 |
+
# "key": "ctrl+oem_2",
|
| 160 |
+
# "command": "editor.action.commentLine",
|
| 161 |
+
# "when": "editorTextFocus && !editorReadonly"
|
| 162 |
+
# }
|
| 163 |
+
# ]
|