Commit 800105e2 authored by Agate's avatar Agate 💬
Browse files

Merge branch '1269-subsonic-passphrase' into 'develop'

Replaced token password with passphrase

Closes #1269

See merge request funkwhale/funkwhale!1232
parents f8d53479 22f739a2
......@@ -2,6 +2,7 @@
from __future__ import absolute_import, unicode_literals
import datetime
import os
import random
import string
import uuid
......@@ -29,9 +30,14 @@ from funkwhale_api.federation import models as federation_models
from funkwhale_api.federation import utils as federation_utils
def get_token(length=30):
choices = string.ascii_lowercase + string.ascii_uppercase + "0123456789"
return "".join(random.choice(choices) for i in range(length))
def get_token(length=5):
wordlist_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "wordlist.txt"
)
with open(wordlist_path, "r") as f:
words = f.readlines()
phrase = "".join(random.choice(words) for i in range(length))
return phrase.replace("\n", "-").rstrip("-")
PERMISSIONS_CONFIGURATION = {
......
aardvark
abandoned
abbreviate
abdomen
abhorrence
abiding
abnormal
abrasion
absorbing
abundant
abyss
academy
accountant
acetone
achiness
acid
acoustics
acquire
acrobat
actress
acuteness
aerosol
aesthetic
affidavit
afloat
afraid
aftershave
again
agency
aggressor
aghast
agitate
agnostic
agonizing
agreeing
aidless
aimlessly
ajar
alarmclock
albatross
alchemy
alfalfa
algae
aliens
alkaline
almanac
alongside
alphabet
already
also
altitude
aluminum
always
amazingly
ambulance
amendment
amiable
ammunition
amnesty
amoeba
amplifier
amuser
anagram
anchor
android
anesthesia
angelfish
animal
anklet
announcer
anonymous
answer
antelope
anxiety
anyplace
aorta
apartment
apnea
apostrophe
apple
apricot
aquamarine
arachnid
arbitrate
ardently
arena
argument
aristocrat
armchair
aromatic
arrowhead
arsonist
artichoke
asbestos
ascend
aseptic
ashamed
asinine
asleep
asocial
asparagus
astronaut
asymmetric
atlas
atmosphere
atom
atrocious
attic
atypical
auctioneer
auditorium
augmented
auspicious
automobile
auxiliary
avalanche
avenue
aviator
avocado
awareness
awhile
awkward
awning
awoke
axially
azalea
babbling
backpack
badass
bagpipe
bakery
balancing
bamboo
banana
barracuda
basket
bathrobe
bazooka
blade
blender
blimp
blouse
blurred
boatyard
bobcat
body
bogusness
bohemian
boiler
bonnet
boots
borough
bossiness
bottle
bouquet
boxlike
breath
briefcase
broom
brushes
bubblegum
buckle
buddhist
buffalo
bullfrog
bunny
busboy
buzzard
cabin
cactus
cadillac
cafeteria
cage
cahoots
cajoling
cakewalk
calculator
camera
canister
capsule
carrot
cashew
cathedral
caucasian
caviar
ceasefire
cedar
celery
cement
census
ceramics
cesspool
chalkboard
cheesecake
chimney
chlorine
chopsticks
chrome
chute
cilantro
cinnamon
circle
cityscape
civilian
clay
clergyman
clipboard
clock
clubhouse
coathanger
cobweb
coconut
codeword
coexistent
coffeecake
cognitive
cohabitate
collarbone
computer
confetti
copier
cornea
cosmetics
cotton
couch
coverless
coyote
coziness
crawfish
crewmember
crib
croissant
crumble
crystal
cubical
cucumber
cuddly
cufflink
cuisine
culprit
cup
curry
cushion
cuticle
cybernetic
cyclist
cylinder
cymbal
cynicism
cypress
cytoplasm
dachshund
daffodil
dagger
dairy
dalmatian
dandelion
dartboard
dastardly
datebook
daughter
dawn
daytime
dazzler
dealer
debris
decal
dedicate
deepness
defrost
degree
dehydrator
deliverer
democrat
dentist
deodorant
depot
deranged
desktop
detergent
device
dexterity
diamond
dibs
dictionary
diffuser
digit
dilated
dimple
dinnerware
dioxide
diploma
directory
dishcloth
ditto
dividers
dizziness
doctor
dodge
doll
dominoes
donut
doorstep
dorsal
double
downstairs
dozed
drainpipe
dresser
driftwood
droppings
drum
dryer
dubiously
duckling
duffel
dugout
dumpster
duplex
durable
dustpan
dutiful
duvet
dwarfism
dwelling
dwindling
dynamite
dyslexia
eagerness
earlobe
easel
eavesdrop
ebook
eccentric
echoless
eclipse
ecosystem
ecstasy
edged
editor
educator
eelworm
eerie
effects
eggnog
egomaniac
ejection
elastic
elbow
elderly
elephant
elfishly
eliminator
elk
elliptical
elongated
elsewhere
elusive
elves
emancipate
embroidery
emcee
emerald
emission
emoticon
emperor
emulate
enactment
enchilada
endorphin
energy
enforcer
engine
enhance
enigmatic
enjoyably
enlarged
enormous
enquirer
enrollment
ensemble
entryway
enunciate
envoy
enzyme
epidemic
equipment
erasable
ergonomic
erratic
eruption
escalator
eskimo
esophagus
espresso
essay
estrogen
etching
eternal
ethics
etiquette
eucalyptus
eulogy
euphemism
euthanize
evacuation
evergreen
evidence
evolution
exam
excerpt
exerciser
exfoliate
exhale
exist
exorcist
explode
exquisite
exterior
exuberant
fabric
factory
faded
failsafe
falcon
family
fanfare
fasten
faucet
favorite
feasibly
february
federal
feedback
feigned
feline
femur
fence
ferret
festival
fettuccine
feudalist
feverish
fiberglass
fictitious
fiddle
figurine
fillet
finalist
fiscally
fixture
flashlight
fleshiness
flight
florist
flypaper
foamless
focus
foggy
folksong
fondue
footpath
fossil
fountain
fox
fragment
freeway
fridge
frosting
fruit
fryingpan
gadget
gainfully
gallstone
gamekeeper
gangway
garlic
gaslight
gathering
gauntlet
gearbox
gecko
gem
generator
geographer
gerbil
gesture
getaway
geyser
ghoulishly
gibberish
giddiness
giftshop
gigabyte
gimmick
giraffe
giveaway
gizmo
glasses
gleeful
glisten
glove
glucose
glycerin
gnarly
gnomish
goatskin
goggles
goldfish
gong
gooey
gorgeous
gosling
gothic
gourmet
governor
grape
greyhound
grill
groundhog
grumbling
guacamole
guerrilla
guitar
gullible
gumdrop
gurgling
gusto
gutless
gymnast
gynecology
gyration
habitat
hacking
haggard
haiku
halogen
hamburger
handgun
happiness
hardhat
hastily
hatchling
haughty
hazelnut
headband
hedgehog
hefty
heinously
helmet
hemoglobin
henceforth
herbs
hesitation
hexagon
hubcap
huddling
huff
hugeness
hullabaloo
human
hunter
hurricane
hushing
hyacinth
hybrid
hydrant
hygienist
hypnotist
ibuprofen
icepack
icing
iconic
identical
idiocy
idly
igloo
ignition
iguana
illuminate
imaging
imbecile
imitator
immigrant
imprint
iodine
ionosphere
ipad
iphone
iridescent
irksome
iron
irrigation
island
isotope
issueless
italicize
itemizer
itinerary
itunes
ivory
jabbering
jackrabbit
jaguar
jailhouse
jalapeno
jamboree
janitor
jarring
jasmine
jaundice
jawbreaker
jaywalker
jazz
jealous
jeep
jelly
jeopardize
jersey
jetski
jezebel
jiffy
jigsaw
jingling
jobholder
jockstrap