Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 00ba7d0

Browse files
committed
Merge branch 'master' of https://github.com/acm-uiuc/linkry
2 parents 0051745 + 2b2afdf commit 00ba7d0

File tree

4 files changed

+89
-12
lines changed

4 files changed

+89
-12
lines changed

.github/workflows/docker.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'AMD64/ARM64 image builder'
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
docker:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v1
17+
with:
18+
platforms: all
19+
20+
- name: Set up Docker Buildx
21+
id: buildx
22+
uses: docker/setup-buildx-action@v1
23+
24+
- name: Cache Docker layers
25+
uses: actions/cache@v2
26+
with:
27+
path: /tmp/.buildx-cache
28+
key: ${{ runner.os }}-buildx-${{ github.sha }}
29+
restore-keys: |
30+
${{ runner.os }}-buildx-
31+
- name: Login to DockerHub
32+
if: github.event_name != 'pull_request'
33+
uses: docker/login-action@v1
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Build and push
40+
id: docker_build
41+
uses: docker/build-push-action@v2
42+
with:
43+
builder: ${{ steps.buildx.outputs.name }}
44+
context: .
45+
platforms: linux/amd64,linux/arm64
46+
push: ${{ github.event_name != 'pull_request' }}
47+
tags: ghcr.io/acm-uiuc/linkry:latest,ghcr.io/acm-uiuc/linkry:${{github.ref_name}}
48+
cache-from: type=local,src=/tmp/.buildx-cache
49+
cache-to: type=local,dest=/tmp/.buildx-cache
50+
51+
- name: Image digest
52+
run: echo ${{ steps.docker_build.outputs.digest }}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @devksingh4

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2021-2022 EpochML and ACM @ UIUC
1+
Copyright 2021-2023 EpochML and ACM @ UIUC
22

33
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
44

@@ -8,4 +8,4 @@ Redistribution and use in source and binary forms, with or without modification,
88

99
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1010

11-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,40 @@ Linkry is an internal tool for shortening links and reducing link rot by redirec
44

55
## Installation
66

7-
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.
8-
Then, run the following commands:
7+
Pull the published Docker container using the appropriate version: `docker pull ghcr.io/acm-uiuc/linkry:latest`.
8+
9+
Create a `.env` file that contains the following keys:
910
```bash
10-
yarn
11-
export proto=http
12-
export baseURL=localhost:9215
13-
export SESSION_DB_FILE_LOC=$PWD
14-
export SESSION_DB_FILE_NAME=db.sqlite3
15-
export DB_FILE=db.sqlite3
16-
export CLIENT_SECRET=<your azure AD secret here>
17-
yarn dev
11+
NODE_ENV=production # or development if in development mode
12+
BASE_URL=go.acm.illinois.edu # production URL
13+
BASE_PROTO=https # http vs. https
14+
AAD_CLIENT_ID=0 # Client ID in Azure Active Directory (ensure idtoken flow is enabled).
15+
AAD_TENANT_ID=0 # Azure AD Tenant ID
16+
AAD_CLIENT_SECRET= # Azure AD client secret for respective client ID.
17+
brandTitle=ACM Link Shortener # HTML title
18+
brandLoginProvider=ACM # Custom name for AAD Auth Provider
19+
brandLogoPath=https://go.acm.illinois.edu/static/img/white-banner.svg # path to banner logo
20+
brandOrgHome=https://acm.illinois.edu # main home page
21+
brandStatusURL=https://status.acm.illinois.edu # Status page
22+
brandCopyrightOwner=ACM @ UIUC # Corporation Name
23+
brandDomainHint=devksingh.com # Azure AD Domain Hint
24+
DB_FILE=/usr/src/app/db.sqlite3 # where the DB of links is.
25+
GROUPS_PERMITTED=ACM Link Shortener Admins, ACM Exec # Groups that can access the link shortener
26+
```
27+
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):
28+
```yml
29+
version: '3'
30+
services:
31+
linkry:
32+
image: ghcr.io/acm-uiuc/linkry:latest
33+
restart: on-failure
34+
environment:
35+
- DB_FILE=/usr/src/app/db.sqlite3
36+
ports:
37+
- "9215:9215"
38+
volumes:
39+
- ./.env:/usr/src/app/.env
40+
- ./db.sqlite3:/usr/src/app/db.sqlite3
1841
```
1942
2043
## Usage
@@ -29,3 +52,4 @@ Maintainer: Dev Singh (<[email protected]>)
2952
3053
## License
3154
[BSD 3-Clause](https://raw.githubusercontent.com/acm-uiuc/linkry/master/LICENSE)
55+

0 commit comments

Comments
 (0)