Commit 5e34e5c9 authored by David Haynes's avatar David Haynes 🙆

Disclaimer in the README

parent 45be3a4f
......@@ -14,9 +14,9 @@ django-crispy-forms = "==1.7.0"
django-ratelimit = "==1.0.1"
django-redis-cache = "==1.7.1"
hashids = "==1.2.0"
mysqlclient = "*"
django-cas-client = "*"
requests = "*"
mysqlclient = "*"
[requires]
python_version = "3.6"
python_version = "3.7"
{
"_meta": {
"hash": {
"sha256": "c8aecf58c565d1e2d106d545721922331eb702b7014ecbaf035747291dd94d94"
"sha256": "344d6a76321ef5bfb303fa700366e26def98b9504ec878359c6e2fe255ce9ef1"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.6"
"python_version": "3.7"
},
"sources": [
{
......@@ -32,11 +32,11 @@
},
"django": {
"hashes": [
"sha256:3eb25c99df1523446ec2dc1b00e25eb2ecbdf42c9d8b0b8b32a204a8db9011f8",
"sha256:69ff89fa3c3a8337015478a1a0744f52a9fef5d12c1efa01a01f99bcce9bf10c"
"sha256:97886b8a13bbc33bfeba2ff133035d3eca014e2309dff2b6da0bdfc0b8656613",
"sha256:e900b73beee8977c7b887d90c6c57d68af10066b9dac898e1eaf0f82313de334"
],
"index": "pypi",
"version": "==2.0.6"
"version": "==2.0.7"
},
"django-cas-client": {
"hashes": [
......@@ -78,28 +78,24 @@
},
"idna": {
"hashes": [
"sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f",
"sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4"
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
],
"version": "==2.6"
"version": "==2.7"
},
"mysqlclient": {
"hashes": [
"sha256:1e85e48b167e2af3bb08f273fdbd1ad6401cbe75057fa6513f97387dc7b282dc",
"sha256:2d9ec33de39f4d9c64ad7322ede0521d85829ce36a76f9dd3d6ab76a9c8648e5",
"sha256:371df79d000af56b4e540b7ce2120d1c9afb04b751bfce25a1eb609c50fd10ff",
"sha256:b3b1a7e4468180afb79289b54069d9499242946a4cedf3928cbf6b2a13800016",
"sha256:d56e379c03efad746e84705cbb97401f60d1f98b05e11a27f2d9c2d043936974"
"sha256:ff8ee1be84215e6c30a746b728c41eb0701a46ca76e343af445b35ce6250644f"
],
"index": "pypi",
"version": "==1.3.12"
"version": "==1.3.13"
},
"pytz": {
"hashes": [
"sha256:65ae0c8101309c45772196b21b74c46b2e5d11b6275c45d251b150d5da334555",
"sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
"sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053",
"sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277"
],
"version": "==2018.4"
"version": "==2018.5"
},
"redis": {
"hashes": [
......@@ -110,37 +106,38 @@
},
"requests": {
"hashes": [
"sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b",
"sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e"
"sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1",
"sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a"
],
"index": "pypi",
"version": "==2.18.4"
"version": "==2.19.1"
},
"urllib3": {
"hashes": [
"sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b",
"sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"
"sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf",
"sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5"
],
"version": "==1.22"
"markers": "python_version != '3.0.*' and python_version != '3.3.*' and python_version != '3.2.*' and python_version < '4' and python_version >= '2.6' and python_version != '3.1.*'",
"version": "==1.23"
}
},
"develop": {
"astroid": {
"hashes": [
"sha256:0ef2bf9f07c3150929b25e8e61b5198c27b0dca195e156f0e4d5bdd89185ca1a",
"sha256:fc9b582dba0366e63540982c3944a9230cbc6f303641c51483fa547dcc22393a"
"sha256:0a0c484279a5f08c9bcedd6fa9b42e378866a7dcc695206b92d59dc9f2d9760d",
"sha256:218e36cf8d98a42f16214e8670819ce307fa707d1dcf7f9af84c7aede1febc7f"
],
"version": "==1.6.5"
"version": "==2.0.1"
},
"coverage": {
"hashes": [
"sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba",
"sha256:0b136648de27201056c1869a6c0d4e23f464750fd9a9ba9750b8336a244429ed",
"sha256:104ab3934abaf5be871a583541e8829d6c19ce7bde2923b2751e0d3ca44db60a",
"sha256:15b111b6a0f46ee1a485414a52a7ad1d703bdf984e9ed3c288a4414d3871dcbd",
"sha256:10a46017fef60e16694a30627319f38a2b9b52e90182dddb6e37dcdab0f4bf95",
"sha256:198626739a79b09fa0a2f06e083ffd12eb55449b5f8bfdbeed1df4910b2ca640",
"sha256:1c383d2ef13ade2acc636556fd544dba6e14fa30755f26812f54300e401f98f2",
"sha256:23d341cdd4a0371820eb2b0bd6b88f5003a7438bbedb33688cd33b8eae59affd",
"sha256:28b2191e7283f4f3568962e373b47ef7f0392993bb6660d079c62bd50fe9d162",
"sha256:2a5b73210bad5279ddb558d9a2bfedc7f4bf6ad7f3c988641d83c40293deaec1",
"sha256:2eb564bbf7816a9d68dd3369a510be3327f1c618d2357fa6b1216994c2e3d508",
"sha256:337ded681dd2ef9ca04ef5d93cfc87e52e09db2594c296b4a0a3662cb1b41249",
"sha256:3a2184c6d797a125dca8367878d3b9a178b6fdd05fdc2d35d758c3006a1cd694",
......@@ -160,16 +157,11 @@
"sha256:7e1fe19bd6dce69d9fd159d8e4a80a8f52101380d5d3a4d374b6d3eae0e5de9c",
"sha256:8c3cb8c35ec4d9506979b4cf90ee9918bc2e49f84189d9bf5c36c0c1119c6558",
"sha256:9d6dd10d49e01571bf6e147d3b505141ffc093a06756c60b053a859cb2128b1f",
"sha256:9e112fcbe0148a6fa4f0a02e8d58e94470fc6cb82a5481618fea901699bf34c4",
"sha256:ac4fef68da01116a5c117eba4dd46f2e06847a497de5ed1d64bb99a5fda1ef91",
"sha256:b8815995e050764c8610dbc82641807d196927c3dbed207f0a079833ffcf588d",
"sha256:be6cfcd8053d13f5f5eeb284aa8a814220c3da1b0078fa859011c7fffd86dab9",
"sha256:c1bb572fab8208c400adaf06a8133ac0712179a334c09224fb11393e920abcdd",
"sha256:de4418dadaa1c01d497e539210cb6baa015965526ff5afc078c57ca69160108d",
"sha256:e05cb4d9aad6233d67e0541caa7e511fa4047ed7750ec2510d466e806e0255d6",
"sha256:e4d96c07229f58cb686120f168276e434660e4358cc9cf3b0464210b04913e77",
"sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80",
"sha256:f8a923a85cb099422ad5a2e345fe877bbc89a8a8b23235824a93488150e45f6e"
"sha256:f3f501f345f24383c0000395b26b726e46758b71393267aeae0bd36f8b3ade80"
],
"index": "pypi",
"version": "==4.5.1"
......@@ -180,6 +172,7 @@
"sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8",
"sha256:ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497"
],
"markers": "python_version != '3.2.*' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.3.*' and python_version >= '2.7'",
"version": "==4.3.4"
},
"lazy-object-proxy": {
......@@ -225,11 +218,11 @@
},
"pylint": {
"hashes": [
"sha256:a48070545c12430cfc4e865bf62f5ad367784765681b3db442d8230f0960aa3c",
"sha256:fff220bcb996b4f7e2b0f6812fd81507b72ca4d8c4d05daf2655c333800cb9b3"
"sha256:248a7b19138b22e6390cba71adc0cb03ac6dd75a25d3544f03ea1728fa20e8f4",
"sha256:9cd70527ef3b099543eeabeb5c80ff325d86b477aa2b3d49e264e12d12153bc8"
],
"index": "pypi",
"version": "==1.9.2"
"version": "==2.0.0"
},
"pylint-django": {
"hashes": [
......@@ -241,9 +234,9 @@
},
"pylint-plugin-utils": {
"hashes": [
"sha256:053ade7c76f83242225b49d47624d9ecb803c60347e2c5127e97a19bf0c9f95e"
"sha256:8ad25a82bcce390d1d6b7c006c123e0cb18051839c9df7b8bdb7823c53fe676e"
],
"version": "==0.2.6"
"version": "==0.4"
},
"six": {
"hashes": [
......
# Go 3
[![build status](https://git.gmu.edu/srct/go/badges/master/build.svg)](https://git.gmu.edu/srct/go/commits/master)
[![coverage report](https://git.gmu.edu/srct/go/badges/master/coverage.svg)](https://git.gmu.edu/srct/go/commits/master)
[![python version](https://img.shields.io/badge/python-3.6-blue.svg)]()
[![Django version](https://img.shields.io/badge/Django-2.0-brightgreen.svg)]()
A project of [GMU SRCT](https://srct.gmu.edu).
Go is a drop-in URL shortening service. This project aims to provide an easy to
use URL branding service for institutions that wish to widely disseminate
information without unnecessarily outsourcing branding.
Go is currently a `Python 3` project written in the `Django` web framework,
with `MySQL` as our backend database.
## Setup instructions for local development
Go currently supports developers on Linux, macOS and Windows platforms through
the Docker container platform. We have included instructions for manual setup
as well. Here's our walk-through of steps we will take:
1. Install `git` on your system.
1. Clone the Go codebase.
1. Get Go up and running with the method of your choice.
### 1) Install `git` on your system
`git` is the version control system used for SRCT projects.
#### On Linux Based Systems
**with apt:**
Open a terminal and run the following command:
sudo apt update
This retrieves links to the most up-to-date and secure versions of your
packages.
Next, with:
sudo apt install git
you install `git` onto your system.
#### On macOS
We recommend that you use the third party Homebrew package manager for macOS,
which allows you to install packages from your terminal just as easily as you
could on a Linux based system. You could use another package manager (or not
use one at all), but Homebrew is highly reccomended.
To get homebrew, run the following command in a terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
**Note**: You do NOT need to use `sudo` when running any Homebrew commands, and
it likely won't work if you do.
Next, to make sure Homebrew is up to date, run:
brew update
Finally we can install git with:
brew install git
#### On Windows
We recommend that if you are on Windows 10 to make use of the Windows Subsystem
for Linux (WSL). The following link should get you up and running:
[https://msdn.microsoft.com/en-us/commandline/wsl/install_guide](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)
#### Contributing with Windows
After that is setup, you should be able to follow the Linux instructions for
_manual setup_ to contribute to the project.
If you are not on Windows 10 or would rather prefer to not use the WSL you may
download Git for Windows here:
[https://git-scm.com/download/win](https://git-scm.com/download/win)
I have successfully ran the project with Docker, though you need access to
Hyper-V which is only available on "Professional" versions of Windows.
### 2) Clone the Go codebase
Now, we're going to clone down a copy of the Go codebase from
[git.gmu.edu](https://git.gmu.edu/srct/go), the SRCT code respository with SSH.
**a)** Configure your ssh keys by following the directions at:
[git.gmu.edu/help/ssh/README](https://git.gmu.edu/help/ssh/README).
**b)** Now, on your computer, navigate to the directory in which you want to
download the project (ie. perhaps one called `development/SRCT`), and run
git clone git@git.gmu.edu:srct/go.git
### 3) Get Go up and running with the method of your choice
Now that we have `git` setup and cloned down the code you can
cd go/
and get to working on setting up a development environment!
#### Docker
Docker is an emerging containerization platform written in Google's Go
language. Instead of running a full VM that runs Go, we package up all the
various bits that make up Go and run that as a container (two containers: one
for Go and the other for mysql) that act as normal processes to the OS.
Check out [docker.com](https://www.docker.com/what-docker) for more details.
Pros:
* Lightweight
* Can be run on most machines without needing significant resources.
* SRCT members report minimal battery impact on laptops.
* Fast
* Compared to other methods, Docker is comparatively faster to setup than
manual setup.
* Minimal setup
* You run one command. Really easy to get up and running once you install
Docker.
* Good cross platform support
* Runs smoothly on macOS, Linux, and Windows
* Great docs to help if you get stuck.
* Can easily destroy and rebuild the docker images
* Loads in changes to code on the fly
There are instructions on how to setup/develop with Docker at the
[docker-configuration page in the Go project wiki](https://git.gmu.edu/srct/go/wikis/docker-configuration).
#### Manual Setup
Manual setup (or: the old fashioned way) is where you install all dependecies
on your system and run Go as a local server with Django. Granted you are
technically doing that with Docker except it automates the steps that are laid
out in this section.
Pros:
* Experience setting up a Django project for local development
Cons:
* Greater potential for things to go wrong
* Way more steps
Head to:
https://git.gmu.edu/srct/go/wikis/manual-setup
## Some words about contributing to Go
### Testing
You are _very strongly_ encouraged to write test cases where applicible for
code that you contribute to the repo. This is not a rule at the moment but
rather a strong suggestion. It's good practice for corporate land and will also
ensure your code works. Additionally, there are quite a few example ones to
look at in the repo and on Google.
### Running Unit Tests
Unit tests are run on every commit sent to gitlab though that can be a pain to
rely on. Here's how to run them locally:
### Docker
Docker is not supported currently for running unit tests. If you're able to get
it set up, open a merge request and I'll merge it in.
### Manual Setup
Assuming you are within your virtualenv:
python manage.py test
### CONTRIBUTING.md
This document goes into detail about how to contribute to the repo, plus some
opinions about using `git`.
### Opening issues
There is a template for issue descriptions located on the new issue page. I
will close issues with poor descriptions or who do not follow the standard.
### Authentication
The authentication service used for Go is CAS. In local development however we
utilize a test server. You can log in with just your CAS username to simulate
logging in. By default, the Django superuser is set to `dhaynes3`.
## DISCLAIMER
In order to approve yourself to be an 'approved user' you must navigate to
127.0.0.1:8000/admin and log in. Once in the admin page go to "registered
users", and create a new registered user in the top right. Be sure to use the
same username and Full Name as your main account and select "approved" in the
bottom row.
Go 3 is a major refactor of the project with an emphasis on extensibility.
### Coding style
Things might not work quite right.
TODO
Docs may not exist.
### Getting Help
I wouldn't go so far as to say we are hitting the reset button.
I encourage you to join the
[#go channel](https://srct.slack.com/messages/go/details/) in SRCT's
[Slack Group](https://srct.slack.com) if you have any questions on setup or
would like to contribute.
But it's close.
......@@ -3,12 +3,12 @@ go/cas_callbacks.py
Parse the CAS/PF responses and create users in the database.
"""
# Other Imports
import requests
# Django Imports
from django.conf import settings
from django.contrib.auth.models import User
# Other Imports
import requests
def pfparse(pf_name_result: str) -> list:
"""
......
......@@ -17,12 +17,11 @@ from django.http import HttpResponseServerError # Http404
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, render
from django.utils import timezone
# Other imports
from ratelimit.decorators import ratelimit
# App Imports
from .forms import SignupForm, URLForm, EditForm
from .forms import EditForm, SignupForm, URLForm
from .models import URL, RegisteredUser
......
......@@ -3,33 +3,34 @@
}
.landing-card {
box-shadow: 0 0 4px 2px rgba(0,0,0,.2);
box-shadow: 0 0 4px 2px rgba(0, 0, 0, .2);
}
.pointer:hover,.shadow-hover {
cursor:pointer
.pointer:hover,
.shadow-hover {
cursor: pointer
}
.shadow-hover {
position:relative;
transition:all .5s cubic-bezier(.165,.84,.44,1)
position: relative;
transition: all .5s cubic-bezier(.165, .84, .44, 1)
}
.shadow-hover:after {
content:"";
box-shadow:0 0 16px 2px rgba(0,0,0,.2);
border-radius:inherit;
opacity:0;
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:-1;
transition:opacity .5s cubic-bezier(.165,.84,.44,1)
content: "";
box-shadow: 0 0 16px 2px rgba(0, 0, 0, .2);
border-radius: inherit;
opacity: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
transition: opacity .5s cubic-bezier(.165, .84, .44, 1)
}
.shadow-hover:focus:after,.shadow-hover:hover:after {
opacity:1
.shadow-hover:focus:after,
.shadow-hover:hover:after {
opacity: 1
}
\ No newline at end of file
......@@ -17,5 +17,3 @@ clipboard.on('success', function (e) {
e.clearSelection();
$('#copy-button').attr('data-original-title', 'Copied!').tooltip('show');
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment