Skip to content

Commit

Permalink
Merge pull request #63 from DaneeSkripter/dev
Browse files Browse the repository at this point in the history
v1.10.0
  • Loading branch information
daneedev authored Sep 23, 2023
2 parents 96bc5fe + 718a12d commit d8a41ed
Show file tree
Hide file tree
Showing 45 changed files with 3,462 additions and 3,988 deletions.
9 changes: 0 additions & 9 deletions .env

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# Config file
config.json
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ DaneeCloud is website, you can upload and download your files, manage your uploa
- [How to switch language](https://docs.daneeskripter.dev/daneecloud/change-language)
- [I want to translate](https://crowdin.com/project/daneecloud)
### Translated languages
| 🏳️ Language | 🙋 Translator |
| ------------ | ------------- |
| 🇨🇿 Czech | DaneeSkripter |
| 🇯🇵 Japanese | Koichi MATSUMOTO |
| 🇪🇸 Spanish | chander1411 |
- *This is list of languages, that we want to translate, if there isn't your language and you want to translate DaneeCloud to it, create an issue.*

| 🏳️ Language | Translated? | 🙋 Translator |
| ------------ | ---------- | -------------- |
| 🇨🇿 Czech | ✅ 100% | [@daneeskripter](https://github.com/daneeskripter) |
| 🇫🇷 French | 0% | - |
| 🇩🇪 German | 0% | - |
| 🇯🇵 Japanese | ✅ 100% | [@mzch](https://github.com/mzch) |
| 🇳🇴 Norwegian | ✅ 100% | [@WiredDesigns](https://www.github.com/WiredDesigns) |
| 🇵🇱 Polish | 0% | - |
| 🇸🇰 Slovak | 0% | - |
| 🇪🇸 Spanish | ✅ 100% | [@chander1411](https://github.com/chander1411) |

## [🖼️ Addons & Themes](./addons.md)
- *to show list of addons & themes click the link above*
Expand Down
10 changes: 0 additions & 10 deletions config.json

This file was deleted.

Binary file modified img/daneecloudfavicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/daneecloudlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ app.use("/delapikey/", require("./routes/api").delkey)
app.use("/files/", require("./routes/files"))

app.use('/favicon.ico', express.static( __dirname + "/img/daneecloudfavicon.png"));

app.use("/background", express.static( __dirname + "/img/background.png"));

app.use("/files/", AuthLimiter, checkAuth, checkVerify, express.static(__dirname + "/uploads/"))
app.set("view-engine", "ejs")
Expand Down Expand Up @@ -209,7 +209,7 @@ app.use("/folder/", require("./routes/filemgr").showfolder)
// 404 PAGE

app.get("/*", async function (req, res) {
res.render(__dirname + "/views/message.ejs", {message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error404"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/views/message.ejs", {message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error404"]}`, cloudname: config.cloudname, lang: lang})
})

// CHECK IF DEFAULT ROLES ARE IN DB
Expand Down
122 changes: 122 additions & 0 deletions lang/no.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"Add-Api-Key": "Legg til API Nøkkel",
"API-Key-Name": "API Nøkkelnavn",
"Add-Role": "Legg til rolle",
"Role-Name": "Rollenavn",
"Amount-Of-Storage": "Mengde lagring (i MB)",
"Badge-URL": "URL til merket(Ikke nødvendig)",
"Add-Subtitles": "Legg til undertekster",
"Add-Subtitles-For": "Legg til undertekster for",
"Subtitles-Name": "Underteksters navn",
"Subtitles-URL": "Underteksters URL",
"Works-Only-With": "Fungerer bare med .vtt",
"Want-Subtitles": "Vil du ha undertekster fra en fil?",
"Admin-Panel": "Admin panel",
"Stats": "Statistikk",
"Name": "Navn",
"Value": "Verdi",
"Ram-Usage": "Rambruk",
"CPU-Usage": "CPUbruk",
"Uptime": "Opptid",
"Version": "Versjon",
"Is-Available": "er tilgjengelig",
"User-Managment": "Brukeradministrasjon",
"Search-Username": "Søk\u2008for\u2008brukernavn",
"Profile-Picture": "Profilbilde",
"Username": "Konto brukernavn",
"Email": "Konto e-post",
"Is-Verified": "Er verifisert?",
"IP": "IP adresse",
"Created-At": "Opprettet kl",
"Last-Seen": "Sist sett",
"Role": "Rolle",
"Actions": "Handlinger",
"Yes": "Ja",
"No": "Nei",
"Roles": "Roller",
"Remove-Role": "Fjern rolle",
"Update-Role": "Oppdater rolle",
"API-Keys": "API Nøkler",
"Back": "Tilbake til hjemmesiden",
"Upload-And-Download": "Last opp & Nedlast filene dine!",
"Deletion-Confirm": "Er du sikker på at du vil slette kontoen din? (Dette er en INGEN-VEI-TILBAKE handling)",
"Delete-Role": "Slett rolle",
"Edit-Account": "Rediger konto",
"Edit": "Rediger",
"New-Account": "Nytt konto navn",
"New-Email": "Ny konto e-post",
"Pfp-Powered-By": "Profilbilder er drevet av Gravatar",
"Change-Role": "Endre rolle",
"Change-Role-For": "Endre rolle for",
"Log-Out": "Logg ut",
"My-Files": "Mine Filer",
"My-Profile": "Min profil",
"Welcome": "Velkommen",
"Upload": "Last opp filen din",
"Log-In": "Logg inn",
"Username2": "Brukernavn",
"Password": "Passord",
"noaccount": "Har du ikke en konto?",
"Search-For-File": "Search\u2008for\u2008file\u2008name",
"Preview": "Forhåndsvisning",
"File-Name": "Filnavn",
"Is-Shared": "Er delt?",
"Size": "Størrelse",
"Created-On": "Opprettet den",
"Not-Supported": "Ikke støttet",
"Delete-Account": "Slett konto",
"Register": "Registrer deg",
"Email2": "E-post",
"Rename": "Gi nytt navn",
"New-Name": "Nytt navn",
"Verify": "Verifiser",
"Send-Verify": "Send bekreftelses e-post til",
"Send-Verify2": "Send bekreftelse e-posten",
"Have-Code": "Har en kode allerede?",
"Verify-Code": "Bekreftelse kode",
"Write-Code": "Skriv koden fra e-posten",
"Account-Updated": "Din konto har blitt oppdatert!",
"Account-Deleted": "Din konto har blitt slettet!",
"Error401": "Feil 401 - Uautorisert",
"Account-Not-Found": "Konto ikke funnet",
"Account-Deleted2": "Konto ${account} har blitt slettet.",
"Account-Renamed": "Konto ${account} med ${findusertorename.email} e-post har fått nytt navn til ${newaccountname} med ${newaccountemail} e-post",
"API-Key-Exist": "Feil 409 - API-nøkkel finnes allerede",
"API-Key-Generated": "API-nøkkel med navn ${apiKeyName} ble generert: ${apiKey.toString()} (!! ADVARSEL: DU VIL IKKE SE DENNE NØKKELEN IGJEN!!)",
"API-Key-Not-Found": "Feil 404 - API-nøkkel ble ikke funnet",
"API-Key-Deleted": "API-nøkkel med navn ${apiKeyName} ble slettet!",
"File-Not-Found": "Filen ${file} ble ikke funnet!",
"Account-Verified": "Kontoen din har blitt bekreftet!",
"File-Renamed": "Filen ${oldname} har fått nytt navn til ${newname}",
"Error404": "Feil 404 - Siden ble ikke funnet!",
"Reg-Disabled": "Beklager, registrering er deaktivert.",
"Pass-8-Characters": "Passordet må inneholde minst 8 tegn.",
"Username-Exist": "Bruker med dette brukernavnet eksisterer allerede!",
"Email-Exist": "Bruker med denne e-postadressen eksisterer allerede!",
"IP-Exist": "Bruker med denne IP-adressen eksisterer allerede!",
"Role-Updated": "Rolle ${role} har blitt oppdatert med maksimal lagringsplass ${maxStorage} MB",
"Role-Added": "Rolle ${req.body.role} (${req.body.storage} MB) lagt til!",
"Del-Admin": "Du kan ikke slette administratorrollen!",
"Del-User": "You can't delete user role!",
"Role-Deleted": "Rollen ${req.body.role} er slettet!",
"Role-Changed": "${req.params.username}'s rolle har blitt skiftet til ${req.body.role}!",
"Username-Not-Exist": "Ingen bruker finnes med dette brukernavnet!",
"No-Shared-File": "Ingen delt fil funnet!",
"File-Already-Shared": "Denne filen er allerede delt!",
"File-Shared": "Filen ${file} har blitt satt som delt!",
"File-Not-Shared": "Filen ${file} er ikke delt!",
"Disabled-Shared": "Filen ${file} har blitt satt som ikke delt!",
"File-Already-Exist": "Filen ${name} finnes allerede!",
"Limit-Reached": "Du har nådd lagringsgrensen din! Prøv å slette noen filer.",
"File-Uploaded": "Filen ${name} er lastet opp vellykket!",
"Have-Subtitles": "Denne filen har allerede undertekster",
"File-Not-Found2": "Filen ble ikke funnet",
"Subtitles-Added": "Undertekster ${req.body.name} vellykket lagt til på ${file}",
"Subtitles-Removed": "Undertekster er fjernet fra ${file}",
"No-Subtitles": "Denne filen har ingen undertekster",
"Create-Folder": "Opprett en mappe",
"Folder-Name": "Navn på mappen",
"Folder-Exist": "Mappen eksisterer allerede!",
"Folder-Created": "Mappen ${req.body.name} har blitt laget!",
"Folder-Not-Found": "Mappen ble ikke funnet!"
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "daneecloud",
"version": "1.9.1",
"version": "1.10.0",
"description": "Online filesystem",
"main": "index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions routes/accountmgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ router.post("/:username", checkAuth, checkVerify, async function (req, res) {
const newaccountemail = sanitize(req.body.newemail)
const updateuser = await users.findOneAndUpdate({username: user.username}, {username: newaccountname, email: newaccountemail})
logger.logInfo(`User ${user.username} updated his account`)
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_done</span>&nbsp;${lang["Account-Updated"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-check"></i>&nbsp;${lang["Account-Updated"]}`, cloudname: config.cloudname, lang: lang})
})

router2.get("/", checkAuth, checkVerify, function (req, res) {
Expand All @@ -33,7 +33,7 @@ router2.post("/", checkAuth, checkVerify, async function (req, res) {
const delaccount = await users.findOneAndRemove({ username: user.username})
fs.rmdirSync(__dirname + "/.." + config.uploadsfolder + `${user.username}/`)
logger.logInfo(`User ${user.username} has been deleted!`)
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_done</span>&nbsp;${lang["Account-Deleted"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-check"></i>&nbsp;${lang["Account-Deleted"]}`, cloudname: config.cloudname, lang: lang})
})

router3.get("/", checkAuth, checkVerify, async function (req, res) {
Expand Down
14 changes: 7 additions & 7 deletions routes/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ router.get("/", checkAuth, checkVerify, async function (req, res) {
})
})
} else {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
}
})

Expand All @@ -41,14 +41,14 @@ router2.get("/:account", checkAuth, checkVerify, async function (req, res) {
if (loggeduser.role == "admin") {
const findusertodelete = await users.findOne({username: account})
if (!findusertodelete) {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Account-Not-Found"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Account-Not-Found"]}`, cloudname: config.cloudname, lang: lang})
} else {
const usertodelete = await users.findOneAndRemove({ username: account})
fs.rmdirSync(__dirname + "/.." + config.uploadsfolder + `${account}/`)
res.render(__dirname + "/../views/message.ejs", {message: `<span class="material-icons">cloud_done</span>&nbsp;${lang["Account-Deleted2"].replace("${account}", account)}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", {message: `<i class="fa-solid fa-square-check"></i>&nbsp;${lang["Account-Deleted2"].replace("${account}", account)}`, cloudname: config.cloudname, lang: lang})
}
} else {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
logger.logInfo(`${req.user.username} deleted account ${account}!`)
}
})
Expand All @@ -67,15 +67,15 @@ router3.post("/:account", checkAuth, checkVerify, async function (req, res) {
if (loggeduser.role == "admin") {
const findusertorename = await users.findOne({username: account})
if (!findusertorename) {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Account-Not-Found"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Account-Not-Found"]}`, cloudname: config.cloudname, lang: lang})
} else {
const usertorename = await users.findOneAndUpdate({username: account}, {username: newaccountname, email: newaccountemail})
fs.renameSync(__dirname + config.uploadsfolder + `${account}/`, __dirname + config.uploadsfolder + `${newaccountname}/`)
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_done</span>&nbsp;${lang["Account-Renamed"].replace("${account}", account).replace("${findusertorename.email}", findusertorename.email).replace("${newaccountname}", newaccountname).replace("${newaccountemail}", newaccountemail)}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-check"></i>&nbsp;${lang["Account-Renamed"].replace("${account}", account).replace("${findusertorename.email}", findusertorename.email).replace("${newaccountname}", newaccountname).replace("${newaccountemail}", newaccountemail)}`, cloudname: config.cloudname, lang: lang})
logger.logInfo(`${account} with ${findusertorename.email} email has been renamed to ${newaccountname} with ${newaccountemail} email by ${req.user.username}`)
}
} else {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
}
})

Expand Down
14 changes: 7 additions & 7 deletions routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ router2.get("/", checkAuth, checkVerify, async function (req, res) {
if (user.role == "admin") {
res.render(__dirname + "/../views/addapikey.ejs", {cloudname: config.cloudname, csrfToken: req.csrfToken(), lang: lang})
} else {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
}
})

Expand All @@ -63,17 +63,17 @@ router2.post("/", checkAuth, checkVerify, async function (req, res) {
if (user.role == "admin") {
const findAPIKey = await apiKeys.findOne({ name: apiKeyName})
if (findAPIKey) {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["API-Key-Exist"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["API-Key-Exist"]}`, cloudname: config.cloudname, lang: lang})
} else {
const ApiKey = new apiKeys({
name: apiKeyName,
apiKey: apiKey.toString()
})
ApiKey.save()
res.render(__dirname + "/../views/message.ejs", {message: `<span class="material-icons">cloud_done</span>&nbsp;${lang["API-Key-Generated"].replace("${apiKeyName}", apiKeyName).replace("${apiKey.toString()}", apiKey.toString())}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", {message: `<i class="fa-solid fa-square-check"></i>&nbsp;${lang["API-Key-Generated"].replace("${apiKeyName}", apiKeyName).replace("${apiKey.toString()}", apiKey.toString())}`, cloudname: config.cloudname, lang: lang})
}
} else {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
}
})

Expand All @@ -85,13 +85,13 @@ router3.get("/:name", checkAuth, checkVerify, async function (req, res) {
const findApiKey = await apiKeys.findOne({name: apiKeyName})
if (user.role == "admin") {
if (!findApiKey) {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["API-Key-Not-Found"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["API-Key-Not-Found"]}`, cloudname: config.cloudname, lang: lang})
} else {
const deleteApiKey = await apiKeys.findOneAndRemove({ name: apiKeyName})
res.render(__dirname + "/../views/message.ejs", {message: `<span class="material-icons">cloud_done</span>&nbsp;${lang["API-Key-Deleted"].replace("${apiKeyName}", apiKeyName)}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", {message: `<i class="fa-solid fa-square-check"></i>&nbsp;${lang["API-Key-Deleted"].replace("${apiKeyName}", apiKeyName)}`, cloudname: config.cloudname, lang: lang})
}
} else {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
}
})

Expand Down
4 changes: 2 additions & 2 deletions routes/audioplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ router.get("/:username/:file", checkAuth, checkVerify, function (req, res) {
if (fs.readdirSync(__dirname + "/.." + config.uploadsfolder + `${sanitize(req.params.username)}/`).includes(file)) {
res.render(__dirname + "/../views/audio.ejs", {file: file, cloudname: config.cloudname, username: req.user.username, lang: lang})
} else {
res.render(__dirname + "/../views/message.ejs", {message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["File-Not-Found"].replace("${file}", file)}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", {message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["File-Not-Found"].replace("${file}", file)}`, cloudname: config.cloudname, lang: lang})
}
} else {
res.render(__dirname + "/../views/message.ejs", { message: `<span class="material-icons">cloud_off</span>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
res.render(__dirname + "/../views/message.ejs", { message: `<i class="fa-solid fa-square-xmark"></i>&nbsp;${lang["Error401"]}`, cloudname: config.cloudname, lang: lang})
}
})

Expand Down
Loading

0 comments on commit d8a41ed

Please sign in to comment.