- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.3k
install.sh: Add remote install support #1996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave this a few test runs and it's working great!
        
          
                install.sh
              
                Outdated
          
        
      | sh_c "curl -#fsSL https://aur.archlinux.org/cgit/aur.git/snapshot/code-server.tar.gz | tar -xzC $CACHE_DIR/code-server-aur --strip-components 1" | ||
| echo "+ cd $CACHE_DIR/code-server-aur" | ||
| if [ ! "${DRY_RUN-}" ]; then | ||
| if sh_f [ ! "${DRY_RUN-}" ]; then | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sh_f isn't needed here I think since DRY_RUN is a local flag.
        
          
                install.sh
              
                Outdated
          
        
      |  | ||
| sh_c="sh_c" | ||
| if [ ! -w "$STANDALONE_INSTALL_PREFIX" ]; then | ||
| if sh-f [ ! -w "$STANDALONE_INSTALL_PREFIX" ]; then | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if sh-f [ ! -w "$STANDALONE_INSTALL_PREFIX" ]; then | |
| if sh_f [ ! -w "$STANDALONE_INSTALL_PREFIX" ]; then | 
| *) | ||
| SSH_ARGS="$1" | ||
| ;; | ||
| -*) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think -* needs to come before * since * will match everything.
        
          
                install.sh
              
                Outdated
          
        
      |  | ||
| # Always runs. | ||
| sh_f() { | ||
| if [ "$SSH_ARGS" ]; then | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be unbound here.
        
          
                install.sh
              
                Outdated
          
        
      | # and all occurances of '"$RHOME' with the literal '"$RHOME'. | ||
| humanpath() { | ||
| sed "s# $HOME# ~#g; s#\"$HOME#\"\$HOME#g" | ||
| sed "s# $RHOME# ~#g; s#\"$RHOME#\"\$RHOME#g" | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use HOME (or ~) for the literal instead of RHOME? In the standalone case it'll output instructions that won't work as-is:
Please extend your path to use code-server:
  PATH="$RHOME/.local/bin:$PATH"
Then you can run:
  code-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~ is not supported in early init scripts before the shell started. $HOME is preferred.
| Yea I think I'ma update all the docs/messages when installing remotely and modify fetch to fetch locally and then copy over ssh so that it works in closed off environments. | 
7b3b988    to
    bcf032e      
    Compare
  
            
          
                install.sh
              
                Outdated
          
        
      | # Always runs. | ||
| sh_f() { | ||
| if [ "$SSH_ARGS" ]; then | ||
| mkdir -p ~/.ssh/sockets | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ~/.ssh directory requires to have 700 for openssh to accept it. It should probably be chmoded to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
bcf032e    to
    aeae326      
    Compare
  
    aeae326    to
    a5387a4      
    Compare
  
    | This got messy quickly, opening a follow up PR without  | 
Closes coder/sshcode#185, #1996, and pretty much archives that repository.
See also #1991