Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a358a20
Send an email when the packet is generated
devinmatte Aug 10, 2019
4a7d8cf
Fixing package versions
devinmatte Aug 10, 2019
0076d38
Fixing email formatting and variables
devinmatte Aug 10, 2019
057714d
Merge pull request #145 from devinmatte/mail
devinmatte Aug 10, 2019
2a55a59
Fixing bool parse
devinmatte Aug 10, 2019
5a7cbdc
Updating Gulp and npm
devinmatte Aug 11, 2019
3130348
Merge pull request #146 from devinmatte/gulp_update
devinmatte Aug 11, 2019
1d6241d
Fixing css minify
devinmatte Aug 12, 2019
444d824
Merge pull request #147 from devinmatte/gulp_update
devinmatte Aug 12, 2019
99911e6
Minifying JS
devinmatte Aug 12, 2019
11401cd
Gzip and compressing
devinmatte Aug 12, 2019
67edcc3
Merge pull request #148 from devinmatte/minify_js
devinmatte Aug 12, 2019
af22d6e
Merge pull request #149 from devinmatte/gzip
devinmatte Aug 12, 2019
fc12145
Report an issue to Evals
devinmatte Aug 13, 2019
3ccb94a
Fixing newlines
devinmatte Aug 13, 2019
fe8ef31
Merge pull request #151 from devinmatte/report
devinmatte Aug 14, 2019
23e7c20
Push Notifications Phase 1
devinmatte Aug 15, 2019
ee28245
Adding model to collect subscriptions
devinmatte Aug 15, 2019
f6c2506
Merge pull request #153 from devinmatte/onesignal_notifications
devinmatte Aug 15, 2019
8f5f64a
Phase 2: Notification on signing
devinmatte Aug 15, 2019
7ea68b0
Adding 100 notification
devinmatte Aug 16, 2019
fbb5482
Completed Notifications
devinmatte Aug 16, 2019
6cdf8be
Send 100% notification
devinmatte Aug 16, 2019
ebb19c6
Removing prints
devinmatte Aug 16, 2019
ead921d
Merge pull request #155 from devinmatte/onesignal_notifications
devinmatte Aug 16, 2019
5e0a5dd
Fixing filter to map to allow signing
devinmatte Aug 16, 2019
e9f0284
Merge pull request #158 from devinmatte/onesignal_notifications
devinmatte Aug 16, 2019
ec16f11
Fixing Notifications and adding logging
devinmatte Aug 16, 2019
24b4df8
Merge pull request #159 from devinmatte/onesignal_notifications
devinmatte Aug 16, 2019
65109f8
Splitting into two onesignal clients
devinmatte Aug 18, 2019
b30322e
Dual Client setup
devinmatte Aug 19, 2019
7147d85
Using send_notification in both
devinmatte Aug 20, 2019
dcaf83b
Merge pull request #161 from devinmatte/onesignal_notifications
devinmatte Aug 20, 2019
5f2361f
Starting notifications
devinmatte Aug 21, 2019
22da9ac
Fixing datetime formating
devinmatte Aug 21, 2019
eed9e79
Single notification for starting
devinmatte Aug 21, 2019
97d2932
Fixing hardcoded references to instances
devinmatte Aug 21, 2019
6c5f713
Merge pull request #164 from devinmatte/hardcode_fix
devinmatte Aug 22, 2019
2a4bd8a
Merge pull request #163 from devinmatte/onesignal_notifications
devinmatte Aug 22, 2019
e0d3fae
Version Bump to 3.3.0
devinmatte Aug 23, 2019
7b7374c
Using the correct APP_ID
devinmatte Aug 23, 2019
4c6317b
Fixing inconsistent '
devinmatte Aug 23, 2019
b689a70
Fixing quote inconsistencies
devinmatte Aug 23, 2019
fca8e5c
Moving signed_notification into commit_sig
devinmatte Aug 23, 2019
9116cbc
Fixing quote issue
devinmatte Aug 23, 2019
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ config.py
node_modules

# Generated Assets
packet/static/css/packet.css
*.min.css
packet/static/css/**/*.css
packet/static/js/*.min.js
packet/static/android-chrome-192x192.png
packet/static/android-chrome-512x512.png
packet/static/apple-touch-icon.png
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6
10
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get -yq update && \

ADD . /opt/packet

RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get -yq update && \
Expand Down
21 changes: 20 additions & 1 deletion config.env.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
Default configuration settings and environment variable based configuration logic
See the readme for more information
"""

from distutils.util import strtobool
from os import environ

# Flask config
DEBUG = False
IP = environ.get("PACKET_IP", "localhost")
PORT = environ.get("PACKET_PORT", "8000")
PROTOCOL = environ.get("PACKET_PROTOCOL", "https://")
SERVER_NAME = environ.get("PACKET_SERVER_NAME", IP + ":" + PORT)
SECRET_KEY = environ.get("PACKET_SECRET_KEY", "PLEASE_REPLACE_ME")

Expand All @@ -31,5 +32,23 @@
LDAP_BIND_DN = environ.get("PACKET_LDAP_BIND_DN", None)
LDAP_BIND_PASS = environ.get("PACKET_LDAP_BIND_PASS", None)

# Mail Config
MAIL_PROD = strtobool(environ.get("PACKET_MAIL_PROD", "False"))
MAIL_SERVER = environ.get("PACKET_MAIL_SERVER", "thoth.csh.rit.edu")
MAIL_USERNAME = environ.get("PACKET_MAIL_USERNAME", "[email protected]")
MAIL_PASSWORD = environ.get("PACKET_MAIL_PASSWORD", None)
MAIL_USE_TLS = strtobool(environ.get("PACKET_MAIL_TLS", "True"))

# OneSignal Config
ONESIGNAL_USER_AUTH_KEY = environ.get("PACKET_ONESIGNAL_USER_AUTH_KEY", None)
ONESIGNAL_CSH_APP_AUTH_KEY = environ.get("PACKET_ONESIGNAL_CSH_APP_AUTH_KEY", None)
ONESIGNAL_CSH_APP_ID = environ.get("PACKET_ONESIGNAL_CSH_APP_ID", "6eff123a-0852-4027-804e-723044756f00")
ONESIGNAL_INTRO_APP_AUTH_KEY = environ.get("PACKET_ONESIGNAL_INTRO_APP_AUTH_KEY", None)
ONESIGNAL_INTRO_APP_ID = environ.get("PACKET_ONESIGNAL_INTRO_APP_ID", "6eff123a-0852-4027-804e-723044756f00")

# Slack URL for pushing to #general
SLACK_WEBHOOK_URL = environ.get("PACKET_SLACK_URL", None)

# Packet Config
PACKET_UPPER = environ.get("PACKET_UPPER", "packet.csh.rit.edu")
PACKET_INTRO = environ.get("PACKET_INTRO", "freshmen-packet.csh.rit.edu")
6 changes: 6 additions & 0 deletions frontend/scss/components/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ button {
&.signed-button {
float: right;
}

@media screen and (min-width: 992px) {
&.report-button {
margin-top: 0.5rem !important;
}
}
}
11 changes: 4 additions & 7 deletions gulpfile.js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
when you run `gulp`.
*/

var requireDir = require('require-dir');
var gulp = require('gulp');
const requireDir = require('require-dir');
const gulp = require('gulp');

// Require all tasks in gulpfile.js/tasks, including subfolders
requireDir('./tasks', {recurse: true});

// CSS
gulp.task('css', ['sass:compile', 'css:minify']);

// Default task
gulp.task('default', ['css']);
gulp.task('production', ['css', 'generate-favicon', 'pylint']);
gulp.task('default', gulp.parallel('css', 'js'));
gulp.task('production', gulp.parallel('css', 'js', 'generate-favicon', 'pylint'));
132 changes: 66 additions & 66 deletions gulpfile.js/tasks/favicon.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
var gulp = require('gulp');
var realFavicon = require ('gulp-real-favicon');
var fs = require('fs');
const gulp = require('gulp');
const realFavicon = require('gulp-real-favicon');
const fs = require('fs');

// File where the favicon markups are stored
var FAVICON_DATA_FILE = 'faviconData.json';
const FAVICON_DATA_FILE = 'faviconData.json';

// Generate the icons. This task takes a few seconds to complete.
// You should run it at least once to create the icons. Then,
// you should run it whenever RealFaviconGenerator updates its
// package (see the check-for-favicon-update task below).
gulp.task('generate-favicon', function(done) {
realFavicon.generateFavicon({
masterPicture: 'packet/static/assets/logo.svg',
dest: 'packet/static',
iconsPath: '/',
design: {
ios: {
pictureAspect: 'backgroundAndMargin',
backgroundColor: '#ffffff',
margin: '35%',
assets: {
ios6AndPriorIcons: false,
ios7AndLaterIcons: false,
precomposedIcons: false,
declareOnlyDefaultIcon: true
}
},
desktopBrowser: {},
windows: {
pictureAspect: 'whiteSilhouette',
backgroundColor: '#b0197e',
onConflict: 'override',
assets: {
windows80Ie10Tile: true,
windows10Ie11EdgeTiles: {
small: true,
medium: true,
big: true,
rectangle: true
}
}
},
androidChrome: {
pictureAspect: 'noChange',
themeColor: '#b0197e',
manifest: {
display: 'standalone',
orientation: 'notSet',
onConflict: 'override',
declared: true
},
assets: {
legacyIcon: false,
lowResolutionIcons: false
}
},
safariPinnedTab: {
pictureAspect: 'silhouette',
themeColor: '#b0197e'
}
},
settings: {
scalingAlgorithm: 'Mitchell',
errorOnImageTooSmall: false,
readmeFile: false,
htmlCodeFile: false,
usePathAsIs: false
},
markupFile: FAVICON_DATA_FILE
}, function() {
done();
});
gulp.task('generate-favicon', (done) => {
realFavicon.generateFavicon({
masterPicture: 'packet/static/assets/logo.svg',
dest: 'packet/static',
iconsPath: '/',
design: {
ios: {
pictureAspect: 'backgroundAndMargin',
backgroundColor: '#ffffff',
margin: '35%',
assets: {
ios6AndPriorIcons: false,
ios7AndLaterIcons: false,
precomposedIcons: false,
declareOnlyDefaultIcon: true
}
},
desktopBrowser: {},
windows: {
pictureAspect: 'whiteSilhouette',
backgroundColor: '#b0197e',
onConflict: 'override',
assets: {
windows80Ie10Tile: true,
windows10Ie11EdgeTiles: {
small: true,
medium: true,
big: true,
rectangle: true
}
}
},
androidChrome: {
pictureAspect: 'noChange',
themeColor: '#b0197e',
manifest: {
display: 'standalone',
orientation: 'notSet',
onConflict: 'override',
declared: true
},
assets: {
legacyIcon: false,
lowResolutionIcons: false
}
},
safariPinnedTab: {
pictureAspect: 'silhouette',
themeColor: '#b0197e'
}
},
settings: {
scalingAlgorithm: 'Mitchell',
errorOnImageTooSmall: false,
readmeFile: false,
htmlCodeFile: false,
usePathAsIs: false
},
markupFile: FAVICON_DATA_FILE
}, function () {
done();
});
});
21 changes: 21 additions & 0 deletions gulpfile.js/tasks/javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const gulp = require('gulp');
const minify = require('gulp-minify');

gulp.task('js:minify', (done) => {
gulp.src([
'packet/static/js/*.js',
'!packet/static/js/*.min.js'
])
.pipe(minify({
ext: {
src: '.js',
min: '.min.js'
},
ignoreFiles: ['.min.js']
}))
.pipe(gulp.dest('packet/static/js'));
done();
});

// JS
gulp.task('js', gulp.series('js:minify'));
16 changes: 0 additions & 16 deletions gulpfile.js/tasks/minify.js

This file was deleted.

8 changes: 4 additions & 4 deletions gulpfile.js/tasks/pylint.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var gulp = require('gulp');
var exec = require('child_process').exec;
const gulp = require('gulp');
const exec = require('child_process').exec;

var pylintTask = function (cb) {
let pylintTask = (cb) => {
exec('pylint packet', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
}
};

gulp.task('pylint', pylintTask);
11 changes: 0 additions & 11 deletions gulpfile.js/tasks/sass.js

This file was deleted.

29 changes: 29 additions & 0 deletions gulpfile.js/tasks/stylesheets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const gulp = require('gulp');
const sass = require('gulp-sass');
const cleanCSS = require('gulp-clean-css');
const rename = require("gulp-rename");

// Compile SCSS
gulp.task('sass:compile', () => {
return gulp.src('frontend/scss/**/*.scss')
.pipe(sass.sync({
outputStyle: 'expanded'
}).on('error', sass.logError))
.pipe(gulp.dest('packet/static/css'))
});

// Minify CSS
gulp.task('css:minify', () => {
return gulp.src([
'packet/static/css/*.css',
'!packet/static/css/*.min.css'
])
.pipe(cleanCSS())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('packet/static/css'));
});

// CSS
gulp.task('css', gulp.series('sass:compile', 'css:minify'));
35 changes: 35 additions & 0 deletions migrations/versions/53768f0a4850_notifications.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""notifications

Revision ID: 53768f0a4850
Revises: eecf30892d0e
Create Date: 2019-08-06 22:15:04.400982

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '53768f0a4850'
down_revision = 'eecf30892d0e'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('notification_subscriptions',
sa.Column('member', sa.String(length=36), nullable=True),
sa.Column('freshman_username', sa.String(length=10), nullable=True),
sa.Column('token', sa.String(length=256), nullable=False),
sa.ForeignKeyConstraint(['freshman_username'], ['freshman.rit_username'], ),
sa.PrimaryKeyConstraint('token')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('notification_subscriptions')
# ### end Alembic commands ###

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "CSH Packet",
"name": "csh-packet",
"version": "3.2",
"version": "3.3.0",
"description": "A web app implementation of the CSH introductory packet.",
"bugs": {
"url": "https://github.com/ComputerScienceHouse/packet/issues",
Expand All @@ -17,11 +17,12 @@
"url": "https://github.com/ComputerScienceHouse/packet.git"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-clean-css": "^3.9.2",
"gulp-real-favicon": "^0.2.2",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.1.0",
"require-dir": "^1.0.0"
"gulp": "^4.0.2",
"gulp-clean-css": "^4.2.0",
"gulp-real-favicon": "^0.3.2",
"gulp-rename": "^1.4.0",
"gulp-sass": "^4.0.2",
"gulp-minify": "^3.1.0",
"require-dir": "^1.2.0"
}
}
Loading