...
 
Commits (7)
......@@ -10,7 +10,7 @@ BASE_URL=http://localhost
FRONTEND_BASE_URL=http://localhost
# URL (or root path) of the backend API
REACT_APP_GRAPHQL_ENDPOINT=/api/graphql
# URL for websockets
# URL for websockets
REACT_APP_PHOENIX_SOCKET_ENDPOINT=ws://localhost/api/socket
# cc public activities to the mothership for indexing
CONNECT_WITH_MOTHERSHIP=false
......@@ -33,4 +33,9 @@ PORT=4000
ACME_AGREE=true
LANG=en_US.UTF-8
REPLACE_OS_VARS=true
CI=false
\ No newline at end of file
CI=false
SECRET_KEY_BASE="generate-a-random-secure-string-here"
MAIL_DOMAIN=
MAIL_KEY=
POSTGRES_PASSWORD=generate-secure-password-here
REACT_APP_MOTHERSHIP_API_KEY=
SECRET_KEY_BASE="generate-a-random-secure-string-here"
MAIL_DOMAIN=
MAIL_KEY=
POSTGRES_PASSWORD=generate-secure-password-here
REACT_APP_MOTHERSHIP_API_KEY=
......@@ -37,10 +37,7 @@ yarn.lock
## env
.env*
.env.local
.env.development.local
.env.test.local
.env.production.local
!.env*.example
# sentry
sentry.tsx
......
......@@ -3,8 +3,8 @@ FROM node:alpine as build-stage
WORKDIR /app
#RUN apk add --update py-pip && pip install -U pip && pip install transifex-client
# optimise layer caching:
COPY package*.json ./
COPY yarn.lock ./
COPY package*.json ./
COPY yarn.lock ./
RUN yarn
COPY . .
# RUN yarn add-locale en_GB
......@@ -16,4 +16,3 @@ RUN yarn build --prod
FROM caddy:alpine as production-stage
COPY --from=build-stage /app/build /frontend
EXPOSE 80
EXPOSE 443
This diff is collapsed.
......@@ -2,30 +2,31 @@ version: '3.5'
services:
backend:
#image: "moodlenet/moodlenet:stable" # use stable/production/master release of backend
image: "moodlenet/moodlenet:latest" # uncomment to use unstable/staging/develop backend branch
image: "moodlenet/moodlenet:stable" # use stable/production/master release of backend
# image: "moodlenet/moodlenet:latest" # uncomment to use unstable/staging/develop backend branch
# You can also build your own backend image from the source or deploy in other ways, see further docs at https://gitlab.com/moodlenet/servers/federated/blob/develop/DEPLOY.md
ports:
- "4000:4000"
- "81:80"
env_file:
- .env
- .env.secrets
depends_on:
- db
volumes:
- type: bind
source: ./uploads
target: /var/www/uploads
networks:
- internal_network
- external_network
frontend:
build:
context: .
# dockerfile: "Dockerfile"
ports:
- "80:80"
- "443:443"
build: ./
env_file:
- .env
depends_on:
- backend
networks:
external_network:
aliases:
- moodlenet-frontend
internal_network:
volumes:
- type: bind
source: ./Caddyfile2
......@@ -36,13 +37,28 @@ services:
target: /frontend/uploads
db:
image: postgres:9.6-alpine
networks:
- internal_network
# - external_network
volumes:
- postgres_data:/var/lib/postgresql/data
# ports:
# - "5432:5432"
ports:
- "5432:5432"
env_file:
- .env
- .env.secrets
# adminer:
# image: adminer
# restart: always
# ports:
# - 8080:8080
volumes:
postgres_data:
networks:
external_network:
external:
name: nginx-agora
internal_network:
internal: true
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name learn.noeldemartin.social;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name learn.noeldemartin.social;
access_log off;
ssl_protocols TLSv1.2;
ssl_ciphers EECDH+AESGCM:EECDH+AES;
ssl_ecdh_curve prime256v1;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_certificate /etc/letsencrypt/live/learn.noeldemartin.social/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/learn.noeldemartin.social/privkey.pem;
keepalive_timeout 70;
sendfile on;
client_max_body_size 0;
gzip off;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://moodlenet-frontend;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
tcp_nodelay on;
}
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name learn.noeldemartin.test;
access_log off;
keepalive_timeout 70;
sendfile on;
client_max_body_size 0;
gzip off;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://moodlenet-frontend;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
tcp_nodelay on;
}
}
......@@ -7,7 +7,6 @@
"build": "lingui extract --clean ; lingui compile ; cross-env NODE_ENV=production node scripts/build.js",
"build-as-is": "cross-env NODE_ENV=production node scripts/build.js",
"preinstall": "npx use-yarn",
"precommit": "lint-staged",
"add-locale": "lingui add-locale",
"extract": "lingui extract --clean",
"compile": "lingui compile",
......
......@@ -7,10 +7,6 @@
<meta name="theme-color" content="#FF7500">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<script src="https://browser.sentry-cdn.com/5.9.0/bundle.min.js" integrity="sha384-hMcetfUA+TR8vwXLe2PQTtnfYMs/1BMpXcmNGMNVjzbdKcd5mQ50kU6EC1fPHHq7" crossorigin="anonymous">
</script>
<!-- or include the full Algolia theme -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/algolia-min.css" integrity="sha256-HB49n/BZjuqiCtQQf49OdZn63XuKFaxcIHWf0HNKte8=" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
<title>MoodleNet</title>
</head>
......@@ -18,7 +14,7 @@
<body>
<noscript>
<h1>MoodleNet</h1>
<p><em>Please enable JavaScript or try another browser to run this app.</em></p>
</noscript>
<div id="root"></div>
......@@ -26,24 +22,12 @@
<script type="text/javascript">
const locale = localStorage.getItem("locale") || 'en_GB';
const [language] = locale.split('_');
window.doorbellOptions = {
"id": "10690",
"appKey": "ObfmzIS8cairiG2UI0CnQEPDhYMWme7cHvbo8TJgBWTiducnxAtaKfFmN6lwOWN2",
"language": language,
};
const dir = language === 'ar' ? 'rtl' : 'ltr';
const htmlEl = document.querySelector('html');
htmlEl.style.direction = dir;
htmlEl.classList.remove('--rtl', '--ltr');
htmlEl.classList.add('--' + dir);
</script>
</body>
<script type="text/javascript">
window.addEventListener('load', function() {
Sentry.init({ dsn: 'https://[email protected]/1825990' });
})
</script>
</html>
\ No newline at end of file
</html>
#!/usr/bin/env bash
if [[ -z $RIREKI_BACKUP_PATH ]]; then
echo "This script should only be called by rireki!"
exit;
fi
# abort on errors
set -e
# move to project directory and generate backup artifacts
cd "$( dirname "${BASH_SOURCE[0]}" )/../"
# backup database
docker-compose exec db pg_dump --username="postgres" moodle_net > $RIREKI_BACKUP_PATH/database.backup
# backup uploads
frontendcontainer=`docker-compose ps frontend | sed -n "3p" | sed "s/ .*//"`
docker cp $frontendcontainer:/frontend/uploads $RIREKI_BACKUP_PATH/uploads
cd $RIREKI_BACKUP_PATH/uploads
tar -czf ../uploads.tar.gz *
cd ../
rm ./uploads -rf
......@@ -12,7 +12,7 @@ import { LoginPageRoute } from 'routes/LoginPageRoute';
import { ResetPasswordPageRoute } from 'routes/ResetPasswordPageRoute';
import { SearchPageRoute } from 'routes/SearchPageRoute';
import { SettingsPageRoute } from 'routes/SettingsPageRoute';
import { SignupPageRoute } from 'routes/SignupPageRoute';
// import { SignupPageRoute } from 'routes/SignupPageRoute';
import { ThreadPageRoute } from 'routes/ThreadPageRoute';
import { UserPageRoute } from 'routes/UserPageRoute';
import { NotFound } from 'ui/pages/notFound';
......@@ -33,7 +33,7 @@ export const Router: React.FC = () => {
<Route {...CreateNewPasswordPageRoute} />
<Route {...ResetPasswordPageRoute} />
<Route {...LoginPageRoute} />
<Route {...SignupPageRoute} />
{/* <Route {...SignupPageRoute} /> */}
<Route {...ConfirmEmailRoute} />
<Route {...TermsAndConditionsPageRoute} />
<Route {...LMSMoodleSearchRoute} />
......
......@@ -10,7 +10,7 @@ export const DEFAULT_PAGE_SIZE =
export const APP_NAME = 'MoodleNet';
export const INSTANCE_DESCRIPTION =
process.env.INSTANCE_DESCRIPTION ||
'This general-purpose instance of MoodleNet is run by Moodle HQ and is part of the wider network.';
'MoodleNet Instance-of-one run by Noel De Martin.';
export const INVITE_ONLY_TEXT =
process.env.REACT_APP_INVITE_ONLY_TEXT ||
'Please note, signups on this instance are currently invite-only.';
......@@ -20,11 +20,11 @@ export const INSTANCE_PROMPT =
export const prompt_signin = 'Sign in';
export const my_timeline = 'My MoodleNet';
export const instance_bg_img =
'https://gitlab.com/moodlenet/frontend/-/raw/develop/src/static/img/background.jpg';
process.env.PUBLIC_URL + '/img/background.jpg';
export const logo_large_url =
'https://moodle.net/images/logos/moodlenet-logo.png';
process.env.PUBLIC_URL + '/img/moodlenet-logo.png';
export const logo_small_url =
'https://gitlab.com/moodlenet/frontend/-/raw/develop/src/static/img/logo.jpg';
process.env.PUBLIC_URL + '/img/logo.jpg';
export const terms_markdown_text = {
// replace the text as needed
......
......@@ -98,7 +98,7 @@ export const Login: React.FC<Props> = ({ formik }) => {
</Browse>
</FormWrapper>
<Right>
<Link to="signup">
{/* <Link to="signup">
<Button
mb={2}
style={{ width: '100%', height: '50px' }}
......@@ -107,7 +107,7 @@ export const Login: React.FC<Props> = ({ formik }) => {
>
<Trans>Sign up</Trans>
</Button>
</Link>
</Link> */}
<WrapperPanel className="extra">
<Panel>
<Background />
......