project specific static resources
This commit is contained in:
parent
d54b8317c9
commit
01d8715c2f
@ -5,7 +5,7 @@ from music.model.config import Config
|
|||||||
from music.auth.jwt_keys import generate_key
|
from music.auth.jwt_keys import generate_key
|
||||||
from music.api.decorators import no_cache
|
from music.api.decorators import no_cache
|
||||||
from music.notif.notifier import notify_admin_new_user
|
from music.notif.notifier import notify_admin_new_user
|
||||||
from music.magic_strings import SPOT_CLIENT_URI, SPOT_SECRET_URI
|
from music.magic_strings import SPOT_CLIENT_URI, SPOT_SECRET_URI, STATIC_BUCKET
|
||||||
|
|
||||||
from urllib.parse import urlencode, urlunparse
|
from urllib.parse import urlencode, urlunparse
|
||||||
import datetime
|
import datetime
|
||||||
@ -135,7 +135,7 @@ def register():
|
|||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
return render_template('register.html')
|
return render_template('register.html', bucket=STATIC_BUCKET)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
api_user = False
|
api_user = False
|
||||||
|
@ -7,3 +7,5 @@ LASTFM_CLIENT_URI = f"projects/{project_id}/secrets/lastfm-client/versions/lates
|
|||||||
JWT_SECRET_URI = f"projects/{project_id}/secrets/jwt-secret/versions/latest"
|
JWT_SECRET_URI = f"projects/{project_id}/secrets/jwt-secret/versions/latest"
|
||||||
COOKIE_SECRET_URI = f"projects/{project_id}/secrets/cookie-secret/versions/latest"
|
COOKIE_SECRET_URI = f"projects/{project_id}/secrets/cookie-secret/versions/latest"
|
||||||
APNS_SIGN_URI = f"projects/{project_id}/secrets/apns-auth-sign-key/versions/1"
|
APNS_SIGN_URI = f"projects/{project_id}/secrets/apns-auth-sign-key/versions/1"
|
||||||
|
|
||||||
|
STATIC_BUCKET = f'{project_id}-static'
|
@ -7,7 +7,7 @@ import os
|
|||||||
from music.auth import auth_blueprint
|
from music.auth import auth_blueprint
|
||||||
from music.api import api_blueprint, player_blueprint, fm_blueprint, \
|
from music.api import api_blueprint, player_blueprint, fm_blueprint, \
|
||||||
spotfm_blueprint, spotify_blueprint, admin_blueprint, tag_blueprint
|
spotfm_blueprint, spotify_blueprint, admin_blueprint, tag_blueprint
|
||||||
from music.magic_strings import COOKIE_SECRET_URI
|
from music.magic_strings import COOKIE_SECRET_URI, STATIC_BUCKET
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
secret_client = secretmanager.SecretManagerServiceClient()
|
secret_client = secretmanager.SecretManagerServiceClient()
|
||||||
@ -42,11 +42,11 @@ def create_app():
|
|||||||
else:
|
else:
|
||||||
logged_in = False
|
logged_in = False
|
||||||
|
|
||||||
return render_template('login.html', logged_in=logged_in)
|
return render_template('login.html', logged_in=logged_in, bucket=STATIC_BUCKET)
|
||||||
|
|
||||||
@app.route('/privacy')
|
@app.route('/privacy')
|
||||||
def privacy():
|
def privacy():
|
||||||
return render_template('privacy.html')
|
return render_template('privacy.html', bucket=STATIC_BUCKET)
|
||||||
|
|
||||||
@app.route('/app', defaults={'path': ''})
|
@app.route('/app', defaults={'path': ''})
|
||||||
@app.route('/app/<path:path>')
|
@app.route('/app/<path:path>')
|
||||||
@ -56,7 +56,7 @@ def create_app():
|
|||||||
flash('please log in')
|
flash('please log in')
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
|
|
||||||
return render_template('app.html')
|
return render_template('app.html', bucket=STATIC_BUCKET)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Pirata+One|Lato" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Pirata+One|Lato" rel="stylesheet">
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://storage.googleapis.com/sarsooxyzstatic/apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://storage.googleapis.com/{{ bucket }}/apple-touch-icon.png">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="https://storage.googleapis.com/sarsooxyzstatic/favicon-32x32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="https://storage.googleapis.com/{{ bucket }}/favicon-32x32.png">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="https://storage.googleapis.com/sarsooxyzstatic/favicon-16x16.png">
|
<link rel="icon" type="image/png" sizes="16x16" href="https://storage.googleapis.com/{{ bucket }}/favicon-16x16.png">
|
||||||
<link rel="manifest" href="https://storage.googleapis.com/sarsooxyzstatic/site.webmanifest">
|
<link rel="manifest" href="https://storage.googleapis.com/{{ bucket }}/site.webmanifest">
|
||||||
<link rel="mask-icon" href="https://storage.googleapis.com/sarsooxyzstatic/safari-pinned-tab.svg" color="#5bbad5">
|
<link rel="mask-icon" href="https://storage.googleapis.com/{{ bucket }}/safari-pinned-tab.svg" color="#5bbad5">
|
||||||
<link rel="shortcut icon" href="https://storage.googleapis.com/sarsooxyzstatic/favicon.ico">
|
<link rel="shortcut icon" href="https://storage.googleapis.com/{{ bucket }}/favicon.ico">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<a href="https://sarsoo.xyz/about/" style="display: inline-block">
|
<a href="https://sarsoo.xyz/about/" style="display: inline-block">
|
||||||
<img src="https://storage.googleapis.com/sarsooxyzstatic/andy.png"
|
<img src="https://storage.googleapis.com/{{ bucket }}/andy.png"
|
||||||
alt="AP"
|
alt="AP"
|
||||||
width="120px"
|
width="120px"
|
||||||
style="display: block;
|
style="display: block;
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
<link href="https://fonts.googleapis.com/css?family=Pirata+One|Roboto" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Pirata+One|Roboto" rel="stylesheet">
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="https://storage.googleapis.com/sarsooxyzstatic/apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="https://storage.googleapis.com/{{ bucket }}/apple-touch-icon.png">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="https://storage.googleapis.com/sarsooxyzstatic/favicon-32x32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="https://storage.googleapis.com/{{ bucket }}/favicon-32x32.png">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="https://storage.googleapis.com/sarsooxyzstatic/favicon-16x16.png">
|
<link rel="icon" type="image/png" sizes="16x16" href="https://storage.googleapis.com/{{ bucket }}/favicon-16x16.png">
|
||||||
<link rel="manifest" href="https://storage.googleapis.com/sarsooxyzstatic/site.webmanifest">
|
<link rel="manifest" href="https://storage.googleapis.com/{{ bucket }}/site.webmanifest">
|
||||||
<link rel="mask-icon" href="https://storage.googleapis.com/sarsooxyzstatic/safari-pinned-tab.svg" color="#5bbad5">
|
<link rel="mask-icon" href="https://storage.googleapis.com/{{ bucket }}/safari-pinned-tab.svg" color="#5bbad5">
|
||||||
<link rel="shortcut icon" href="https://storage.googleapis.com/sarsooxyzstatic/favicon.ico">
|
<link rel="shortcut icon" href="https://storage.googleapis.com/{{ bucket }}/favicon.ico">
|
||||||
|
|
||||||
{% block scripts %}{% endblock %}
|
{% block scripts %}{% endblock %}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@
|
|||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<a href="https://sarsoo.xyz/about/" style="display: inline-block">
|
<a href="https://sarsoo.xyz/about/" style="display: inline-block">
|
||||||
<img src="https://storage.googleapis.com/sarsooxyzstatic/andy.png"
|
<img src="https://storage.googleapis.com/{{ bucket }}/andy.png"
|
||||||
alt="AP"
|
alt="AP"
|
||||||
width="120px"
|
width="120px"
|
||||||
style="display: block;
|
style="display: block;
|
||||||
|
Loading…
Reference in New Issue
Block a user