DEV Community

Discussion on: Getting node.js and Express up and running on my... phone?

Collapse
 
joelnet profile image
JavaScript Joel

That's Awesome!!!

I definitely have just started to play with this but see so many possibilities.

I'm curious about your gitea + ssh to push files. I have another project where I need to sync files with a remote machine s and I have been looking into different tools to do this.

Could you describe your setup and how it works?

Cheers!

Collapse
 
sangowen profile image
sangowen • Edited

This is the record I left in my wiki a few months ago. A small part of the instruction (mostly step 5 ~ 6) are SQL commands or instead only descriptive.

Setup:

  1. install termux, sshd, go, make

    • pkg install sshd golang-1.10 make
  2. put public key into .ssh/authorized_keys

    • cat ~/.ssh/ssh_host_rsa_key.pub >> ~/.ssh/authorized_keys
  3. set GOPATH & put lib & GOPATH/bin into PATH

    • export GOPATH="/data/data/com.termux/files/home/go/"
    • export PATH="$PATH:/data/data/com.termux/files/home/go/src/github.com/jteeuwen/go-bindata/"
    • export PATH="$PATH:/data/data/com.termux/files/usr/lib/go"
    • export PATH=$PATH:$(go env GOPATH)/bin
  4. install mariadb

    • pkg install mariadb
    • mysql_install_db
  5. maybe change root password for mariadb

    • stop mysqld
    • mysqld_safe --skip-grant-tables --skip-networking &
    • mysql -u root
    • FLUSH PRIVILEGES;
    • ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
    • stop mysqld again
    • restart
  6. create gitea database

    • CREATE DATABASE gitea DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
  7. download & build gitea go package

    • go get -d -u code.gitea.io/gitea
    • cd $GOPATH/src/code.gitea.io/gitea
    • make generate all
  8. ssh into itself to get a valid username for gitea installation

    • ssh 192.168.43.1 -p 8022
  9. start gitea

    • cd $GOPATH/src/code.gitea.io/gitea
    • ./gitea web
  10. open localhost:3000 with browser and install with mysqldb

  11. create user, repo

  12. currently I haven't fix git ssh path shown in UI, ssh can only access by:

    • git remote add phone ssh://u0_a238@192.168.43.1:8022/data/data/com.termux/files/home/gitea-repositories/[gitea_username]/[reop_name].git
    • git push -u phone master