Patching albums for installations which serve files through a different domain (experimental).
This commit is contained in:
Bobby Wibowo 2018-02-07 13:45:18 +07:00
parent efbaa24b30
commit 62f142a046
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 15 additions and 8 deletions

View File

@ -27,6 +27,12 @@ module.exports = {
serveFilesWithNode: false,
domain: 'https://lolisafe.moe',
/*
If you are serving your files with a different domain than your lolisafe homepage,
then fill this option with your lolisafe homepage, otherwise leave it null (or other falsy value).
*/
albumDomain: null,
// Port on which to run the server
port: 9999,

View File

@ -8,6 +8,7 @@ const Zip = require('jszip')
const albumsController = {}
albumsController.list = async (req, res, next) => {
const albumDomain = config.albumDomain || config.domain
const user = await utils.authorize(req, res)
const fields = ['id', 'name']
@ -26,7 +27,7 @@ albumsController.list = async (req, res, next) => {
album.date = new Date(album.timestamp * 1000)
album.date = utils.getPrettyDate(album.date)
album.identifier = `${config.domain}/a/${album.identifier}`
album.identifier = `${albumDomain}/a/${album.identifier}`
ids.push(album.id)
}

View File

@ -10,13 +10,13 @@
<title>{{ title }}</title>
<!-- Stylesheets and scripts -->
<link rel="stylesheet" type="text/css" href="libs/bulma/bulma.min.css">
<link rel="stylesheet" type="text/css" href="libs/sweetalert/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="libs/dropzone/dropzone.min.js"></script>
<script type="text/javascript" src="libs/axios/axios.min.js"></script>
<script type="text/javascript" src="js/home.js"></script>
<link rel="stylesheet" type="text/css" href="../libs/bulma/bulma.min.css">
<link rel="stylesheet" type="text/css" href="../libs/sweetalert/sweetalert.min.css">
<link rel="stylesheet" type="text/css" href="../css/style.css">
<script type="text/javascript" src="../libs/sweetalert/sweetalert.min.js"></script>
<script type="text/javascript" src="../libs/dropzone/dropzone.min.js"></script>
<script type="text/javascript" src="../libs/axios/axios.min.js"></script>
<script type="text/javascript" src="../js/home.js"></script>
<!-- Open Graph tags -->
<meta property="og:type" content="website" />