Skip to content

Commit

Permalink
curl now works, but "No file received"???
Browse files Browse the repository at this point in the history
  • Loading branch information
RichtXO committed Mar 21, 2022
1 parent 2b9bc9e commit 2ff78f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version: "3.4"
# web -> api -> db [dependency chain]

services:

yacs_web:
ports:
- 80:8080
Expand Down Expand Up @@ -37,7 +38,7 @@ services:
- PROXY_CACHE_VALID=200=1s
# ===== HTTPS config =====
- AUTO_LETS_ENCRYPT=${AUTO_LE:-no}
- GENERATE_SELF_SIGNED_SSL=${SELF_CERT:-no}
- GENERATE_SELF_SIGNED_SSL=${SELF_CERT:-yes}
- REDIRECT_HTTP_TO_HTTPS=yes
# ===== ModSecurity =====
- USE_MODSECURITY=no
Expand Down Expand Up @@ -85,5 +86,3 @@ services:
build:
context: ./rpi_data
dockerfile: Dockerfile
depends_on:
- yacs_web
12 changes: 7 additions & 5 deletions rpi_data/automate-semesters.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spring() {
SOURCE_URL=${source_url} DEST=p0.csv HEADERS=True python3 ./modules/rpi-parse.py
cat p* > spring-${year}.csv
rm -rf p*.csv
curl -X POST -H "Content-Type: multipart/form-data" -F "isPubliclyVisible=on" -F "file=spring-${year}" -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" $API_ENDPOINT
curl --insecure -X POST -H "Content-Type: multipart/form-data" -F "isPubliclyVisible=on" -F "file=spring-${year}" -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" -k $API_ENDPOINT
else
echo "The requested Spring SIS page returned error 404." >&2
fi
Expand All @@ -34,7 +34,7 @@ summer() {
SOURCE_URL=${source_url_c} HEADERS=False DEST=p2.csv python3 ./modules/rpi-parse.py
cat p* > summer-${year}.csv
rm -rf p*.csv
curl -X POST -H "Content-Type: multipart/form-data" -F "isPubliclyVisible=on" -F "file=summer-${year}" -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" $API_ENDPOINT
curl --insecure -X POST -H "Content-Type: multipart/form-data" -F "isPubliclyVisible=on" -F "file=summer-${year}" -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" $API_ENDPOINT
else
echo "A requested Summer SIS page returned error 404." >&2
fi
Expand All @@ -52,7 +52,7 @@ fall() {
SOURCE_URL=${source_url} DEST=p0.csv HEADERS=True python3 ./modules/rpi-parse.py
cat p* > fall-${year}.csv
rm -rf p*.csv
curl -X POST -H "Content-Type: multipart/form-data" -F "isPubliclyVisible=on" -F "file=fall-${year}" -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" $API_ENDPOINT
curl --insecure -X POST -H "Content-Type: multipart/form-data" -F "isPubliclyVisible=on" -F "file=fall-${year}" -A "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0" $API_ENDPOINT
else
echo "A requested Fall SIS page returned error 404." >&2
fi
Expand All @@ -61,7 +61,7 @@ fall() {

MONTH=$(date +%m)
YEAR=$(date +%Y)
API_ENDPOINT=https://yacs_web/api/bulkCourseUpload
API_ENDPOINT=https://yacs_web:8443/api/bulkCourseUpload
if [[ ${MONTH} -ge 1 && ${MONTH} -lt 5 ]]
then
spring ${YEAR}
Expand All @@ -78,4 +78,6 @@ if [[ ${MONTH} -ge 9 && ${MONTH} -le 12 ]]
then
fall ${YEAR}
spring ${YEAR}
fi
fi

rm *.csv

0 comments on commit 2ff78f0

Please sign in to comment.