-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/acm-uiuc/linkry
- Loading branch information
Showing
4 changed files
with
89 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: 'AMD64/ARM64 image builder' | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ghcr.io/acm-uiuc/linkry:latest,ghcr.io/acm-uiuc/linkry:${{github.ref_name}} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @devksingh4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,40 @@ Linkry is an internal tool for shortening links and reducing link rot by redirec | |
|
||
## Installation | ||
|
||
Ensure that you have [Node](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com/) installed on your machine. For non-ACM users, configure config.js to use your AAD tenant's client ID. | ||
Then, run the following commands: | ||
Pull the published Docker container using the appropriate version: `docker pull ghcr.io/acm-uiuc/linkry:latest`. | ||
|
||
Create a `.env` file that contains the following keys: | ||
```bash | ||
yarn | ||
export proto=http | ||
export baseURL=localhost:9215 | ||
export SESSION_DB_FILE_LOC=$PWD | ||
export SESSION_DB_FILE_NAME=db.sqlite3 | ||
export DB_FILE=db.sqlite3 | ||
export CLIENT_SECRET=<your azure AD secret here> | ||
yarn dev | ||
NODE_ENV=production # or development if in development mode | ||
BASE_URL=go.acm.illinois.edu # production URL | ||
BASE_PROTO=https # http vs. https | ||
AAD_CLIENT_ID=0 # Client ID in Azure Active Directory (ensure idtoken flow is enabled). | ||
AAD_TENANT_ID=0 # Azure AD Tenant ID | ||
AAD_CLIENT_SECRET= # Azure AD client secret for respective client ID. | ||
brandTitle=ACM Link Shortener # HTML title | ||
brandLoginProvider=ACM # Custom name for AAD Auth Provider | ||
brandLogoPath=https://go.acm.illinois.edu/static/img/white-banner.svg # path to banner logo | ||
brandOrgHome=https://acm.illinois.edu # main home page | ||
brandStatusURL=https://status.acm.illinois.edu # Status page | ||
brandCopyrightOwner=ACM @ UIUC # Corporation Name | ||
brandDomainHint=devksingh.com # Azure AD Domain Hint | ||
DB_FILE=/usr/src/app/db.sqlite3 # where the DB of links is. | ||
GROUPS_PERMITTED=ACM Link Shortener Admins, ACM Exec # Groups that can access the link shortener | ||
``` | ||
Then, use the following docker-compose.yml in the same directory and run `docker-compose up` to start the application (it will be exposed on port 9215): | ||
```yml | ||
version: '3' | ||
services: | ||
linkry: | ||
image: ghcr.io/acm-uiuc/linkry:latest | ||
restart: on-failure | ||
environment: | ||
- DB_FILE=/usr/src/app/db.sqlite3 | ||
ports: | ||
- "9215:9215" | ||
volumes: | ||
- ./.env:/usr/src/app/.env | ||
- ./db.sqlite3:/usr/src/app/db.sqlite3 | ||
``` | ||
|
||
## Usage | ||
|
@@ -29,3 +52,4 @@ Maintainer: Dev Singh (<[email protected]>) | |
|
||
## License | ||
[BSD 3-Clause](https://raw.githubusercontent.com/acm-uiuc/linkry/master/LICENSE) | ||
|