Skip to content

Commit

Permalink
Merge pull request #5 from SaahilNotSahil/v0.1.2
Browse files Browse the repository at this point in the history
V0.1.2
  • Loading branch information
SaahilNotSahil authored Jun 7, 2024
2 parents 7ed33d8 + 379b835 commit 6d59de8
Show file tree
Hide file tree
Showing 488 changed files with 3,486 additions and 17,987 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/packagecloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: packagecloud

on:
workflow_run:
workflows: ["goreleaser"]
types:
- completed

jobs:
packagecloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- run: cat VERSION
- run: echo "TAG=$(cat VERSION)" >> $GITHUB_ENV
- run: wget https://github.com/SaahilNotSahil/iitj-autoproxy/releases/download/${{ env.TAG }}/iitj-autoproxy_${{ env.TAG }}_linux_amd64.deb
- name: Upload package PackageCloud.io
uses: danielmundi/upload-packagecloud@v1
with:
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}
packagecloud-username: "SaahilNotSahil"
packagecloud-repo: "iitj-autoproxy"
package-name: iitj-autoproxy_${{ env.TAG }}_linux_amd64.deb
packagecloud-distrib: any/any

- run: wget https://github.com/SaahilNotSahil/iitj-autoproxy/releases/download/${{ env.TAG }}/iitj-autoproxy_${{ env.TAG }}_linux_arm64.deb
- name: Upload package PackageCloud.io
uses: danielmundi/upload-packagecloud@v1
with:
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}
packagecloud-username: "SaahilNotSahil"
packagecloud-repo: "iitj-autoproxy"
package-name: iitj-autoproxy_${{ env.TAG }}_linux_arm64.deb
packagecloud-distrib: any/any

- run: wget https://github.com/SaahilNotSahil/iitj-autoproxy/releases/download/${{ env.TAG }}/iitj-autoproxy_${{ env.TAG }}_linux_amd64.rpm
- name: Upload package PackageCloud.io
uses: danielmundi/upload-packagecloud@v1
with:
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}
packagecloud-username: "SaahilNotSahil"
packagecloud-repo: "iitj-autoproxy"
package-name: iitj-autoproxy_${{ env.TAG }}_linux_amd64.rpm
packagecloud-distrib: rpm_any/rpm_any

- run: wget https://github.com/SaahilNotSahil/iitj-autoproxy/releases/download/${{ env.TAG }}/iitj-autoproxy_${{ env.TAG }}_linux_arm64.rpm
- name: Upload package PackageCloud.io
uses: danielmundi/upload-packagecloud@v1
with:
packagecloud-token: ${{ secrets.PACKAGECLOUD_TOKEN }}
packagecloud-username: "SaahilNotSahil"
packagecloud-repo: "iitj-autoproxy"
package-name: iitj-autoproxy_${{ env.TAG }}_linux_arm64.rpm
packagecloud-distrib: rpm_any/rpm_any
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
args: release --clean --config=.goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
94 changes: 63 additions & 31 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ builds:
{{- end }}
flags:
- -mod=vendor
ldflags:
- -X github.com/SaahilNotSahil/iitj-autoproxy/pkg.Version={{ .Version }}
ignore:
- goos: windows
goarch: arm64
Expand All @@ -47,6 +49,8 @@ builds:
{{- end }}
flags:
- -mod=vendor
ldflags:
- -X github.com/SaahilNotSahil/iitj-autoproxy/pkg.Version={{ .Version }}
ignore:
- goos: windows
goarch: arm64
Expand All @@ -56,13 +60,14 @@ checksum:

nfpms:
- package_name: iitj-autoproxy
vendor: XanderWatson
homepage: https://github.com/XanderWatson/iitj-autoproxy
vendor: SaahilNotSahil
homepage: https://github.com/SaahilNotSahil/iitj-autoproxy
maintainer: Saahil Bhavsar <[email protected]>
license: MIT
formats:
- deb
- archlinux
- rpm
release: "1"
bindir: /usr
contents:
Expand All @@ -78,28 +83,26 @@ nfpms:
dst: /usr/bin/autoproxyd-start
- src: ./scripts/linux/daemon-stop.sh
dst: /usr/bin/autoproxyd-stop
scripts:
postinstall: ./scripts/linux/daemon-start.sh
- src: ./service_files/linux/[email protected]
dst: /etc/systemd/system/[email protected]

release:
prerelease: auto
github:
owner: XanderWatson
owner: SaahilNotSahil
name: iitj-autoproxy
name_template: "{{.ProjectName}}-v{{.Version}}"
extra_files:
- glob: autoproxy.config

aurs:
- name: iitj-autoproxy-bin
homepage: https://github.com/XanderWatson/iitj-autoproxy
homepage: https://github.com/SaahilNotSahil/iitj-autoproxy
license: MIT
maintainers:
- "Saahil Bhavsar <[email protected]>"
contributors:
- "Saahil Bhavsar <[email protected]>"
commit_author:
name: XanderWatson
name: SaahilNotSahil
email: [email protected]
private_key: "{{ .Env.AUR_KEY }}"
git_url: "ssh://[email protected]/iitj-autoproxy-bin.git"
Expand All @@ -109,32 +112,11 @@ aurs:
install -Dm755 "./scripts/linux/login.sh" "${pkgdir}/usr/bin/autoproxylogin"
install -Dm755 "./scripts/linux/daemon-start.sh" "${pkgdir}/usr/bin/autoproxyd-start"
install -Dm755 "./scripts/linux/daemon-stop.sh" "${pkgdir}/usr/bin/autoproxyd-stop"
install -Dm644 "./service_files/linux/[email protected]" "${pkgdir}/etc/systemd/system/[email protected]"
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/iitj-autoproxy/LICENSE"
install -Dm644 "./autoproxy.config" "${pkgdir}/etc/iitj-autoproxy/autoproxy.config"
install -Dm644 "./README.md" "${pkgdir}/usr/share/doc/iitj-autoproxy/README.md"
# chocolateys:
# - name: iitj-autoproxy
# owners: Saahil Bhavsar
# title: IITJ Autoproxy
# authors: Saahil Bhavsar
# project_url: https://github.com/XanderWatson/iitj-autoproxy
# url_template: "https://github.com/XanderWatson/iitj-autoproxy/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# copyright: 2023 Saahil Bhavsar
# license_url: https://github.com/XanderWatson/iitj-autoproxy/blob/main/LICENSE
# require_license_acceptance: false
# project_source_url: https://github.com/XanderWatson/iitj-autoproxy
# docs_url: https://github.com/XanderWatson/iitj-autoproxy/blob/main/README.md
# bug_tracker_url: https://github.com/XanderWatson/iitj-autoproxy/issues
# summary: A CLI tool to automatically login to IIT Jodhpur's network firewall.
# description: |
# IITJ Autoproxy installer package.
# A CLI tool to automatically login to IIT Jodhpur's network firewall.
# release_notes: "https://github.com/XanderWatson/iitj-autoproxy/releases/tag/v{{ .Version }}"
# api_key: '{{ .Env.CHOCOLATEY_API_KEY }}'
# source_repo: "https://push.chocolatey.org/"
# skip_publish: false

archives:
- wrap_in_directory: false
format_overrides:
Expand All @@ -145,5 +127,55 @@ archives:
- README.md
- autoproxy.config
- scripts/*
- install.sh
- install.ps1
- autoproxy-uninstall.ps1

brews:
- name: iitj-autoproxy
url_template: "https://github.com/SaahilNotSahil/iitj-autoproxy/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
download_strategy: CurlDownloadStrategy
commit_author:
name: SaahilNotSahil
email: [email protected]
commit_msg_template: "Brew formula update for iitj-autoproxy version {{ .Tag }}"
homepage: "https://github.com/SaahilNotSahil/iitj-autoproxy"
description: "A CLI tool to automatically login to IIT Jodhpur's network firewall."
license: "MIT"
skip_upload: false
service: |
run [opt_bin/"autoproxyd"]
keep_alive true
install: |
bin.install "bin/autoproxyd"
bin.install "bin/autoproxy"
(etc/"iitj-autoproxy").install "autoproxy.config"
bin.install "scripts/darwin/daemon-start.sh" => "autoproxyd-start"
bin.install "scripts/darwin/daemon-stop.sh" => "autoproxyd-stop"
bin.install "scripts/darwin/login.sh" => "autoproxylogin"
repository:
owner: SaahilNotSahil
name: homebrew-iitj-autoproxy
branch: main
pull_request:
enabled: false

scoops:
- name: iitj-autoproxy
url_template: "https://github.com/SaahilNotSahil/iitj-autoproxy/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
commit_author:
name: SaahilNotSahil
email: [email protected]
commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://github.com/SaahilNotSahil/iitj-autoproxy"
description: "A CLI tool to automatically login to IIT Jodhpur's network firewall."
license: MIT
skip_upload: false
repository:
owner: SaahilNotSahil
name: scoop-iitj-autoproxy
branch: main
pull_request:
enabled: false
94 changes: 60 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,93 @@
# IITJ Autoproxy (v0.1.1)
# IITJ Autoproxy (v0.1.2)

A CLI tool to automatically login to IIT Jodhpur's network firewall.

#### (Currently only supports Windows and Linux)
## Installation

### Installation
### Windows:

#### Windows:
#### Scoop:

- Download the latest release from [here](https://github.com/SaahilNotSahil/iitj-autoproxy/releases).
- Unzip the file and open a powershell instance with administrator privileges in the unzipped directory:
- Run the following script to install autoproxy:
- First, you need to install [Scoop](https://scoop.sh/).
- Next, run the following commands in PowerShell

```shell
scoop bucket add org https://github.com/SaahilNotSahil/scoop-iitj-autoproxy.git
scoop install iitj-autoproxy
```

#### From archive:

- Download the latest release (`iitj-autoproxy_<version>_windows_amd64.zip`) from [here](https://github.com/SaahilNotSahil/iitj-autoproxy/releases).
- Extract the zip file.
- Open Powershell as administrator and run the following commands

```shell
cd <path-to-extracted-folder>
.\install.ps1
```

This will install the autoproxy CLI and daemon in "C:\Program Files\IITJ Autoproxy\" and also add it to the PATH environmment variable.
- IITJ Autoproxy is now installed on your system in the `C:\Program Files\IITJ Autoproxy` directory, and is added to the PATH.

#### Debian-based Linux Distributions:
- Run the following commands to install the package:
### Linux:

```
$ curl -s https://packagecloud.io/install/repositories/SaahilNotSahil/iitj-autoproxy/script.deb.sh | sudo bash
$ sudo apt update
$ sudo apt install iitj-autoproxy
```
#### Debian-based Distros (Debian, Ubuntu, Linux Mint, etc.):

- The daemon service will be started automatically. Incase it doesn't, run the following command:
- You can install by running the following commands

```
$ sudo autoproxyd-start
```bash
curl -s https://packagecloud.io/install/repositories/SaahilNotSahil/iitj-autoproxy/script.deb.sh?any=true | sudo bash
sudo apt update
sudo apt install iitj-autoproxy
```

- To stop the daemon service, run the following command:
#### Arch-based Distros (Arch Linux, EndeavourOS, Manjaro, etc.):

```
$ sudo autoproxyd-stop
- Download the AUR package for IITJ Autoproxy:
(You can install it with your favourite AUR helper)

```bash
yay -S iitj-autoproxy-bin
```

#### Arch-based Linux Distributions:
- Install the [AUR package](https://aur.archlinux.org/packages/iitj-autoproxy-bin/) using your favourite AUR helper.
#### RHEL-based Distros (RHEL, Fedora, CentOS, etc.):

For example, using `yay`:
```
$ yay -S iitj-autoproxy-bin
- You can install by running the following commands

```shell
curl -s https://packagecloud.io/install/repositories/SaahilNotSahil/iitj-autoproxy/script.rpm.sh?any=true | sudo bash
sudo yum install iitj-autoproxy
```

- Start the daemon service:
#### From archive:

- Download the latest release (`iitj-autoproxy_<version>_linux_<amd64/arm64>.tar.gz`) from [here](https://github.com/SaahilNotSahil/iitj-autoproxy/releases).
- Extract the `tar.gz` file and run the installer script
```shell
tar zxvf iitj-autoproxy_<version>_linux_<amd64/arm64>.tar.gz
chmod +x install.sh
./install.sh
```
$ sudo autoproxyd-start
```
- IITJ Autoproxy is now installed on your system in the `/usr/bin` directory, which is already in the PATH.

### Mac:

- To stop the daemon service, run the following command:
#### Homebrew:

- You can install by running the following commands

```shell
brew tap SaahilNotSahil/iitj-autoproxy
brew install iitj-autoproxy
```
$ sudo autoproxyd-stop

- To upgrade the package:

```shell
brew upgrade iitj-autoproxy
```

### Usage
## Usage

- First, you need to set your username and password. To do so, run the following command:

Expand Down Expand Up @@ -89,5 +117,3 @@ Note: You need to be logged out before running the above command.
```
$ autoproxy logout
```

#### Support for other operating systems coming soon :)
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.2
5 changes: 5 additions & 0 deletions autoproxy.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"base_url": "http://www.gstatic.com/generate_204",
"login_base_url": "https://gateway.iitj.ac.in:1003/"
"username": "",
"password": "",
"token": "",
"scheduler_running_state": false,
"dummy_scheduler_running_state": false
}
2 changes: 1 addition & 1 deletion cli/cmd/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

"github.com/XanderWatson/iitj-autoproxy/pkg"
"github.com/SaahilNotSahil/iitj-autoproxy/pkg"
)

func init() {
Expand Down
Loading

0 comments on commit 6d59de8

Please sign in to comment.