├── .gitignore ├── scripts ├── down.sh ├── startup.sh └── up.sh ├── frontend ├── public │ ├── robots.txt │ ├── favicon.png │ ├── apple-icon.png │ ├── screenshot.png │ ├── index.html │ └── manifest.json ├── Dockerfile ├── src │ ├── setupTests.js │ ├── reportWebVitals.js │ ├── index.js │ ├── App.js │ ├── gluestack-ui.config.js │ ├── API.js │ ├── components │ │ ├── StatusInfo.js │ │ └── PeerInfo.js │ └── Plugin.js ├── .gitignore ├── bundle.sh ├── craco.config.js └── package.json ├── code ├── run.sh ├── validators.go ├── go.mod ├── go.sum ├── tailscale_plugin.go └── spr.go ├── plugin.json ├── .github └── workflows │ ├── bump-version.yml │ └── docker-image.yml ├── docker-compose.yml ├── install.sh ├── Dockerfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | configs/ 2 | state/ 3 | .github_creds 4 | .spr-setup-done 5 | node_modules 6 | -------------------------------------------------------------------------------- /scripts/down.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . /configs/spr-tailscale/config.sh 3 | 4 | tailscale down 5 | -------------------------------------------------------------------------------- /frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /frontend/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-networks/spr-tailscale/HEAD/frontend/public/favicon.png -------------------------------------------------------------------------------- /frontend/public/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-networks/spr-tailscale/HEAD/frontend/public/apple-icon.png -------------------------------------------------------------------------------- /frontend/public/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spr-networks/spr-tailscale/HEAD/frontend/public/screenshot.png -------------------------------------------------------------------------------- /code/run.sh: -------------------------------------------------------------------------------- 1 | go build -ldflags "-s -w" -o tailscale_plugin ./tailscale_plugin.go 2 | export LANIP=192.168.2.1 3 | sudo -E ./tailscale_plugin 4 | -------------------------------------------------------------------------------- /frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /frontend/Dockerfile: -------------------------------------------------------------------------------- 1 | # NOTE for frontend stuff 2 | FROM node:alpine 3 | 4 | COPY . /app 5 | WORKDIR /app 6 | RUN yarn install 7 | 8 | USER 1000:1000 9 | EXPOSE 3000 10 | ENTRYPOINT yarn run start 11 | 12 | ## TODO build 13 | -------------------------------------------------------------------------------- /frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /scripts/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -a 3 | . /configs/base/config.sh 4 | . /configs/spr-tailscale/config.sh 5 | 6 | # TS_STATE_DIR is set in docker-compose.yml 7 | tailscaled & >$TAILSCALE_STATE_DIR/stdout.log 2>$TAILSCALE_STATE_DIR/stderr.log 8 | 9 | /tailscale_plugin 10 | -------------------------------------------------------------------------------- /plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "spr-tailscale", 3 | "ComposeFilePath": "plugins/user/spr-tailscale/docker-compose.yml", 4 | "UnixPath": "/state/plugins/spr-tailscale/socket", 5 | "URI": "spr-tailscale", 6 | "HasUI": true, 7 | "SandboxedUI": false, 8 | "InstallTokenPath": "/configs/plugins/spr-tailscale/api-token", 9 | "ScopedPaths": ["/firewall/config:r", "/firewall/custom_interface"], 10 | "Enabled": true 11 | } 12 | -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /frontend/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = onPerfEntry => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /.github/workflows/bump-version.yml: -------------------------------------------------------------------------------- 1 | name: Bump version 2 | 3 | on: 4 | push: 5 | branches: [ main, dev ] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | with: 13 | fetch-depth: '0' 14 | - name: Bump version and push tag 15 | uses: anothrNick/github-tag-action@v1 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | WITH_V: true 19 | INITIAL_VERSION: 0.1.0 20 | DEFAULT_BUMP: none 21 | -------------------------------------------------------------------------------- /frontend/bundle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "+ running custom bundler... neep webpack therapy" 4 | 5 | npx craco build 6 | 7 | OUTFILE=build/index.html 8 | 9 | #FUCKWEBPACK2.3 10 | cat build/index.html | sed 's/<\/head>.*//g'|sed 's/.*