Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore): version 0.14.3 #1758

Merged
merged 31 commits into from
Dec 31, 2023
Merged
Changes from 21 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
669d311
🚧 WIP on Docker import group
ajnart Nov 17, 2023
c88cd3c
🚧 WIP on docker import feature
ajnart Nov 20, 2023
9bdd6a4
Update acceptableStatusCodes.ts
jeffersonraimon Nov 25, 2023
cca8be0
Merge pull request #1709 from jeffersonraimon/patch-1
ajnart Nov 26, 2023
e2da833
🚧 WIP on adding docker containers to boards
ajnart Nov 26, 2023
48ca535
Add client side reload of the config with the newly added apps
ajnart Nov 26, 2023
deee511
Fix unused function and enable user count check in
ajnart Dec 2, 2023
fc38f7a
✨ #1616 Recovery script in Docker container (#1726)
manuel-rw Dec 4, 2023
d6af6af
🐛 About page and manage user pages not translated (#1724)
ajnart Dec 7, 2023
51e96c0
✨ Use gravatar with user email (#1688)
SeDemal Dec 7, 2023
2170201
feat: add filter and sorting functionality to torrents table
InterN0te Dec 7, 2023
976634a
⚡️ Improve code in manage layout page (#1681)
SeDemal Dec 7, 2023
199b711
Updated entityStateSchema to handle nullables (#1744)
gfomichev Dec 17, 2023
553fa98
✨ #1616 better user management (#1748)
manuel-rw Dec 20, 2023
fd3f8f3
config: update crowdin translations
ajnart Dec 22, 2023
b6b697c
fix: umlaute in RSS (#1755)
manuel-rw Dec 29, 2023
19e65e0
config: new crowdin updates
ajnart Dec 29, 2023
f9c9f23
Update overseerr.ts
ajnart Dec 29, 2023
f20c209
Address PR comments
ajnart Dec 29, 2023
e13a4af
feat: remove location based timezone resolving (#1680)
SeDemal Dec 30, 2023
082077e
feat: import to docker form board, docker button on boards (#1714)
ajnart Dec 30, 2023
e9100fc
Update FUNDING.yml (#1768)
ajnart Dec 30, 2023
0a929a9
config; stale action (#1752)
manuel-rw Dec 30, 2023
159ba4b
config: greetings (#1753)
manuel-rw Dec 30, 2023
b9a5b5e
chore: new Crowdin updates (#1770)
ajnart Dec 30, 2023
108803a
fix: outdated config schema (#1769)
manuel-rw Dec 30, 2023
a394843
chore: increase version in package.json (#1771)
manuel-rw Dec 30, 2023
c83b04d
Refactor Docker integration in board page
ajnart Dec 31, 2023
745adb3
Merge branch 'dev' into docker-onboarding-fix
ajnart Dec 31, 2023
eba4dd3
Merge pull request #1773 from ajnart/docker-onboarding-fix
ajnart Dec 31, 2023
a68f842
Update tests
ajnart Dec 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
open_collective: homarr
ko_fi: ajnart
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
16 changes: 16 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Hi 👋. Thank you for submitting your first issue to Homarr. Please ensure that you've provided all nessesary information. You can use the three dots > Edit button to update your post with additional images and information. Depending on the current volume of requests, the team should get in conact with you shortly."
pr-message: "Hi 👋. Thank you for making your first contribution to Homarr. Please ensure that you've completed all the points in the TODO checklist. We'll review your changes shortly."
28 changes: 28 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests

on:
schedule:
- cron: '18 17 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: "Hello 👋, this issue has been open for 60 without activity. Please close this issue if it's no longer relevant or has been resolved. Still relevant? Simply reply and I'll mark it as active."
stale-pr-message: 'Hello 👋, this PR has gone stale. Please reply to mark it as active.'
stale-issue-label: 'Stale'
stale-pr-label: 'Stale'
days-before-close: -1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
/cli/node_modules/

# testing
/coverage
@@ -49,6 +50,7 @@ data/configs
!.yarn/releases
!.yarn/sdks
!.yarn/versions
/cli/.yarn/

#envfiles
.env
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ COPY ./drizzle ./drizzle

COPY ./drizzle/migrate ./migrate
COPY ./tsconfig.json ./migrate/tsconfig.json
COPY ./cli ./cli

RUN mkdir /data

@@ -43,6 +44,10 @@ RUN mv node_modules ./migrate/node_modules
# Copy temp node_modules of app to app folder
RUN mv _node_modules node_modules

RUN echo '#!/bin/bash\nnode /app/cli/cli.js "$@"' > /usr/bin/homarr
RUN chmod +x /usr/bin/homarr
RUN cd /app/cli && yarn --immutable

# Expose the default application port
EXPOSE $PORT
ENV PORT=${PORT}
30 changes: 30 additions & 0 deletions cli/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import yargs from 'yargs';

import { resetPasswordForOwner } from './commands/reset-owner-password.js';
import { resetPasswordForUsername } from './commands/reset-password.js';

yargs(process.argv.slice(2))
.scriptName('homarr')
.usage('$0 <cmd> [args]')
.command('reset-owner-password', 'Resets the current owner password without UI access', async () => {
await resetPasswordForOwner();
})
.command(
'reset-password',
'Reset the password of a specific user without UI access',
(yargs) => {
yargs.option('username', {
type: 'string',
describe: 'Username of user',
demandOption: true
});
},
async (argv) => {
await resetPasswordForUsername(argv.username);
}
)
.version(false)
.showHelpOnFail(true)
.alias('h', 'help')
.demandCommand()
.help().argv;
55 changes: 55 additions & 0 deletions cli/commands/reset-owner-password.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import bcrypt from 'bcryptjs';

import Database from 'better-sqlite3';

import boxen from 'boxen';

import chalk from 'chalk';

import Consola from 'consola';

import crypto from 'crypto';

import { sql } from 'drizzle-orm';
import { drizzle } from 'drizzle-orm/better-sqlite3';

export async function resetPasswordForOwner() {
if (!process.env.DATABASE_URL) {
Consola.error('Unable to connect to database due to missing database URL environment variable');
return;
}

Consola.info('Connecting to the database...');
const sqlite = new Database(process.env.DATABASE_URL.replace('file:', ''));
const db = drizzle(sqlite);

Consola.info('Connected to the database ' + chalk.green('✓'));
Consola.info('Generating new random password...');

const newPassword = crypto.randomUUID();
const salt = bcrypt.genSaltSync(10);
const hashedPassword = bcrypt.hashSync(newPassword, salt);

try {
await db.transaction((tx) => {
tx.run(
sql`DELETE FROM session WHERE userId = (SELECT id FROM user WHERE is_owner = 1 LIMIT 1)`
);
tx.run(sql`UPDATE user SET password = ${hashedPassword} WHERE is_owner = 1 LIMIT 1;`);
});
console.log(
boxen(`New owner password is '${chalk.red(newPassword)}'. You can now log in with this password.\nExising sessions have been destroyed and need to login again with the new passowrd.`, {
dimBorder: true,
borderStyle: 'round',
padding: {
left: 1,
right: 1
}
})
);
} catch (err) {
Consola.error('Failed to update password', err);
} finally {
Consola.info('Command has completed');
}
}
56 changes: 56 additions & 0 deletions cli/commands/reset-password.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import bcrypt from 'bcryptjs';

import Database from 'better-sqlite3';

import Consola from 'consola';

import crypto from 'crypto';

import boxen from 'boxen';

import chalk from 'chalk';

import { sql } from 'drizzle-orm';
import { drizzle } from 'drizzle-orm/better-sqlite3';

export async function resetPasswordForUsername(username) {
if (!process.env.DATABASE_URL) {
Consola.error('Unable to connect to database due to missing database URL environment variable');
return;
}

Consola.info('Connecting to the database...');
const sqlite = new Database(process.env.DATABASE_URL.replace('file:', ''));
const db = drizzle(sqlite);

Consola.info('Generating new random password...');

const newPassword = crypto.randomUUID();
const salt = bcrypt.genSaltSync(10);
const hashedPassword = bcrypt.hashSync(newPassword, salt);

Consola.info(`Updating password for user '${username}'`);

try {
await db.transaction((tx) => {
tx.run(
sql`DELETE FROM session WHERE userId = (SELECT id FROM user WHERE name = ${username} LIMIT 1)`
);
tx.run(sql`UPDATE user SET password = ${hashedPassword} WHERE id = (SELECT id FROM user WHERE name = ${username} LIMIT 1) LIMIT 1`);
});
console.log(
boxen(`New password for '${username}' is '${chalk.red(newPassword)}'. You can now log in with this password.\nExising sessions have been destroyed and need to login again with the new passowrd.`, {
dimBorder: true,
borderStyle: 'round',
padding: {
left: 1,
right: 1
}
})
);
} catch (err) {
Consola.error('Failed to update password', err);
} finally {
Consola.info('Command has completed');
}
}
12 changes: 12 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"dependencies": {
"bcryptjs": "^2.4.3",
"better-sqlite3": "^8.6.0",
"boxen": "^7.1.1",
"chalk": "^5.3.0",
"consola": "^3.0.0",
"drizzle-orm": "^0.28.6",
"yargs": "^17.7.2"
},
"type": "module"
}
Loading