Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
03a4571
chore(client/server): Updated client components and Auth handlers
May 25, 2021
db0f150
chore(nextjs-config): Edited stuff for MAIL_FROM_ADDRESS stuff
May 25, 2021
4ed9509
fix(@kutt-sercer/env): Fix an syntax error, again.
May 25, 2021
a1285a5
chore(github-actions): Updated workflow stuff
May 25, 2021
8e0f2df
chore(github-actions): Implement environments on Ci workflow
May 27, 2021
8a3dc12
fix(railway-setup): Forgot to add sudo before running the script
May 27, 2021
d1e94d2
[manual-pull] Merge branch 'develop' of github.com:MadeByThePinsHub/r…
May 27, 2021
eea42b3
chore(github-actions): Updated some stuff
May 27, 2021
563a428
chore(package.json): Scripts cleanup and more stuff to do
May 27, 2021
d6ed8a0
chore(github-actions): Update jobs.railway-deploy.enviornment stuff
May 27, 2021
123e9e5
docs(global): Add docs stuff
May 27, 2021
73d6ae3
chore(dockerfile): Automagically update lockfile at build time.
May 27, 2021
e2dd358
fix(github-actions): Fix some syntax errors [skip ci]
May 27, 2021
1ddd7bf
chore(github-actions): Done some shitshows again
May 27, 2021
08cc7c4
ci(github-acrion): Use our action for Railway deployments
May 30, 2021
58451fa
ci(github-actions): Update script file [SKIP CI]
May 30, 2021
03d9520
fix(github-actions): fix syntax errors
May 30, 2021
9cffb9c
fix(github-actions): fix another shitshow
May 30, 2021
adc36a7
fix(github-actions): fix more shitshows
May 30, 2021
c257ba7
fix(github-qctions): finally fixed this shitshow
May 30, 2021
7f4c3dd
chore(global): trigger manual CI stuff
Jun 22, 2021
4e1c0ec
ci(github-actions): add workflow_dispatch stuff on dev deployments
Jun 22, 2021
ed43d3a
fix(github-actions): fix syntax errors BS
Jun 22, 2021
bc80f83
fix(github-actions): fix more "only-single-quotes-only, d***head" chaos
Jun 22, 2021
bddcfac
Create codeql-analysis.yml
Jun 29, 2021
9cbc04e
Add Gitpod config to Git version control
RecapTimeSquad Oct 7, 2021
75d21fd
Update lockfile to v2
RecapTimeSquad Oct 7, 2021
33c7588
Fix ESLint issues found with the lint script
RecapTimeSquad Oct 7, 2021
266a6e8
Bump node version to v16
RecapTimeSquad Oct 7, 2021
9b50f29
Update Dockerfile to support build-args Railway is passing during build
Oct 7, 2021
0c92754
Update GitHub Actions workflows
Oct 7, 2021
9168846
Update Gitpod workspace Dockerfile
Oct 7, 2021
df68042
chore(deps): bump nanoid from 1.3.4 to 3.1.31 (#9)
dependabot[bot] Apr 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ rules:
- base: "prod"
upstream: "develop"
mergeMethod: hardreset
- base: "develop"
upstream: "update-lockfiles-npmjs"
mergeMethod: merge
5 changes: 5 additions & 0 deletions .github/workflows/build-static-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Static Page Buulder
on:
push:
branches: [ develop ]
paths:
- "client/**"
- "server/**"
- "static/**"
- "package*.json"
pull_request:
branches: [ develop ]

Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ develop, prod ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '27 19 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
4 changes: 2 additions & 2 deletions .github/workflows/docker-build-beta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and push image (develop)
name: Build and push image (beta)

env:
repository: "madebythepinshub/rtappdotio"
Expand All @@ -15,7 +15,7 @@ on:
- prod

jobs:
docker-ci:
docker-ci-staging:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,19 @@ on:
push:
branches:
- develop
paths:
- "client/**"
- "server/**"
- "static/**"
- "Dockerfile"
- "start-rtappdotio"
- ".trigger-deploy"
- "package*.json"
workflow_dispatch:

jobs:
docker-ci:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-build-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release-based Docker image builder
name: Build and push image (stable)

env:
repository: "madebythepinshub/rtappdotio"
Expand All @@ -12,7 +12,7 @@ on:
types: [published]

jobs:
release-image:
docker-ci-prod:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -47,4 +47,4 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ env.repository }}:${{ env.tag }}, ghcr.io/${{ env.repository }}:latest, quay.io/${{ env.repository }}:${{ env.tag }}, quay.io/${{ env.repository }}:latest
tags: ghcr.io/${{ env.repository }}:${{ env.tag }}, ghcr.io/${{ env.repository }}:latest, ghcr.io/${{ env.repository }}:stable, quay.io/${{ env.repository }}:${{ env.tag }}, quay.io/${{ env.repository }}:latest, quay.io/${{ env.repository }}:stable
35 changes: 35 additions & 0 deletions .github/workflows/update-lockfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lockfile Updater

on:
workflow_dispatch:

env:
commitMessage: "chore(lockfile-npmjs): Updated lockfiles for npmjs"

jobs:
lockfile-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_SERVICE_ACCOUNT_API_KEY }}
fetch-depth: 0
- uses: actions/setup-node@v2
name: "Setup Node.js 16"
with:
node-version: '16'
- run: npm cache verify --verbose && npm cache clean -f --verbose
name: Verify and nuke cache
- name: Rebuild package-lock.json
run: npm install --package-lock
- name: Stage and commit
run:
git branch update-lockfiles-npmjs && git switch update-lockfiles-npmjs
git config user.name "Recap Time Bot"
git config user.email "[email protected]"
git add package*.json && git commit --signoff -m "${{ env.commitMessage }}"
git fetch && git push origin update-lockfiles-npmjs
- name: Trigger Pull app
run: curl -i ${PULL_APP_HOST}/process/${{ github.repository }}
env:
PULL_APP_HOST: "https://ghpullapp-thepinsteam.up.railway.app"
5 changes: 5 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM gitpod/workspace-full:latest

RUN bash -lc "source ~/.nvm/nvm-lazy.sh && nvm install --lts && nvm use --lts && nvm install-latest-npm"
RUN brew install hadolint shellcheck
RUN sudo install-packages gettext
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
image:
file: .gitpod.Dockerfile
tasks:
- init: |
npm install
npm run build
command: npm run gitpod:start
- name: Mail Debugging
command: sudo python3 -m smtpd -c DebuggingServer localhost:2680
1 change: 1 addition & 0 deletions .trigger-deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello world
39 changes: 31 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
FROM node:14-alpine
FROM node:16-alpine

# Only used for Railway to force-rebuild minus the cache.
ENV LAYER_CACHE=1
ARG LAYER_CACHE=1
ENV LAYER_CACHE=$LAYER_CACHE
# apk add is needed for our script to be working
RUN LAYER_CACHE=$LAYER_CACHE apk add --no-cache --update bash coreutils dumb-init

RUN LAYER_CACHE=$LAYER_CACHE apk add --no-cache --update bash coreutils

# Setting working directory.
# Set working directory to /app
WORKDIR /app

# Installing dependencies
# Install Node.js dependencies with npm (ensuring that package-lock.json is up-to-date)
COPY package*.json ./
RUN LAYER_CACHE=$LAYER_CACHE npm install
RUN LAYER_CACHE=$LAYER_CACHE npm cache clean --force && npm install --package-lock

# Copying source files
# After that, copy the rest of the codebase
COPY . .

# Build-time envvars for npm run build, especially you don't want to pay more if
# FORCE_REBUILD_CLIENT is set to 1 and you're on Railway's free plan and don't have money yet.
# Contact and Abuse Report Emails
ARG CONTACT_EMAIL="[email protected]"
ARG REPORT_EMAIL="[email protected]"
# Whenever generating shortlinks on anonymous users and registration should be allowed
ARG DISALLOW_ANONYMOUS_LINKS="false"
ARG DISALLOW_REGISTRATION="false"
ARG SITE_NAME="rtapp.io"
# Depending on our DNS provider, we can't just add an CNAME to root record, unless
# ANAMEs or CNAME flattening is supported.
ARG DEFAULT_DOMAIN="https://prod.rtapp.tk"
# The From address we're using
ARG MAIL_FROM_ADDRESS="[email protected]"
# Google Analytics and ReCaptcha stuff
# We'll work to switch to hCaptcha and Ackee in the future.
ARG RECAPTCHA_SITE_KEY
ARG GOOGLE_ANALYTICS
# Sentry DSN
ARG SENTRY_PUBLIC_DSN

# Build files
RUN LAYER_CACHE=$LAYER_CACHE npm run build

Expand All @@ -23,4 +45,5 @@ ENV PORT=3000
EXPOSE 3000

# Running the app
ENTRYPOINT [ "dumb-init" ]
CMD [ "/app/start-rtappdotio" ]
12 changes: 6 additions & 6 deletions client/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ const Footer: FC = () => {
>
{!isAuthenticated && <ReCaptcha />}
<Text fontSize={[12, 13]} py={2}>
Made with love by developers at{" "}
Made with love, originally by developers at{" "}
<ALink href="https://github.com/thedevs-network/kutt" title="The Devs">
The Devs
</ALink>
, and improved by{" "}
<ALink href="https://madebythepins.tk" title="friends at The Pins Team">
The Pins Team
, and currently by{" "}
<ALink href="https://recaptime.tk" title="friends at Recap Time Squad">
Recap Time Squad
</ALink>
.{" | "}
<ALink
href="https://github.com/MadeByThePinsHub/rtappdotio"
title="Our fork's sauce on GitHub"
href="https://github.com/RecapTime/rtappdotio"
title="Source on GitHub"
target="_blank"
>
Our fork's sauce on GitHub
Expand Down
2 changes: 1 addition & 1 deletion client/components/Settings/SettingsApi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const SettingsApi: FC = () => {
<ALink href="https://docs.rtapp.tk" title="API Docs" target="_blank">
Read API docs
</ALink>
and see list of <ALink href="https://github.com/thedevs-network/kutt#integrations" title="Integrations">integrations</ALink>, <ALink href="https://github.com/thedevs-network/kutt#3rd-party-packages" title="3rd-Party Packages">community-maintained packages</ALink> and <ALink href="https://github.com/thedevs-network/kutt#browser-extensions" title="Browser Extensions">extensions for your browser</ALink>.
{" "}and see list of <ALink href="https://github.com/thedevs-network/kutt#integrations" title="Integrations">integrations</ALink>, <ALink href="https://github.com/thedevs-network/kutt#3rd-party-packages" title="3rd-Party Packages">community-maintained packages</ALink> and <ALink href="https://github.com/thedevs-network/kutt#browser-extensions" title="Browser Extensions">extensions for your browser</ALink>.
</Text>
{apikey && (
<Flex alignItems={["flex-start", "center"]} my={3}>
Expand Down
4 changes: 2 additions & 2 deletions client/components/__tests__/footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ describe("<Footer /> component test", () => {

it("should contain a github link", () => {
const screen = render(app);
const githubLink = screen.getByRole("link", { name: "GitHub" });
expect(githubLink).toHaveAttribute("href", "https://github.com/thedevs-network/kutt");
const githubLink = screen.getByRole("link", { name: "Source on GitHub" });
expect(githubLink).toHaveAttribute("href", "https://github.com/RecapTime/rtappdotio");
});

it("should contain a TOS link", () => {
Expand Down
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ version: "3"

services:
kutt:
image: "ghcr.io/madebythepinshub/rtappdotio:stable"
image: "ghcr.io/recaptime/rtappdotio:stable"
build:
context: .
dockerfile: Dockerfile
depends_on:
- postgres
- redis
Expand All @@ -17,6 +20,7 @@ services:
DB_USER: user
DB_PASSWORD: pass
REDIS_HOST: redis
REDIS_PORT: "6379"

redis:
image: "redis:6.0-alpine"
Expand All @@ -32,6 +36,9 @@ services:
volumes:
- postgres_data:/var/lib/postgresql/data

maildebug:
image: ghcr.io/recaptime/smtp-debuggingserver-docker:master

volumes:
redis_data:
postgres_data:
12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Docs for the `rtapp.tk` Kutt instance

This documentation is currently in WIP, and we'll polish them in the futre. If you self-host your own, please update the docs written here.

## Requires Assistance

* [Enabling shortened links on your custom domain](custom-domains.md)

## API Docs stuff

* [Source files](./api)
* [The fully generated API Docs page](https://docs.rtapp.tk)
42 changes: 42 additions & 0 deletions docs/custom-domains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Custom domains for your shortlinks

> Currently work in progress, we'll update you once we're ready.

## Manual

1. Point your custom domain's CNAME records to `rtappdotio.up.railway.app` (`rtapp.tk`) or `rtappdotio-development.up.railway.app` (`dev.rtapp.tk`).
2. Visit your account settings page and add the domsin. Optionally, set an homepage if you don't like to point into the homepage. (e.g. our abuse report form: <https://reportabuse.rtapp.tk/url-shortener>)
3. Request your custom domain to be added into our projrct's custom domains [here](https://github.com/RecapTime/rtappdotio-custom-domains/issues).

## Allow us to manage your DNS records

### Allow access into your DNS records

* Cloudflare:
* Go to your Cloudflare account that has `Super Admin` permission.
* Click `Members`
* Enter `[email protected]` to the box and hit **Invite**.
* Then go back to GitHub and comment `/verify cloudflare-shared-access` to notify humans. This may take up to 72 hours for us to accept the invite and atleast 30 minutes for adding DNS records and doing checks.
* Netlify:
*

### Completely let us handle the rest

#### Cloudflare

To use our Cloudflare nameservers, go to your domain registar to change your nameservers into these:

```
null.ns.cloudlfare.com
```

```
null.ns.cloudflate.com
```

If you're currently an Cloudflare user, please invite us instead to keep your DNS records and settings.


#### Netlify

Since Netlify uses DNS1 as their nameservers, contact us first using
4 changes: 4 additions & 0 deletions gitpod-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/env bash

cat gitpod.env | envsubst > .env
docker-compose up
Loading